text stringlengths 7 3.69M |
|---|
/*
柯里化函数
*/
const _ = require('lodash')
function func(a, b, c) {
return a + b + c
}
const curried = _.curry(func)
/*
func 共需要三个参数,所以柯里化后得函数 curried
*/
console.log(curried(1)(2)(3)); // 6
console.log(curried(1,2)(3)); // 6
console.log(curried(1,2,3)); // 6
|
var isEditing = false,
tempNameValue = "",
tempDataValue = "";
// Handles live/dynamic element events, i.e. for newly created edit buttons
$(document).on('click', '.edit', function() {
var parentRow = $(this).closest('tr'),
tableBody = parentRow.closest('tbody'),
tdName = parentRow.chi... |
module.exports = ({ emit }) => {
return async ({ state, next }) => {
let arr1 = [state.current, ...state.queue].filter(x => x)
let arr2 = []
while (arr1.length) {
let index1 = Math.floor(Math.random() * arr1.length)
let index2 = Math.floor(Math.random() * arr2.length + 1)
arr2.splice(in... |
class Request {
constructor() {
this.headers = new Headers();
this.headers.set("Content-Type", "application/json");
}
fetch = (url, type, payload) => {
const baseUrl = process.env.REACT_APP_API_BASE_URL;
const requestUrl = `${baseUrl}${url}`;
return fetch(requestUrl, {
method: type,
... |
var fs = require('fs');
var DiagramSchema = require('../models/Diagram');
var xmlEmcoder = require('./xmlEncoder');
var shell = require("shelljs");
var classNames;
var classConecteds;
module.exports = {
//read xml file line by line
readXML : function(GitRepo){
classNames = [];
classConecteds =... |
'use strict';
import { permutations } from './perms.js';
const BLK_CODE_MARKED = '_';
const BLK_GUESS_MARKED = '-';
const WHITE_CODE_MARKED = '*';
const WHITE_GUESS_MARKED = '#';
//----------------------------------------------------------------------
// Adding replaceChar to String prototype.
// Replace a single ch... |
//function adminShowUserInfo(){
$(function(){
page = 1;
adminShowAllUser(page);
$(".data-table").on("click",".admin_user_show_info",function(){
adminShowUserInfo($(this));
});
$("#admin_btn_search").on("click",function(){
adminFindByUserName();
$("#admin_btn_search_panel").click();
});
$(".data-table").o... |
import React from "react";
import { Input } from "antd";
function Search({ handleInput, search }) {
return (
<div
style={{ display: "grid", justifyContent: "center", gridRowGap: "15px" }}
>
<div>
<h1>Movies Search </h1>
</div>
<div>
<Input
className="search-b... |
import React from 'react';
import FA from 'react-fontawesome';
import Tile from 'components/tiles/tile.js'
export default class WebGL3D extends React.Component {
constructor(props) {
super(props);
this.state = {
}
}
render() {
var main = (
<Tile className="bg-... |
#!/bin/node
const loremIpsum = require("./lorem-ipsum.js");
const countWord = (words, word) => {
const lowerCaseWord = word.toLowerCase();
if (lowerCaseWord in words) {
words[lowerCaseWord] = words[lowerCaseWord] + 1;
} else {
words[lowerCaseWord] = 1;
}
return words;
};
const isNotEmpty = (word) =>... |
'use strict'
const Router = require('koa-router')
const Wechat = require('../app/service/wechat');
module.exports = function(){
const router = new Router();
const wechat = new Wechat();
/**
* 微信公众号验证
*/
router.get('/', async ctx => {
const result = wechat.auth(ctx);
ctx.body = result;
});
/**
* ... |
import { useLocation } from "react-router-dom";
import queryString from "query-string";
export default () => {
return queryString.parse(useLocation().search);
};
|
var headers = document.querySelectorAll('.accordion__header');
var contents = document.querySelectorAll('.accordion__content');
var chevrons = document.querySelectorAll('.accordion__chevron');
var menuItems = document.querySelectorAll('.menu__item');
var states = [1];
for (let i = 0; i < contents.length; i++) {
hea... |
// ~~~~~~~~~~~~~~~ Requires ~~~~~~~~~~~~~~ //
var express = require('express');
var mongoose = require('mongoose');
var bodyParser = require('body-parser');
// ~~~~~~~~ Inicializar variables ~~~~~~~~ //
var app = express();
// ~~~~~~~~~~~~~ Body Parser ~~~~~~~~~~~~~ //
// parse application/x-www-form-urlencoded... |
import React, { useEffect, useState } from 'react';
import { Icon, Paper, ClickAwayListener, TextField, InputAdornment } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import SearchIcon from '@material-ui/icons/Search';
const useStyles = makeStyles((theme) => ({
root: {
borderRadiu... |
'use strict';
var EventEmitter = require( 'eventemitter2' ).EventEmitter2;
module.exports = IFrameSizer;
function IFrameSizer( eventBus ) {
var self = this;
EventEmitter.call( self );
self.eventBus = eventBus;
self.eventBus.on( 'rendered', self.onRendered.bind( self ) );
}
IFrameSizer.prototype = O... |
const { User, UserData, AuthToken} = require('../models');
module.exports = async function(req, res, next){
let token = req.headers.authorization;
if(token){
const authToken = await AuthToken.findOne({ where: {token}, include: [{
model: User, include: [
{model: UserData}
... |
import { scale } from '../../utils/scaling'
import { Dimensions, StyleSheet } from 'react-native'
import { alignment, colors } from '../../utils'
const { width } = Dimensions.get('window')
const styles = StyleSheet.create({
flex: {
flex: 1
},
safeAreaStyle: {
backgroundColor: colors.headerbackground
},... |
'use strict'
module.exports = {
sequelizeDb: {
databaseName: 'Aggaton',
username: 'chris',
password: 'chris',
options: {
host: 'localhost',
dialect: 'postgres',
port: 5432
}
},
paths: {
prodPaths: {
routes: '*/... |
import Carousel from "react-multi-carousel";
import "react-multi-carousel/lib/styles.css";
export const responsive = {
superLargeDesktop: {
breakpoint: { max: 4000, min: 3000 },
items: 5,
},
desktop: {
breakpoint: { max: 3000, min: 1024 },
items: 2,
},
tablet: {
breakpoint: { max: 1024, m... |
myApp.controller('RegistrationController',['$scope','Authentication',function($scope , Authentication){
$scope.login= function(){
Authentication.login($scope.user);
};//login
$scope.logout= function(){
Authentication.logout();
}; // logout
$scope.register= function(){
Au... |
setInterval(function(){
var date=Intl.DateTimeFormat("en-Us",{dateStyle:"medium", timeStyle:"medium"})
var dd=date.format(new Date())
document.getElementById("box").innerHTML=dd
},1000)
console.log("================================================")
|
define(['jquery', 'cfgs',
'core/core-modules/framework.base64',
'core/core-modules/framework.block',
'core/core-modules/framework.dialog',
'core/core-modules/framework.util',
'core/core-modules/framework.event'
], function ($, cfgs, base64, block, dialog, util, event) {
const events = {
'login... |
export default {
html: {
fontSize: '16px',
},
'html, body': {
height: '100%',
mozOsxFontSmoothing: 'grayscale',
WebkitFontSmoothing: 'antialiased',
},
body: {
background: '#f7f7f7',
fontFamily: '"Open Sans", "Helvetica Neue", Helvetica, sans-serif',
color: '#393939',
paddingTop... |
import * as React from 'react'
import styled from 'styled-components'
import SwipeableViews from 'react-swipeable-views'
import theme from '../../theme'
const Flex = styled.div`
display: flex;
align-items: center;
justify-content: center;
`
function Swipeable({ children, hasPagination, length }) {
const [inde... |
import React from 'react';
import PropTypes from 'prop-types';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import { compose } from 'redux';
import { Collapse } from 'antd';
import get from 'lodash.get';
import moment from 'moment';
// import Link from '../../components/Link';
import collapseStyle... |
import ExpoPixi, { PIXI } from 'expo-pixi';
export default async context => {
//http://pixijs.io/examples/#/basics/basic.js
const app = ExpoPixi.application({
context,
});
// const bunny = await ExpoPixi.spriteAsync(require('../../assets/pixi/bunny.png'));
// Scale mode for all textures, will retain pix... |
'use strict';
/**
* @ngdoc function
* @name photosApp.controller:UploadCtrl
* @description
* # UploadCtrl
* Controller of the photosApp
*/
angular.module('photosApp')
.controller('UploadCtrl', function ($scope, $location, API) {
$scope.tags = [];
$scope.upload = function(){
var fd = new FormData... |
const engines = require('consolidate');
const bodyParser = require('body-parser');
const hashPasswordEndPoint = require('./hash-password');
const init = (app) => {
app.set('view engine', 'html');
app.engine('html', engines.ejs);
app.use(bodyParser.urlencoded({extended: true}));
app.get('/', (req, res) => {
... |
class SummerCamp {
constructor(organizer, location) {
this.organizer = organizer;
this.location = location;
this.priceForTheCamp = { "child": 150, "student": 300, "collegian": 500 };
this.listOfParticipants = [];
}
registerParticipant(name, condition, money) {
if(thi... |
/**
* DomoGeeek v0.1
* https://github.com/ltoinel/domogeeek
*
* Copyright 2014 DomoGeeek
* Released under the Apache License 2.0 (Apache-2.0)
*
* @desc: Event emitter for the ZwaveBus.
* @author: ltoinel@free.fr
*/
// Bus event shared between the components
var bus = require( 'events' ).EventEmitter;
module.... |
let path = require('path')
module.exports = {
path: {
_configdirname: path.join(__dirname, 'config')
}
} |
import React from 'react'
import virus from '../../images/virus.png'
import Card from '../CasesCard/CasesCard'
import hand from '../../images/handsanitizer.png'
function CaseShowWorld(props) {
return (
<div >
<Card backgroundcolor='purple' header="Numbers At Glance In World" date={props.date} c... |
import React, { Component } from 'react';
import { NavigationActions } from 'react-navigation';
import { ScrollView, Text, View } from 'react-native';
import { Button } from 'react-native-elements';
import styles from './Sidebar.style';
import PropTypes from 'prop-types';
class DrawerContent extends Component {
nav... |
var cleackMeElement = document.getElementById('addBtn');
cleackMeElement.onclick = function () {
var newHeadingElement = document.createElement('h1');
var newParagraphElement = document.createElement('p');
newHeadingElement.innerHTML = 'This is heading element';
newParagraphElement.innerHTML = 'This is... |
!function() {
$.fn.particle = function(options){
var dotSize = 3; // 粒子大小
var lwidth = 0.8; //线体宽度
var settings = $.extend({
canvas_box: 'cas', // 画布的id
color: '222,222,222,0.8', // 线条颜色值
extend: 50, // 可超出的画布边界
lineD: 200, // 连线的距离
... |
let MultiComponent = require("./multicomponent.js");
class PaperFooter extends MultiComponent{
constructor(params){
super(params);
let pos = params.position;
this.set.Text = new UI.Components.Text($.extend(true, {position: {x: pos.x + 25, y: pos.y + 2}, id: "Text", z: 5}, params.text));
... |
export default class LightFBO {
constructor( gl ){
this.gl = gl;
this.FBO = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, this.FBO);
this.fboSampleSize = 512;
this.FBO.width = this.fboSampleSize;
this.FBO.height = this.fboSampleSize;
this.FBOTexture = gl.createTexture()... |
import React, { Component } from 'react';
class TopBox extends Component {
constructor() {
super();
this.hoverIn = this.hoverIn.bind(this);
this.hoverOut = this.hoverOut.bind(this);
this.click = this.click.bind(this);
}
hoverIn() {
this.props.topHover(this.props.id);
}
hoverOut() {
th... |
var ship,ship_sailing;
var sea,flowing
function preload(){
ship_sailing=loadAnimation("ship-1.png","ship-2.png","ship-3.png","ship-4.png");
flowing=loadImage("sea.png");
}
function draw() {
background("white");
drawSprites();
}
function setup(){
createCanvas(500,400)
sea=createSprite(400,180,400,20);
sea .a... |
import { Provider, connect } from 'react-redux';
const mapStateToProps = (state) => {
let time = (state.calories * 1080 ) /4194;
return {
value: parseInt(time)
}
}
const Time = (props) => (
<span>
{props.value}分鐘運動
</span>
)
// placeholder="卡路里"
const TimeToBurn = connect(
mapStateToPro... |
/**
* Copyright IBM Corp. 2016, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { withKnobs, boolean, select } from '@storybook/addon-knobs';
import { withReadme } from 'storybook-readme';
import readme from './REA... |
/******************************************************************************
* Compilation: node HelloUser.js
*
* Purpose: Take User Input and Replace String with the user name provided by
* the user.
*
* @author Nishant Kumar
* @version 1.0
* @since 16-10-2018
*
********************... |
'use strict';
const express = require('express');
const cors = require('cors');
const dotenv = require('dotenv');
const morgan = require('morgan');
const mongoose = require('mongoose');
const Promise = require('bluebird');
const debug = require('debug')('gear-share:server.js');
const imageRouter = require('./route/im... |
var config = require('./config/primary.json');
var colors = require('colors');
var path = require('path');
var functionalTestRunner = require('./modules/functional-test-runner.js');
var performanceAnalysis = require('./modules/performance-analysis.js');
var accessibilityTest = require('./modules/accessibility-tests.js... |
require('dotenv').config();
const got = require('got');
const {
OSU_V1_KEY,
DB_HOST,
DB_PORT,
DB_DATABASE,
DB_USER,
DB_PASSWORD
} = process.env;
const { Pool } = require('pg');
const pool = new Pool({
user: DB_USER,
host: DB_HOST,
database: DB_DATABASE,
password: DB_PASSWORD,
port: DB_PORT
});
... |
import { useState, useContext } from "react";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { MenuContext } from "../context/MenuContext";
import {
getCurrentDate,
getLastWeeksDate,
formatForSearch,
} from "../utils/date";
export default function SearchMod... |
Ext.define('JSONExtJS.view.books.mainPage.Controller', {
extend: 'JSONExtJS.view.base.Controller',
alias: 'controller.mainPageBook',
routes: {
'bookForm': 'onHashChanged',
'booksGrid': 'onHashChanged',
'bookInfo': 'onHashChanged'
},
onCreateButtonPressed: function () {
... |
const express = require('express');
const pug = require('pug');
const mydate = require('./modules/mydate');
const app = express();
const port = 3000;
const host = 'localhost';
app.get('/', (req, res) => {
const compiledFunction = pug.compileFile('templates/index.pug');
date = mydate.getFormatedDate();
... |
import React, { isValidElement } from 'react';
import Ingredient from '../Ingredient/Ingredient'
const Burger = (props) => {
let ingredientArr = props.ingredient.map(item => {
let amountArr = [...Array(item.amount).keys()];
return amountArr.map(_ => {
return <Ingredient type={item.type... |
// #1 SHUFFLE A NAME MIRRORED
const nameShuffle = (name) =>
name.split(" ").reverse().toString().replace(/,/g, " ");
// console.log(nameShuffle("Md Mudassir"))
// #2 RETURN A FOUR LETTER STRING
isFourLetters = (words) => words.map((word, i) => word.length == 4 && word);
// console.log(isFourLetters(["hello","wassup"... |
const jwt = require('jsonwebtoken')
const User = require('../models/User')
const secret = require('../config/settings').development.secret;
module.exports = (req, res, next) => {
var token = req.headers['x-access-token'];
if(!token) {
return res.status(401).send({
auth:false,
message:'No t... |
// author: catomatic
// website: https://github.com/catomatic
// source: personal projects library
var bubbleSort = function(someList) {
var count = someList.length;
while (count > 0) {
for (i = 0; i <= count; i++) {
if (someList[i] > someList[i + 1]) {
var x = someList[i];
someList[i] = ... |
(async function () {
const controller = app.Controller;
const path = "pages/home";
const cssPath = "pages/home/css";
const partialsPath = "pages/home/partials";
controller.addStyle(cssPath, "nav-section");
controller.addStyle(cssPath, "sidebar");
controller.addStyle(cssPath, "sidebar.sm");
controller.ad... |
var pathName = window.document.location.pathname;
var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
function getQuickShopTop(sort, startTime, endTime) {
var path = "/api/v1/communities/1/users/1/orderHistories/getQuickShopTop?sort="
+ sort + "&startTime=" + startTime + "&endTime=" + endT... |
// Images Component WhatDoWeDo
import ecommerce from '../../images/Banners/ecommerce.svg'
import userInterface from '../../images/Banners/user_interface.svg'
import webDeveloper from '../../images/Banners/Web_developer.svg'
//Images Component flags
import spain from '../../../assets/images/Icons/espana.svg'
import UU... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsFlask = {
name: 'flask',
data: `<svg xmlns="http://www.w3.org/2000/svg" data-name="EOS icon" viewBox="0 0 24 24"><path d="M20.642 18.452L19.731 17h-.001L15 9.462V3h2V1H7v2h2v6.462L4.27 17l-.912 1.452A2.317 2.317 0 005.321 22h13.358a2.317 2.317 0 ... |
import React from 'react';
import MenuItem from '@material-ui/core/MenuItem';
import AccountCircle from '@material-ui/icons/AccountCircle';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import { makeStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core... |
import React, { useContext, useEffect } from "react";
import ItemsContext from "context/itemsContext";
import ProductsList from "components/productsList";
import "./Deals.scss";
const Main = () => {
const { state, isLoading, setTotalItems } = useContext(ItemsContext);
useEffect(() => {
if (!isLoading && state... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.get_average = exports.get_date = exports.get_temp_from_units = exports.kelvin_to_fahrenheit = exports.kelvin_to_celsius = void 0;
const common_1 = require("../common");
const definitions_1 = require("../definitions");
/*
* @descriptio... |
import Tests from "/imports/db/tests/collection";
import Clients from "/imports/db/clients/collection";
Tests.addLinks({
client: {
type: "one",
collection: Clients,
field: "clientId",
},
});
|
var express = require('express');
var exphbs = require('express-handlebars');
var bodyParser = require('body-parser')
var session = require('express-session')
var onlineStore = require('./shopping')
var onlineStore = require('./shopping')
var onlineStoreFunctions = onlineStore()
var app = express();
app.engine('ha... |
var searchData=
[
['similarity_5fmeasures_2eh',['similarity_measures.h',['../similarity__measures_8h.html',1,'']]],
['ssp_5fclient_5fk4a_2ecc',['ssp_client_k4a.cc',['../ssp__client__k4a_8cc.html',1,'']]],
['ssp_5fclient_5fopencv_2ecc',['ssp_client_opencv.cc',['../ssp__client__opencv_8cc.html',1,'']]],
['ssp_5fc... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsExposure = {
name: 'exposure',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 17v2h2v-2h2v-2h-2v-2h-2v2h-2v2h2zm5-15H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM5 5h6v2H5V5zm15 15H4L20 4... |
function insertMessage(type, message) {
let div = `<div class="message ${type}" role="alert">${message}</div>`;
return div;
}
|
import _ from 'lodash';
import moment from 'moment';
import React from 'react';
import { connect } from 'react-redux';
import EventFormFields from './EventFormFields';
import * as actions from '../../actions';
const EventFormReview = ({ onCancel, formValues, submitEvent }) => {
const reviewFields = _.map(EventFor... |
// using an Immediately Invoked Function Expression (IIFE)
var greeting = function(name) {
return 'Hello ' + name;
}('John');
console.log(greeting);
var greeting2 = function(name) {
return console.log('Hello ' + name);
}('John');
|
async function signup1() {
const requiredKeys = ['email', 'firstname', 'lastname'];
const requiredValues = getValues('#signup-form1 ', requiredKeys);
let missed = false;
for (const key of requiredKeys) {
const v = requiredValues[key];
if (v == null || v.trim().length === 0) {
... |
import React, { Component } from 'react';
import { ProductContext } from '../../context';
import DetailsView from './DetailsView';
import DetailsEdit from './DetailsEdit';
class Details extends Component {
render() {
return this.context.isAdminMode ? <DetailsEdit /> : <DetailsView />
}
}
Details.conte... |
import React from 'react';
import FA from 'react-fontawesome';
export default class PrintItem extends React.Component {
render() {
var farbe
var form
var process
var processIcon
switch(this.props.item.color.actualValue == null ? this.props.item.color.toValue : this.pr... |
import React from 'react'
import {LoadingSVG} from '../LoadingAnimationS'
const Tableloading = () => {
return (
<div style={{width:'50px',height:'50px',position: 'absolute',top: '50%',left: '50%',transform: 'translate(-50%, -100%)'}}>
<LoadingSVG />
</div>
)
}
export default Table... |
import React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import {increment, decrement} from './actions';
function App() {
const counter = useSelector(state => state.counter);
const isLogged = useSelector(state => state.inLogged);
const dispatch = useDispatch();
return (
<div cla... |
import React, {useState} from 'react';
import {
SafeAreaView,
View,
TextInput,
StyleSheet,
TouchableOpacity,
Text,
Image,
Alert,
} from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {AuthContext} from '../../App';
import RegisterScreen from... |
import Vue from 'vue'
export const isStrong = (password) => {
// const regex = /(.*[0-9`!@#$%^&*\-_=+'/.,]){2}/g
const regex = /^(?=.*[A-Z])(?=.*[0-9]).*$/g
return regex.test(password) && password.length > 8
}
export const currencyFormat = (number) => {
if (!number) {
return `$${0}`
}
const formatter ... |
//Use Express middleware to manage incoming requests and
//dispatch them to corresponding behaviours
const express = require('express');
//Use chalk to add colours on the console
const chalk = require('chalk');
//to access form data
let bodyParser = require('body-parser');
//The 404 middleware used when an incoming... |
export default {
AUDIO_GET_VOLUME: 'ssap://audio/getVolume', // response: { returnValue: true, scenario: 'mastervolume_tv_speaker', volume: 100, muted: false }
AUDIO_VOLUME_UP: 'ssap://audio/volumeUp',
AUDIO_VOLUME_DOWN: 'ssap://audio/volumeDown',
AUDIO_SET_MUTE: 'ssap://audio/setMute', // payload: { mu... |
import Vue from 'vue';
const budget = {
namespaced: true,
state: {
list: {
1: {
type: 'Income',
cash: 100,
comment: 'Income comment',
id: 1,
},
2: {
type: 'Outcome',
cash: -75,
comment: 'Outcome comment',
id: 2,
},
3:... |
$(function(){
$('.modal_services').click(function () {
LoadModal(this.title, this.value);
});
});
$(function(){
$('.modal_method').click(function () {
LoadModal(this.title, this.value, true, 1100);
});
});
$(function(){
$('.modal_package').click(function () {
LoadModal(this... |
/*
Project Name : Bottega Construction
Author Company : Arif Alim
Project Date: 4 August, 2018
*/
/*
==============================================
TABLE OF CONTENT
==============================================
1. Owl Carousels
2. CountUp
3. Slider
4. Navbar
5. Youtube Video Section
6. Video ... |
import { Dimensions, StyleSheet } from 'react-native';
import * as colors from 'kitsu/constants/colors';
const styles = StyleSheet.create({
wrapper: {
flexGrow: 1,
alignItems: 'center',
marginBottom: 70,
minHeight: Dimensions.get('window').height - 150,
width: Dimensions.get('window').width * 0.... |
foshizzle - Asa is awesome |
// pages/logistics/logistics.js
var network = require("../../utils/network.js")
var common = require("../../utils/common.js")
Page({
/**
* 页面的初始数据
*/
data: {
state: 0,
ShipperCode: "ZTO",
LogisticCode: ""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
var shopId = option... |
import React from 'react'
const ParagraphWidget = ({widget, editingWidget, setWidget, editing}) => {
return (
<div>
{
editing &&
<>
<br/>
<textarea
onChange={(e) => setWidget({...widget, text: e.targ... |
"use strict";
function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } }
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Sy... |
export const userFragment = `
id
fullName
email
lastVerificationCode
isVerified
profiles {
id
user {
id
email
}
}
`;
export const postFragment = `
id
expiresAt
hasRoom
profile {
id
name
age
avatar {
id
image
source {
id... |
import React, { Component } from "react";
import "./App.css";
import socketIOClient from "socket.io-client";
import WorldMap from "./components/WorldMap.jsx";
import WorldMapSelection from "./components/WorldMapSelection";
//I am going to stateup code
class App extends Component {
constructor() {
super();... |
function setup() {
createCanvas(window.innerWidth, window.innerHeight);
smooth();
noStroke();
noiseDetail(4);
}
a = 0;
s = Math.PI*2/500;
function draw() {
doLines();
a+=s;
}
function doLines() {
background(0);
fill(255,255,255,10)
for(var j=50;j<450;j+=25) {
for(var i=50;i<450;i+=25) {... |
import React, { Component } from 'react';
import Banner from 'user/Components/Home/Banner/banner';
import Feature from 'user/Components/Home/Features/features';
import Books from 'user/Components/Home/Books/books';
import HandNotes from 'user/Components/Home/HandNotes/handnotes';
import MockTest from 'user/Components/H... |
import React from 'react';
import { StyleSheet, TouchableHighlight, View } from 'react-native'
import NetworkConnection from '../NetworkConnection'
import Colors from '@Colors/colors'
const overlayStyle = {
visible: {
...StyleSheet.absoluteFillObject,
backgroundColor: 'white',
opacity: 0.... |
import styled from 'styled-components';
const GalleryContainer = styled.div`
.ImageGallery {
display: grid;
max-width: calc(100vw - 48px);
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
grid-gap: 16px;
margin-top: 0;
margin-bottom: 0;
padding: ... |
import React from 'react';
// At the annual family gathering, the family likes to find the oldest living family member’s age and the youngest family member’s age and calculate the difference between them.
//
// You will be given an array of all the family members' ages, in any order. The ages will be given in whole nu... |
import React, { useEffect, useState } from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { searchText, updateSearchFilter } from '../../actions/search';
import Spinner from '../Utility/Spinner';
import SearchFilter from './SearchFi... |
import React from 'react';
import { LeftBar, Main, RightBar } from './layout';
import initialState from './initialState.json';
import './App.css';
class App extends React.Component {
constructor(props) {
super(props);
this.state = initialState;
this.chooseOption = this.chooseOption.bind(this);
}... |
describe('react-simple-grid-tool', function() {
it('should work', function() {})
})
|
import React from 'react'
import classNames from 'classnames'
const CustomIcon = ({
className,
size,
spin = false,
children
}) => {
let dimension = 22
if (size === '4xs') {
dimension = 8
}
if (size === '3xs') {
dimension = 10
}
if (size === '2xs') {
dimension = 12
}
if (size ===... |
const express = require('express');
const router = express.Router();
const home = require('../controllers/home');
const beatmapId = require('../controllers/beatmapid');
const beatmapSetId = require('../controllers/beatmapsetid');
const search = require('../controllers/search');
const initialBeatmaps = require('../cont... |
import { useState } from 'react'
import { search, getDetails } from './services/planets'
export function usePlanetSearch() {
const [results, setResults] = useState([])
const [isLoading, setIsLoading] = useState(false)
async function searchPlanets(term) {
setIsLoading(true)
const data = await search(term... |
$(".testimonial-reel").slick({
centerMode: true,
centerPadding: "40px",
dots: true,
slidesToShow: 3,
infinite: true,
arrows: false,
lazyLoad: "ondemand",
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 2,
centerMode: false
}
},
{
breakpoint... |
import React from 'react';
import CircularProgress from '@material-ui/core/CircularProgress';
const styles = {
progress: {
margin: 16,
zIndex: 9999
},
loadingContainer: {
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0,
display: 'flex',
justifyContent: 'center',
... |
/**
TESTS SHOULD NOT BE RUN BY THEMSELVES. THESE ARE INTEGRATED TESTS.
All the tests for PersonManager in one big integrated pile.
We do this because it's a manager! And managers affect the world!
Jokes on you if the world ain't working.
@author laifrank2002
@date 2020-01-02
*/
var TestPersonManager = (
functio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.