text
stringlengths
7
3.69M
var model = { init:function() { model.words = [] model.wordCounts =[] }, words:[], wordCounts:[], incrementWordCount:function(word){ var index = $.inArray(word, model.words) if (index == -1) { index = model.words.push(word) - 1 model.wordC...
const arr = [1,4,6,7,14,18,29,35,47]; const target = 3; // Use binary search to find the target, return index if found or return -1 iuf not found function binarySearch(arr, target){ let start = 0; let end = arr.length-1; while(start <= end) { let mid = Math.floor((start + end)/2); if(target...
class linkedListNode{ constructor(data,next){ this.data = data; this.next = null; } } // var linkedListNode(); // const head = var linkedListNode(21); // head.next = new linkedListNode(31); // head.next.next = new linkedListNode(41); // let current = head; // while(current!==null){ ...
import React from "react" function TodoItem(props) { return ( <div className="todo-item"> <input type="checkbox" checked={props.completed} onChange={() => props.toggleCheck(props.id)} /> <p className={props.completed ? ...
/** * 创建考试页面 * @param selector 添加的位置 * @param data 数据 * @param config 配置文件 */ var ExamCreate = function (selector, data, fn_submit) { this.data = data || {}; this.fn_submit = fn_submit; this.config = { radio: 'radio', checkbox: 'checkbox', bool: 'bool' }; this.selector = selector; // 创建页面模板...
import React from 'react'; import styled from 'styled-components'; const StyledCard = styled.div` --padding: 1rem 1.5rem; --border: 1px solid #e8e8e8; background-color: white; border: 1px solid #e8e8e8; `; const Header = styled.div` padding: var(--padding); border-bottom: var(--border); `; const Conte...
'use strict'; app.controller('menuDetailsController', ['$http','$rootScope','$scope','$state','$modal',"$timeout",'sessionStorageService','uiClassService',"utilService","hintService",function($http, $rootScope, $scope, $state,$modal,$timeout,sessionStorageService,uiClassService,utilService,hintService) { // $sco...
import React from 'react'; import ProgressiveLoadable from './progressive-loadable'; import cleanLoadableTags from './clean-loadable-tags'; import ProgressiveLoadableExtractorContext from './progressive-loadable-extractor'; const ProgressiveLoadableExtractor = ({extractor, children}) => (<ProgressiveLoadableExtractorC...
import angular from "/ui/web_modules/angular.js"; import mnAlertsService from "/ui/app/components/mn_alerts.js"; import mnHelper from "/ui/app/components/mn_helper.js"; import _ from "/ui/web_modules/lodash.js"; export default "mnPromiseHelper"; angular .module('mnPromiseHelper', [mnAlertsService, mnHelper]) .fac...
/** * Created by julian on 15/09/14. */ ; (function () { "use strict"; angular.module(G.APP) .directive('sisesWidgetArchivos', [function() { return { templateUrl: G.template('directive/widget_archivos'), scope: { elements: '=sisesWidgetA...
const { App } = require('database').models; const getOne = async ({ name, bots }) => { try { const app = await App.findOne({ name }).select(bots ? {} : { service_bots: 0 }).lean(); if (!app) { return { error: { status: 404, message: 'App not found!' } }; } return { app }; } catch (error) { ...
jQuery(function () { /*using animate.css list*/ var animationend = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationEnd AnimationEnd'; function intro_animation() { $(".main_illust .backgrid_img").addClass("animated fadeIn"); $(".main_illust .face_img").delay(400).animate({ ...
import React, { Component } from 'react' const arr1 = [ { type: 'renderTitle', content: '七种内置类型' }, { type: 'renderUl', content: [ '基本类型 - undefined null string number boolean', '引用类型 - object 传递的是引用地址', 'es6 新增类型 - symbol 属于基本类型'...
const React = require('react'); const Gridfunc = require('./Gridfunc.js'); const TileEditor = React.createClass({ render: function () { if (this.props.editingContentType) { //initial select return <div className='select-div'> <form onSubmit={this.onTextSubmit}> <select onCh...
/* eslint-disable react/prefer-stateless-function */ /* eslint-disable jsx-a11y/label-has-for */ /* eslint-disable jsx-a11y/no-autofocus */ /* eslint-disable jsx-a11y/label-has-associated-control */ import React, { Component } from 'react'; import Loader from 'react-loaders'; import PropTypes from 'prop-types'; // esl...
import axios from "axios"; import React, { useState } from "react"; import { useHistory } from "react-router"; import { link } from "../../Proxy/proxy"; function SignUp() { const history = useHistory(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [confpassword, ...
//@ts-check import { useRef, useMemo, useState, useEffect, useCallback } from "react"; import { mixClass, build, getDisplayName, SemanticUI, } from "react-atomic-molecule"; import { useDebounce, useMounted } from "reshow-hooks"; import scrollStore from "../../stores/scrollStore"; import fastScrollStore from "....
// 引入Vue import Vue from 'vue' // 引入vue-router import router from './router' // 引入axios import axios from 'axios' // 引入json-bigint import JSONBig from 'json-bigint' // 给axios做配置 axios.defaults.baseURL = 'http://ttapi.research.itcast.cn/mp/v1_0/' // axios请求拦截器 axios.interceptors.request.use(function (config) { // co...
/** * The MIT License (MIT) * Copyright (c) 2016, Jeff Jenkins @jeffj. */ const React = require('react'); const ArticleActions = require('../actions/ArticleActions'); const ArticleStore = require('../stores/ArticleStore'); const NotFound = require('./NotFound.react'); const Messages = require('./Messages.react'); c...
import React from 'react' import { StyleSheet, Platform, Image, Text, View, Button, FlatList } from 'react-native' import firebase from 'firebase' export default class Doigtes extends React.Component { constructor(){ super() //firebase.auth() this.state={doigtes:[], chargement:true} } ...
/** eslint-disable react/require-render-return,react/jsx-no-undef **/ /** * Created by liu 2018/5/14 **/ import React, {Component} from 'react'; import {storeAware} from 'react-hymn'; import {Spin, Layout, DatePicker, message, Button} from 'antd'; import TableView from '../../components/TableView' import Breadcrumb ...
import { graphql } from 'react-apollo' import gql from 'graphql-tag' import objFragment from '../fragments/obj' export const ObjQuery = gql` query ObjQuery($objId: ID!) { obj(id: $objId) { ...ObjFragment } } ${objFragment} ` const queryConfig = { options: ({ objId }) => ({ variables: { ...
const express = require("express"); const app = express(); const { checkErr, correctPath, borrarImagen, borrarArchivo, deleteDir, findData, } = require("../funts"); const { verificaToken } = require("../middelwares/authentication"); const Dir = require("../models/dir"); const File = require("....
angular.module('app') .controller('UserListController', function($location, $state, UserService) { const vm = this; vm.users = UserService.getAll(); vm.search = lastName => { vm.users = UserService.getAll({lastName}); }; const errorCallback = err => { vm.msg=`${err.data.message}`; }; const deleteCallback ...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
import React from 'react' import PropTypes from 'prop-types' import styled from 'styled-components' const Bar = styled.div` width: 100vw; height: 10vh; position: fixed; z-index: 1; display: flex; justify-content: center; align-items: center; transition-duration: 0.2s; &.white { ...
import React, { Component } from 'react' import { StyleSheet, View, Image, Text, FlatList,TouchableOpacity} from 'react-native' import { connect } from 'react-redux' import {forEach, map} from 'lodash' import * as ScreenUtil from '../utils/ScreenUtil' import { NavigationActions, createAction } from '../utils' import ...
var searchData= [ ['ia',['ia',['../classplayer.html#ab5c7590da844e3e2128868820ab9ec45',1,'player']]], ['id',['id',['../classplayer.html#a5862f005a5367e1b0dc19bdf2846fd34',1,'player']]], ['info',['info',['../classnoeud.html#ad6e70a2d7350a11040d53468eaa40510',1,'noeud']]] ];
define(["jquery", "knockout", "durandal/app", "durandal/system", "plugins/router", "services/data", "moment", "utils/utils"], function ($, ko, app, system, router, data, moment, utils) { var // Properties taskName = ko.observable(''), TIME_FORMAT = "DD.MM.YYYY HH:mm:ss", tId, pro...
import React, { Component } from "react"; import { connect } from "react-redux"; import RouletteBoard from "components/RouletteBoard"; import { Typography } from "components"; import redColors from "../../../../RouletteGameCard/redColors"; import classNames from "classnames"; import _ from 'lodash'; import "./index.css...
'use strict'; var gulp = require('gulp'); var gulpLoadPlugins = require('gulp-load-plugins'); var browserSync = require('browser-sync'); var plugins = gulpLoadPlugins(), reload = browserSync.reload, BROWSER_SYNC_RELOAD_DELAY = 500, paths = { js: ['*.js', 'app.js', 'test/**/*.js', '!test/coverage/**', 'route...
/* eslint-disable no-underscore-dangle */ const { getUser, updateUser, deleteUser, createUser } = require('./userController'); const User = require('../models/userModel'); jest.mock('../models/userModel.js'); describe('Given a function createUser', () => { let req; let res; beforeEach(() => { req ...
import React from 'react'; import './RecipeLinks.css'; import { Link } from 'react-router-dom'; //<a href={'/recipe/' + this.state[3].title}> this.state[3].title </a> // <a href={'/recipe/' + this.state[2].title}> this.state[2].title </a> class RecipeLinks extends React.Component { constructor(props...
import * as d3 from 'd3'; export const chartStock = function (tickerSym, ajaxResponse, investment){ debugger; let data, startDate, endDate, minPrice, maxPrice, priceVariable; if (Object.keys(ajaxResponse)[0] === "history"){ data = ajaxResponse["history"] .reverse() .map(quote => ({ date: quote["...
/** * Created by duoyi on 2016/8/30. */ var db=require('../models'); exports.getCommentsByMessageId=function (option){ var msgId=option.msgId; return db.comment.findAll({where:{msgId:msgId},order:[['creatAt','DESC']],raw:true}); } exports.getMessageFrowardComment=function (option) { var msgId=option.m...
const arrow = document.querySelector('.arrow'); const authorPanel = document.querySelector('.author-panel'); const avatar = document.querySelector('.avatar'); const postInfo = document.querySelector('.post-info'); const shareButton = document.querySelector('.share-button'); const shareLabel = document.querySelecto...
import React from 'react' import CreateScene from './Create' import ViewScene from './View' const Scene = ({ id }) => ( <> {id ? ( <ViewScene id={id} /> ) : ( <CreateScene /> )} </> ) export default Scene
import React from 'react' import { Jumbotron, Button } from 'react-bootstrap' const DefaultAskQuestion = (props) => ( <Jumbotron> <h2>Hello you!</h2> <p>You want to ask a question too? Don't be shy, register!</p> <p> <button className="reg-btn-color" onClick=...
// var sum = 0; // function addToSum(num) { // sum += num; // } // var arr = [1,2,3]; // myForEach = (array, func) => { // for(let i = 0; i < array.length; i++){ // let currentElem = array[i]; // action() // } // } // myForEach(arr, addToSum); // console.log(sum); // 6 // var arr = [1, 2, 3, 4, 5,...
export default [ { prop: 'mixin', label: '分享内容', //rule: { required: false, message: '分享内容为必填项', trigger: 'blur' }, render(h) { h = this.$root.$createElement //, { icon: 'ios-videocam', label: '视频', name: 'video' } const uploadType = [{ icon: 'image', label: '图片', name: 'image' }, { icon: 'android-im...
import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import './Home.css'; import './Pokedex.css'; function App() { const[type, setType] = useState("all"); const [pokemonType, setPokemonType] = useState([]); const [pokemons, setPokemons] = useState([]); const [po...
const request = require('request'); const parseDomain = require('parse-domain'); const NlpProcess = require('./nlpProcess'); function converse(storage, bot, message){ storage.users.get(message.user,function(err, user) { // console.log("--------------------converse------------------"); if (err) { // ...
var express = require('express'), db = require('../../common/database'), router = express.Router(), data = null, newList = {}; function formatUser(key, data) { return { 'userId': key, 'username': data.username || 'Anonymous', 'status': data.status || 'Offline', 'avatar': data.avatar || null, 'game': dat...
function t_slidesInit(recid) { var el = $('#rec' + recid), windowWidth = $(window).width(), sliderItem = el.find('.t-slides__item'), sliderWrapper = el.find('.t-slides__items-wrapper'), sliderArrows = el.find('.t-slides__arrow_wrapper'), sliderWidth = el.find('.t-slides__container').width(),...
function reverseArray(arr) { arr.reverse(); console.log(arr) } reverseArray(["A", "B", "C"]);
import React from 'react' import { number, boolean } from '@storybook/addon-knobs' import Chart from './chart' export default { title: 'Chart/Line', parameters: { component: Chart, }, } export const Basic = () => ( <Chart id="line" subtitle={boolean('Subtitle', true, 'General option')} custom...
import React from "react"; import Nittedal from "../../../images/Nittedal.png"; const Art3 = props => { return ( <div className="balsfjord co" style={{ left: `${props.scrollLeft}` }} > <div className="art"> <img src={Nittedal} alt="" /> <div className="text"> ...
import React from 'react'; import { Button, Grid, Typography, TextField, FormControl, FormControlLabel, FormHelperText, Radio, RadioGroup, Collapse, } from '@material-ui/core'; import Autocomplete from '@material-ui/lab/Autocomplete'; //TODO: add real list of schools, organized ...
const API_URL = "http://localhost:8080/api"; import axios from "axios"; import router from "../router"; class AuthService { user = { authenticated: false }; login(context, account, redirect) { const url = `${API_URL}/login/`; axios .post(url, account) .then(response => { localStor...
export default { splash: { teaching_kid: '育兒', }, };
mainModule.controller('activityController', function($rootScope, $scope, $routeParams, defaultFactory) { $scope.result = []; $scope.activity = []; $scope.$on('pushActivities', function(event, data) { console.log("received", data); $scope.result = data; }); $scope.submitActivity = function() { $("#activityC...
'use strict'; module.exports = function (gulp, plugins, config, gutil) { return function () { return gulp.src([ config.viewsPath + '/**/*.html' ]) .pipe(gulp.dest(config.buildFolder + '/views')) .on('error', gutil.log); }; };
import {Component} from "react"; import { styled } from '@material-ui/core/styles'; import { Grid,Card,Typography} from "@material-ui/core"; import {Form,Button} from "react-bootstrap"; import axios from "axios"; import Modal from 'react-bootstrap/Modal' import Payment from "../../Passenger/Payment/Payment"; import { w...
//The webpage will prompt you for your slack token! $(document).ready(function() { var url = "https://slack.com/api/"; $("#token").val(getSlackToken()); $("#user-div").hide(); $("#navbar").hide(); $(".home-div").hide(); var ajaxCall = function(apiMethod, options) { return $.ajax(url + apiMethod, option...
require('should'); const zapier = require('zapier-platform-core'); const App = require('../index'); const appTester = zapier.createAppTester(App); ` {key: 'url', required: true, type: 'string'}, {key: 'sourceId', required: true, type: 'string'}, {key: 'orgId', required: true, type: 'string'}, {key...
const express = require('express'); const restaurantModel = require('../models/Restaurants'); const app = express(); // find all restaurants // http://localhost:3000/restaurants app.get('/restaurants', async (req, res) =>{ const restaurants = await restaurantModel.find({}); try { res.send(restauran...
function showText() { $('#more').css('display', 'none'); $('#text').css('display', 'inline') }
function icl_get_form_id() { form_id = ""; $("input[name=form_id]").each(function() { if ($(this).attr('id').indexOf('icl') >= 0) { form_id = $(this).val(); } }); return form_id; } function icl_get_form_token() { form_token = ""; $("input[name=form_token]").each(function() { ...
// @ts-nocheck /* eslint-disable */ /* tslint:disable */ /* prettier-ignore-start */ import React from "react"; import { classNames } from "@plasmicapp/react-web"; export function UploadIcon(props) { const { className, style, title, ...restProps } = props; return ( <svg xmlns={"http://www.w3.org/2000/svg...
function nextStep(){ // 註冊三個步驟 var step1=document.getElementById("step1"); var step2=document.getElementById("step2"); var step3=document.getElementById("step3"); var upBtn=document.getElementById("upBtn"); var share=document.getElementById("sharePhoto"); var chooseBtn=document.getElementByI...
// Exercise 13 // // Write a function that takes accepts a string as its only argument // and returns a number that indicates how many uppercase "B"s are in the string. // // Edit only the code between the lines (below) // ----------------------------------------------------------------- function countBs(str) { // st...
// Variables used by Scriptable. // These must be at the very top of the file. Do not edit. // icon-color: orange; icon-glyph: grin-hearts; // Created by Enjoyee @ https://github.com/Enjoyee/Scriptable // Modified by Samuel Shi on 2020-10-24 ////////////////////////////////////////// // 预览大小【小:Small,中:Medium,大:Large】 c...
! function() { var e = function(e, i, a) { var r = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; return r ? new Promise(function(i, a) { r.call(navigator, e, i, a) }) : Promise.reject(new Error("getUserMedia is n...
import React, {useRef} from 'react'; import { Dropdown } from 'semantic-ui-react'; import DocumentsActsTable from './DocumentsActsTable/DocumentsActsTable'; import DateTimePicker from '../../DateTimePicker/DateTimePicker'; import UploadScantModal from "../../modals/UploadScan/UploadScanModal"; import RoleBasedRender fr...
import React, { useContext, useState } from 'react' import style from "../styles/pages/Products.module.scss" import Link from "next/link" import AllProducts from '../pages/all-products' import AppContext from './AppContext' const Product = ({...restProps}) => { const myContext = useContext(AppContext); if...
'use strict'; import React, {Component} from 'react'; import { View, ScrollView, TouchableOpacity, SafeAreaView, StatusBar, Image, StyleSheet, KeyboardAvoidingView, FlatList, TouchableWithoutFeedback, Text, Modal, } from 'react-native'; import { Icon} from 'native-base' import styles fro...
import React from "react"; import { Menubar } from "primereact/menubar"; import { InputText } from "primereact/inputtext"; import { Button } from "primereact/button"; export const MenubarDemo = ({handleChange , handleClick}) => { const loadState = () => { try { const serializedState = localStorage.getI...
const express = require('express') const scheduleController = require('../controllers/scheduleController') const auth = require('../middlewares/auth') const router = new express.Router() /** * Router for all endpoints regarding to managing the schedules. */ /** * Route for creating a new schedule. */ router.pos...
const require_ = require('esm')(module) module.exports = require_('./index.js').default module.exports.init = module.exports
'use strict'; const express = require('express'); const router = new express.Router(); router.get('/', serveFront); router.post('/', serveFront); /** * Serves frontpage (/) of the website * * @param {Object} req HTTP Request object * @param {Object} req HTTP Response object */ function serveFront(req, res) { ...
import { StyleSheet, Platform, StatusBar } from "react-native"; export const styles = StyleSheet.create({ container: { marginTop: 30 }, subtitleView: { flexDirection: 'row', paddingLeft: 10, paddingTop: 5 }, subtitleText: { opacity: 0.5 } });
import classes from '../styles/Header.module.css'; import Query from './Query/index.js'; import HEADER_QUERY from '../queries/header.js'; import { connect } from "react-redux"; import store from '../store/index'; import { slide as Menu } from 'react-burger-menu'; import { NavHashLink } from 'react-router-hash-link'; ...
import React from 'react'; import { observer } from 'mobx-react'; // import {action, observable} from 'mobx'; @observer class SimpleCheckbox extends React.Component { // @observable field = null constructor(props) { super(props) // this.field = props.field } render() { const { field, label, style...
import React, { useState } from "react"; import "./ProjectEdit.css"; import moment from "moment"; import ReactDatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import { useHistory } from "react-router"; import { Button, Dropdown, Form } from "semantic-ui-react"; import Wrapper fro...
import { ApolloClient } from 'apollo-client' import {HttpLink} from "apollo-link-http" import {InMemoryCache} from "apollo-cache-inmemory" const GITHUB_BASE_GQL_URL = 'https://api.github.com/graphql' const httpLink = new HttpLink({ uri: GITHUB_BASE_GQL_URL, headers: { authorization: `Bearer ${process.env.REAC...
// pass the modules you would like to see transpiled const withTM = require('next-transpile-modules')(['lodash-es', '@bootcamp/graphql', '@bootcamp/stores']); module.exports = withTM();
import React, {Component} from "react"; import {Button, Card, Modal} from "react-bootstrap"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" class BookMarkCard extends Component { state = { show: false } setShow = (event) => { this.setState({show: true}); } onModalCl...
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import { loginAction } from '../modules/Login' import * as RoutePath from '../utilities/RoutePath'; import { Formik, Form, Field } from 'formik'; class Login extends Component { constructor...
import { ManagementClient, AuthenticationClient } from "auth0"; const { AUTH0_DOMAIN: domain, AUTH0_CLIENT_ID: clientId, AUTH0_CLIENT_SECRET: clientSecret } = process.env; const auth0Management = new ManagementClient({ domain, clientId, clientSecret }); const auth0Authentication = new AuthenticationClien...
/************** BLOCK SCOPE IN JS ********************/ /* { var x = 10; let y = 100; const z = 1000; console.log(x); console.log(y); console.log(z); } console.log(x); console.log(y); console.log(z); */ /********* SHADOWING IN JS ****************/ /* let y = 11; { var x = 10; // t has shadowed the glo...
OC.L10N.register( "lib", { "Cannot write into \"config\" directory!" : "Nu se poate scrie în folderul \"config\"!", "This can usually be fixed by giving the webserver write access to the config directory" : "Aceasta se poate repara de obicei prin permiterea accesului de scriere la dosarul de configurare...
import fetch from '@system.fetch'; import settle from './settle'; import createError from './createError'; /** * Execute a fetch request * * @param {object} config The config that is to be used for the request * @returns {Promise} The Promise to be fulfilled */ function http(config) { return new Promise((resolv...
import React, {Component} from 'react'; import './App.css'; import Shop from './components/Shop'; import About from './components/About'; import Navbar from './components/Navbar'; import Home from './components/Home'; import Contact from './components/Contact'; import Footer from './components/Footer'; import Employ fr...
function DistanceMatrix() { let distanceMatrix = {}; let graph = {}; let identifier = d => d; let sz = 0; /** * Method for Creating a node in the graph * For each node, the following attributes will be created: * { * name: the identifier of the node * neighbors: list of all neighbors of ...
import React from 'react'; import ClassNames from 'classnames'; import ActivableRenderer from '../hoc/ActivableRenderer'; import Overlay from '../overlay'; import style from './style'; const Drawer = (props) => { const className = ClassNames([style.root, style[props.type]], { [style.active]: props.active }, pr...
angular .module('planTrip') .component('planTripCenter', { templateUrl: 'app/page/plantrip/plantrip-center.html', controller: PlanTripCenterController }); /** @ngInject */ function PlanTripCenterController() { // var vm = this; }
import successfulPermApi from '@/api/successfulPerm' import selectCase from '@/components/main/dialog/selectCase/selectCase.vue' import selectCandidate from '@/components/main/dialog/selectCandidate/selectCandidate.vue' import selectUser from '@/components/main/dialog/selectUser/selectUser.vue' import selectHr from '@/...
const getLocalDate = (offset) => { const date = new Date(); return new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000 + offset); }; export default getLocalDate;
console.log("jashith java script loaded"); function isDefined(a) { return (typeof(a)=="undefined" ? false : true); } try{ var JCL_timer = (function(){ this.serachVelocity = 300; this.searchTrigger = ''; this.searchQuery = ''; this.callBack = function(obj){} this.setDelayTime = function(velocity){ thi...
import React from 'react' import localforage from 'localforage' import Graph from '../engine/Graph.js' import GraphEditor from './GraphEditor.js' class ReflowEditor extends React.Component { static defaultProps = { reflowStore: localforage.createInstance({name: 'reflow'}), } constructor (opts) { supe...
const express = require('express') const userRouter = require('./routers/userinfo') const app = express() // 处理req body app.use(express.json()) app.use(express.urlencoded({extended: true})) app.get('/', (req, res) => { res.send('hello express') }) app.use('api/user', userRouter) app.listen(3000) console.log('...
/** * Copyright 2016 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
/* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable react/sort-comp */ /* eslint-disable global-require */ /* eslint-disable no-nested-ternary */ /* eslint-disable react/destructuring-assignment */ /* eslint-disable react/prop-types */ import React from 'react'; import './AnalystProfile.scss'...
/** * date:20191213 * author:WL * description:后台界面框架 */ layui.define(["element", "jquery"], function (exports) { var $ = layui.$ ,element = layui.element ,layer = layui.layer; let adminui = new function () { this.init = function () { }; /** * * ...
import React from 'react'; export default class TrainerCounter extends React.Component { constructor(props) { super(props); } render() { return ( <div className="row mt-3"> <div id="poke-master-counter-text" className="col-md-12 text-center"> ...
import React from 'react'; import { shallow } from 'enzyme'; import SectionCard from './SectionCard'; import renderer from 'react-test-renderer'; test('It calls the function that gets passed in as a prop to remove section on click.', () => { const mockOnClick = jest.fn(); const props = { title: 'This is a Sec...
import { ParamsError } from './Err'; import ValidatorBase from './ValidatorBase'; import { isBool } from './dataType'; export default class BooleanValidator extends ValidatorBase { constructor(data, options) { super(); this.type = 'boolean'; this.value = data; this.options = option...
import { selectedSub } from '../reducers' import { SELECT_SUB, } from '../actions' describe("selectedSub Reducer", () => { it("returns current state", () => { const action = {} const state = "reactjs" expect(selectedSub(state, action)).toEqual(state) }) it("updates state", () => { const actio...
var app = require('express')(); var server = require('http').createServer(app); var io = require('socket.io')(server); var router = require('express').Router(); var Brainiac = require('./brainiac.js'); router.get('/', function(req, res) { res.status(200).json( { message: 'Welcom to Brainiac, an int...
import styled from "styled-components"; import Paper from "@material-ui/core/Paper"; export const Div = styled(Paper)` width: 100%; position: relative; margin: 0 auto auto; .ant-upload { width: 100% !important; min-height: 200px !important; padding: 15px; span:first-child { width: 100% ...