text
stringlengths
7
3.69M
var rejuvenate = { run: function(creep) { creep.drop(RESOURCE_ENERGY); creep.moveTo(Game.flags.HOME); } } module.exports = rejuvenate;
const Npc = require('./Npc'); const Animal = require('./Animal'); module.exports = { Npc, Animal};
const mongoose = require("mongoose"); const { ModelName } = require("../../utils/modelNames"); const GameSchema = new mongoose.Schema({ myTeam: { type: mongoose.Schema.ObjectId, ref: ModelName.Team, required: true, }, goals: { type: Number, required: true, }, homeGame: { type: Boolean...
import React from 'react' import PropTypes from 'prop-types' import Radium from '@instacart/radium' import responsive from '../../styles/responsive' import { supportsCSSGrid } from '../../utils/detectFeature' const { columnWidth } = responsive const getLecacySizedStyles = sizes => { return { display: 'inline-bl...
import './Log.js'; import './Utils.js'; import * as Ramda from './Ramda.js'; import * as Three from '../node_modules/three'; import * as Tween from '../node_modules/@tweenjs/tween.js/dist/tween.umd.js'; import * as OrbitControls from '../node_modules/three-orbitcontrols'; window.RAMDA = Ramda; window.THREE = Three; wi...
import penImage from './pen.png'; export default [ { name: 'Stylo', extensionURL: 'pen', iconURL: penImage, description: 'Tracer', featured: true } ];
import React, { Component } from 'react'; import { StyleSheet, View, Image, Text, TouchableWithoutFeedback, } from 'react-native'; import { Button, Dialog, Portal } from 'react-native-paper'; import { ItMaterial } from '../common'; class ItObservationCard extends Component { INITIAL_STATE = { currentIndex: 0,...
const express = require('express') let router = express.Router() //Import controllers const {addVehicles} = require('./controllers'); router.route('/add').post(addVehicles); module.exports = router;
import React from 'react'; import Flip from '../assets/img/flip.png'; import Catalunya from '../assets/img/Catalunya.png'; import SpaceTravel from '../assets/img/SpaceTravel.png'; import Ramen from '../assets/img/Ramen.png'; import RedCloud from '../assets/img/redCloud.png'; import BlueCloud from '../assets/img/blueClo...
var contextMenu = { "id": "quicknote", "title": "Quick Note", "contexts": ["selection"], } chrome.contextMenus.create(contextMenu); chrome.contextMenus.onClicked.addListener(function(data){ if(data.menuItemId == 'quicknote' && data.selectionText) { let url = data.pageUrl; let text = data.selectionText; if...
import React from 'react'; import makeTrashable from 'trashable'; const makeComponentTrashable = (Component) => { class TrashableComponent extends React.Component { promiseStore = {}; key = 0; componentWillUnmount() { const keys = Object.keys(this.promiseStore); keys.forEach((key) => { ...
const Engine = Matter.Engine; const World = Matter.World; const Bodies = Matter.Bodies; const Body = Matter.Body; function preload() { } function setup() { createCanvas(1200, 700); engine = Engine.create(); world = engine.world; //Create the Bodies Here. ground1=new Ground(600,680,1200,20) stone1=new sto...
import React from 'react'; import InputBase from '@material-ui/core/InputBase'; function SearchField(props) { return ( <InputBase inputProps={{ 'aria-label': 'search', 'data-testid': "gifsearcher"}} placeholder={props.placeholder} classes={props.classes} onC...
const express = require('express'); const path = require('path'); const { requireAuth } = require('../middleware/jwt-auth'); const UsersService = require('./users-service'); const AuthService = require('../auth/auth-service'); const usersRouter = express.Router(); const jsonBodyParser = express.json(); usersRouter ...
'use strict'; var libxml = require('libxmljs'); var _ = require('lodash'); var RATIO = require('./ratio'); var log = require('../services/log.js'); var Node = require('../models/node-model.js'); var Way = require('../models/way.js'); var xml = { read: function(xmlString) { var result = { create: {}, ...
const config = { APP_ID: '18a4afec9a2541284ef5c8bb72ba3467', CITIES: ['Itapira', 'Campinas', 'Sao Paulo'] }; export default config;
import { SIGN_OUT_REQUESTED, FETCH_USER_BODY_DATA_REQUESTED } from 'action-types'; export function signOut() { return { type: SIGN_OUT_REQUESTED, }; } export function fetchBodyData() { return { type: FETCH_USER_BODY_DATA_REQUESTED } }
$('.mobile-btn').on('click', function() { $('.mobile-btn').toggleClass('show-mobile-btn'); $('.nav').toggleClass('show-menu'); $('.nav-item').toggleClass('show-nav-item') }); $('.nav nav a').on('click', function() { $('.mobile-btn').removeClass('show-mobile-btn'); $('.nav').removeClass('show-menu...
import React from "react" import { ImageStyle } from "react-native" import FastImage from "react-native-fast-image" import { Images } from "../assets/" export const CoverBlank = ({ styles }) => ( <FastImage source={Images.noPlaylist} style={styles} /> ) export default CoverBlank
import React from 'react'; import { MeteorGriddle } from 'meteor/utilities:meteor-griddle'; import gizmos from '/imports/api/gizmos/collection.js'; const App = () => { const content = ( <div className="container"> <div className="row"> <div className="col-md-12"> <MeteorGriddle ...
import React, {Component} from 'react'; import {View, Text, StyleSheet, Dimensions} from 'react-native'; import {DrawerActions} from 'react-navigation-drawer'; import { TabView, TabBar } from 'react-native-tab-view'; import Icon from 'react-native-vector-icons/Ionicons'; import {AppNavigationBar, AppTouchableIcon} from...
import React, {useState, useEffect} from 'react'; import Datatable from './components/datatable'; import Slider from '@material-ui/core/Slider'; import './index.css'; function App(props) { const [data, setData] = useState([]); const [q, setQ] = useState(""); const [rangemin, setMinValue] = useState(); const [...
import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, getSettledState, waitUntil } from '@ember/test-helpers'; import EmberObject from '@ember/object'; import Service from '@ember/service'; import { hbs } from 'ember-cli-htmlbars'; import { clickTrigger, selectChoose }...
// ***** Question 1 ***** // *** Uncomment the lines below to test // console.log("%cQuestion 1", "color: red") let counter = 1 counter = 2 // re-assign values // console.log(counter) // // => 2 // console.log("%c----------", "color: red") // ***** Question 2 ***** // *** Uncomment the lines below to test // *** af...
function makeBold(element, callback) { element.style.fontWeight = "bold" if (callback instanceof Function ) { callback(element); } } let bolded = CustomEvent() let sectionElement = document.querySelector('section'); makeBold(sectionElement, function(elem) { elem.classList.add('highlight'); }); sectionEle...
require("../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/building/comments/_input_dlg" ], { 3873: function(n, e, t) { t.r(e); var o = t("c8a7"), r = t("def1"); for (var i in r) [ "default" ].indexOf(i) < 0 && function(n) { t.d(e, n, functi...
// Avoid `console` errors in browsers that lack a console. (function() { var method; var noop = function () {}; var methods = [ 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile',...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. * */ $(function(){ $("#addLottery").click(function(){ var param = $("#editMenuForm").serializeArray(); /*if (confirm("你...
const express = require("express"); const bodyParser = require("body-parser"); const cookieParser = require("cookie-parser"); const mongoose = require("mongoose"); // const config = require('./config/config').get(process.env.NODE_ENV) const app = express(); mongoose.connect( // put your mongodb uri here { useNewUr...
import React from 'react'; import './App.css'; import MainDisplay from './components/MainDisplay' import { notes } from './constants' function App() { return ( <div className="App"> <MainDisplay notes={notes} /> </div> ); } export default App;
import { createAppContainer } from 'react-navigation'; import { createBottomTabNavigator } from "react-navigation-tabs"; import { createStackNavigator } from 'react-navigation-stack'; import React from "react"; import { ScrollView, Text, StyleSheet, Dimensions, View, TouchableOpacity, Button, } from "rea...
import React from 'react' import { View, StyleSheet, ActivityIndicator } from 'react-native' const Loading = () => { return ( <View style={styles.container}> <ActivityIndicator style={styles.loading} size={70}></ActivityIndicator> </View> ) } const styles = StyleSheet.create({ container: { pos...
function capitalize(word) { if (word === undefined) throw new Error("word is required"); return word.charAt(0).toUpperCase() + word.substr(1); } function generateInitials(firstName, lastName) { // if (firstName === undefined) throw new Error("firstName is required"); // if (lastName === undefined) throw new Er...
App.Collections = (function (_super) { __extends(Collections, _super); function Collections() { return Collections.__super__.constructor.apply(this, arguments); } return Collections; })(Backbone.Collection);
import React, { useState, useEffect } from 'react'; //import AnimatedNumber from 'react-animated-number'; import '../App.css' const Url = "https://cebu-covid-api.herokuapp.com/api/cases/totals"; function App() { const [caseCounts, setCaseCounts] = useState([]); useEffect(() => { getDataWithFetch(); }, []);...
/* * Tag file * * http://search.cpan.org/dist/Image-ExifTool/lib/Image/ExifTool/TagNames.pod * * Exif.Image.Artist * * Used by windows * Exif.Image.XPTitle * Exif.Image.XPComment * Exif.Image.XPAuthor * Exif.Image.XPKeywords * Exif.Image.XPSubject * * Exif.Photo.UserComment * * [IPTC] Keywords ...
var navName = window.navigator.appName; var navVersion = window.navigator.appVersion; var navInfoSO = window.navigator.appVersion.toLowerCase(); var so = window.navigator.platform; var lastModidyDate = document.lastModified; var navIdioma = window.navigator.language; var hostIp = location.hostname; var hostUrl = locati...
/** tagify */ @@include('@@nodeRoot/../node_modules/@yaireo/tagify/dist/jQuery.tagify.min.js')
Sonatype.repoServer.PluginConsolePanel = function( config ) { var config = config || {}; var defaultConfig = { title: 'Plugin Console' }; Ext.apply( this, config, defaultConfig ); Sonatype.repoServer.PluginConsolePanel.superclass.constructor.call( this, { url: Sonatype.config.servicePath + '/plug...
const eventosRestClient = { _proxyurl : "https://cors-anywhere.herokuapp.com/", _URL: "https://sustentatemiddleware-generous-bonobo.mybluemix.net/events", getEvents(){ return axios.get(this._proxyurl + this._URL).then(response => response.data) }, createEvent(event){ /* event t...
import React, {useEffect} from 'react'; import { useParams } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import {fetchHomepagesById} from '../../store/homeDetails/actions'; import { selectHomeDetails } from '../../store/homeDetails/selectors'; import Homepage from '../../components/...
/* * @Descripttion: * @version: 1.0 * @Author: Ankang * @Date: 2021-05-21 22:21:34 * @LastEditors: Ankang * @LastEditTime: 2021-05-22 17:10:20 */ const { checkUserLogin } = require('../models/userModel') let loginMsg = [ '', '登录或密码不正确', '请先登录,再访问', '欢迎再次登录' ] module.exports = ...
import React, { Component, PropTypes } from 'react' import $ from 'jquery' import SelectBox from "../../shareComponent/SelectBox"; import './index.css' import promiseXHR from '../../../funStore/ServerFun' import { API_PATH } from '../../../constants/OriginName'; import AuthProvider from '../../../funStore/AuthProvider'...
'use strict'; // 生成一个唯一的guid function getGuid() { let s = []; let hexDigits = "0123456789abcdef"; for (let i = 0; i < 36; i++) { s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); } s[14] = "4"; s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); s[8] = s[13] = s[18] = s[23] = "-"; let uui...
import React from "react"; const TodoHeader = props => { return ( <div className="todo-heading"> <h1 className="todo-header">Todo application</h1> <div> Total Items : {props.todos.length}</div> </div> ); }; export default TodoHeader;
// DoubleClick const dbl = document.querySelector(".img-content img"); dbl.addEventListener('dblclick', function () { console.log("You found the double click badge!") }) //Click const click = document.querySelector("footer"); click.addEventListener('click', function () { console.log("You found the click badge!"...
const express = require('express'); const http = require('http'); const mobx = require('mobx'); const { observable, reaction } = mobx; const app = express(); const port = 3000 // const connectedClients = observable.box(0); const connectedClients = observable({ string: '', num: 0 }); app.get('/', (req, res) => { ...
'use strict' const config = require('../config') /** * Class of the Grid Mars */ class MarsGrid { /** * Constructor MarsGrid * @param {Integer} lengthX * @param {Integer} lengthY */ constructor(lengthX, lengthY) { //initialize class attributes if (lengthX > config.MAX...
import React, { useState } from "react"; import Dropdown from "./Dropdown"; import Link from "next/link"; import Rede from "./logos/Rede"; import SocialMedia from "./SocialMedia"; export default function Navbar() { const [click, setClick] = useState(false); const [dropdown, setDropdown] = useState(false); const...
import { createStore, combineReducers, applyMiddleware, compose } from 'redux' import thunk from 'redux-thunk' import filters from '../reducers/filterReducer' import trades from '../reducers/tradeReducer' import auth from '../reducers/authFirebaseReducer' const composeEnhencers = window.__REDUX_DEVTOOLS_EXTEN...
import React from 'react'; function Menu({menuFunction}) { return ( <div className="menu"> <div className="menu__div"></div> <div className="menu__container"> <ul className="menu__ul"> <li> <span>01</span> <a href="#aboutUs" className="menuFunction" onClick={menuFunct...
/** vim: set noexpandtab tabstop=8 shiftwidth=8 softtabstop=8: * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.83 (July 02 2010) * * @copyr...
const btnToggle = document.querySelector('#toggle'); btnToggle.addEventListener('click',function(){ document.getElementById('sidebar').classList.toggle('active'); //toggle agrega la clase si no la tine o quitarla si ya la tiene });
const express = require("express"); const morgan = require("morgan"); require("dotenv").config(); const app = express(); const PORT = process.env.PORT || 4001; if (process.env.NODE_ENV === "development") { app.use(morgan("dev")); } app.get("/", (req, res) => { res.send("Hello World!"); }); app.listen(PORT, () =>...
import React from 'react' import ReactDOM from 'react-dom' import Reforma from '@reforma/core' import { FocusStyleManager } from '@blueprintjs/core' import 'normalize.css/normalize.css' import '@blueprintjs/core/lib/css/blueprint.css' import '@blueprintjs/icons/lib/css/blueprint-icons.css' import '@reforma/ui/lib/css/...
/* eslint indent: [2, 2] */ const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); process.env.NODE_ENV = 'development'; module.exports = { devtool: 'inline-source-map', entry: { app: [ './src/app/index', ], }, output: ...
import { Op } from "sequelize"; import Question from "../models/Question" import { regexPDF } from "../functions/pdfParse" const pdf = require('pdf-parse') // import Office from "../models/Office"; import Alternative from "../models/Alternative"; import { Console, count } from "console"; import dbConfig from "../config...
import React from 'react'; class DetailView extends React.Component{ render(){ if(!this.props.children)return null; console.log(this.props.children); return( <p>{this.props.children['im:artist'].label}</p> ); } } export default DetailView;
import mongoose from 'mongoose'; const refreshTokenSchema = new mongoose.Schema({ value: { type: String, required: true, }, user: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: true, } }); const RefreshToken = mongoose.model('RefreshToken', refreshTokenSchema); export defa...
// JavaScript - Node v8.1.3 howManydays = (month) => { switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; case 4: case 6: case 9: case 11: return 30; default: ...
import React, { Component } from 'react'; import { Upload, Icon, message, Button } from 'antd'; class FileUp extends Component { constructor() { super(); this.state = { fileList:null }; this.canUpload = true; // 定义此文件是否可以上传 } componentWillMount() { con...
var express = require('express'); var bodyParser = require('body-parser'); var path = require('path'); var connect = require('connect'); var sassMiddleware = require('node-sass-middleware'); var app = express(); var Web3 = require('web3'); var multiSigContract = require('./MultiSig.json'); var session = require('expres...
import { GET_ALL_ALBUMS_SUCCESS, GET_ALL_ALBUMS_FAILURE, GET_ALBUM_SUCCESS, GET_PHOTOS_SUCCESS, CLEAR_PAGE } from '../Actions/actions'; const albumsDefaultState = { albumsObj: [], oneAlbum: {}, photosOfAnAlbum: [] }; const albums = (state = albumsDefaultState, action) => { switch (action.type) { ...
// Stan Helsloot, 10762388 // Renders a histogram of the yearly gas extraction by NAM var requestsBarYear = [d3.json("../../data/data_refined/data_years.json")]; // main function for creating a yearly extraction histogram var barYear = function() { Promise.all(requestsBarYear) .then(function(response) { ...
(function() { 'use strict'; angular.module('Dash.view.module', ['chart.js', 'Order.api.module']) // .run(function($log) { // $log.info("") // }); })();
const Nightmare = require('nightmare') const config = require('./config'); const readline = require('readline'); const cheerio = require('cheerio'); const mongoose = require('mongoose'); const fs = require('fs'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let verifyCode...
/** * @module ping-remote launcher 1 * Two actors play ping-pong in two differents containers. * Container1: start the container and add actor. * discorveryAddr option should be a multicast or unicast address. * discoveryAddr is used for containers mutual discovery and therefore remotes actors discovery. * * Act...
'use strict'; const async = require("async"); const db = require('../models'); class TeacherService { constructor() { } registerStudents(teacher_email, student_emails, res) { db.Teacher.findOrCreate({where: {email: teacher_email}}) .spread((teacher, created) => { conso...
const jwt = require ('jsonwebtoken'); const config = require ('../config/secret'); function verification () { return function (req, rest, next){ var tokenwithbearer = req.headers.authorization; if(tokenwithbearer){ //proses pemisahan menggunakan split var token = tokenwith...
var mongodb = require('mongodb'); function x(){ console.log("start"); new mongodb.ObjectID('4'); console.log("end"); } setTimeout(x,100);
import React, {useState, useEffect} from 'react'; import axios from 'axios'; import DeleteButton from './DeleteButton'; import {navigate} from '@reach/router'; export default (props) => { const [authors, setAuthors] = useState([]); const removeFromDom = authorId => { setAuthors(authors.filter(authors =...
import {createReducer} from '../../action-reducer/reducer'; import {combineReducers} from '../../action-reducer/combine'; const prefix = ['basic', 'tenantCurrency']; const joinPrefix = ['basic', 'tenantCurrency', 'join']; const join = combineReducers({join: createReducer(joinPrefix)}); const tenantCurrency = createRed...
import React from 'react'; const { bool, number, shape, string } = React.PropTypes; const pushGroup = shape({ // Group ID id: number, // Image URL for the groups's thumbnail imageUrl: string, // Group name name: string, // True if the group should be subscribed to on app launch, false otherwi...
/** * jsp에 쓸것(ui.js에서 변경) */ /** * ajax global setting: */ $(function(){ $( document ).ajaxStart(function() { console.log( "Triggered ajaxStart handler. show loading layer." ); $('.wrap-loading').show(); }); $( document ).ajaxStop(function() { console.log( "Triggered ajaxStop handler. hide loading layer....
// Promise /** * 什么是异步 * Promise的作用 * Promise的基本用法 */ { let ajax = function(callback){ console.log('执行') setTimeout(function () { callback && callback.call() }, 1000) } ajax(function(){ console.log('timeout1') }) } { let ajax = function () { console.log('执行2') return new P...
const bcrypt = require('bcrypt'); const { pool } = require('../config/config'); const jwt = require('jsonwebtoken'); // Signup logic exports.signup = (req, res, next)=>{ bcrypt.hash(req.body.password, 10).then((hash)=>{ let user = { first_name: req.body.first_name, last_name: req.body.last_name, email: r...
import { getISOLocalDate } from '../../src/shared/dates'; const hourOptionalSecondsRegExp = /^(([0-1])?[0-9]|2[0-3]):[0-5][0-9](:([0-5][0-9]))?$/; const hourRegExp = /^(([0-1])?[0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9])$/; export function getHours(date) { if (date instanceof Date) { return date.getHours(); } if...
'use strict' window.onload = function() { var puzzleForm = document.getElementById('puzzleForm'); var onSubmitPuzzleForm = function(e) { e.preventDefault(); document.getElementById('result').innerHTML = ''; const ANSWER = { 1: [0, 0], 2: [0, 1], 3: [0, 2], 4: [1, 0], 5: [1, 1], 6: [1, 2], 7: [2, 0], ...
import React, { useState } from 'react'; import { StyleSheet, View, FlatList } from 'react-native'; import ListItem from './components/ListItem'; import NewItemForm from './components/NewItemForm'; import uuid from 'react-native-uuid'; export default function App() { const [todos, setTodos] = useState([]); const...
import { request } from '@/network/request' import { Module } from '@/common/const.js' export function getMenus(params) { return request({ url: 'permission/showMenuModule.do', method: 'GET', params: { jsonParams: JSON.stringify(params), }, }) } export class Menu { constructor(menu) { ...
import {createAppContainer} from 'react-navigation'; import {createStackNavigator} from 'react-navigation-stack'; import SplashScreen from './screens/SplashScreen'; import LoginScreen from './screens/LoginScreen'; import SignUpScreen from './screens/SignUpScreen'; const AppNavigator = createStackNavigator( { Spl...
import Head from "next/head"; import { dehydrate, QueryClient } from "react-query"; import { contactQuery } from "../utils/helpers/querys"; import { fetchQuery } from "../utils/functions/fetchQuery"; import { useData } from "../context/DataContext"; import ContentStructure from "../components/ContentStructure"; const ...
var mysql = require('mysql'); /* const conn = mysql.createConnection({ host: 'epf.johnnybread.com', user:'js_user', password: 'smartexhibit', database: 'eportfolio' }); conn.connect(function(err) { if (err) throw err; console.log("Database server connected!"); }); */ const pool = mysql.createP...
import dispatcher from '../dispatcher'; export function updateTable(text) { dispatcher.dispatch({ type: 'UPDATE_GAME_TABLE', text, }); } export function updateStep(text) { dispatcher.dispatch({ type: 'UPDATE_GAME_MOVE', text, }); }
import { useState, useEffect } from "react" import { getTopHeadlines } from "../api" import { Link } from "react-router-dom" import NewsCard from "./NewsCard" import SmallNewsCard from "./SmallNewsCard" import Loader from "./Loader" import useViewport from "./useViewport" const Home = () => { const [topHeadlines, se...
import React from 'react' import { Layout } from '../../components/layout' import { SEO } from '../../components/seo' import { RELEASE_DATE, RELEASE_VERSION } from '../../libs/config' const releaseDateText = getReleaseDateText() export const DebugPage = () => ( <Layout> <SEO title="Debug" /> <h1>Debug.</h1...
var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var PRODUCTION = (process.env.NODE_ENV === 'production'); module.exports = { entry: './src/js/main.js', output: { path: './dist', filename: PRODUCTION ? 'bundle.min.js' : 'bundle.js', publicPath: '/' }, ...
/* eslint-env node */ const fs = require('fs'); const https = require('https'); const http = require('http'); function download(url, dest) { return new Promise((resolve, reject) => { let path = dest.slice(0, dest.lastIndexOf('/')) !fs.existsSync(path) && fs.mkdirSync(path, { recursive: true }) ...
const config = require('../config/config') const bunyan = require('bunyan') const { Runner } = require('ddd-js') const ClimateData = require('./Aggregate/Climate/ClimateData') const InstrumentalReadModel = require('./ReadModel/Instrumental') const DashboardReadModel = require('./ReadModel/Dashboard') const logStreams...
const merge = (dest, ...inputs) => { inputs.forEach(obj =>{ for (prop in obj) { dest[prop] = obj[prop] } }) return dest } const addUnit = (value, ...names) => { const result = {} names.forEach(name => { result[name] = value }) return result } module.exports.merge = merge module.export...
const { Stack } = require('./Stack'); function baseConverter(number, base) { var remStack = new Stack(), rem, baseString = '', digits = '0123456789ABCDEF'; while (number > 0) { rem = Math.floor(number % base); remStack.push(rem); number = Math.floor(number / base); } while ( ! remStack.isEmpty()) ...
// /import/aa/scripts/aa-layout.js // require aa-core.js, aa-flow.js /** * JAZ library script. */ (function () { "use strict"; /** * JAZ Polyfills. */ if (!('forEach' in NodeList.prototype)) { NodeList.prototype.forEach = function (callback, thisArg) { thisArg = thisArg||window; for (var i...
var Phaser = Phaser || {}; var CrazyBird = CrazyBird || {}; CrazyBird.Bottom = function(gameState, position, texture, group, properties) { "use strict"; CrazyBird.Prefab.call(this, gameState, position, texture, group, properties); game.physics.p2.enable(this, true); this.fixedToCamera = true; this.body.s...
const { InvalidLoginError, InvalidUserError, InvalidParamsError, MissingParamsError, errorHandler } = require('../errorHandlers'); describe("Error Handlers", () =>{ test("should display default error message if invalidLoginerror is called", () =>{ const error = new InvalidLoginError(); const errorMe...
"use strict"; function createTask(taskText,index,isDone) { //creating a task with proper markup var taskLi = $('<li>',{ 'class': 'list-group-item'}), taskDiv = $('<div>',{ 'class': 'checkbox' }).appendTo(taskLi), taskLabel = $('<label>').appendTo(taskDiv), taskInput = $('<input>',{ ...
const components = require('./components') /** * TODO: add tests */ module.exports = function transform(fileInfo, api) { const j = api.jscodeshift const root = j(fileInfo.source) const TDSImports = root.find(j.ImportDeclaration, { source: { value: '@telusdigital/tds', }, }) TDSImports.inse...
/** * Created by yishan on 17/4/9. */ function Person(name,age){ this.name = name; this.age = age; this.sayName = function () { console.log(this.name); } }; //1.当构造函数使用 var p = new Person('lc',18); p.sayName() //2.当普通函数调用 这样直接调用 属性和方法会被添加到window 上 Person('hf',28); window.sayNmae();//hf //3....
import gql from "graphql-tag"; export default gql` query { getGlobalStats { username posts { likes tags caption } } }`
/* jshint node:true, expr:true */ 'use strict'; const _sinon = require('sinon'); const _chai = require('chai'); _chai.use(require('sinon-chai')); _chai.use(require('chai-as-promised')); const expect = _chai.expect; const _index = require('../../src/index'); describe('_index', () => { describe('[handlers]', () =>...
import { bisector } from 'd3-array'; import { select, mouse } from 'd3-selection'; import { setTickFormatY as yFormatter } from './axis'; import { timeDiff } from '../../utils/utils'; import { tipRadius } from '../../../../custom/chart-tool-config.json'; export function bisectData(data, keyVal, stacked, xKey) { if (...