text stringlengths 7 3.69M |
|---|
var loopback = require('loopback');
module.exports={
createCallback:function(){
var callback;
var promise = new global.Promise(function(resolve, reject) {
callback = function(err, data) {
if (err) return reject(err);
return resolve(data);
};
});
callback.promise = promise;... |
const express=require("express")
const app=express();
const db=require("./config/db.js")
app.use(express.json())
const cors=require("cors")
app.use(cors())
/*
const bodyParser=require("body-parser");
const { urlencoded } = require("body-parser");
app.use(bodyParser.urlencoded({extended:true}))
*/
app.post("/api/cre... |
const mortal = "MORTAL";
let men = {
Newton: mortal,
Edison: mortal,
Socrates: mortal,
}
const isMortal = (name = null) => {
if(name !== null && name.length > 0){
if(name in men){
return men[name];
}
else{
return "Immortal";
}
}
return "no... |
// underscore 是一个开源库,提供了丰富的高性能的对数组,集合等的操作
// api 手册:http://learningcn.com/underscore
// 为了少加载不必要的代码,默认是不引入 underscore 的,需要用到的话
// 将define所在中的'underscore'的注释去掉即可。即改为
// define(['underscore'], function() {
// ...
// });
define([/* 'underscore' */], function() {
// data 是Graph的输入数据。
// 使用data... |
import React from 'react';
import LayoutContainer from '../../../components/Layout/LayoutContainer';
import Container from './Container';
export default {
path: '/password/modify',
action() {
return {
title: '修改密码',
component: <LayoutContainer><Container /></LayoutContainer>
};
}
};
|
import styled from 'styled-components';
export const Header = {
wrap: styled.div`
.navbar {
background-color: #000 !important;
}
.nav-link {
color: #ff00f7 !important;
cursor: pointer;
}
.nav-link:hover,
.nav-link__active {
color: #fff !important;
}
.dropdow... |
import React from 'react';
import { FormattedMessage } from 'react-intl';
import Templates from './component/Templates';
export default class Page1 extends React.PureComponent {
render() {
return (<div className="page-wrapper page1">
<div className="page">
<h1><FormattedMessage id="app.home.templat... |
import React, { Component } from 'react';
import axios from 'axios';
import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';
class SignupForm extends Component {
constructor(props) {
super(props);
this.state={
username: '' ,
email: '',
password: '',
... |
const Question = require("../models/Question");
const CustomError = require("../helpers/error/CustomError")
const asyncWrapper = require("express-async-handler")
const askNewQuestion = asyncWrapper(async (req,res,next) => {
const information = req.body;
const question = await Question.create({
...inf... |
// Copyright 2018 - UDS/CNRS
// The Aladin Lite program is distributed under the terms
// of the GNU General Public License version 3.
//
// This file is part of Aladin Lite.
//
// Aladin Lite is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as publis... |
let tableEl = document.getElementById("tabla");
let data = `{
"salidas" : [
{
"Lugar ": "Dique ",
"Compania ": "Solos ",
"Duracion ": "3:00 Hs. ",
"Colacion ": "Mates y galletitas "
},
{
"Lugar ": "Parque ",
"Compania ": "Lau ",
"Duracion ": "2... |
'use strict';
const React = require('react');
const { Component } = React;
const PropTypes = require('prop-types');
const classes = require('classnames');
require('./formInput.less');
class FormInput extends Component {
render() {
const {
className, type, name, placeholder, value, disabled, ... |
$(".breadcrumb_nav_btn").eq(0).toggle(function() {
return $(this).parent().find(".breadcrumb_nav").eq(0).animate({
height: "toggle",
opacity: "toggle"
}, "fast"), $(this).addClass("active"), !1
}, function() {
return $(this).parent().find(".breadcrumb_nav").eq(0).animate({
height: "toggle",
opacity: "toggl... |
jQuery(function () {
//Sự kiện nút chọn tất cả
jQuery('#checkAllNotInGroup:button').click(function () {
var checked = !jQuery(this).data('checked');
jQuery('input[name="chkUsersNotInGroup"]:checkbox').prop('checked', checked);
jQuery(this).val(checked ? 'uncheck all' : 'check all')
... |
var a=1
export {a} |
const assert = require('assert');
const checkSocialNetworkIntegrity = require('../../src/validators/data-integrity-check')
const loadSocialNetworkFromFile = require('../../src/data/dataloader')
const path = require('path')
describe('data-integrity-check', function () {
let validSocialNetwork = {}
let invalidSo... |
//1、页面加载完成以后,直接ajax请求,要到分页信息
$(function () {
//开始去首页
to_page(0);
//新增员工
addEmp();
//提交新增员工信息
add_btn();
//员工更新
updateEmp();
//提交员工修改信息
update_btn();
//员工删除
deleteEmp();
//复选框功能
checkAll_cbx();
checkItem_cbx();
//删除复选框选中的员工
deleteEmps();
});
function to_page(pn) {
$.ajax({
url: "emps",
data: "pn... |
import Vue from 'vue'
// import {store} from './redux/store';
// import App from './examples/App.vue'
// import Login from './login/Login.vue';
// import Redux from './redux/Redux.vue';
// import Counter from './redux/Counter';
// import {store} from './login-vuex/store';
// import Login from './login-vuex/Login';
impo... |
sendFunction = function (row, store) {
Ext.define('gigade.elcm', {
extend: 'Ext.data.Model',
fields: [
{ name: 'elcm_id', type: 'int' },
{ name: 'elcm_name', type: 'string' }
]
});
var elcmStore = Ext.create("Ext.data.Store", {
autoLoad: true,
... |
var express = require('express');
var router = express.Router();
var User = require('../models/user');
var mongoose = require('mongoose');
const encryptor = require('bcrypt');
/* GET login page. */
router.get('/', function(req, res, next) {
if (req.session.user){
res.redirect('/');
}
else{
res.render('si... |
import React, { Component } from 'react';
import {Link} from 'react-router'
class Landing extends Component {
// constructor(props){
// super(props)
// }
render() {
return (
<center>
<div class="jumbotron">
<h3>Welcome to Project Tracking Managment Application</h3>
<h4>Client:ReactJs</h4> ... |
import React, { Component} from 'react'
export const Header_Default = () => (
<div className="ui container">
<div className="ui row vertical segment">
<h1 className="ui header">Header
<div className="sub header">{`<Header default/>`}</div>
</h1>
</div>
<div className="ui row vertic... |
var settings = {
gamename: "mortimer",
version: "pyweek-2",
savegamename: "mortimerpw2save",
sessionname: UFX.random.word(),
review: window.location.href.indexOf("review") > -1,
sx: 800,
sy: 400,
nlevels: 6,
levelnames: [
["Stage 1", "Mortimer's backyard"],
["Stage 2", "Dojo of the Royal Lepidopteral S... |
function clearForm(id) {
var objId = document.getElementById(id);
if (objId == undefined) {
return;
}
for (var i = 0; i < objId.elements.length; i++) {
if (objId.elements[i].type == "text") {
objId.elements[i].value = "";
}
else if (objId.elements[i].... |
class Player extends Drawable {
constructor({ image, totalFrames = 1, ticksPerFrame = 10,
width, height, startX = 0, startY = 0, framesPerSeconds,
playerSpeed = 10, deathCallback = () => { }, respawnCallback = () => { } }) {
super({ drawOrder: 5 })
this.gameObject = new GameObject({
startX, star... |
var app = angular.module("adminApp", [] );
app.factory("logger", jotaLogger);
app.factory("convert", jotaConvert);
app.factory("service",jotaService);
app.factory("transcend", jotaTranscend);
app.controller("mainController", function(logger,convert,service,transcend,$scope){
var self = this;
self.log... |
import { render, screen } from "@testing-library/react"
import MainPage from "./MainPage"
test("show MainPage", () => {
const rendered = render(<MainPage/>)
expect(rendered).toMatchSnapshot();
});
|
var http = require('http');
var handleRequest = function(request, response) {
if(process.env.TYPE == "GATEWAY"){
console.log('Passed.');
var options = {
host: 'service',
port: 8080,
method: 'GET'
};
var req = http.request(options, function(res) {
data = ""
res.on('data', ... |
import React from "react";
const SideListContent = props => {
const dummyList = props.projectData;
console.log("side-dummy", dummyList);
const probableList = dummyList.filter(
project => project.fields.Status !== "Probable"
);
const filterList = probableList.filter(
project => project.fields.Status !... |
import React from 'react';
import AccessCode from '../components/AccessCode.jsx';
class SelectName extends React.Component {
constructor() {
super();
this.joinGame = this.joinGame.bind(this);
}
joinGame(e) {
e.preventDefault();
var gameId = this.props.gameId;
var playerName = e.target.name.value;
cons... |
/**
* @see {@link https://developer.chrome.com/extensions/i18n}
*/
module.exports = {
extName: { message: 'Vue Chrome 擴充套件' },
extDescription: { message: 'Vue.js Chrome 擴充套件模板' },
background: { message: '背景(Background)' },
content: { message: '內容腳本(Content Script)' },
devtools: { message: '從回呼函數來的訊息(from c... |
import { h, Component, createRef } from 'preact';
import PropTypes from 'prop-types';
import List from 'components/list';
import { route } from 'preact-router';
class ListPage extends Component {
createButtonRef = createRef();
constructor(props) {
super(props);
this.onCreate = this.onCreate.bind(this);
... |
TEXPIRED = "已過期";
NOTPASTDUE = "未過期";
SEARCH = "查詢";
RESET = "重置";
SAVE = "保存";
/*列表頭*/
REFERRER = "推薦人";
EMAIL = "被推薦人mail";
CREATETIME = "建立日期";
/*查詢條件*/
DDLSEL = "查詢條件";
DDLCON = "查詢內容";
ALL = "全部";
NAMEEMAIL = "被推薦人信箱";
NAME = "被推薦人姓名";
REFERRERNAME = "推薦人姓名";
REFERREREMAIL = "推薦人信箱";
NOW_DISPLAY_RECORD = "當前顯示記... |
import React from 'react';
import { useMediaQuery } from 'react-responsive';
import { Link } from 'react-router-dom';
import './Header.scss';
const Header = ({ count }) => {
const isPc = useMediaQuery({
query: '(min-width:1024px)',
});
return (
<>
{isPc ? (
<div className="header">
... |
import React from "react";
function Help() {
return <div>
<h1>This Portion is on Progress please bear with us</h1>
</div>;
}
export default Help; |
import React, { useState, useEffect } from "react";
import {makeWidthFlexible, XYPlot, XAxis, YAxis, HorizontalGridLines, VerticalGridLines, VerticalBarSeries} from 'react-vis'
import API from "../../util/API";
function BarChart(props) {
const [chartData, setChartData] = useState([]);
const [xAxisArrayState, s... |
//During the test the env variable is set to test
process.env.NODE_ENV = "test";
//Require the dev-dependencies
let chai = require("chai");
let chaiHttp = require("chai-http");
let app = require("../server");
let should = chai.should();
describe("Server", () => {
// Test the /GET route
describe("/GET *", () => {
... |
import formatDeclarations from "../formatDeclarations"
describe("formatDeclarations", () => {
function collectRules() {
function result(rule) {
result.rules.push(rule)
}
result.rules = []
return result
}
it("should iterate over each rule of a declaration", () => {
const declaration = ... |
var loginApp = angular.module("loginApp", []);
loginApp.controller("loginCtrl", function($scope, $http) {
// 用户登录
$scope.login = function() {
var user = $scope.user;
// md5加密用户密码
var userPwd = $.md5(user.userPwd);
user.userPwd = userPwd;
// 请求后台用户登录方法
console.log(user);
var url = $("#path").va... |
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: ['@nuxtjs', 'plugin:nuxt/recommended'],
plugins: [],
// add your custom rules here
rules: {
quotes: [2, 'single'], // 单引号
semi: [2, 'never'], // 不使用分号
'space-b... |
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { View, TextInput, TouchableOpacity } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import * as colors from 'kitsu/constants/colors';
import { Avatar } from 'kitsu/screens/Feed/components/Avatar';
impo... |
import React from 'react'
import {ProductImage, plainText} from '../store/db';
function Intro() {
const ProductScreen = () => {
return (
<>
{ProductImage.map((image,key) => {
return(
<div key={key} className={`product-screen-${key+1} wow fadeIn... |
Ext.define('CBA.store.StBusStore', {
extend: 'Ext.data.Store',
requires: [
'CBA.model.StBusModel',
],
config : {
autoLoad: true,
model: 'CBA.model.StBusModel',
storeId: 'StBusStore',
sorters: {
property: 'idx',
direction: 'asc'
},
... |
const express=require('express');
const router=express.Router();
const multer=require('multer');
const thumbnailGenerator = require('../helper/videothumbnail');
//multer
var storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, 'uploads')
},
filename: function (req, file, cb... |
var searchData=
[
['length',['length',['../struct_s_f___e_m_b_e_d___f_i_l_e___i_n_f_o.html#a877c809e76ebbec7c45da688ff0109e8',1,'SF_EMBED_FILE_INFO']]],
['level',['level',['../struct_s_f___d_i_t_h_e_r___i_n_f_o.html#ab2103a4159cf90c75df76318eaa5eb7f',1,'SF_DITHER_INFO']]],
['loop_5fcount',['loop_count',['../struc... |
import React ,{Component} from 'react';
class Form extends Component{
constructor(){
super()
this.state={
tasks:[],
text:"Hello World!!"
}
}
clickFunction()
{
console.log("Add this Value to Array",this.refs.task.value)
var o={
"task":this.refs.task.value,
"no":... |
const itemsNav = document.querySelectorAll('.nav-li');
const itemsProjeto = document.querySelectorAll('.item-projeto');
const itemsHabilidade = document.querySelectorAll('.moldura-icone');
const sectOff = document.querySelectorAll('.sectOff');
const flexExperiencia = document.querySelectorAll('.flex-experiencia');
... |
///TODO: REVIEW
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @param {number} v
* @param {number} d
* @return {TreeNode}
*/
const addOneRow = (root, v, d) => {
const helper = (root, level,... |
import React from 'react';
import {
Title,
TextBlock,
InvasivePotential,
Resources,
Resource,
Summary,
SexualReproduction,
AsexualReproduction,
EcologicalNiche,
PopulationDensity,
EnvironmentImpact,
ManagementMethod,
ManagementApplication,
OriginalArea,
SecondaryArea,
Introduction,
Breeding,
CaseImage... |
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Libreria = void 0;
const express_1 = require("express");
const controladorLibros_1 = __importDef... |
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
* This is the base class for creating a PIXI filter. Currently only webGL supports filters.
* If you want to make a custom filter this should be your base class.
* @class AbstractFilter
* @constructor
* @param fragmentSrc {Array} The fragment sour... |
/**
* Created by heavenduke on 15-5-20.
*/
|
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
//Product Slice will add product objects to the store for rendering/filtering etc
export const getProducts = createAsyncThunk(
"productSlice/getProducts",
async () => {
const storeProducts = await fetch("http://localhost:4000/products");
con... |
import Alumini from "./Alumini";
import Header from "./Header";
import React, { useEffect, useState } from "react";
import AOS from "aos";
import db from "./firebase";
import "./AluminiList.css";
import Contact from "./Contact";
import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
function AluminiList() {... |
if (true) {
var x = 3;
}
console.log(x);
if (true) {
const y =3;
}
console.log(y);
////// Object Literal
var sayNode = function() {
console.log('Node');
};
var es = 'ES';
/////
// var oldObj = {
// sayJS : function(){ // sayJS객체의 메서드에 함수를 연결
// console.log('JS');
// },
... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("mocha");
const chai_1 = require("chai");
const app_1 = require("./app");
// var assert = require('assert');
describe('MyCharacter', function () {
const exampleCharacter = new app_1.myCharacter('Example', 1, [app_1.DNDStat['str'], ... |
(function (root, factory) {
var lib = factory();
if (typeof module === 'object' && module.exports) {
// node.js/CommonJs
module.exports = lib;
}
if (typeof define === 'function' && define.amd) {
// AMD anonymous module
define(lib);
}
if (root) {
root.Handl... |
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const locales = ['en', 'es'];
const translations = {
en: {
hello: 'Hello',
goodbye: 'Goodbye',
thank_you: 'Thank you',
world: 'World',
},
es: {
hello: 'Hola',
goodbye:... |
import React from 'react'
import { PropTypes } from 'prop-types'
import { Link } from 'react-router-dom'
import { Breadcrumb } from 'react-bootstrap'
export default function BreadCrumb({ current }) {
return (
<Breadcrumb>
<li className="breadcrumb-item">
<Link to="/">Dashboard</Link>
</li>
... |
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
//根级别的
import defaultState from './state'
import defaultMutations from './mutations'
import defaultGetters from './getters'
import defaultActions from './actions'
const store = new Vuex.Store({
// 当这个值为true,就不允许使用this.$store.state.count=3这样的方式修改count的值,
//... |
import { api } from './instances'
import store from '../store'
// класс для обращения к АПИ
class Api {
static getCountriesList () {
return new Promise((resolve, reject) => {
api.get('/get-countries')
.then(response => {
resolve(response)
})
.catch(err => {
rejec... |
import { createCamera } from "./components/camera.js";
import { createLights } from "./components/lights.js";
import { createScene } from "./components/scene.js";
import { createHelpers } from "./components/helpers.js";
import { createRenderer } from "./systems/renderer.js";
import { Resizer } from "./systems/Resizer.... |
function include(fileName){
document.write("<script type='text/javascript' src='"+fileName+"'></script>" );
}
include('js/client.js');
$(document).ready(function() {
listpays()
});
function getXMLHttpRequest() {
var xhr = null;
if (window.XMLHttpRequest || window.ActiveXObject) {
if (window.Activ... |
import axios from 'axios'
import store from '@/store'
import * as loginAuth from './session';
import * as tools from './tools'
const http = axios.create({
baseURL: '',
timeout: 30000
})
// request 拦截器
http.interceptors.request.use(
config => {
// if (store.getters.userInfo.token) {
// config.headers['... |
module.exports = {
"Bond": {
"address": "0x302b9dee61cd01F7A21D65c4C9c8fA76D675E3F0",
"name": "Bond",
"symbol": "BOND",
"decimals": 18,
"investing": false,
}
} |
const { describe, it } = require('mocha');
const { request } = require('../context');
describe('Basic server responses', () => {
it('<200> GET /', (done) => {
request.get('/')
.expect(200)
.end(done);
});
it('<404> GET /pagenotfound', (done) => {
request.get('/pagenotfound')
.expect(4... |
import React from 'react'
import AppSelect from './app-select/app-select'
import AppData from './app-data/app-data'
import "./devices.css"
const Page = () => (
<div className="jumbotron devices">
<h1 className="display-4">Medical Devices Coming Soon</h1>
<p className="lead">
This page will contain all the da... |
import React from "react";
import {
Grid,
TextField,
Typography,
Button,
IconButton,
Toolbar,
Avatar,
Paper
} from "@material-ui/core";
import useStyles from "./styles";
import CloseIcon from "@material-ui/icons/Close";
import EditIcon from "@material-ui/icons/Edit";
import Accountcirle from "@materia... |
import React from 'react'
import ReactDOM from 'react-dom'
class MgrRegister extends React.Component {
constructor(props) {
super(props)
this.state = { message: '' }
this.submit = this.submit.bind(this)
}
submit() {
this.setState({ message: '' })
if (!!!document.getElementById('account').v... |
const urlConfig = (env) => {
if (env === 'test') {
// test
return {
url: {
SIGNIN_URL: 'http://localhost:3000/signin',
REGISTER_URL: 'http://localhost:3000/register',
IMAGE_URL : 'http://localhost:3000/image',
API_URL: 'http://localhost:3000/imageurl'
}
}
} el... |
/**
* Created by dmitry on 04.11.15.
*/
var { Model, View, Collection, Router, LocalStorage } = Backbone;
import Form from './module/form.js'
var form = new Form({
model: new Form.Model({
action: "/contacts",
fields: {
company: { name: "company", placeholder: "Компания", type: "text", valida... |
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import RaisedButton from 'material-ui/RaisedButton';
import React,{ Component } from 'react';
import axios from 'axios';
import WeatherHeader from './header';
import WeatherFooter from './footer';
class Weather extends Component
{
constructor(props... |
"use strict";
module.exports = {
up: (queryInterface, Sequelize) => {
const data = [
{
id: "randomID1",
name: "Áo thun nam",
categoryId: 1,
description: "abc",
createdAt: new Date(),
updatedAt: new Date()
},
{
id: "randomID2",
name... |
import TimelinesChart from "timelines-chart";
import HorizonTSChart from "horizon-timeseries-chart";
export { TimelinesChart, HorizonTSChart };
|
module.exports = class Index {
constructor(name) {
this.name = name;
}
hello() {
return `Hello ${this.name}`;
}
};
|
import React from 'react';
import {MDBCard} from 'mdbreact';
import PropTypes from 'prop-types';
import {withRouter} from 'react-router-dom';
import {videoData} from './index.mock';
import {VideoShow} from './containers/video';
import {VideoInfor} from './containers/video-infor';
import {languageHelper} from '../../..... |
import dayjs from 'dayjs';
import Trip from './Trip';
class Traveler {
constructor(info) {
this.id = info.id;
this.name = info.name;
this.trips = [];
this.travelerType = info.travelerType;
}
getTrips(trips) {
this.trips = trips
.filter((trip) => trip.userID === this.id)
.map((tri... |
$(function() {
/*
$('#franceDepartements-map').JSMaps({
map: 'franceDepartements',
enablePanZoom: false,
disableTooltip: false,
stateClickAction : 'url',
strokeWidth: 3,
strokeColor : '#24221f'
});
*/
}); |
/* Smooth scrolling */
$(document).ready(function(){
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
//... |
(function(exports) {
function NotePadViewer() {
}
NotePadViewer.prototype.wrapNote = function(string){
return `<ul><li><div>${string}</div></li></ul>`
};
exports.NotePadViewer = NotePadViewer;
})(this);
|
// REVERSE TEXT JQUERY PLUGIN
(function($) {
$.fn.reverseText = function(params) {
params = $.extend({ min: 0, max: 99999 }, params);
this.each(function() {
var e = $(this);
var txt = e.text();
if (txt.length >= params.min && txt.length <= params.max) {
... |
import React from 'react';
import PropTypes from 'prop-types';
export default class Buttons extends React.Component {
// 检测类型
static contextTypes = {
text: PropTypes.string,
change: PropTypes.func
}
constructor(props) {
super(props)
this.state = {
text: 'button'
}
}
componentWillM... |
var timer = {
countTime: 0,
individualTime: new Array(),
create_time: function(timerId, time) {
this.timerId = timerId;
this.totalSeconds = time;
timer.update_timer();
window.setTimeout(timer.tick, 1000);
},
update... |
function show(type)
{
count = 0;
for (var key in methods) {
var row = document.getElementById(key);
if ((methods[key] & type) != 0) {
row.style.display = '';
row.className = (count++ % 2) ? rowColor : altColor;
}
else
row.style.display = 'none... |
const express = require("express");
const router = express.Router();
const cors = require("cors");
const { FriendsAPI, FriendSearchAPI } = require("../model/Friends");
const { ViewHugAPI } = require('../model/Hugs');
router.use(
express.urlencoded({
extended: true,
})
);
router.use(express.json());
router.use(... |
// 通过<a>标签实现选项卡
(function () {
var aLink = document.querySelectorAll('a');
// 用偏函数闭包实现
var linkPartial = function (k) {
var i = k;
return function () {
var choiceItem = document.querySelectorAll('.choiceItem');
var j = 0;
for (; j < choiceItem.length; j++) {
if (choiceI... |
import React from 'react'
import { useHistory } from 'react-router-dom'
const ListCard = (props) => {
let history = useHistory()
const { list } = props
const { id, title, completed } = list
return (
// send to page with item id
<div className="card" data-v-0001 onClick={() => history... |
jQuery(function()
{
var contentNL='<input id="mailNL" type="mail" placeholder="Votre e-mail"/><div id="submitNL">Valider</div>',
formNewsLetter=$('<form></form>', {id: 'formNewsLetter', autocomplete:'off', spellcheck:'false'}),
mailNL, blockedScreenNL=$('<div></div>').css({width: '100%', height: '100%', backgro... |
/**
* Created by a on 2017/10/20.
*/
// const mysql = require("mysql");
const dbpool = require("../config/fileconfig"); //dbpool
const userController = {
getUser(request,response){
console.log("controller收到getUser的任务");
//...业务处理
//GET请求里面获取form表单的数据
//请求相关信息都在request对象里
... |
import {Grid} from '@material-ui/core';
import ContactForm from './ContactForm';
import firebaseDb from '../Firebase';
import {useEffect,useState} from 'react';
const Contacts = () => {
var [userObjects, setUserObjects] = useState({});
var [currentUser, setCurrentUser] = useState('');
useEffect(()=>{
... |
import FormErrorMessage from './FormErrorMessage'
export default FormErrorMessage
|
function addAll(){
let sum=0
for(let i=0; i<arguments.length; i++){
sum += arguments[i]
}
return sum
console.log("This will never call")
}
let sum1=addAll(10,20)
let sum2=addAll(10,20,30,40,50)
let sum3=addAll(10,20,30,40,50,60,70,80,90,100)
console.log(sum1)
console.log(sum2)
console.log(su... |
for(var i = 0; i < 78; i++) { var scriptId = 'u' + i; window[scriptId] = document.getElementById(scriptId); }
$axure.eventManager.pageLoad(
function (e) {
});
gv_vAlignTable['u21'] = 'center';gv_vAlignTable['u51'] = 'center';gv_vAlignTable['u25'] = 'top';document.getElementById('u16_img').tabIndex = 0;
u16.style.cu... |
function Enemy(xPos, yPos, xVel, yVel, radius)
{
//----Attributes----//
//This is the parent object
this.orb = new Orb(xPos, yPos, xVel, yVel, radius);
this.isBiggerThanPlayer = false; //A bool to check if the enemy is bigger than the player
//----Functions----//
this.draw = function(context)
{
//Draw the orb... |
import React, { Component } from 'react'
import { FlatList,View} from 'react-native';
import Header from '../Header/Header'
import StyleSheet from './ContactsStyle'
import { ListItem } from 'react-native-elements'
import Contact from './Contact/Contact'
import DataContact from '../helpers/Contact/ContactData'
import Fo... |
// identifier variables
var clientVersion = "0.0.3"; // makes sure client and server are compatible versions
var serverPollRate = "2"; // frames per movement update
var clientResolution = [1280, 720]; // Resolution in pixels of the game's screen
// init socket.io
var socket = io.connect(window.location.host);
// star... |
/*------------------------------METODOS DE MANIPULAÇÃO DE STRING-------------------------------------*/
let nome = 'Renato Oliveira';
let resultado = '';
//resultado = nome.length;
//resultado = nome.indexOf(' ');
if (nome.indexOf('u') >-1) {//mostra o index da letra, se o resultado for -1 é por que não possui tal... |
const mongoose = require('mongoose');
const testCaseSchema = new mongoose.Schema({
inputs: {
type: [String],
},
outputs: {
type: [String],
},
questionName: {
type: String,
required: true,
},
});
const questionSchema = new mongoose.Schema({
questionName: {
... |
function concatString() {
return Array.prototype.slice.call(arguments).join('');
}
function yourFunctionRunner() {
let finalStr = '';
for (let i = 0; i < arguments.length; i++) {
finalStr += arguments[i]();
}
return finalStr;
}
function makeAdder(adder) {
return function(num) {
return num + adde... |
const { camelCase } = require('change-case');
const {
validateExistence,
validateStringLength,
validateEmail,
validateInteger,
validateDate,
validatePhone,
} = require('./validators');
const validation = objectFields => (objectToValidate) => {
const fieldsToCheck = objectFields;
fieldsToCheck.forEach(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.