text stringlengths 3.07k 16k |
|---|
var crop_max_width = 400;
var crop_max_height = 400;
var jcrop_api;
var canvas;
var context;
var image;
var prefsize;
$("#file").change(function() {
loadImage(this);
});
function loadImage(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
canvas = null;
reader.onload = func... |
//---Parameters---
var bucketName = 'eltod-1'; //match Google Cloud storage bucket name
var clusterName = "eltod";
var zone = "us-central1-a";
var numNodes = 3;
var numWorkerPods = 5;
var machineType = 'g1-small';
//var machineType = 'n1-standard-1';
var deleteCluster = true; //delete cl... |
import React, { useState } from "react"
// Gatsby
import { Link, graphql } from "gatsby"
// import Img from "gatsby-image"
// Components
import Layout from "../components/layout"
import Card from "../components/card"
import GlobalCTA from "../components/globalCta"
import SEO from "../components/seo"
import DraggableCar... |
let observingRouteChanges = false;
let interceptingLinks = false;
const routeChangeCallbacks = [];
const paths = { all: false, included: [], excluded: [] };
// Enable intercepting clicks on anchor elements
export const interceptLinks = ({ include = undefined, exclude = [] } = {}) => {
// On first call, set up global... |
var mysql = require('mysql');
var cheerio = require('cheerio'); //可以像jquer一样操作界面
var charset = require('superagent-charset'); //解决乱码问题:
var superagent = require('superagent'); //发起请求
charset(superagent);
var async = require('async'); //异步抓取
var express = require('express');
var eventproxy = require('eventproxy'); ... |
import React, { useEffect, useState } from "react";
import { useLocation, useHistory } from "react-router-dom";
import AddJobButton from './overview/AddJobButton';
import DeleteJobButton from './overview/DeleteJobButton';
import EditJobButton from './overview/EditJobButton'
import { Table, Thead, Tbody, Tr, Th, Td } fr... |
function get_pgn() {
return document.getElementById("target_pgn").value;
}
function parse_pgn_as_json(isAnnotated) {
var pgn = get_pgn();
var a = pgn.split("\n");
score_index = 0;
game = {
event: "",
site: "",
date: "",
round: "?",
white: "",
black: "... |
const mongoose = require('mongoose');
//const fetch = require('node-fetch')
const axios = require('axios')
//const getApi = require('./GetApi')
const request = require('request');
const User = mongoose.model('User')
/*
LONG-TOKEN TEST
<KEY>
*/
/*
class Api{
static async getToken(code){
const api_url = 'ht... |
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { t... |
var FileTools = function (options) {
var settings = $.extend({
fileList: "#folder-container",
folderClass: ".folder",
fileToolsContainer: "#file-tools",
uiSelectedClass: ".ui-selected",
fileClass: ".file",
cutFilesBtn: "#cut-files",
deleteFilesBtn: "#delete-f... |
/*
Used and avilable variables:
const windowtitle = document.getElementById('windowtitle');
const content = document.getElementById('content');
const toasts = document.getElementById('toasts');
const videoplayer = document.getElementById('videoplayer');
const subtitleContainer = document.getElementById("subtitleCont... |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017-2018 <NAME> (Cisco Systems), /
// <NAME> (Cisco Systems), <NAME> (Cisco Systems) and others /
// /
// All rights ... |
/**
* Copyright 2018 Aarhus University
*
* 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 agr... |
import React, { createContext } from 'react'
import propTypes from 'prop-types'
import { useSelector, useDispatch } from 'react-redux'
import styled from '@emotion/styled'
import {
selectCustomer,
selectCustomerFavorites,
setOrderServiceType,
setAddress,
reorderPastOrder,
editOrder,
} from '@open-tender/red... |
const { api, _, Action } = require("../../")
const KBucket = require('k-bucket')
const ms = require('ms')
const util = require('icebreaker-network/lib/util')
const paramap = require('pull-paramap')
const url = require("url")
function arbiter(incumbent, candidate) {
if (incumbent.lastSeen > candidate.lastSeen) {
... |
{
"translatorID": "406d8800-17b2-498c-8e79-49311caedc5f",
"label": "Stitcher",
"creator": "<NAME>",
"target": "^https?://(www\\.)?stitcher\\.com/(search\\?|podcast/)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated":... |
/**
* Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the ... |
/*
CREATED BY PHILSON
*/
// imports
var fs = require('fs');
var log = require('../core/log.js');
var config = require('../core/util.js').getConfig();
var RSI = require('./indicators/RSI.js');
var EMA = require('./indicators/EMA.js');
var ATRStopLoss = require('./indicators/ATRStopLoss.js');
// filepaths ... |
import U from './u.js';
var Sprite = function( element, options ) {
options = U.default_param( options, {} );
// initialize it with an element
this.element = element;
this.message_bus = undefined;
this.x = U.default_param( options.x, 0 );
this.y = U.default_param( options.y, 0 );
// need to use setTim... |
// @flow
import React from 'react';
import { compose, withState } from 'recompose';
import { Row, Column } from '@ncigdc/uikit/Flex';
import styled from '@ncigdc/theme/styled';
import { zDepth1 } from '@ncigdc/theme/mixins';
import ContactLink from '@ncigdc/components/Links/ContactLink';
import RepositoryLink from '@... |
/*
GAME RULES:
- The game has 2 players, playing in rounds
- In each turn, a player rolls a dice as many times as he whishes. Each result get added to his ROUND score
- BUT, if the player rolls a 1, all his ROUND score gets lost. After that, it's the next player's turn
- If the player rolls two 6 in a row, all his GLO... |
var holiday_slot = "";
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
function getHolidaySlot(dynamicContent, slot) {
return "<div class='white-wrapper newSlot'>" +
"<h2 class='top-heading m-b-sm'>" + slot... |
//The following functions are used to handle the lokijs data.
//----------------------------------------------------------------------------------------------------
const electron = require('electron');
const database = require(path.resolve("./database"));
const { ipcRenderer } = require('electron');
const loki = requi... |
const admin = require('firebase-admin');
const functions = require('firebase-functions');
admin.initializeApp(functions.config().firebase);
const billing = require('./billing');
const emailHandler = require('./emailHandler');
const calendarHandler = require('./calendarHandler');
const taskHandler = require('./taskHandl... |
'use strict';
//Dependencies
const express = require('express');
const superagent = require('superagent');
const pg = require('pg');
const methodoverride = require('method-override');
require('dotenv').config();
//Applications
const app = express();
const PORT = process.env.PORT || 3001;
app.listen(PORT, () => conso... |
const formularioContactos = document.querySelector('#contacto'),
listadoContactos = document.querySelector('#listado-contacto tbody');
inputbuscador = document.querySelector('#buscar');
eventListeners();
function eventListeners(){
//cuando el formulario de crear o editar se ejecuta
formularioConta... |
'use strict';
var MAX_ITERS = 200;
var WIDTH = 500;
var HEIGHT = 300;
var PADDING = 12;
var lineOut = d3.line()
.x(function(d){ return (d[0] + 1)*250;})
.y(function(d){return HEIGHT-d[1]*250 - PADDING;});
var lineErr = d3.line()
.x(function(d){ return (d[0] / MAX_ITERS)*500;})
.y(function(d){ return HEIGHT-d[1]*200... |
const SHA256 = require('crypto-js/sha256');
const fs = require('fs');
const client = require('scp2');
const http = require('http');
const node1File = "controllers/jsonFiles/blockchain1.json"
const node2File = "controllers/jsonFiles/blockchain2.json"
const node3File = "controllers/jsonFiles/blockchain3.json"
const stat... |
'use strict';
const HttpError = require('http-errors');
/**
* Swagger 2 Authentication is described here: https://swagger.io/docs/specification/2-0/authentication/
*
* The specification is complex and multiple schemes are supported by the spec.
*
* However, in this example we assume (and use) only the first auth... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DataGridComponent = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; ... |
let current_slot = null;
let status_click = false;
let current_itemId = null;
let current_itemType = null;
let current_itemValue = null;
let body = document.getElementsByTagName('body');
const items = document.querySelectorAll('.item');
items.forEach((item) => {
item.addEventListener('click', moveItem);
item.add... |
'use strict';
var validators = require('../../helpers/validators');
var NumberMasks = require('../../helpers/number-mask-builder');
var PreFormatters = require('../../helpers/pre-formatters');
function preparePercentageToFormatter(value, decimals, modelMultiplier) {
return PreFormatters.clearDelimitersAndLeadingZero... |
const chokidar = require('chokidar');
const path = require('path');
const fs = require('fs-extra');
const walk = require('./walk');
const logInfo = require('../logger')('bixt:builder:builder');
const colors = require('colors');
const webpack = require('webpack');
const BUILD_DELAY = 300;
const WATCHER_EVENTS = ['add',... |
const EventEmitter = require('events');
class Didax extends EventEmitter {
constructor(config) {
super();
const Ajv = require("ajv")
const eventEmitter = new EventEmitter();
const addFormats = require("ajv-formats");
const Loader = require("./refLoader.js");
const parent = this;
if((typeo... |
import React from "react";
import PropTypes from "prop-types";
import { graphql } from "gatsby";
import Img from "gatsby-image";
import Layout from "../components/Layout";
import { HTMLContent } from "../components/Content";
export const IndexPageTemplate = ({ videoEmbedCode }) => (
<div className="bodywrap">
<d... |
//
// Takes an object of { key: JoiSchema } pairs to generate a GraphQL Schema.
//
const Joi = require('joi')
const {
uniqueId,
map,
find,
capitalize,
flatten,
isEmpty,
mapValues,
omit,
omitBy,
isNull,
fromPairs,
compact,
first
} = require('lodash')
const {
GraphQLSchema,
GraphQLObjectType... |
// AWS
import AWS from 'aws-sdk';
import { createSmartBrowser } from './utils.js';
// update AWS config region
AWS.config.update({region: process.env["REGION"]});
// Create an SQS service object
const sqs = new AWS.SQS({apiVersion: '2012-11-05'});
// create kms for decrypting the information
const kms = new AWS.KMS({a... |
import React, {useState, useEffect} from "react";
import {withRouter} from "react-router-dom";
// reactstrap components
import {
Card,
CardBody,
Row,
Col,
Button,
TabContent,
TabPane,
Nav,
NavItem,
NavLink,
CardTitle,
Pagination, PaginationItem, PaginationLink
} from "rea... |
import React, { Component } from 'react'
import { getShifts } from './UserFunctions'
import Scheduler from './Scheduler'
import './Scheduler.css'
import moment from 'moment'
import { withRouter } from 'react-router-dom'
class Shifts extends Component {
_isMounted = false;
constructor() {
super();
... |
import React from 'react';
import { useHistory } from 'react-router-dom';
import { useState } from "react";
import { Connection, PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, Keypair } from '@solana/web3.js';
import * as anchor from '@project-serum/anchor';
import {
Program, Provider
} from '@project-serum/anchor'... |
/**
* Copyright 2017 IBM Corp. 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 applica... |
// module for woking with express
const express = require('express');
const app = express();
// module for woking with the tamplates
const handlebars = require('express-handlebars');
// module for woking with databases
const mongoose = require('mongoose');
const db = require('./config/db');
// module for woking with fo... |
import React, { Component } from 'react';
import { forwardRef } from 'react';
import AddBox from '@material-ui/icons/AddBox';
import ArrowUpward from '@material-ui/icons/ArrowUpward';
import Check from '@material-ui/icons/Check';
import ChevronLeft from '@material-ui/icons/ChevronLeft';
import ChevronRight from '@mate... |
'use strict';
const url = 'https://localhost:8000';
const loggedInUserId = JSON.parse(sessionStorage.getItem('user')).user_id;
// Create tabs for displaying/toggling between user and activity list:
const tabs = document.querySelector('.tab-panel');
const userList = document.querySelector('.user-list');
const activi... |
'use strict';
const
ID = 0x50,
ADDR = 0x29,
COMMAND = 0xA0,
C = {ALS: 0xE6, INT: 0xE7, NPALS: 0xEA},
E = {NPIEN: 0x80, SAI: 0x40, AIEN: 0x10, AEN: 0x02, PON: 0x01},
L = {FULLSPECTRUM: 0, VISIBLE: 1, INFRARED: 2},
G = {LOW: 0x00, MED: 0x10, HIGH: 0x20, MAX: 0x30},
I = {MS100: 0x00, MS200... |
/**
`.------:::--...``.`
`-:+hmmoo+++dNNmo-.``/dh+...
.+/+mNmyo++/+hmmdo-.``.odmo -/`
... |
function amountParser (text, config) {
config = config || {}
var parsers = config.parsers || ['total', 'largest']
var result = {}
var parser
// Go through all parsers and match the first best
for (var i = 0; i < parsers.length; i++) {
parser = parsers[i]
if (typeof parser === 'string') {
pars... |
/**
* Copyright 2019, SumUp Ltd.
* 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 in wri... |
import React from 'react';
import {actions} from './actions';
import Gateway from '../models/Gateway';
import Pipeline from '../models/Pipeline';
import Policy from '../models/Policy';
import ApiEndpoint from '../models/ApiEndpoint';
const {
coreActions,
actions: actionsCore,
userStorage,
} = LunchBadgerCore.uti... |
'use strict'
const Cache = use('Cache')
const { HttpException } = use('@adonisjs/generic-exceptions')
const ReadingActivityLogModel = use('App/Models/ReadingActivityLog')
class UserReadingActivityLog {
register(Model) {
Model.prototype.getLog = async function (webpage, type) {
let cacheKey = Cache... |
import React, {Component, Fragment} from 'react';
import PropTypes from 'prop-types';
import {ScrollView} from 'react-native';
import {List} from 'react-native-elements';
import {connect} from 'react-redux';
import {Button, LoadingIndicator, Title} from '@indec/react-native-commons';
import {Alert} from '@indec/react-n... |
import React from 'react';
import { Route, Switch, Redirect } from 'react-router-dom';
import SearchTitle from './Header/index';
import Progress from '../EditAddTask/ProgressBar/index';
import CategoryAdd from '../EditAddTask/CategoryAdd/index';
import TaskAdd from '../EditAddTask/TaskAdd/index';
import Categories fro... |
// Parser module
//
// const parse = require('./parser');
// const ast = parse(sourceCodeString);
const ohm = require('ohm-js');
const fs = require('fs');
const {
Program,
Block,
AssignmentStatement,
RepeatStatement,
ForStatement,
IfStatement,
IfShort,
WhileStatement,
VariableDeclaration,
Func... |
// All values and structures referenced from:
// http://msdn.microsoft.com/en-us/library/bb943991.aspx/
//
// DX10 Cubemap support based on
// https://github.com/dariomanesku/cmft/issues/7#issuecomment-69516844
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb943983(v=vs.85).aspx
// https://github.com/play... |
import React from 'react';
import { connect } from 'react-redux';
import Grid from '@material-ui/core/Grid';
import List from '@material-ui/core/List';
import Avatar from '@material-ui/core/Avatar';
import Divider from '@material-ui/core/Divider';
import ExportIcon from '@material-ui/icons/Save';
import ListItem from '... |
import applyFilter from '@gob/examine-student/source/apply-filter'
import excludeCourse from '@gob/examine-student/source/exclude-course'
import filterByWhereClause from '@gob/examine-student/source/filter-by-where-clause'
import findCourse from '@gob/examine-student/source/find-course'
import getMatchesFromChildren fr... |
$(document).ready(function (e) {
$('.thongbao').hide();
$('.btnlink').click(function () {
$(this).html('<i class="uk-icon-spinner uk-icon-spin"> </i>');
//$(this).prop("disabled",true);
})
$('.input-price').keyup(function () {
$(this).prop("value", dinhdanggia($(this).val()))... |
let restaurants,
neighborhoods,
cuisines
var map
var markers = []
/**
* Fetch neighborhoods and cuisines as soon as the page is loaded.
*/
document.addEventListener('DOMContentLoaded', (event) => {
registerServiceWorker();
fetchNeighborhoods();
fetchCuisines();
updateRestaurants();
});
document.querySel... |
import React, { Component } from 'react';
import { Text, View, TextInput, StyleSheet, TouchableHighlight, Image, Alert } from 'react-native';
import NavigationService from 'App/Services/NavigationService';
import { Button, Container, Content, Item, Input, Form, Label, Row, Grid } from 'native-base';
import SpinnerView ... |
const { window, commands, workspace } = require('vscode')
const path = require('path')
const qnUpload = require('./lib/upload')
const editor = window.activeTextEditor
const moment = require('moment')
const fs = require('fs')
const { spawn } = require('child_process')
const upload = (config, fsPath) => {
if(!fsPath... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("... |
'use strict'
const fs = require('fs')
const path = require('path')
const https = require('https')
const split = require('split2')
const changeLogUrl = 'https://raw.githubusercontent.com/nodejs/node/master/doc/changelogs/CHANGELOG_'
const versions = ['V4', 'V5', 'V6', 'V7', 'V8', 'V9', 'V10']
versions.forEach(v => {... |
import React, { useState } from 'react';
import { connect } from 'react-redux';
import { compose, withProps } from 'recompose';
import isEmpty from 'lodash/isEmpty';
import { actions as tournamentsActions } from 'pages/tournaments';
import classnames from 'classnames/bind';
import Modal from 'components/modal';
import... |
var canvas;
var gl;
var program;
var projectionMatrix;
var modelViewMatrix;
var camModelViewMatrix;
var instanceMatrix;
var camModelViewLoc;
var modelViewMatrixLoc;
var projectionMatrixLoc;
var normalMatrixLoc;
var numNodes = 27;
var stack = [];
var figure = [];
for( var i=0; i<numNodes; i++) figure[i] = create... |
const renderEngine = require('../render-engine');
const gfx = renderEngine.gfx;
let MeshBuffer = cc.Class({
name: 'cc.MeshBuffer',
ctor(batcher, vertexFormat) {
this.byteStart = 0;
this.byteOffset = 0;
this.indiceStart = 0;
this.indiceOffset = 0;
this.vertexStart = 0;
... |
function getCookie(name) {
let matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
async function postDataImage(url, headers = new Headers(... |
import React, { Component } from 'react';
import AceEditor from 'react-ace';
import ReactMarkdown from 'react-markdown';
import Splitter from 'm-react-splitters';
import 'm-react-splitters/lib/splitters.css';
import SampleAnalyst from './SampleAnalyst.js';
import './App.css';
import lessons from './lessons.json';
impo... |
/**
* Author: DrowsyFlesh
* Create: 2018/11/12
* Description:
*/
import _ from 'lodash';
import $ from 'jquery';
import React from 'react';
import styled from 'styled-components';
import {theme} from 'Styles';
const {color} = theme;
const Title = styled.div.attrs({className: 'bilibili-helper-video-download-title'... |
'use strict';
var gulp = require('gulp');
// load plugins
var $ = require('gulp-load-plugins')();
var del = require('del');
var runSequence = require('run-sequence');
var eventStream = require('event-stream');
var mainBowerFiles = require('main-bower-files');
gulp.task('styles', function () {
return gulp.src('conte... |
import { mapGetters } from 'vuex';
import request from '@/utils/request';
const requestUrl="https://bbk.800app.com/uploadfile/staticresource/238592/279833/api_auto_json.aspx";
import { userList } from '@/api/user'
export default{
data(){
return {
gym:undefined,
gyms:undefined,
}... |
import { Universe, Cell } from "wasm-game-of-life";
import { memory, __wbindgen_malloc, __wbindgen_free } from "wasm-game-of-life/wasm_game_of_life_bg";
const CELL_SIZE = 5; // px
const GRID_COLOR = "#CCCCCC";
const DEAD_COLOR = "#FFFFFF";
const ALIVE_COLOR = "#000000";
// Construct the universe, and get its width a... |
/** @license React v16.4.0-alpha.0911da3
* simple-cache-provider.development.js
*
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import warning from 'fbjs/li... |
function createNewStory() {
var buttonToLoad = document.getElementById("save-story-btn");
buttonToLoad.innerHTML = "<i class='fas fa-circle-notch'></i>";
var ContentText = document.getElementById("story-text-area").innerHTML;
db.collection("stories").add({
title: document.getElementById("story-title-in... |
const fs = require('fs')
const Web3 = require('web3')
const uuid = require('uuid/v1')
const amqp = require('amqplib/callback_api');
const deployer = require('./deployer')
const abi = JSON.parse(fs.readFileSync('./Contracts/out/Vault_sol_Vault.abi', {'encoding':'utf8', 'flag':'r'}));
const $admin_account = "0xed9d02e3... |
'use strict';
let defaults = require('./options').defaults;
let drawCanvas = require('./drawCanvas');
let drawLeaflet = require('./drawLeaflet');
let mercator = require('../libs/mercator');
let turf = require('../libs/turf');
let Route = require('./route').Route;
let blur = require('ctx-blur');
let toLineString = requ... |
function setup()
{
window.S = new Sudoku();
createCanvas(window.innerWidth, window.innerHeight);
noLoop();
}
function draw()
{
background(53);
S.findSolutions();
console.log(S);
}
/* [ ] Fix 'fill' method
[ ] Prepare filled grid by removing number until unsolvable */
let AAA... |
var session = require('client-sessions');
var Item = require('../models/item');
var User = require('../models/user');
var fs = require('fs');
module.exports = function (io) {
var profile = io.of('/profile');
profile.on('connection',function(socket){
var cookie_string = socket.request.headers.cookie;
v... |
import React, { Component } from "react";
import API from "../../utils/API";
import { Link } from "react-router-dom";
import { Col } from "../../components/Grid";
// import { List, ListItem } from "../../components/List";
import { Modal, Row as MatRow } from "react-materialize";
import moment from "moment";
import "./... |
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
import React, { PropTypes } from 'react/addons';
import styles from './ConnectPage.less';
import withStyles from '../../decorators/withStyles';
import Location from '../../core/Location';
@withStyles(styles)
class ConnectPage extends React.Compo... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Mainstay = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { ... |
var game = {
board: [null, null,null, null, null, null, null, null, null],
winConditions: [ [0, 4, 8], [2, 4, 6], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 1, 2], [3, 4, 5], [6, 7, 8] ],
x: { value: 0, iconClass: 'fa fa-times' },
o: { value: 1, iconClass: 'fa fa-circle-o' }
};
var player = {
name: 'Player',
turnCount... |
import {
Button,
Card, CardActions,
CardContent,
CardHeader, CircularProgress, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle,
Fab,
FormControlLabel,
FormGroup, Input, LinearProgress,
makeStyles,
Switch,
TextField
} from "@material-ui/core";
import {DateTime... |
'use strict';
const usr_mgr = require('./usr_mgr.js').init();
const dev_test = require('./dev_test.js');
const su_cmd = require('./su_cmd.js');
const push2reply = require('./push2reply.js');
const custom_cmd = require('./custom_cmd.js').init();
const nlp = require('./nlp.js');
const txt_react = require('./txt_react.js... |
import React, { useState } from "react";
import { api, handleError } from "helpers/api";
import User from "models/User";
import { useHistory } from "react-router-dom";
import { Button } from "components/ui/Button";
import "styles/views/Registration.scss";
import BaseContainer from "components/ui/BaseContainer";
import ... |
/**
* A line of code that prints "Hello, World!" on a new line is provided in the editor.
* Write a second line of code that prints the contents of 'parameterVariable' on a new line.
*
* Parameter:
* parameterVariable - A string of text.
**/
function greeting(parameterVariable) {
// This line prints 'Hello, ... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IConditionType = exports.ConditionQueryBuilder = void 0;
const class_validator_1 = require("class-validator");
const normalize_diacritics_1 = require("normalize-diacritics");
const routing_controllers_1 = require("routing-controllers")... |
import Types from './rules/types.js';
const { isType, invariant: inv } = Types;
const unsupported = syntax => {
throw new Error(`Unsupported syntax: ${syntax}`);
};
const eq = (left, right) => input => left(input) === right(input);
const ne = (left, right) => input => left(input) !== right(input);
const eq_c = (lef... |
import * as bookmaker from '/lib/gu_sports_betting/gu_odds.js';
export function updateOdds(location, odds) {
var objectForSet = {};
objectForSet[location + '.asOriginalInput'] = odds;
var isValidOddsFormat = false;
var exact = -1;
if (odds.length > 0) {
if (parseFloat(odds) >= 100 && odds.charAt(0) != '... |
import React, { Component, Fragment } from 'react'
import {
ComposableMap,
ZoomableGroup,
Geographies,
Geography,
} from 'react-simple-maps'
import autobind from 'react-autobind'
import ReactTooltip from 'react-tooltip'
import NGB_CONFIG from './ngb_config'
const mapPath =
'https://raw.githubusercontent.com/... |
/**
* @typedef {string} Assets
* @typedef {string} Pages
*
* @callback Build
* @param {Element} node
* @returns {ElementChild|ElementChild[]}
*
* @typedef Options
* Configuration.
* @property {Assets} [assets='assets']
* @property {Pages} [pages='pages']
* How to create links.
*/
import {visit} from '... |
//this file is incharge of the initialization of the app backend
const top = {};
const electron = require("electron");
const path = require("path");
const reminder = require(path.join(__dirname, "./server/reminder.js"));
const { DBManagement } = require(path.join(__dirname,"./server/dbManagement.js"));
const { Reminder... |
import React, { useState } from 'react';
import { NavLink as RouterLink } from 'react-router-dom';
import { useParams, useLocation } from 'react-router-dom';
import {
Grid,
Fab,
makeStyles,
Paper,
ListItem,
ListItemAvatar,
Avatar,
ListItemText,
Typography,
Chip,
} from '@material-ui/core';
import Ad... |
function captureSquareBrackets(line)
{
//Find the string "[[...]]" and capture its content
var regExp = /\[\[(.*?)\]\]/i;
var capture = regExp.exec(line);
//Build a new choice target that will be populated
var choice = {"target":"", "text":"", "conditions":[]};
if(capture == null)
{
return false;
... |
import format from 'chalk'
import _ from 'lodash'
import stackTrace from 'stack-trace'
import { GlobalSpinner, SimpleSpinner } from './helpers/spinner'
import logger from '../utils/debug'
import { p, error, warning, echo, printSourceCode } from '../utils/print-tools'
import { currentTime } from '../utils/date-utils'
... |
'use strict';
require("dotenv").config();
import 'core-js/stable';
import moment from 'moment';
import { MongoClient } from "mongodb";
import GetLeagueData from '../../requests/getLeagueData';
import TransfersDAO from './transfersDAO';
import PlayersDAO from '../players/playersDAO';
import ManagersDAO from '../managers... |
import { type, isObject } from './type'
import { deepClone } from './clone'
/**
* Check whether an object has the property.
*/
const hasOwnProperty = Object.prototype.hasOwnProperty
export function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
export function noop () {}
// transfer 对象的`${name}`属性值... |
module.exports.builtInTagMap = {
a: 'HTMLAnchorElement',
abbr: 'HTMLElement',
address: 'HTMLElement',
area: 'HTMLAreaElement',
article: 'HTMLElement',
aside: 'HTMLElement',
audio: 'HTMLAudioElement',
b: 'HTMLElement',
base: 'HTMLBaseElement',
basefont: 'HTMLBaseFontElement',
bdi: 'HTMLElement',
... |
import React from 'react'
import { graphql } from 'gatsby'
import get from 'lodash/get'
import Helmet from 'react-helmet'
import Hero from '../components/hero'
import Img from 'gatsby-image'
import Layout from '../components/layout'
import Styles from './index.css'
import ReactFullpage from '@fullpage/react-fullpage'
i... |
const spawn = require('cross-spawn');
const commandExists = require('command-exists').sync;
const path = require('path');
const fs = require('fs');
const fse = require('fs-extra');
const readFile = require('fs-readfile-promise');
const fullname = require('fullname');
const simpleGit = require('simple-git')();
const she... |
import React, { Component } from 'react';
import './App.css';
const DEFAULT_TIME = 1500;
class TimerLengthControl extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div className="length-control">
<div id={this.props.titleID}>
{this.props.title}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.