text stringlengths 7 3.69M |
|---|
/*
var mainHeader = document.getElementById('main_h1');
//alert(mainHeader.innerText); for opera, IE
alert(mainHeader.textContent); //for firefox
var myDiv = document.getElementById('div_for_img');
myDiv.innerHTML = "<p><strong>chaging content by new method</strong></p>"
alert(myDiv.innerHTML);
*/
//Lesson 59 - cild... |
/* eslint no-console:0 */
import formatFn from 'date-fns/format';
import React from 'react';
import TimePicker from '..';
import '../assets/index.less';
const format = 'h:mm a';
const now = new Date();
now.setHours(0, 0);
function onChange(value) {
console.log(value && formatFn(value, format));
}
const App = () =... |
import React, { useState, useEffect } from 'react';
import {
View,
Text,
StyleSheet,
FlatList,
TouchableOpacity,
} from 'react-native';
import { ListItem, Avatar } from 'react-native-elements';
import axios from 'axios';
// const instance = axios.create({});
function SessionsScreen({ navigation, route }) {
... |
module.exports = {
plugins: ['wdio', 'jasmine'],
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'prettier',
'plugin:wdio/recommended',
'plugin:jasmine/recommended',
],
env: {
node: true,
es6: true,
... |
var editingLocationId;
function GenerateAvailsTable() {
var yearSelected = $("#year").val();
var marketSelected = $("#market").val();
Apollo.ProductionIOService.GetAvails(yearSelected, marketSelected, GenerateAvailsTableCallback, ErrorCallback);
}
function GenerateAvailsTableCallback(results) {
$("#boo... |
/**
*Client side vote logic. Take a look at the vote.ctp file
*to see all the html.
*/
//No javascript trim function? Puh-leeze
String.prototype.trim = function () {
return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
};
//These are the up and down vote arrow images that
//change when the user upvotes or downvotes... |
import React from 'react';
import classes from './NavigationItems.css';
import Aux from '../../../hoc/Aux/Aux';
import NavigationItem from './NavigationItem/NavigationItem';
const navigationItems = (props) =>(
<ul className={classes.NavigationItems}>
<NavigationItem link="/" onClick={props.closeDrawer} e... |
angular.module('app.component2', ['ngRoute', 'app.component2.templates', 'ui.bootstrap'])
.config(function($routeProvider) {
'use strict';
$routeProvider.when('/component-2/dialog-b', {
templateUrl: 'component-2/dialog-b/dialog-b.html',
controller: 'MySecondController'
... |
//The color of the enemy, starts out either red, yellow, or blue
var color : Color = Color.white;var friend : GameObject;
var width : float;
var height : float;
var dirx : int = 1;
var diry : int = 1;
private var size : float = 0.4;
//The speed at which the object rotates around its center
var ROTATE_SPEED : int ... |
'use strict';
angular.module('spedycjacentralaApp')
.controller('EmployeePersonalDataController', function ($scope, $state, $modal, EmployeePersonalData) {
$scope.employeePersonalDatas = [];
$scope.loadAll = function() {
EmployeePersonalData.query(function(result) {
... |
/*
* @lc app=leetcode.cn id=34 lang=javascript
*
* [34] 在排序数组中查找元素的第一个和最后一个位置
*/
// @lc code=start
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var searchRange = function (nums, target) {
const getLefBorder = () => {
// [left, right]
let left = 0,
right = nums.l... |
'use strict';
var fs = require('fs');
var turf = require('turf');
var applyFilter = require('../applyFilter.js');
var analytics = JSON.parse(fs.readFileSync(global.mapOptions.analyticsPath));
analytics.experienceFields.forEach(function(field) {
field.filter = applyFilter(field.filter);
});
// Filter features touc... |
import React from 'react';
const SocialNetworks = ({color}) => {
const icoColor = color === "white" ? "text-white" : "text-dark";
return (
<ul className="list-inline social-networks">
<li className="list-inline-item"><a href=" "><i className={`tf-ion-social-facebook ${icoColor}`}></i></a></li>
<li... |
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
mongoose.connect('mongodb://127.0.0.1/gridfstest');
var conn = mongoose.connection;
var multer = require('multer');
var GridFsStorage = require('multer-gridfs-storage');
var Grid = require... |
import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';
import { Form, Input, Select, Button, AutoComplete, notification, Row, Col } from 'antd';
import { updatePersonalInfo } from '@common/api.js'
import Upload from '@components/upload/index';
import Style from './index.module.less';
... |
import * as OrderController from "./../controllers/order";
import * as OrderItemController from "./../controllers/order_item";
import { Router } from "express";
const router = new Router();
router.get("/", OrderController.getAllOrders);
router.post("/", OrderController.createOrder);
router.get("/:order_id", OrderItem... |
/*
* @file webpack config for development
* @author nighca <nighca@live.cn>
*/
module.exports = require('./common').then(
config => {
config = require('./addons/sourcemap')(config)
config = require('./addons/define-env')(config, 'development')
return config
}
)
|
class Node {
constructor(key) {
this.key = key;
this.height = 1; // the height of the current node. Each node has a height of at least 1 plus the height of it's tallest child.
this.size = 1; // the number of nodes that are children/grandchildren of the current node. Each node will have a size of at least ... |
import * as types from '../actions/actionTypes'
import initialState from '../store/initialState'
export default function reducer(state = initialState, action) {
debugger
switch(action.type) {
case types.UPDATE_RANDOM_GUID :
return {...state, guid: action.guid}
case types.UPDATE_FORM_FIELD:
retu... |
/**
* Vuetify theme options.
*/
import { userAdmin, userEditor } from '@/api/mock';
/**
* Login by email and password
*
* @param {String} email user email
* @param {String} password user password
*/
export const loginByEmail = async (email, password) => {
console.log(`[loginByEmail] email ${email}`);
let user... |
(function(){
var HorB=$(document.documentElement);
var title=$(".wraptitle .title");
var floatArea=$(".wraptitle .floatArea");
var fa=$(".floatArea .part2 a");
var pa=$(".previewCatalog dd");
/*左侧章节点击效果类名*/
/* var a=$(".template3 .article .side .previewCatalog dl dd a").eq(0)[0].className;
var arr=a.split(" ")... |
import React, {Component} from 'react';
import {Row, Col} from 'reactstrap';
class Footer extends Component {
render() {
return (
<footer className="app-footer">
<div className="container">
<Row>
<Col>
<span> © 2020 ParkZeus | All Rights Reserved</span... |
/**
* Created by nisabhar on 3/11/2016.
*/
define(['jquery', 'pcs/util/pcsUtil'],
function($, pcsUtil) {
'use strict';
function StartformDataService() {
var self = this;
var loggerUtil = require('pcs/util/loggerUtil');
self.paths = {
// For getting t... |
define(['apps/system2/docquery/docquery', 'apps/system2/docquery/docquery.service'], function (app) {
app.module.controller("docquery.controller.myarchive", function ($scope, stdApiUrl,stdApiVersion, $uibModal, $filter, docqueryService) {
$scope.downloadUrl = stdApiUrl + stdApiVersion;
docqueryS... |
export const FETCH_HOME = 'FETCH_HOME';
export const REQUEST_LOADING_HOME = 'REQUEST_LOADING_HOME';
export const REQUEST_REJECTED_HOME = 'REQUEST_REJECTED_HOME';
|
import React from 'react';
const TerminatorWars = () => (
<section id="terminator-section">
<span class="green-verbage">Terminator Wars</span>
<span class="white-verbage">Scenario Game</span>
</section>
);
export default TerminatorWars; |
//style of inputs
$(document).ready(function () {
$('input').blur(function () {
if ($(this).val())
$(this).addClass('used');
else
$(this).removeClass('used');
});
$('textarea').blur(function () {
if ($(this).val())
$(this).addClass('used');
else
$(this).removeClass('us... |
import mongoose from "mongoose";
import Post from "./post.js";
const Schema = mongoose.Schema;
const UserSchema = new Schema({
username: { type: String, unique: true },
password: String,
posts: {
type: [{ type: Schema.Types.ObjectId, ref: "Post" }],
default: [],
},
});
/* Remove all posts created by ... |
/*
Santa is coming to town and he needs your help finding out who's been naughty or nice. You will be given an entire year of JSON data following this format:
{
January: {
'1': 'Naughty','2': 'Naughty', ..., '31': 'Nice'
},
February: {
'1': 'Nice','2': 'Naughty', ..., '28': 'Nice'
},
... |
import React, {Component} from 'react'
// import productList from '../components/productlist'
// import Footer from '../components/footer'
import Productlist from '../components/productlist'
class Home extends Component {
render(){
return(
<div>
<section class="banner-area">
... |
/* global EditorTool, Util, translate */
/* exported ListTool */
class ListTool extends EditorTool {
static get toolbox() {
return {
icon: '<i class="list icon"></i>',
title: translate.content.blocks.list,
}
}
// Sanitizer data before saving
static get sanitize() {
return {
items... |
function getValues(selector, names) {
const obj = {};
names.forEach((key) => {
const ele = document.querySelector(`${selector}[name=${key}]`);
if (ele == null) {
console.error('missing key: ' + key);
return;
}
if (ele.value.length === 0) {
retu... |
import React from 'react';
import {Router, Route, IndexRedirect} from 'react-router';
import * as handlers from './handlers';
import App from '../components/App.jsx';
import Chat from '../components/Chat.jsx';
import Login from '../components/Login.jsx';
import Account from '../components/Account.jsx';
function rende... |
const express = require('express');
const app = express();
const mongojs = require('mongojs');
const db = mongojs('todo', [ 'tasks' ]);
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
const cors = require('cors');
app.use(cors());
app.post(... |
import React, { useEffect, useState } from "react";
import {
Container,
Content,
Header,
CompanyIcon,
WrapperMenuItem,
WrapperMenu,
} from "./styles";
import NavBar from "../../components/Navbar";
import { registerLocale, setDefaultLocale } from "react-datepicker";
import ptBR from 'date-fns/locale/pt-BR... |
$(function () {
//Function that gets the time and displays in the html tag with id = time
function getTime() {
var today = new Date();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
if (hours < 10) hours = "0" + hours;... |
const express = require("express");
const axios = require("axios");
const models = require("../models");
const {
getPagingData,
getPagination,
getSort,
} = require("../utils/collection");
const router = express.Router();
router.get("/", async (req, res) => {
const { _page, _limit, _collectionId, _sort } = req... |
var uiScripts = function () {
var pingTypeSelected = 1;
var init = function () {
supportsSVG();
tooltipHover();
toggleGraphicsPanel();
togglePingBubble();
toggleCreatePing();
runAjaxNotLoggedIn();
};
// fetches the persona content if user is not logged... |
const express = require('express');
const app = express();
const cors = require('cors');
const PORT = 8000;
app.use(cors())
let rappers = {
'21 savage': {
'age': 28,
'birthName': 'Sheyaa Bin Abraham-Joseph',
'birthLocation': 'London, England'
},
'chance the rapper': {
'age'... |
/*
*查看退款列表
*/
import React, { PureComponent } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale';
import {
Card, Table, Affix, Button
} from 'antd';
import { changeTimeFormat } from '@/utils/changeTimeFormat';
import reqwest from 'reqwest'; //ajax格式的请求函数
import PageHeaderWrapper from ... |
/**
* Display Map
*
* @param geo_info
*/
function bblog_display_map( geo_info ) {
for ( var i =0; i<geo_info.length; i++ ) {
bblog_init_map(geo_info[i]);
}
}
/**
* Display editable map
*/
function bblog_init_editable_map() {
//create map
//we may be creating or editing post
//in case of e... |
var banner = document.querySelector('.banner');
var nav = document.querySelector('nav');
var contacts = document.querySelector('.contacts');
var aboutSection = document.querySelector('.aboutMe');
var footer = document.querySelector('footer');
var openProjects = document.querySelector('.main');
var about = document.quer... |
/*
* Copyright 2017 PhenixP2P Inc. Confidential and Proprietary. All Rights Reserved.
* Please see the LICENSE file included with this distribution for details.
*/
import React from 'react';
import PropTypes from 'prop-types';
import ChatMessagesContainer from '../containers/ChatMessagesContainer.jsx';
import ChatI... |
// eslint-disable-line no-console
var genetic;
var pixel = 100;
var gen;
var canvasW = 600;
var stats = new Stats();
stats.setMode( 0 ); // 0 FPS, 1 MS
// align top-left
stats.domElement.style.position = 'absolute';
stats.domElement.style.right = '0px';
stats.domElement.style.bottom = '0px';
stats.domElement.style.z... |
// var MINI = require('minified-custom');
// var _=MINI._, $=MINI.$, $$=MINI.$$, EE=MINI.EE, HTML=MINI.HTML;
freebusy.pickatime.enable();
freebusy.pickatime.onclick(callback)
freebusy.pickatime.open(request, query)
// if ('serviceWorker' in navigator) {
// window.addEventListener('load', function() {
// navigato... |
function setPropsOnObj(object) {
object.x = 7;
object['y'] = 8;
object.onePlus = function(num) {return num + 1};
}
function setPropsOnArr(arr) {
arr.hello = () => 'Hello!';
arr['full'] = 'stack';
arr[0] = 5;
arr.twoTimes = (num) => num * 2;
}
function setPropsOnFunc(func) {
func.year = '20??';
func.... |
$(function() {
$('pre:not(.hljs)').addClass('hljs');
$(".select-selecter").selecter();
$('#btn-fullscreen').click(function() {
if ($.fullscreen.isFullScreen()) {
$.fullscreen.exit();
} else {
$('.canvas-container').fullscreen({
toggleClass: 'fullscreen'
});
}
});
}); |
class App {
constructor() {
this.landingPage = new LandingPage()
this.navBar = new NavBar()
}
}
|
// search form
// query form, add event, fetch api
document.querySelector("form").addEventListener("submit", (event) => {
event.preventDefault();
// reset/remove old things
const location = event.target.location.value;
// console.log(location);
// find errors
if (!location) {
document.querySelector(".... |
const functions = require("firebase-functions");
const Filter=require('bad-words')
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
// exports.helloWorld = functions.https.onRequest((request, response) => {
// functions.logger.info("Hello ... |
/*
The background process is responsible for opening Carrot windows in response to
app launches, choosing a file in the Files app on Chrome OS, and external
messages.
*/
var mainWindow = null;
var pending = null;
var files = [];
var commands = [];
var openWindow = function() {
//if window exists, re-use it
if ... |
import React from 'react'
import { shallow } from 'enzyme'
import { Button } from '@blueprintjs/core'
import CollectionComponent from '../../CollectionComponent'
import RefreshAction from '../index'
describe('<RefreshAction />', () => {
let dataSource
beforeEach(() => {
dataSource = {
__isCollectionDS__... |
//公用引入模块
const express = require("express");
const bodyParser = require("body-parser"); //post请求
const session = require("express-session");
const cookieParser = require("cookie-parser");
const path = require("path"); //处理路径
const router = express.Router();
const app = express();
var signature = require('cookie... |
$(function(){
// 登陆表单
$('#login').click(function(){
$('.sign-box').show();
$('.index-cover').show();
});
$('#close-btn').click(function(){
$('.index-cover').hide();
$('.sign-box').hide();
});
$('.cover').click(function(){
$(this).hide();
// 登陆表单隐藏
$('.sign-box').hide();
// 二维码隐藏
$('#Jqrcode-box'... |
import React, { Component } from 'react'
import Axios from 'axios'
import config from '../global/config.json'
const API = config.api_url
export default class Generic extends Component{
constructor(props){
super(props)
this.state = {}
}
render(){
return(
<div>
Project is running!
... |
//
// Waves dApp Magic 8 ball tests
//
describe('8 ball', () => {
const ballAddress = "3N27HUMt4ddx2X7foQwZRmpFzg5PSzLrUgU"
const question = "Test" + Date.now()
const tx = invokeScript({fee: 500000, dApp: ballAddress, call:{function:"tellme", args:[{"type": "string", "value": question}]}, payment: null})
... |
const express = require('express');
const router = express.Router();
const mongoDB = require('mongodb').MongoClient;
const passport = require('passport');
const routes = () => {
router.route('/signUp')
.post((req, res, next) => {
const url = 'mongodb://localhost:27017/libraryApp';
mongoDB.connect(url, (err, ... |
import React, { Component } from 'react'
import { Range } from './components/Range'
export class App extends Component {
state = {
hue: Math.floor(Math.random() * 360),
saturation: Math.floor(Math.random() * 100),
lightness: Math.floor(Math.random() * 100),
alpha: Math.round((Math.random() * (1 - 0) ... |
function returnOrderCtrl($scope, $uibModal, $rootScope, $compile, $state, productService) {
//$scope.products = {};
init();
function init() {
//getAllProducts();
}
//$scope.product = {};
//function getAllProducts() {
// productService.getAllProducts().then(
// fu... |
import express from 'express';
import { checkSchema } from 'express-validator/check';
import asyncHandler from 'express-async-handler';
import { Stops } from '../config/param-validation';
import stopsCtrl from '../controllers/stops.controller';
import inputsCtrl from '../controllers/inputs.controller';
const router... |
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const db = require('../database/database');
const { encryPassword, matchPassword } = require('../controllers/encriptar');
passport.use(
//estategia para autenticar
new LocalStrategy(
{
username... |
/*
Copyright 2016-2018 Stratumn SAS. All rights reserved.
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 l... |
angular.module('starter.controllers', ['ionic.cloud'])
.config(function ($ionicCloudProvider) {
$ionicCloudProvider.init({
"core": {
"app_id": "ff9c7a36"
},
"push": {
"sender_id": "972141839894",
"pluginConfig": {
"ios": {
"badge": true,
... |
const AWS = require('aws-sdk');
const request = require('request');
const _ = require('lodash');
const BigQuery = require('@google-cloud/bigquery');
const bigquery = BigQuery();
Date.prototype.yyyymmdd = function() {
var mm = this.getMonth() + 1; // getMonth() is zero-based
var dd = this.getDate();
return [this... |
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Header from './components/Header.js'
import Footer from './components/Footer.js'
class App extends Component {
constructor(props) {
super(props);
this.state = {
hobbies: ["flying kites", "skipping to my... |
//1. fs.stat 检索是文件还是目录
//2. fs.mkdir 创建目录
//3. fs.writeFile 创建写入目录
//4. fs.appendFile 追加目录
//5. fs.readFile 读取文件 .toString()
//6. fs.readdir 读取目录
//7. fs.rename 重命名 移动文件
//8. fs.rmdir 删除目录
//9. fs.unlink 删除文件
//10. fs.createReadSteam 从文件流中读取数据
//11. fs.createWriteStream 写入文件 //58
const fs = require("fs");
... |
import React, {useState} from "react";
import {View, StyleSheet, Image, ScrollView} from 'react-native'
import {BigTitle} from "../ui/BigTitle";
import StrainInput from "../components/StrainInput";
import CultureSelector from "../components/CultureSelector";
import {AppButton} from "../ui/AppButton";
import {useDispatc... |
require("../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/building/_components/_plate" ], {
5734: function(e, n, t) {},
7649: function(e, n, t) {
t.r(n);
var a = t("d4fe"), o = t("d3e2");
for (var c in o) [ "default" ].indexOf(c) < 0 && function(e)... |
import React from 'react'
import {View} from 'react-native'
import MovieDetail from '../componets/MovieDetail'
const Details = ({route})=>{
return(
<View>
<MovieDetail movieid={route.params.movieid}/>
</View>
);
}
export default Details; |
window.onload = btnon;
function btnon(){
var input = document.getElementsByTagName("input");
var btn = document.getElementsByTagName("button");
btn[0].onclick = function(){
ale(input[0],input[1]);
}
}
function ale(x,y){
alert(x.value);
alert(y.value);
}
|
import React from 'react';
import UserInfo from './UserInfo';
import { Row, Col } from 'react-flexbox-grid';
import { Link } from 'react-router-dom';
import logo from '../img/logo.png';
const Header = () => (
<Row className="header">
<Col xs={6}>
<Link to="/">
<img className="img-logo" src={... |
describe('Poll Model', () => {
describe('create()', () => {
it('creates a poll with an owner', (done) => {
Poll
.create({
guid: GUID.v4(),
owner_guid: 'f03ede7c-b131-4112-bcc7-130a3e87988c',
title: "If you had a milli... |
(function() {
// 这些变量和函数的说明,请参考 rdk/app/example/web/scripts/main.js 的注释
var imports = [
'rd.controls.Table'
];
var extraModules = [ ];
var controllerDefination = ['$scope', 'EventService','EventTypes',main];
function main($scope,EventService,EventTypes ) {
$scope.tableSetCurrentP... |
// https://codepen.io/chrisbridges/pen/YJXzPZ?editors=0012
// What used to be this
let name = 'Chris'
let activity = 'learning about template strings!'
// need to remember to include proper spaces before adding
let sayHello = 'Hello, ' + name + '. I hope you are having a fun time ' + activity
console.log(sayHello)
/... |
import { lazy, Suspense } from 'react';
import { NavLink, Route, useRouteMatch } from "react-router-dom";
import { useLocation } from 'react-router';
// import CastView from "../CastView/CastView";
// import ReviewsView from "../ReviewsView/ReviewsView";
import styles from './styles.module.scss';
const CastView = lazy... |
define([
"controllers/layouts/main",
],
function (Main
) {
var layouts = [
{
id: 'wrapper',
module: function (opt) {
return new Main.View(opt);
}
}
];
return layouts;
})... |
P.views.exercises.priv.Image = P.views.Item.extend({
templateId: 'exercise.priv.image',
tagName: 'span',
className: 'v-image col-xs-4',
events: {
'click .js-delete': 'del',
'click .js-rank-top': 'rank'
},
behaviors: {
Img: {
behaviorClass: P.behaviors.exercises.Image
}
},
del: func... |
'use strict';
function solve(params){
var result = '';
for (var i = 0, len = params.length; i < len; i += 1) {
result += params[i].replace(/\s\s+/g, ' ');
result += '\n';
if (params[i].lastIndexOf('{') !== -1) {
result += ' ';
}
}
console.log(result.trim())... |
const log = require('../')('test')
describe('debug-log', () => {
test('log is a method', () => {
log('this is a test', new Date(), { object: 'test'} )
expect(typeof log === 'function').toBeTruthy()
})
})
|
import React, { useState, useEffect } from 'react';
import { Grid, Typography, Link } from '@material-ui/core'
import { axiosInstance, keyApi } from '../api/weather'
import { useSelector, useDispatch } from 'react-redux'
import SearchBar from './SearchBar';
import WeatherDetails from './WeatherDetails';
import WeatherL... |
import { Router } from 'express'
import moment from 'moment'
import consola from 'consola'
import nodemailer from 'nodemailer'
import xss from 'xss'
import hasher from 'wordpress-hash-node'
import connection from '../mysqlConnect'
const config = require('../config').default
const router = Router()
// eslint-disable-nex... |
// ==UserScript==
// @name find_all_ed2k_or_magnet
// @namespace NULL
// @version 0.1
// @description find all ed2k,magnet links
// @author Simon Shi
// @include *
// @match *
// @grant unsafeWindow
// @run-at document-end
// ==/UserScript==
(function() {
'use strict... |
var Vue = require('vue');
var VueRouter = require('vue-router');
var configRouter = require('./route.config.js');
Vue.use(VueRouter);
var router = new VueRouter({});
configRouter(router)
var App = Vue.extend(require('./app.vue'));
router.start(App, 'body div');
window.router = router;
|
import ResultsItem from '../../client/components/results__item';
const FLIGHT = {
"airline": {
"code": "SU",
"name": "Aeroflot"
},
"flightNum": 182,
"start": {
"dateTime": "2016-09-03T09:59:00+10:00",
"airportCode": "SYD",
"airportName": "Kingsford Smith",
"cityCode": "SYD",
"cityNa... |
/**
* Represents a playing card.
* @TODO Add support for blank cards, use '00' as the code.
* @author Rajitha Wannigama
*/
var Card = {
/**
* @type {Rank}
* @private
*/
rank: undefined,
/**
* @type {Suit}
* @private
*/
suit: undefined,
/**
* Create a new c... |
import React, {useState} from 'react';
import {Button, Form, FormGroup, Label, Input, Row} from 'reactstrap';
import './SkiLengthForm.css'
function SkiLengthFormAdult() {
const [type, setType] = useState("Klassisk")
const [bodyLength, setBodyLength] = useState(0);
const [skiLength, setSkiLength] = useStat... |
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// 空禁止
function validator(v) {return v.length > 0;}
var Chat = new Schema({
roomId : { type: Number }
, userId : { type: String }
, userImageUri : { type: String }
, message : { type: String, validate: [validator, "Empty Erro... |
// New York Times API
//
// http://developer.nytimes.com/
//
// Ask your local mentor for the API key or request your own. Use localhost as the website.
//
// - Use the Article Search API
// - Find articles about the moon landing by Apollo 11
// - Display the following fields in a list
// - Headline
// - Snippet
//... |
import Grid from "@material-ui/core/Grid";
import ToggleButton from "@material-ui/lab/ToggleButton";
import ToggleButtonGroup from "@material-ui/lab/ToggleButtonGroup";
import React from "react";
export default function SizeSelector() {
const [alignment, setAlignment] = React.useState("left");
const handleChange ... |
var spawn = require("child_process").spawn;
var spawnSync = require("child_process").spawnSync;
var exec = require("child_process").exec;
var readline = require('readline');
var binaryFile = 'test';
var gdb = spawn('lldb',[binaryFile]);
var cur_ip_port = "192.168.31.169\:1234" //ip:port
var searching_flag = 0;
var sear... |
var server = require("./server.js");
var router = require("./router.js");
var processor = require("./requestProcessor");
var process = {};
process["/"] = processor.hello;
process["/start"] = processor.start;
process["/list"] = processor.list;
process["/upload"] = processor.upload;
server.start(router.route, process);... |
/**
* Created by Administrator on 2015/3/26.
*/
var indexPageController = angular.module("indexPageController",[
]);
indexPageController.controller("headDivController",[
"$scope",
"$http",
"$location",
'$timeout',
'checkDuplicateService',
'loginStatusCheckService',
'loginCheckService',
fu... |
function Piranha(context) {
this.context = context;
this.goingUp = true;
this.currentLocation = 0;
this.frameCount = 0;
this.waitFrames = 0;
this.leafAngle = 30;
this.colorPalette = {
orange: "rgb(200, 76, 12)",
blue: "rgb(0, 128, 136)",
lightPink: "rgb(25... |
// globals
var particles;
// constants
var BACKGROUND_COLOR = [15, 5, 5];
var INTERACT_DISTANCE = 60;
var CANVAS_X = 1340;
var CANVAS_Y = 300;
var NUM_PARTICLES = 50;
var V_MAX = 0.7;
/**
* A particle object.
*/
var Particle = function(position) {
this.velocity = createVector(random(-V_MAX,V_MAX), random(-V_MAX... |
/* Import node's http module: */
var express = require('express');
var server = express();
var fs = require('fs');
var _chats = [];
// var handleRequest = require('./request-handler').requestHandler;
var readFile = function(callback) {
fs.readFile('messageData.txt', 'utf-8', (err, chatData) => {
if (err) { throw... |
// decorator
function cachify(oldFn) {
var cache = {};
var newFn = function() {
var k = Array.prototype.join.call(arguments, ',');
console.log("key", k);
if(cache.hasOwnProperty(k)) {
console.log('cache hit!!!!');
return cache[k];
} else {
var... |
import React from 'react'
import { HashRouter as Router, Switch, Route, Link } from "react-router-dom"
import AddUser from './pages/AddUser.jsx'
import AllUser from './pages/AllUser.jsx'
import EditUser from './pages/EditUser.jsx'
import Page404 from './pages/Page404.jsx'
class App extends React.Component {
constru... |
import map from '../signals/processes/map'
import tail from 'ramda/src/tail'
export default
map((ev) => tail(ev.target.location.hash))
|
/** @see https://drafts.csswg.org/css-grid/ */
export default {
'display': ['grid', 'inline-grid', '-ms-grid'],
'grid': true,
'grid-area': true,
'grid-auto-columns': true,
'grid-auto-flow': true,
'grid-auto-rows': true,
'grid-column': true,
'grid-column-end': true,
'grid-column-start': true,
'gri... |
import React, { useState } from "react";
import { MdDehaze, MdClear } from "react-icons/md";
import {
Container,
Nav,
Logo,
MenuButton,
NavRight,
NavMenu,
ButtonOne,
ButtonTwo,
ButtonThree,
} from "./styles";
const style = {
fontSize: 30,
color: "#FFF",
lineHeight: 1.2,
};
function Header() {... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.