text stringlengths 3.22k 29.5k |
|---|
import * as Kit from "./kit";
const { Tag } = Kit;
const emptyMap = new Map();
const emptyArr = [];
/**
* collects all ES or CommonJS imports into root's import field
*
* type RootValue = RootValue & {imports:Map<string,
* {ns?:IdValue,
* ... |
var DEBUG = false;
function isObject(thing) {
return Object.prototype.toString.call(thing) === "[object Object]";
}
function isArray(it) {
return Object.prototype.toString.call(it) === '[object Array]';
}
function isFunction(it) {
return Object.prototype.toString.call(it) === '[object Function]';
}
var __ex... |
function colorForHealth(health, saturation, brightness) {
return 'rgb(' + HSLToRGB((health / 100) * (120 / 360), saturation, brightness).join(',') + ')';
}
function hueToRGB(p, q, t) {
if (t < 0) { t += 1; }
if (t > 1) { t -= 1; }
if (t < 1/6) { return p + (q - p) * 6 * t; }
if (t < 1/2) { return q... |
var parser = require("./parser");
var processor = require("./process");
// AST modifier which adds implicit returns to the last statement of a function
exports.add_implicit_returns = function add_implicit_returns(ast) {
var w = processor.ast_walker(),
MAP = processor.MAP,
wrapStatement;
wrapStatement ... |
"use strict";
var canvas;
var gl;
var numVertices = 24;
var maxNumParticles = 10000;
var initialNumParticles = 10;
var initialPointSize = 30;
var initialSpeed = 0.1;
var numColors = 8;
var program;
var time = 0;
var dt = 1;
var numParticles = initialNumParticles;
var pointSize = initialPointSize;
var speed = init... |
import React, { Component } from 'react';
import { Redirect } from 'react-router-dom';
import { isAuthenticated } from '../../Api';
import { create } from '../../Api/Post';
import loader from '../../Images/loader2.gif';
import { serverUrl } from '../variables';
import { Multiselect } from 'multiselect-react-dropdown';... |
import { domElements, gctMonoList, gctSubList } from "./globalvars.js";
import { glycantojson } from './glycantoJSON.js';
//function takes the cfg name from the input field and outputs the GlycoCT
export function cfgToGlycoCT() {
var cfgname = document.getElementById(domElements.nameInputID).value;
if (cfgname ===... |
"use strict";
//rest.controller.js
var debug = require('debug')('pushserver:crud.controller'),
EventEmitter = require('events').EventEmitter,
util = require('util'),
config = require('config').get('pushserver'),
_ = require('lodash');
/**
* [CrudController description]
* @param {[type]} model [description]
*/
var Cr... |
// Prepare our textures
const loader = new THREE.TextureLoader();
const textures = {
'oakSide': loader.load('src/textures/oak-bark.jpg'),
'oakMiddle': loader.load('src/textures/oak-inner.jpg'),
'leaves': loader.load('src/textures/leaves.png'),
'water': loader.load('src/textures/water.jpg'),
'grassTo... |
const fs = require("fs-extra");
const path = require("path");
const readDirectory = async directoryPath => {
return new Promise((resolve, reject) => {
fs.readdir(directoryPath, (error, files) => {
if (error) {
reject(error);
}
resolve(files);
});
});
};
const makeDirectory = asyn... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
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)) { target[key] = source[key]; } }... |
import {
Transform, Mapping
} from 'prosemirror-transform'
import {
ChangeSet
} from 'prosemirror-changeset'
import {
recreateTransform
} from './recreate'
export function mergeTransforms(tr1, tr2, automerge = true, rebase = false, wordDiffs = false) {
// Create conflicting steps. Make sure the steps a... |
// Copyright (C) 2011 Google Inc.
// Copyright (C) 2018 Agoric
//
// 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 ap... |
var Mobro2017Application = (function () {
function Mobro2017Application() {
var _this = this;
this.state = {
selectedItemName: "",
options: {}
};
this.onOptionsChanged = STD.callOnce(function () {
_this.onRender();
});
this.onRender... |
var calendarOptions = [];
var changecalendarOptions = [];
var calendarEvents;
function changeSelect(option) {
$('#roomSelect option').eq(0).prop('selected', true);
changeLoaded();
}
function changeLoaded() {
var selectCalendar = $('#roomSelect').find(":selected").text();
let selectCalendarWithoutSpace... |
const path = require('upath')
const glob = require('fast-glob')
const fs = require('fs-extra')
const chokidar = require('chokidar')
const frontMatter = require('./front-matter')
const localRequire = require('../../lib/utils/local-require')
const {
hasMatchedLocale,
matchLocale,
addIndexSuffix,
getPageLink,
wr... |
//copyright 2014 C.D.Price
LoaderS.push('init_cells();');
function init_cells() {
var rows = document.getElementById('tblLog').rows;
for (var rndx=2; rndx<rows.length; rndx++) { //skip header and add rows
var cells = rows[rndx].cells;
for (var cndx=0; cndx<cells.length; cndx++) {
var cell = cells[cndx];
s... |
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const morgan = require('morgan');
const chalk = require('chalk');
const mongoose = require('mongoose');
const OAuth2Server = require('oauth2-server');
const models = require('./models');
const apiRoutes = requi... |
// Import caccl
import initCACCL from 'caccl/client/cached';
// Import stats
import stats from 'stats-lite';
// Import queries
import GRAPH_QL_QUERIES from '../constants/GRAPH_QL_QUERIES';
// Import helpers
import visitServerEndpoint from './visitServerEndpoint';
// Initialize caccl
const { api } = initCACCL();
/*... |
jQuery(function ($) {
layer.config({
title: false
});
$('.checkAll').on('click', function () {
$('.checkItem').prop('checked', this.checked);
$(this).prop('checked', this.checked);
});
$('.checkBtn').on('click', function () {
if ($('.checkItem:checked').length > 0) ... |
const fs = require('fs')
const marked = require('marked')
const { join } = require('path')
const presetCSS = fs.readFileSync(join(__dirname, '../node_modules/serve-marked/presets/merri.css'), 'utf8')
const indexMd = fs.readFileSync(join(__dirname, 'index-shutdown.md'), 'utf8')
const serveMarked = (markdown, helmetOpt... |
const { app, ipcRenderer, remote, shell } = require('electron');
const services = require('../default-services.js');
let menuItems = services.slice(0);
const menu = require('./menu');
const Store = require('electron-store');
menuItems.unshift({name: 'Menu'});
Vue.config.devtools = true;
const store = new Store();
let... |
'use babel';
import WebServerJsView from './web-server-js-view';
import { CompositeDisposable } from 'atom';
var http = require('http');
var url = require('url');
var fs = require('fs');
var util = require('util');
var os = require('os');
var child_process = require("child_process");
var GBK = require('../files/gbk.j... |
'use strict';
// ======= Global Variables ======= //
Product.productArray = [];
var productHTMLList = document.getElementById('productUL');
var totalPageClicks = 0;
var productIndexsCurrentlyOnPage = [];
// ======= Constructor ======= //
function Product(productName, src) {
this.numClicksOfProduct = 0;
this.numTi... |
const CODE = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789-=+*';
const BASE_STEP = 45;
const WORDS = [
[
'barnstorm',
'conscripts',
'corkscrew',
'cornfields',
'emu',
'extinct',
'firstborn',
'flatlands',
'foursquare',
'grindstone',
'groundsw... |
//
// convert atlas academy servant(JP) json to json
//
// expected data from
// https://api.atlasacademy.io/export/JP/nice_servant.json
//
fs = require('fs')
pako = require('pako')
const { execSync } = require('child_process')
const atlasjson = JSON.parse(fs.readFileSync("output/servantdata.new.json"))
const atlas... |
const {app, ipcMain} = require('electron');
const path = require('path');
const Data = require('electron-store');
const fs = require('fs-extra');
const isDev = require('electron-is-dev');
const id = require('id.log');
const tampax = require('tampax');
const async = require('async');
const mem = require('mem');
const ju... |
'use strict';
var _ = require('lodash');
var rp = require('request-promise');
var BASE_URL = 'https://data.sfgov.org/resource/rqzj-sfat.json';
var DEFAULT_RADIUS = 500; // The default radius to search
var DEFAULT_LIMIT = 30; // The default number of records to load
/**
* Truck class used when transforming data for ... |
// Store string arrays as global const's, keeps it neat, and it's no harm since this is just a small script
// Message should be of the format: PREFIX FAKE_FACT SUFFIX
const prefixes = [
['Did you know ', '?'], // Array prefix will use predefined suffix
['You should know ', '...'],
"It's common knowledge ",
"It's c... |
import { CoreTypes } from '../../../core-types';
import { Trace } from '../../../trace';
import { CSSType } from '../../core/view';
import { GridLayout } from '../grid-layout';
import { Animation } from '../../animation';
let RootLayoutBase = class RootLayoutBase extends GridLayout {
constructor() {
super()... |
var connection;
var onMessageCallbacks = {};
var SIGNALING_SERVER = window.location.origin;
var role;
// onNewSession can be fired multiple times for same session
// to handle such issues; storing session-ids in an object
var sessions = { };
var iceServers = [];
iceServers.push({
url: 'stun:stun.google.c... |
function rest(app, dao){
app.get("/topPlayers", function(req, res){
var season = req.query.season || 2016;
var positions = req.query.position == null ? ['RB','TE','WR'] : req.query.position;
var numberPlayers = req.query.numberPlayers || 20;
dao.getTopFantasyPlayers(season, positions, numberPlayers, function(d... |
const videoWrapper = document.querySelector('.video-flex-wrapper');
const videoContainer = document.querySelector('.video-container');
const controls = document.querySelector('.controls');
const player = document.querySelector('.player');
const prevBtn = document.querySelector('.prev-btn');
const nextBtn = document.que... |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// =================================================================
function hoje(){
var today = new Date();
var dd = today.getDate();
var mm = t... |
// JavaScript Document
//Here is the text that goes on the first page of the application, the one presented by running the HTM.
var Title="Sample Size--Unmatched Case Control Study";
var Authors="<b>Statistics</b><br><NAME>, Emory University<br>"+
"based on code from <NAME><br>"+
"<b>Interface</b><br>"+
"<N... |
const constants = require('dotaconstants');
const utility = require('./utility');
const { max, min, isRadiant } = utility;
const { ancients } = constants;
/**
* Count the words that occur in a set of messages
* - messages: the messages to create the counts over
* - player_filter: if non-null, only count that playe... |
const chalk = require('chalk');
const boxen = require('boxen');
const CFonts = require('cfonts');
const chalkAnimation = require('chalk-animation');
const { getSanitizedText } = require('./text.utility');
const { addSentenceToSpeechQueue } = require('./voices.utility');
const readline = require('readline');
const it... |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.getData = getData;
exports.renderPageData = renderPageData;
exports.renderHTML = renderHTML;
require("../engines-fs-provider");
var path = _interopRequireWildcard(require("path"));
... |
// define weekDays
const weekDays = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
const scheduleCache = {};
// define data points
const dp_heating_period = '0_userdata.0.Heating.heating_period';
const dp_off_temp = '0_userdata.0.Heating.off_temp';
const dp_present = '0_userdata.0.Heati... |
import eventBus from '../../core/eventBus'
import $ from '../../utils/slimJQ'
import DrawUtils from '../../draw/drawUtils'
import { setScale, restoreScale } from '../../utils/utils'
import { cloneJSON } from '../../utils/clone'
class ShapeMove {
constructor(options, $container) {
this.options = options
thi... |
let webSocket
let ID
let me
let players = {}
let chat = []
let layer
let balls = []
let engineID = null
let xMax = 1280
let yMax = 720
let paddle
let pos = -80
function init() {
console.log(location)
createWebSocket((location.protocol === 'https:' ? 'wss://' : 'ws://') + location.host, onStatus, onReceive)
layer... |
import readJSON from '../helpers/readJSON';
import writeJSON from '../helpers/writeJSON';
import fetch from '../helpers/fetch';
import createFolder from '../helpers/createFolder';
import target from './target';
import sketch from './sketch';
import FormData from 'sketch-polyfill-fetch/lib/form-data';
import { isWebview... |
import React from "react";
import { ClassNames } from "@emotion/react";
import {
Box,
Button,
Flex,
Skeleton,
useColorModeValue,
useToken,
} from "@chakra-ui/react";
import gql from "graphql-tag";
import { useQuery } from "@apollo/client";
import { Link, useHistory, useParams } from "react-router-dom";
imp... |
var
express = require('ep_etherpad-lite/node_modules/express'),
async = require('async');
// var settings = require('/Users/andreas/wcn/etherpad-lite/src/node/utils/Settings');
var settings = require('ep_etherpad-lite/node/utils/Settings');
// var API = require('/Users/andreas/wcn/etherpad-lite/src/node/db/API');
v... |
import React, { Fragment, useEffect, useState, createRef } from "react";
import Layout from "@theme/Layout";
import CodeBlock from "@theme/CodeBlock";
import { EditorState, EditorView, basicSetup } from "@codemirror/basic-setup";
import { python } from "@codemirror/lang-python";
import styles from "./playground.module.... |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
File Name: 15.9.5... |
import dayjs from 'dayjs';
import React, { forwardRef, useState, useRef, useEffect } from 'react';
import { useUncontrolled, upperFirst, useMergedRef } from '@mantine/hooks';
import { useMantineTheme } from '@mantine/core';
import { Calendar } from '../Calendar/Calendar.js';
import { DatePickerBase } from '../DatePicke... |
/// <reference path="../typings/tsd.d.ts" />
var Thrimbletrimmer;
(function (Thrimbletrimmer) {
var Constants;
(function (Constants) {
Constants.EDITORPAGELOCATION = __dirname + '/EditorPage';
Constants.TYPE = "video/mp4";
Constants.TITLE = "Desert Bus Clip";
Constants.DESCRIPTIO... |
var jq = require('json-query');
var jf = require('jsonfile');
var Filter = require('./filters.js');
var Helper = require('./helpers.js');
/*classs constructor*/
function Def(defs, callBack){
this.defTree = {};
this.error = {};
this.f = new Filter();
for (var i = 0; i < defs.length; i++) {
//gather all the... |
DTDB.data_loaded.add(function() {
DTDB.data.sets({
code : "alt"
}).remove();
DTDB.data.cards({
pack_code : "alt"
}).remove();
$(this).closest('tr').siblings().removeClass('active');
$(this).closest('tr').addClass('active');
for (var i = 0; i < Decklist.cards.length; i++) {
var slot = Decklist.cards[i];
... |
var events = require('events')
var inherits = require('util').inherits
var _ = require('lodash')
var Q = require('q')
var Transaction = require('../bitcoin').Transaction
var errors = require('../errors')
var verify = require('../verify')
var TX_STATUS = require('../const').TX_STATUS
/**
* @name TxManager~getCurren... |
'use strict';
const _ = require('lodash');
const Async = require('async');
const Boom = require('boom');
const AgentTools = require('../tools');
const Flat = require('../../../helpers/flat');
const RemoveBlankArray = require('../../../helpers/removeBlankArray');
const getConfidence = (confidence) => {
if (confide... |
const fs = require('fs');
function populateSentenceArray(sentenceFile){
try{
// Loads the file into array
var factArray = fs.readFileSync(sentenceFile).toString().split('\n');
console.log(`Lines: ${factArray.length}`)
factArray = [...new Set(factArray)];
console.log(`Unique... |
import React from 'react';
import {ScrollView, Image, StyleSheet,Clipboard , Text, View, Dimensions, TouchableOpacity, FlatList, TouchableWithoutFeedback, Alert, StatusBar, Modal } from 'react-native';
import { Block, theme } from 'galio-framework';
import { Ionicons } from '@expo/vector-icons';
//Obtem as dimensões
i... |
/**
* @fileoverview
* A utility to transform a texture coordinate to another texture coordinate
* representing how the shaders apply effects.
*/
const matrix = require('gl-matrix');
const {rgbToHsv, hsvToRgb} = require('./util/color-conversions');
const EffectManager = require('./EffectManager');
/**
* A textur... |
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { CollapsibleBox } from '../../common'
import uuid from 'uuid-v4'
import {
IMAGE_SRC,
PURPOSE_OF_ACTION as PurposeOfAction,
REFERENCE_KEY,
PLANT_CRITERIA
} from '../../../constants/variables'
import { CRITERIA_TIP } from '../../..... |
$(document).ready(function(){
$(window).scroll(function(){
if(ScollPostion().top > 200) //监听是否需要加入滚动事件
{
menu_drop("scrollBar","block");
buffer($id("scrollBar"),{"opacity":"100"});
}else{
buffer($id("scrollBar"),{"opacity":"0"},null,function(){
menu_drop("scrollBar","none");
});
}
});
$i... |
//
// Database module
//
'use strict';
if (process.env.NODE_ENV !== 'production') {
// Load the .env file, that sets process.env.
require('dotenv').load();
}
const pg = require('pg');
const db = new pg.Client({
ssl: true,
connectionString: process.env.DATABASE_URL
});
db.connect(err => {
if (err) {
co... |
$(document).ready(function () {
//Prevent enter key function except texarea
$("form").on("keyup keypress", function (e) {
var keyCode = e.keyCode || e.which;
if (keyCode === 13 && e.target.tagName != "TEXTAREA") {
e.preventDefault();
return false;
}
});
/... |
var inquire = require("inquirer");
var fs = require("fs");
var BasicFlashCard = require("./BasicCard.js");
var ClozeFlashCard = require("./ClozeCard.js");
//var BQuestions = require("./questions.js");
var BasicQuestions = [];
var ClozeQuestions = [];
//console.log(Questions);
var bquestion1 = BasicFlashCard("Which U... |
/*!
* Sections of code from https://github.com/jimpurbrick/crestexplorerjs
* Copyright 2012, CCP (http://www.ccpgames.com)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*
* All other code is under th... |
import { Link } from "gatsby"
import React, {useContext, useState, useEffect} from "react"
import { useAsyncFn, useEffectOnce } from 'react-use'
import Button, { LeftButton, RightButton } from "../components/button"
import { formatSeconds } from "../pages/index"
import PacmanLoader from "react-spinners/PacmanLoader"
im... |
window.stop_ajax=false;
function radio_tab(radios,lists,prefix) {
$(radios).on('change',function (e) {
if(!$(this).is(':checked'))return;
var curval=$(this).val();
$(lists).hide();
$('.'+prefix+curval).show();
}).filter(':checked').trigger('change');
}
//绑定数据
function bindData(... |
import React, { Component } from 'react';
import { ScrollView, View, TouchableOpacity, StyleSheet, Dimensions } from 'react-native';
import Text from "../../../components/Text";
import TextInput from "../../../components/TextInput";
import { connect } from "react-redux";
import { updateUserState } from "../../../action... |
"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... |
"use strict"
var async = require("async");
var opcua = require("node-opcua");
function ReadPump(config, measurements, writepump) {
this.uaServerUrl = config.url;
this.uaClient;
this.uaSession;
this.uaSubscription;
this.measurements = measurements;
this.polledMeasurements = [];
this.monitor... |
/*
* This code is borrowed from `ungit`
*/
var child_process = require('child_process');
var gitParser = require('./git-parser');
var async = require('async');
var path = require('path');
var fs = require('fs');
// var config = require('./config');
// var winston = require('winston');
var logger = require('./logger')... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Location = exports.QueryEnumParam = exports.QueryParam = undefined;
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Sym... |
// THIS FILE HAS BEEN GENERATED WITH zzfx-minifier
// Keep that in mind when modifying it!
// ZzFX - Zuper Zmall Zound Zynth - Micro Edition
// MIT License - Copyright 2019 <NAME>
// https://github.com/KilledByAPixel/ZzFX
// This is a tiny build of zzfx with only a zzfx function to play sounds.
// You can use zzfxV t... |
/**
*
* @param {string} program - Code
*/
function parseExpression(program) {
program = skipSpace(program);
let match, expr;
// Get string.
if (match = /^"([^"]*)"/.exec(program)) {
expr = {type: "value", value: match[1]};
// Get number.
} else if (match = /^\d+\b/.exec(program)) {
... |
var _ = require('underscore');
var log = require('../../log')(module);
// --- GlobalSat GPS ------------------------------------------------------------
var parser = {};
module.exports = parser;
labels = {
NO_VALUE: '<no value>',
NO_PARAM: 'unknown'
};
/**
* Are passed data in supported format and can be pa... |
import React from 'react';
import {connect} from 'react-redux';
import Link from 'react-router-dom/es/Link';
import {updatePostDownVote, updatePostUpVote} from '../../actions/postActions';
import BrandLogo from '../common/BrandLogo';
import DeletePost from './DeletePost';
import EditPost from './EditPost';
class Artic... |
var ContextUser = 1;
var ContextMachine = 2;
var XCN_NCRYPT_ALLOW_EXPORT_FLAG = 1;
var XCN_NCRYPT_UI_NO_PROTECTION_FLAG = 0;
var XCN_NCRYPT_UI_PROTECT_KEY_FLAG = 1;
function setGenKeyFlags(objPrivateKey, nGenKeyFlags)
{
// some constants defined in wincrypt.h:
var CRYPT_EXPORTABLE... |
const argv = require('optimist').argv
, fs = require('fs')
, path = require('path')
, mkdirp = require('mkdirp')
, map = require('map-async')
, msee = require('msee')
, http = require('http')
, ecstatic = require('ecstatic')
const showMenu = req... |
import m from 'mithril';
import tagl from 'tagl-mithril';
import games from './games';
console.log(games)
const { h1, div, small, button, p, pre } = tagl(m);
const FieldSize = 10;
const range = (S, N) => {
const r = [];
for (let i = S; i < N; i++) r.push(i);
return r;
}
const flatMap = (arr, fn = e => ... |
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
var Releases = {};
var DATA_FORMAT_VERSION = "1.0";
jQuery(document).ready(function() {
if( jQuery(' .metadata-table ').length ) {
// get the hg19 metadata information
jQuery.ajax({
url: "//... |
const express = require("express"),
session = require("express-session"),
cookieParser = require("cookie-parser"),
bodyParser = require("body-parser"),
auth = require("./config/auth"),
path = require("path"),
mongoose = require("mongoose"),
multer = require("./config/multer"),
cors = require("cors"),
... |
//Copyright 2013-2017 Amazon.com, Inc. or its affiliates. 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.
//A copy of the License is located at
//
// http://aws.amazon.com/apache2.0/
//
//or in the "license" fil... |
const myLibrary = [];
const bookCollectionContainer = document.querySelector('.book-collection-container');
const modalTitle = document.querySelector('.modal-title');
const feedbackMessage = document.createElement('div');
const modalHeader = document.querySelector('.modal-header');
const titleInput = document.querySele... |
var http = require('http'),
moment = require('moment'),
_ = require('lodash'),
helper = require('./helper'),
querystring = require('querystring'),
url = require('url'),
apierror = require('./error');
var cfg = {
httpRealHost: 'gw.api.taobao.com',
httpRealPath: '/router/rest',
httpSandHost: 'gw.api.tbsandbox.c... |
import React from 'react'
class Tip {
constructor(component) {
this.component = component
console.log(this)
}
// indie
async increaseTipAmount(amount) {
let tip = Math.round((this.component.state.tip + amount) * 10) / 10
let { currentAHT, afterAHT } = this.getCurrentAHT(
this.component.sta... |
// 幻灯片
var
$item = $(".carousel-inner .item");
$btn = $(".carousel-btn .btn");
$prev = $(".carousel .prev");
$next = $(".carousel .next");
i = 0;
// 默认
// 幻灯片以及小按钮的变换规则
function slide(num){
$item.eq(num).fadeIn(1000).css({"display":"block"});;
$item.not($item.eq(num)).fadeOut("slow");
$btn.eq(num).... |
import React from "react";
import PropTypes from "prop-types";
import { Link, graphql } from "gatsby";
import Layout from "../components/Layout";
import HeadData from "../components/HeadData.js";
import { Calendar } from "../components/SVG.js";
import SiteMetaData from "../components/SiteMetadata.js";
import { F... |
/* global describe, it, beforeEach, afterEach */
"use strict";
const InstanceManager = require("../../InstanceManager.js");
const endpointToUrl = InstanceManager.endpointToUrl;
const {sleep, debugLog, afterEachCleanup} = require('../../utils');
const expect = require("chai").expect;
const rp = require("request-promise... |
console.log("%c浏览器保佑~别出BUG,别报错!", "font-size:20px;background-color:#444;color:yellow;border-radius:5px;");
//获取回到顶部和导航栏元素
const retop = document.querySelector('.retop');
const nav = document.querySelector('nav');
function reTOP() {
var scroll = document.documentElement.scrollTop || document.body... |
import angular from 'angular';
import ngCookies from 'angular-cookies'
import duScroll from 'angular-scroll'
import ngDialog from 'ng-dialog'
//custom styles
import '../style/reset.css'
import '../style/app.scss'
//custom scripts
import '../plugins/ng-scrollSpy.js'
//library styles
import 'font-awesome/css/font-awes... |
'use strict';
require('colors');
require('stripcolorcodes');
var async = require('async');
var _ = require('lodash');
var mongoose = require('mongoose');
function treeRelationshipPlugin(schema) {
// Adds Support for:
//
// SAMPLE Schema Entry:
// floor: { type: mongoose.Schema.Types.ObjectId, ref: 'Floor', ... |
//
// Get the AQI from https://www.purpleair.com/ and/or sparetheair.org
// So we can decide if it's ok to go for a ride/run
//
// @author <NAME>
// @date 8/2020
//
let aqiObj = {
aqiVal: -1,
lastUpdate: -1
}
let classNames = [
{
className: "green",
title: "Good"
},
{
className: "yellow",
ti... |
let emojiArr;
let func = ["perlinNoise", "valueNoise", "cellularNoise", "fbm"];
//This code is ported from <NAME>'s awesome noise sketch written in Processing.
//https://github.com/HarukaKajita/NoiseFlow
let moverNum = 100;
let movers = [];
let aNum = 100;
let agents = [];
let nS; //noise scale
let maxRot; //width o... |
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) { try { step(gene... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import MediaQuery from 'react-responsive';
import _ from 'lodash';
import PageLayout from '../components/PageLayout';
import Loading from '../components/Loading... |
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/core";
import { Link } from "react-router-dom";
import { useHistory } from "react-router-dom";
import {
Button,
Icon,
Image,
Dropdown,
Label,
Menu,
Segment,
Sidebar,
} from "semantic-ui-react";
import BodyClassName from "react-body-cla... |
const Command = require('@ak-clown/command');
const log = require('@ak-clown/log');
const fs = require('fs');
const inquirer = require('inquirer');
const fse = require('fs-extra');
const semver = require('semver');
const getProjectTemplate = require('./getProjectTemplate.js');
const path = require('path');
const userHo... |
/**
* @file
* @author huangzongzhe
*/
/* eslint-disable fecs-camelcase */
import React, { PureComponent } from 'react';
import { Menu, Icon } from 'antd';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import Svg from '../../components/Svg/Svg';
import './header.styles.less';
import... |
/*
* Copyright 2017, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
const Rx = require('rxjs');
const axios = require('../libs/ajax');
const Url = require('url');
const {changeSpatialA... |
import React, { useState } from 'react';
import API from '../../utils/API';
import { useAuth } from '../../utils/auth';
import { Link, useHistory } from 'react-router-dom';
import Badge from '../../components/Badge/Badge';
import {
Input,
Form,
Dropdown,
TextArea,
Checkbox,
Container,
Progress,
Modal
... |
function startSite() {
rotateCircle(180);
$('#Text1').show(1000);
}
var _CURRENT_ANGLE = 0;
var currentRotation = 0;
var i = 0;
function update() {
clickDot('#home', '#Text1', '#sunID', 180);
clickDot('#projects', '#Text2', '#sunID', 0);
clickDot('#contact', '#Text3', '#sunID', 90);
clickDot('#about', '#Text4', '... |
import cls from 'classnames';
import { useFormik } from 'formik';
import compact from 'lodash/compact';
import every from 'lodash/every';
import find from 'lodash/find';
import reject from 'lodash/reject';
import uniq from 'lodash/uniq';
import { useSnackbar } from 'notistack';
import React, { useEffect, useMemo } from... |
document.addEventListener("DOMContentLoaded", () => {
setTimeout(() => {
/*
Create SLUG from a string
This function rewrite the string prototype and also
replace latin and other special characters.
Forked by <NAME> - https://gist.github.com/gabrielfroes
Original Author: <NAME> - https://gis... |
import './styles.css';
import BaseChartView from '../../components/chart/BaseChartView';
import {once} from 'underscore';
import {className} from '../../decorators';
import duration from '../../helpers/duration';
import {scaleLinear, scaleBand} from 'd3-scale';
import {select, event as currentEvent} from 'd3-selection... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.