text stringlengths 3.07k 16k |
|---|
// Copyright 2015 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.
import 'chrome://resources/cr_elements/icons.m.js';
import './icons.js';
import './viewer-zoom-button.js';
import {assert} from 'chrome://resources/js/as... |
const {transformSync} = require('@babel/core');
const {btoa} = require('base64');
const {
lstatSync,
mkdirSync,
readdirSync,
readFileSync,
writeFileSync,
} = require('fs');
const {emptyDirSync} = require('fs-extra');
const {resolve} = require('path');
const rollup = require('rollup');
const babel = require('r... |
const { Mal } = require('node-myanimelist');
const Promise = require('bluebird');
const youtubeDownload = require('ytdl-core-discord');
const youtubeSearchApi = require('simple-youtube-api');
const similarity = require('string-similarity');
class GameManager {
constructor(options = {}) {
this.voiceChannel ... |
'use strict'
// 3rd
const assert = require('better-assert')
const knex = require('knex')({ client: 'pg' })
const debug = require('debug')('app:db:hits')
// 1st
const { pool } = require('./util')
const { sql } = require('pg-extra')
const { isValidUuid } = require('../belt')
/////////////////////////////////////////////... |
import { Controller } from "stimulus"
import { mapProvinceSum2MapData } from "../echart-helper";
let contractProviceAreaChinaChart;
export default class extends Controller {
connect() {
contractProviceAreaChinaChart = echarts.init(document.getElementById('contract-provice-area-china-chart'));
const provi... |
function _type(x) {
if (x === null) {
return null;
} else if (_is_number(x)) {
return 'number';
} else if (_is_string(x)) {
return 'string';
} else if (x === true || x === false) {
return 'boolean';
} else if (_is_list(x)) {
return 'list';
} else if (_is_pair(x)) {
return 'pair';
} else if (_is_array... |
'use strict';
let time = ['6:00am', '7:00am', '8:00am', '9:00am', '10:00am', '11:00am', '12:00pm', '1:00pm', '2:00pm', '3:00pm', '4:00pm', '5:00pm', '6:00pm', '7:00pm']
let branshs = [];
function Salamon(location, Min_Cust, Max_Cust, Avg_Cookies) {
this.location = location;
this.Min_Cust = Min_Cust;
... |
'use strict';
console.log('projects controller')
var gProjecId;
renderProjects()
renderModal()
//pagination()
function renderModal() {
$('#portfolioModal').on('show.bs.modal', function (e) {
//console.log('show modal =' ,e)
//console.log('show modal id =', e.relatedTarget.dataset.id ... |
#!/usr/bin/env node
/* eslint-disable import/no-dynamic-require, no-console */
const childProcess = require('child_process');
const fs = require('fs');
const path = require('path');
const { isFunction, mapValues, merge } = require('lodash');
const { program } = require('commander');
const rimraf = require('rimraf');... |
var portNumber = 25000;
var serverName = '192.168.8.201/';
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var request = require('request');
var url = require('url');
var user_key = "b7b54ece20fead34c8c9156027a1cfb2";
var host = "https://developers.zomato.com/api/v2.1";
v... |
const del = require('del');
const path = require('path');
const gulp = require('gulp');
const runSequence = require('run-sequence');
const plugins = require('gulp-load-plugins')({
lazy: true
});
const config = {
appName: 'mysoundboard'
};
const browserSync = require('browser-sync').create(config.appName);
gulp.t... |
'use strict';
const Promise = require('bluebird');
const neeoapi = require('neeo-sdk');
const debug = require('debug')('neeo-driver-spotify:dir_device');
const config = require('../Config');
const api = require('../SpotifyAPI');
const dotProp = require('dot-prop');
function getItems(items, key) {
let a_out = [];
le... |
var stdRSACertificate = {
name: "RSASSA-PKCS1-v1_5",
modulusLength: 2048,
publicExponent: new Uint8Array([1, 0, 1]),
hash: "SHA-256"
};
String.prototype.hashCode = function(hex=false) {
let hash = 0;
for (let i = 0; i < this.length; i++) {
//hash = 31*hash + this.charCodeAt(i);
hash = Math.imul(3... |
var menusound = new buzz.sound("./sounds/menu.wav", {
loop: true
});
var buttonpressed = new buzz.sound("./sounds/button.wav", {
});
var shooting = new buzz.sound("./sounds/shoot.wav", {
});
var destroy = new buzz.sound("./sounds/collide.wav", {
});
var game = (function() {
function GameSingleton() {
... |
/* jshint node:true */
var _ = require('lodash');
module.exports = search;
function search(options, callback) {
return new search.Search(options, callback);
}
search.Search = function(options, callback) {
var apos = options.apos;
var app = options.app;
var self = this;
self._apos = apos;
self._app = app;... |
const lastIndex = 3;
const timeIntervalInMs = 1000 * 5;
var timeToNextPageInMs = timeIntervalInMs,
countdownTimer,
countdownDiv,
previousPageBtn,
pauseBtn,
restartBtn,
isPaused;
isPaused = false;
createCountDownElement();
createPreviousPageElement();
createPauseElement();
createRestartEle... |
console.log("digi-utils> grade_average.js loaded");
// https://stackoverflow.com/questions/7193238/wait-until-a-condition-is-true
// test: function that returns a value
// expectedValue: the value of the test function we are waiting for
// msec: delay between the calls to test
// callback: function to execute when the... |
import React from 'react';
import {Form, Input, Button, Modal, Spin, Select} from 'antd';
import {FunctionRequest} from "./FunctionRequest";
import Api from "../../api/api";
import Message from "../../core/message";
export class FunctionReactBoxFormAntd extends FunctionRequest {
constructor(props) {
super(... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { AutoComplete, IconButton, Paper } from 'material-ui';
import { ClientStyle as Style } from 'react-css-component';
import SearchIcon from 'material-ui/svg-icons/action/search';
import CloseIcon from 'material-ui/svg-icons/navigation/c... |
import React from "react"
import armoire_1 from "../images/meubles-sur-mesure/armoire/1.png"
import armoire_2 from "../images/meubles-sur-mesure/armoire/2.png"
import armoire_3 from "../images/meubles-sur-mesure/armoire/3.png"
import armoire_4 from "../images/meubles-sur-mesure/armoire/4.png"
import armoire_5 from "..... |
var redis = require('redis');
var extras = require('./extras');
var RedisEvent = require('./RedisEvent');
var shortId = require('shortid');
/**
* Node.js scheduling system powered by Redis Keyspace Notifications
* @param options {Object}
* @constructor
*/
var Redular = function(options){
var _this = this;
thi... |
import React, { useContext, useState, useEffect } from 'react';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import makeStyles from '@material-ui/core/styles/makeStyles';
import Typography from '@material-ui/core/Typography';
import CardActions from '@material-ui/c... |
/**
* Created by ld on 10/6/15.
*/
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var clean = require('gulp-clean');
var rsync = require('gulp-rsync');
var gulpSequence = require('gulp-sequence');
var async = require('async');
var _ = require('lodash');
var spawn = require('child_process').spa... |
// Global variables for selectors to be used throughout the code
var landingPage = document.getElementById("landing-page");
var quizPage = document.getElementById("quiz");
var startGameButton = document.getElementById("start-game-button");
var countdown = document.getElementById("timer");
var question = document.getEle... |
import React from 'react';
import axios from 'axios';
import {
FlatList,
Image,
View,
TouchableOpacity,
ImageBackground,
Dimensions,
StyleSheet,
ScrollView
} from 'react-native';
import {
RkText, RkButton,
RkCard, RkStyleSheet, RkTabView
} from 'react-native-ui-kitten';
import {SocialBar} from '../.... |
import React, { useState, useEffect } from "react"
import { useQuery, useMutation, useSubscription } from "@apollo/client"
import ReactMapGL, { NavigationControl, Popup } from "react-map-gl"
import Button from "@material-ui/core/Button"
import { withStyles } from "@material-ui/core/styles"
import Typography from "@mate... |
import test from 'ava';
import {headUtil} from '../../lib/utils';
const newHead = {
head: {
title: 'It was a Pleasure',
meta: [
{ name: 'application-name', content: 'Name of my application' },
{ name: 'description', content: 'A description of the page', id: 'desc' },
... |
/**
* notifDigest template
* renders notification digest emails
* @author adrienjoly, whyd
**/
var config = require('../models/config.js');
var templateLoader = require('../templates/templateLoader.js');
var snip = require('../snip.js');
// LOAD TEMPLATES
var digestTemplate = templateLoader.loadTemplate('app/ema... |
// This function is used to determine whether or not a resource should be tagged as copy-only. See the resourceTags
// property below for more information.
function copyOnly(mid) {
return mid in {
// There are no modules right now that are copy-only. If you have some, though, just add
// them here l... |
import { useState } from 'react';
import { getGithubPreviewProps, parseJson } from 'next-tinacms-github';
import { useGithubJsonForm } from 'react-tinacms-github';
import Router from 'next/router';
import SingleLayout from '../layouts/SingleLayout.js';
import GuideList from '../components/GuideList';
import ArticlesLis... |
/*
need to install npm package csv-parse (not listed in package json)
Take the spreadsheet andrea has and export as csv files - one file for parts, one file for connectors
Ensure that the header rows match those below. After importing, verify that the sample project loads without problem, and ideally that all cons... |
import React, { Component } from 'react';
import MainModal from '../delivery/MainModal';
class AsideCatalog extends Component {
constructor(props) {
super(props);
this.state = {
products: JSON.parse(localStorage.getItem('products')) || [],
isLoaded: false,
items: this.props.dataFromParent.... |
function onload () {
$.ajax ({
url: '../data/client.csv',
dataType: 'text',
}).done (
function (response) {
var rows_data = response.split (/\r?\n|\r/);
var grid = '<table>';
for (var each_r = 0; each_r < 11; each_r++) {
if (each_r === 0) {
grid += '<thead>';
... |
const OneBtc = artifacts.require("OneBtc");
const RelayMock = artifacts.require("RelayMock");
const { expectRevert } = require("@openzeppelin/test-helpers");
const bitcoin = require('bitcoinjs-lib');
const { issueTxMock } = require('./mock/btcTxMock');
const bn=b=>BigInt(`0x${b.toString('hex')}`);
web3.extend({
p... |
// translate setup.yaml to devices.xml
// note: we use 'yaml' and 'xml' for the strings,
// 'yamltree' and 'xmltree' for the corresponding js structures.
import fs from 'fs' // node lib filesys
import libyaml from 'js-yaml' // https://github.com/nodeca/js-yaml
import libxml from 'xml-js' // https://github.com/nashwaa... |
function moveToLocation(lat, lng, map){
console.log("This is called!");
center = new google.maps.LatLng(lat, lng);
map.panTo(center);
map.setZoom(6);
return map;
}
var west = 1;
var midwest = 1;
var south = 1;
var northeast = 1;
function statePass(state, map){
console.log(map);
switch(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.