text stringlengths 3.07k 16k |
|---|
var EventEmitter = require('events').EventEmitter;
var fs = require('fs');
var should = require('chai').should();
var wait = require('../index.js');
describe('wait-for-stuff', function(){
this.timeout(10000);
it('waits-for: time', () => {
var isDone = false;
setTimeo... |
import React from "react";
import { shape, arrayOf, object, number, string } from "prop-types";
import Link from "gatsby-link";
import Img from "gatsby-image";
import { Grid, Row, Col } from "react-bootstrap";
import styled from "styled-components";
import { columnClasses } from "../utils/helpers";
const Template = s... |
const path = require('path')
const fs = require('fs-extra')
const matter = require('gray-matter')
const pug = require('pug')
const showdown = require('showdown')
const { createIndentedFilter } = require('indent-utils')
const dotenv = require('dotenv')
const rimraf = require('rimraf')
const { scan: dreeScan } = require... |
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { Text, View, ScrollView, KeyboardAvoidingView, TouchableNativeFeedback, TouchableOpacity, TextInput } from 'react-native';
import { Header, MainContent } from '../components';
import Modal from 'react-native-modal';
impor... |
var loadedMapScript = false;
var map;
var count;
function plotEvents(events){
var infowindow = new google.maps.InfoWindow({content: content});
var markers = {};
count = 0;
events.forEach(function(event) {
if (event.attributes.latitude !== null && event.attributes.longitude !== null) {
... |
const express = require("express");
const mongoose = require("mongoose");
const session = require("express-session")
const router = require("./routes/api/players")
const cors = require("cors")
// websocket ish
let socket = require('socket.io')
let cardsLogic = require('./cards.js');
const playerController = require(".... |
'use strict' //making sure new terms are readable
//including necessary modules and setting up of the file
const express = require ('express')
const fs = require ('fs')
const bodyParser = require('body-parser') //al in twee tutorials gezien dat het gebruikt wordt, dus gebruiken
const app = express ()
//this one is ge... |
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
//import App from './App.vue';
import VueRouter from 'vue-router'
import VueHighlightJS from 'vue-highlightjs'
import VueFace from '../src/index.js'
Vue.con... |
/* eslint no-restricted-syntax: "off" */
import { EventRegister } from 'react-native-event-listeners';
import moment from 'moment';
import { AsyncStorage } from 'react-native';
import globals from '../globals';
import translateTerm from './translate_term';
import * as settings from './settings';
const storeSave = (k... |
load("8b38e12cab5de21ec5393724c0d9b7dd.js");
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//------------... |
const fs = require('fs')
const fse = require('fs-extra')
const co = require('co')
const pify = require('pify')
const path = require('path')
const Koa = require('koa')
const KoaRuoter = require('koa-router')
const { createBundleRenderer } = require('vue-server-renderer')
const LRU = require('lru-cache')
const fetch = re... |
const Element = require('./Element');
class Dosage extends Element {
constructor(opt) {
super(opt);
this.__resourceType = 'Dosage';
Object.assign(this, opt);
}
// This is a Dosage resource
static get __resourceType() {
return 'Dosage';
}
// Indicates the order in which the dosage instructions should be... |
import React, {useState, useEffect} from 'react';
import {Directions, TouchableOpacity} from 'react-native-gesture-handler';
import {
ActivityIndicator,
Text,
StyleSheet,
Button,
TextInput,
Dimensions,
} from 'react-native';
import {View, ScrollView, Animated, Image} from 'react-native';
import MapView, {Ma... |
const Album = require('../../models/album.js');
const Artist = require('../../models/artist.js');
const appConfig = require('../../config.js');
const Discogs = require('disconnect').Client;
const express = require('express');
const mongoose = require('mongoose');
const User = require('../../models/user.js');
const rou... |
////////////////////////////////read txt///////////////////////////////
var w = window.innerWidth;
var h = window.innerHeight;
var loaderWidth = 150;
var loaderHeight = 160;
var picWidth = loaderWidth;
var picHeight = loaderWidth;
var chineseBol = true;
function initHelp() {
var textDiv = document.getElementByI... |
const candidatesInput = document.querySelector('#candidates');
const ballotsInput = document.querySelector('#ballots');
const resultDiv = document.querySelector('#results');
function ok(value) {
return { ok: true, value };
}
function err(value) {
return { ok: false, value };
}
function run() {
const sps ... |
'use strict';
const fs = require('fs');
const process = require('process');
if (process.argv.length <= 3) {
console.error('usage: optimize-st3.js source_prefix dest_prefix');
process.exit(1);
}
const source = process.argv[2];
const dest = process.argv[3];
fs.readdirSync('.').filter(file => file.startsW... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.uploadAttachment = uploadAttachment;
exports.default = main;
var _fs = _interopRequireDefault(require("fs"));
var _path = _interopRequireDefault(require("path"));
var _chalk = _interopRequireDefault(require("chalk"));
var _fileT... |
var assert = require("assert"),
jsonCommand = require("../lib/jsonCommand");
var testObj = {
id : 19375093,
text : "who knows",
user : {
id : 1310571,
name : "foo"
},
arr1 : [
'a', 'b', 'c'
],
obj1 : {
arr2 : [
'd', 'e', 'f'
]
},
created_at : 127817599,
zero : 0
};
f... |
let imagemCenario;
let imagemPersonagem;
let imagemInimigo;
let imagemInimigoGrande;
let imagemInimigoVoador;
let imagemGameOver;
let cenario;
let somDoJogo;
let somDoPulo;
let pontuacao;
let persomagem;
let inimigo;
let inimigoGrande;
let inimigoVoador;
const matrizInimigo = [
[0, 0],
[104, 0],
[208, 0],
[31... |
/*
Copyright 2010-2013 SourceGear, LLC
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 writing, softwar... |
import React from 'react';
import {
StyleSheet,
View,
Image,
SafeAreaView,
TouchableOpacity,
Dimensions,
} from 'react-native';
import { Card, Icon, Text } from 'react-native-elements';
import Colors from '../constants/Colors';
import { ScrollView } from 'react-native-gesture-handler';
import { coinButton }... |
let isInRegistering = false;
let isInSelecting = false;
$(document).on("mousedown", (e) => {
if (e.button == 0 && !isInSelecting && !isInRegistering) {
$.post("http://dl-characters/click_event", JSON.stringify({
primary: true
}), (data) => {
if (data != "register" && data != ... |
// Load plugins
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')(),
http = require('http'),
runSequence = require('run-sequence');
gulp.task('styles', function() {
return gulp.src('src/styles/app.scss')
.pipe(plugins.sassLint())
.pipe(plugins.sassLint.format())
.pipe(plugins... |
import React, { useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux';
import { getQueryParams } from "../../utils";
import { setFormResetPassword } from './redux';
import { Link, useHistory } from "react-router-dom";
import { useForm } from "react-hook-form";
import { FaRegPaperPlane, FaEyeSl... |
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow TextInput自动提示输入
*/
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
} from 'react-native';
import {
StyleSheetAdapt,
Theme,
Tools,
} from "./../api/api";
import {Bar... |
import React, { useState, useRef } from 'react'
import styled from 'styled-components'
import { colors, formatPhone, formatPhoneHref } from '@qlean/york-core'
import {
View,
Separator,
Text,
Link as YorkLink,
} from 'york-web/components/primitive'
import { Button } from 'york-web/components/simple'
import {
u... |
import {
getToBeTweenedProps,
convertCSSPropsToPIXI,
parseAnimationRule,
parseCSSInnerHTML,
getAtRules,
castStringCSSValue,
cssRuleMatch,
} from '../src/utils/css';
import { cssInnerHTML, cssObject, allAnimations } from './__utils__/mock'
const animationAndTransitionProps = {
transitionProperty: 'x',
... |
/* --------------------
* babel-unique-id module
* ------------------*/
'use strict';
// Modules
const {relative: pathRelative, sep: pathSeparator} = require('path'),
createSymbols = require('symbols-collection'),
invariant = require('tiny-invariant').default,
{isString, isFullString, isBoolean, isPositiveIntege... |
import request from 'supertest';
import { concatenateThenHash } from '../api/src/utils/crypto/hashes/sha256/sha256';
import { MongoClient } from 'mongodb';
const fs = require('fs');
jest.setTimeout(600000);
// Check <repo-root>/docker-compose.yml for correct URLs
const senderApiURL = 'http://localhost:8001';
const s... |
/*
One-dimensional cellular automata in JavaScript.
http://rosettacode.org/wiki/One-dimensional_cellular_automata
"""
Assume an array of cells with an initial distribution of live and dead cells, and
imaginary cells off the end of the array having fixed values.
Cells in the next generation of the array... |
import { GIFLoader } from './gifloader'
const matchesSelector = Element.prototype.matches || Element.prototype.webkitMatchesSelector || Element.prototype.msMatchesSelector
const defaultOptions = {
mode: 'hover',
overlayColor: 'rgba(255, 255, 255, 0.7)',
iconColor: 'rgba(45, 140, 240, 0.8)',
playIcon: '<svg xm... |
//Palette: 2: 'f3b103' 'ead556' 'c4bb14' 1: 'd5d9e4' '2f4263' b: '2e3440' '79888f'
boroughs = []; totals = []; maintained = [];
y = []; n = []; m = []; l = []; s = []; o = [];
var colours = ["#FFC100", "#F88600", "#AD3A59", "#8B1E42", "#47295E"];
var state = 0;
function preload() {
table1 = loadTable('assets/Boroug... |
//添加或修改文章
$(function() {
$("form").submit(function() {
//表单验证
if ($(this).is_validate()) {
var _post = $(this).serialize();
dialog_message("正在发表...", 30);
$.ajax({
type : "POST",
url : ACTION,
dataType : "JSON",
cache : false,
data : _post,
success : function(data) {
//关闭提示框
... |
/*
The MIT License (MIT)
Copyright (c) 2018 <NAME>, <EMAIL>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merg... |
import React from 'react'
import PropTypes from 'prop-types'
import { Link, graphql } from 'gatsby'
import styled from "styled-components"
import { FaInfo, FaInfoCircle } from 'react-icons/fa';
import homeJumbotron from "../img/home-jumbotron.jpg";
import homeJumbotronMobile from "../img/home-jumbotron-mobile.jpg";
im... |
$(function() {
$("#select_post_type").change(function() {
$("#input_post_url, #input_post_number").toggle();
});
manager = new obj_feed_manager();
manager.create_feed();
display_all_feed();
//增加卡片
$("#btn_create_feed").click(function() {
manager.create_feed();
display_... |
var brothers_list = null;
var self_tab_id = null;
var self_window_id = null;
var show_brothers = false;
var show_control = false;
document.addEventListener('DOMContentLoaded', function(){
console.log('CONTROL被执行了!');
docs_ctrl_div = $("<div></div>");
docs_ctrl_div.addClass("inject... |
'use strict';
// 必要なクラスをimport
import * as THREE from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
/* eslint no-unused-vars: 0 */
// import MyShaderChunk from './shader/MyShaderChunks';
import fragmentShader from './shader/frag.glsl';
import vertexShader from './shader/vert.glsl... |
import assign from "lodash.assign";
import React, {useState} from 'react';
import {registerBlockType} from '@wordpress/blocks';
import {__} from '@wordpress/i18n';
import {InspectorControls} from '@wordpress/block-editor';
import {Button, DateTimePicker, PanelBody, SelectControl, TextControl, ToggleControl} from '@word... |
/*
The MIT License (MIT)
Copyright (c) 2014 The Australian National University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... |
import Taro, {Component} from '@tarojs/taro'
import {View, Text, Image, Button, OpenData, Input} from '@tarojs/components'
import {connect} from '@tarojs/redux'
import * as actions from '@actions/user'
import {ButtonItem} from '@components'
import {CDN} from '@constants/api'
// NOTE 使用统一接口的多端文件进行跨端处理
// auth 中有 index.j... |
import { helpers } from 'utils';
import template from './templates/tabLayout.hbs';
import HeaderView from './HeaderView';
import StepperView from './StepperView';
import LayoutBehavior from '../behaviors/LayoutBehavior';
const classes = {
CLASS_NAME: 'layout__tab-layout',
PANEL_REGION: 'layout__tab-l... |
$(document).ready(function(){
$(".jobindex").click(function(){
var aid=$(this).attr("aid");
$(".jobindex").removeClass("job_pop_function_selected");
$(this).addClass("job_pop_function_selected");
$(".job_pop_function_list_tj").hide();
$("#joblist"+aid).show();
})
$(".jobtype").click(function () {
... |
import rules, {
viewCache,
InsertView,
DetailView,
EditView
} from "paas-web-utils/rules";
import {
operationService,
workflowProcessService,
workflowModelService
} from "paas-web-utils/services";
import alteration from "./alteration.js";
import EditPage from "./editPage.vue";
import DetailPage from "./de... |
import { useState } from 'react';
import { useRouter } from 'next/router';
import styled from 'styled-components';
import { Segment, Header, Form, Icon, Divider, Modal, TextArea, Button } from 'semantic-ui-react';
import { useRecoilState } from 'recoil';
import { user as userAtom } from '../../data/userAtom.js';
import... |
var Metrix = require("./index.js");
var assert = require('assert');
// Constructor
assert.equal(typeof new Metrix(),"object","default constructor");
assert.throws(()=>{new Metrix("udp")},Error);
assert.throws(()=>{new Metrix("udp4")},Error);
assert.throws(()=>{new Metrix("http")},Error);
assert.equal(typeof new Metrix... |
// Copyright (c) 2016-2018, BuckyCloud, Inc. and other BDT contributors.
// The BDT project is supported by the GeekChain Foundation.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// ... |
const EventEmitter = require('events');
const socketIo = require('socket.io');
const SERVER_SOCKET_HANDLER_EVENTS = require('./constants/ServerSocketHandlerEvents');
const KERNEL_EVENTS = require('../../lib/constants/KernelEvents');
const SOCKET_ROOMS = require('./constants/SocketRooms');
const SERVER_SOCKET_MESSAGE =... |
import Client from '../src/Client';
import SocketHandler from '../src/core/SocketHandler';
import Api from '../src/core/Api';
import { Event, ChannelName } from '../src/core/constants';
import { setupClient, randomString, createDescription } from './helpers';
const { API } = ChannelName;
const { OK, READY, CHAIN_TERMI... |
var Egg = {
name: "EggTimer",
defaultText: "",
expiredMessage: "",
title: "",
label: "",
progress: 0,
startTime: 0,
endTime: 0,
totalTime: 0,
parseError: "",
progressBar: null,
progressText: null,
staticArea: null,
beep: null,
currDate: null,
... |
import React from "react";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
/**
* COMPONENT
*/
export const Home = (props) => {
const { username } = props;
return (
<div>
<div
id='carouselExampleSlidesOnly'
className='carousel slide carousel-fade'
data-bs-ride='carou... |
import React from 'react';
import './App.css';
import * as d3 from 'd3';
import ReactDOM from 'react-dom';
import {enterNode, updateNode} from '../src/D3Functions.js';
import {enterLink, updateLink} from '../src/D3Functions.js';
import {updateGraph} from '../src/D3Functions.js'
// import {updateGraph, mouseover, mouseo... |
/**
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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.o... |
cpgf.import("cpgf", "builtin.collections");
cpgf.import("cpgf", "builtin.debug");
function overrideISceneNode(node)
{
this.Box = new irr.aabbox3d_f32();
this.Vertices = cpgf.createObjectArray(irr.S3DVertex);
this.Material = new irr.SMaterial();
this.Material.Wireframe = false;
this.Material.Lighting = ... |
import _ from 'lodash';
import Promise from 'bluebird';
import elasticsearch from 'elasticsearch';
import createKibanaIndex from './create_kibana_index';
import kibanaVersion from './kibana_version';
import { ensureEsVersion } from './ensure_es_version';
import { ensureNotTribe } from './ensure_not_tribe';
import { ens... |
'use strict';
const _ = require('lodash');
const fs = require('fs');
const csv = require('./lib/csv-parser.js');
const urls = require('./lib/url-generator.js');
const http = require('./lib/request.js');
const util = require('./lib/util.js');
const casher = require('./lib/casher.js');
const Promise = require('bluebird')... |
const fs=require('fs');
const app=require('./bot');
const bot=app.bot;
const Levenshtein=require('./similar');
const tAlp=require('./tencentAi');
const config={//请修改配置
useTencentAlp:0,//是否使用腾讯ai的对话,0为不使用,1为使用
similarity:0.5,//启用腾讯ai后优先使用学习的对话,低于一定相似度再调用腾讯的
cqImagePath:'',//请修改为酷Q的image目录
storagePath:'',... |
import DE from '@dreamirl/dreamengine';
import CONFIG from 'config';
import { GameScreen } from '@dreamirl/de-plugin-gamescreen';
import DreamWorldControler from 'DreamWorldControler';
import Planet from 'Planet';
import Player from 'Player';
import Hud from 'Hud';
import BtnAudio from 'BtnAudio';
var dreamWorld = new... |
'use strict'; // eslint-disable-line
const { EventEmitter } = require('events');
const Logger = require('werelogs').Logger;
const async = require('async');
const BackbeatConsumer = require('../../../lib/BackbeatConsumer');
const NotificationDestination = require('../destination');
const zookeeper = require('../../../... |
/*
Coding Soccer
Copyright (c) 2017 <NAME>
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, co... |
/**
* Copyright (c) 2016 - 2020 Sqreen. All Rights Reserved.
* Please refer to our terms for more information: https://www.sqreen.io/terms.html
*/
'use strict';
const Logger = require('../logger');
const Reader = require('./reader');
const Exception = require('../exception');
const Hoek = require('../../vendor/hoek/... |
"use strict";
exports.__esModule = true;
exports.validateWhitelistOption = exports.validateModulesOption = exports.validateLooseOption = exports.getTargets = exports.getCurrentNodeVersion = exports.isPluginRequired = exports.MODULE_TRANSFORMATIONS = undefined;
exports.default = buildPreset;
var _plugins = require("..... |
const stream = require('stream');
const azure = require('azure-storage');
const appInsights = require('./insights');
appInsights.initialize();
const { Readable } = stream;
const client = appInsights.getClient();
const { QueueMessageEncoder } = azure;
const { sas } = require('../config');
const {
storageAccount,
s... |
//see http://bl.ocks.org/mbostock/4063663
var width = 960,
size = 150,
padding = 19.5;
var x = d3.scale.linear()
.range([padding / 2, size - padding / 2]);
var y = d3.scale.linear()
.range([size - padding / 2, padding / 2]);
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom")
.ticks(5);
var yAxis = ... |
// Correctly decide between ws:// and wss://
var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws";
var ws_path = ws_scheme + '://' + window.location.host + "/ispin_wheel/";
console.log("Connecting to " + ws_path);
const spinSocket = new WebSocket(ws_path);
spinSocket.onmessage ... |
/*
* VARS
*/
$shareinput = $('#share-input');
var imgsToPost = [];
var formData = new FormData();
//share function imgs
function sharePostImgs(formData, event) {
$.ajax({
method: 'POST',
url: "inc/Share/shareimgs.php",
data: formData,
processData: false,
contentType: false... |
import createInitialSequence from "./utils/createInitialSequence";
import getArrayBufferFromFile from "./utils/getArrayBufferFromFile";
async function ab1ToJson(fileObj, options = {}) {
const arrayBuffer = await getArrayBufferFromFile(fileObj);
const dataview = new DataView(arrayBuffer);
const converter = new ab... |
import React from 'react';
import PropTypes from 'prop-types';
import style from './style.css';
import { isArrayEmpty, compareArraySize, conditionalPropType } from '../src/utils/common.utils';
const propTypes = {
items: PropTypes.array.isRequired,
onChangePage: PropTypes.func.isRequired,
initialPage: Pr... |
var express = require('express');
var app = express(); // create our app w/ express
var morgan = require('morgan'); // log requests to the console (express4)
var url = require('url');
var http = require('http');
var stormpath = require('express-stormpath');
var nodemailer = require('nodem... |
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b)... |
const gulp = require("gulp"),
{ spawn } = require('child_process'),
flatten = require("gulp-flatten"),
postcss = require("gulp-postcss"),
cssImport = require("postcss-import"),
cssnext = require("postcss-cssnext"),
cssNested = require("postcss-nested"),
hugoBin = require("hugo-bin"),
browserSync = require("brow... |
Physijs.scripts.worker = '../physijs_worker.js';
Physijs.scripts.ammo = '../ammo.js'
var container,
camera, controls, scene, renderer;
// light_1, light_2;
// var light_rotation_1 = 0,
// light_rotation_2 = 0;
function initScene() {
// console.log( '[START] initScene' );
// container = document.getElement... |
import React from 'react';
import {Link} from 'react-router';
import {NavLink} from '../helpers/NavLink';
import SignInModal from '../SignInModal';
import sticky from 'jquery-sticky';
import jqueryScrollTo from 'jquery.scrollto';
import {Navbar, Nav, NavItem, Button, DropdownButton, ButtonGroup, MenuItem, Modal, Input... |
'use strict';
// Load external library dependencies
const clone = require('lodash.clonedeep');
const { google } = require('googleapis');
const got = require('got');
const OAuth2 = google.auth.OAuth2;
const sinon = require('sinon');
const test = require('ava');
// Load internal library dependencies
process.env.UsersTa... |
/* eslint react/prop-types: 0 */
/*eslint no-unused-vars: 0 */
import React from "react";
import {
Button,
FormControlLabel,
Switch,
TextField,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
InputLabel,
} from "@material-ui/core";
import DataTable from "mui-datatables";
imp... |
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
______ ______ ______ __ __ __ ______
/\ == \ /\ __ \ /\__ _\ /\ \/ / /\ \ /\__ _\
\ \ __< \ \ \/\ \ \/_/\ \/ \ \ _"-. \ \ \ \/_/\ \/
\ \_____\ \ \_____\ \ ... |
/**
* @author xeolabs / https://github.com/xeolabs
*/
import {Map} from "../../utils/Map.js";
import {EmphasisEdgesShaderSource} from "./EmphasisEdgesShaderSource.js";
import {Program} from "../../webgl/Program.js";
import {stats} from '../../stats.js';
const ids = new Map({});
/**
* @private
*/
const EmphasisEd... |
/**
* https://steemit.com/@investigation
*/
var userData = require("./userData.json");
var MINUTES_BETWEEN_NEW_POST_SEARCH = 30;
var VOTING_POWER_PERCENTAGE = 100; // in percentage (%)
/////////////
var MIN_ADVERTISMENT_REPUTATION = 20,
MAX_ADVERTISMENT_REPUTATION = 45;
var MIN_POST_SIZE = 500;
var URL_TO_INT... |
const version = '14.0.0';
var addUrlParam = function (url, key, val) {
url = url.split('#')[0];
var twoPart = url.split('?'),
params = {};
var tmp = twoPart[1] ? twoPart[1].split('&') : [];
for (let i in tmp) {
let a = tmp[i].split('=');
params[a[0]] = a[1];
}
params[key] = val;
url = twoPart[0] + '?';
f... |
var app = require('express')();
var request = require('request').defaults({jar: true}); // We need cookies
var cheerio = require('cheerio');
var _ = require('lodash');
var morgan = require('morgan')
// Replace the following two lines with your username and password
var username = process.env.QUEST_USER // 'questUse... |
#!/usr/bin/env node
var http = require('http');
var fs = require("fs");
var path = require("path");
var querystring = require("querystring");
var images = require("images");
var crypto = require('crypto');
var markdown = require( "markdown-js" );
var formidable = require('formidable');
var PORT = 4001;
var Root = __... |
const M = require('./common.js');
const axios = require('axios');
const kakao = require('node-kakao');
const Kaling = require('./kaling.js');
const consola = require('consola');
const fs = require('fs');
const path = require('path');
const spoon = require('sopia-core');
const uuid = require('uuid');
const sopia = new s... |
#!/usr/bin/env node
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* 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/LICEN... |
//Main JS Code for Conways Game of Life
function validateInput(value) {
document.getElementById("errMessage").innerText = "";
//The input must be a number between 1 and 30
if (isNaN(value)) {
document.getElementById("errMessage").innerText = "Your value is not a valid number...";
return fal... |
function tabNext(tab){
$(tab).click();
$('html, body').animate({ scrollTop: 300 }, 'slow');
}
function removeQual(input) {
input.parent().parent().prev().children('td:last-child').html('<a class="btn btn-danger text-white remove" onclick="removeQual($(this))">Remove</a>')
input.parent().parent().remove(... |
/*
정렬 > 가장 큰 수
https://programmers.co.kr/learn/courses/30/lessons/42746
채점 결과
정확성: 27.3
합계: 27.3 / 100.0
*/
function solution(numbers) {
let strNumbers = numbers
.filter((value, index, self) => {
return self.indexOf(value) === index;
}).reduce((acc, curr) => {
acc.push(cur... |
"use strict";
const convert = require('./convert');
const names = require('./names');
const Color = require('./color');
const HEX_REGEXP = /^[0-9A-F]+$/;
const FUNCTION_REGEXP = /^[a-zA-Z]+\([^\)]*\)$/;
const ARGUMENTS_REGEXP = new Map([
[3, /^\s*((?:[0-9]+\.)?[0-9]+(?:[º%])?)\s*,\s*((?:[0-9]+\.)?[0-9]+(?:[º%])?)\s... |
/***
* Specs Engine v6: Spectacles Saga Game Engine
* Copyright (c) 2018 Power-Command
***/
import { Prim, Scene, Thread } from '../../lib/sphere-runtime.js';
const
BoxColor = Color.Black.fadeTo(0.75),
BorderColor = Color.Black.fadeTo(0.85),
TextColor = Color.Gray,
TextShadowColor = Color.Black;
exp... |
import MQTT from 'mqtt';
import CONFIG from '@/config';
const { WEB_SOCKET_PREFIX } = CONFIG;
const generateMsgId = () => Number(`${parseInt(Math.random() * 11 + 10, 10)}${`${+new Date()}`.substr(5)}`);
class MqttClient {
constructor(config) {
this.client = null;
this.registerReconnectCount = 0;
this.message... |
import htmlParse from 'html-react-parser'
export const apiHost = process.env.REACT_APP_API_HOST ? process.env.REACT_APP_API_HOST : 'http://localhost:5000/'
/*
** validation
*/
export const validateEmail = (email) => {
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
retu... |
import { PriorityQueue } from "./PriorityQueue";
import { removeDeepFromMap } from "./removeDeepFromMap";
class Graph {
constructor(seed) {
this.graph = new Map();
if (seed) {
for (var a in seed) {
for (var b in seed[a]) {
this.connect(a, b, seed[a][b]);
}
}
}
}
... |
/**
* @author <NAME>
*/
var async = require("async");
// Base URL to where we will get images from
var baseUrl = 'http://whackett.hippocreative.com/img/';
// Which methods to call to handle downloads. Just slings for now but could be expaned in the future...
var methods = ["downloadSlings"];
function ImageSync(p... |
/**
*
* Web Starter Kit
* Copyright 2015 Google Inc. 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
*
* https://www.apache.org/licenses/LICEN... |
/*
* Copyright (c) 2017 Cornell 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 o... |
import Base from './base';
import lib from './library';
"use strict"
class Dot extends Base{
#matrix = [[0]];
#coords = {x: 0, y: 0};
#direction = {x: 0, y: 0};
#speed = 1;
#type = 0;
#buffer = {};
_name = 'unnamed';
constructor(arg = {}) {
super();
const props = {
x: this.x,
y: thi... |
import React, { useState, useEffect, useContext } from "react";
import PropTypes from "prop-types";
import { Card, CardContent, CardHeader } from "@material-ui/core";
import { SAVE, BACK, API } from "constants/index";
import { FormInput, Button } from "components";
import useForm from "hooks/useForm.js";
import { Reque... |
//import fs, mkPath
var fs = require('fs');
var mkPath = require('./mkPath.js');
// public function mkSorted(name:string, obj) returns array of string
function mkSorted(name, obj){
//var result:array=[]
var result = [];
//recursive_mkSorted(name,obj,result)
recur... |
import React from 'react'
import styled from 'styled-components'
import { Elements } from '@stripe/react-stripe-js';
import { loadStripe } from '@stripe/stripe-js';
import CheckoutForm from './CheckoutForm';
const stripePromise = loadStripe("pk_test_9KuFtUOrr7GHBdNyoJc1PyAs");
const Div = styled.div`
body {
colo... |
/*********************************************************************/
var prevcol
var asc
var col
var type
var qt = "\""
var gecko = navigator.userAgent.toLowerCase().indexOf("gecko") > -1;
/*********************************************************************/
function create_xls() {
var cnt=0;
table = document... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.