text stringlengths 3.22k 29.5k |
|---|
'use strict';
const fs = require('fs');
const path = require('path');
const fetch = require('node-fetch');
const admin = require('firebase-admin');
const onesky = require('@brainly/onesky-utils');
// OneSky auth
const SKYAPP_PROJECT_ID = '359388';
const SKYAPP_PUBLIC_KEY = 'e0DfHgNmzrc67zt3RabZRWcYpkSISL1W';
const SK... |
import React, { Component } from 'react';
import styled from 'styled-components';
import is from 'styled-is';
const sizeMap = {
normal: {
fontSize: '1em',
padding: '.7em .8em'
},
small: {
fontSize: '.8em',
padding: '.4em .6em'
},
large: {
fontSize: '1.2em',
padding: '.9em 1.1em'
}
}... |
const serverUrl = "https://xf2slglmhlsr.usemoralis.com:2053/server";
const appId = "BJg5V4IlNGGMSohvAX0Oe0kmWLMfvALWdbNlzZFA";
const pinataImage="https://gateway.pinata.cloud/ipfs/QmbFyeWzoTkSdXgtQCkxWFLvq6TBRgqNb5cE6aQHV5mWJz?preview=1";
const dfhAddress="0x29a1093636a87810DF3Cb79FCB8C76cC4d80e00c";
const nftPortKey="... |
const address = window.location;
$(document).ready(function() {
console.log("i am ready");
/**
Hide the Django message after 3 seconds.
*/
document.querySelectorAll("#messages").forEach(function(message) {
setTimeout(function() {
$(message).fadeOut("slow");
}, 3000)
... |
import Scale from '../components/scale'
import compose from '../core/compose'
import Chart from '../components/chart'
import LineWidth from '../components/line-width'
import LineStyle from '../components/line-style'
import Objects from '../components/objects'
import Opacity from '../components/opacity'
import Smoothing... |
const ParserAbstract = require('./../abstract-parser');
const DataPacker = require('./../../lib/data-packer');
/*
### Get more information about a device (experimental)
> year, weight, release, display.size, display.resolution, display.ratio
```js
const InfoDevice = require('node-device-detector/parser/device/info-d... |
import React, { useEffect, useState } from "react";
import Portis from "@portis/web3";
import Web3 from "web3";
import Fortmatic from "fortmatic";
import WalletLink from "walletlink";
import getWeb3 from "./getWeb3";
import "./Navbar.css";
import { Button, Modal, Spinner } from "react-bootstrap";
const TokenTracker = r... |
// +----------------------------------------------------------------------
// | CmsWing [ 网站内容管理框架 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015-2115 http://www.cmswing.com All rights reserved.
// +-------------------------------------------------------------------... |
import React, {Component, useCallback, useEffect, useState} from 'react';
import { ScrollView, Text, View,TouchableHighlight, TouchableOpacity, RefreshControl} from 'react-native';
import {StyleSheet} from 'react-native';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {Card,Icon,Rating,Button} ... |
import React from 'react'
import {
UIManager,
} from 'react-native'
const log = console.log.bind(console) // eslint-disable-line no-console
const merge = (obj1, obj2) => Object.assign({}, obj1, obj2)
const round = num => Math.round(num) || 0
let id = 0
class ReportableNode {
constructor({ parent, isReporter, isCo... |
import moment from 'moment';
import cookie from 'react-cookies';
import Loadable from 'react-loadable';
import { connect } from 'react-redux';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import React, { Component } from 'react';
import map from 'lodash/map';
import isEmpty from 'lod... |
'use strict';
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = ... |
'use strict'
let WH=['6 am','7 am','8 am','9 am','10 am','11 am','12 pm','1 pm','2 pm','3 pm','4 pm','5 pm','6 pm','7 pm'];
let totalColumn = 0;
let totalArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
function Sales(name,min,max,avg){
this.name=name;
this.minCust=min;
this.maxCust=max;
this.avgCookie=av... |
/*
* area.js - Unit conversions for Area
*
* Copyright © 2014-2015, JEDLSoft
*
* 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
*
*... |
const process = require('process')
const hooks = require('hooks');
const AWS = require('aws-sdk');
console.log("Updating AWS config to use endpoint: " + process.env.AWS_DYNAMODB_ENDPOINT)
AWS.config.update({
region: "us-west-2",
endpoint: process.env.AWS_DYNAMODB_ENDPOINT,
accessKeyId: "foo",
secretAcc... |
import { View, DefaultTemplateOptions } from 'framework/views/view';
import { Events } from 'framework/events';
import { Shortcuts } from 'comp/app/shortcuts';
import { KeyHandler } from 'comp/browser/key-handler';
import { Keys } from 'const/keys';
import { AppSettingsModel } from 'models/app-settings-model';
import {... |
'use strict';
var buffer = require('buffer');
var readString = function(buf, startIndex) {
var length = buf.readUInt8(startIndex)
//console.log(length)
var description = buf.slice(startIndex + 1, length + startIndex + 1)
return [description.toString('utf8'), length + startIndex + 1]
}
var readChannelDescriptor ... |
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enu... |
/* eslint-disable no-nested-ternary */
/* eslint-disable indent */
import React, { Component } from "react";
import PropTypes from "prop-types";
import removeMd from "remove-markdown";
import classNames from "classnames";
import config from "config";
import { DownloadIcon } from "components/icons";
import { Link } from... |
import Vue from 'vue';
import VueRouter from 'vue-router';
import http from '@/api';
import store from '@/store';
Vue.use(VueRouter);
// const Home = () => import(/* webpackChunkName: 'Home' */'@/views/Home')
const ProcessManage = () => import(/* webpackChunkName: 'ProcessManage' */'@/views/ProcessManage').catch(()... |
// Functions for the coordinate-transformations in the Mollier hx-diagram
// x has the unit kg/kg and y the unit °C.
// The y-axis is defined by y = (h-r_0*x)/c_pL such that: firstly, the
// coordinate-lines of h (lines of constant enthalpy h) are parallel and
// equally spaced and secondly the y-axis itself c... |
import Skylink, { SkylinkConstants } from '../index';
import {
SERVER_PEER_TYPE, PEER_CONNECTION_STATE, DATA_CHANNEL_STATE, PEER_TYPE,
} from '../constants';
import PeerData from '../peer-data';
import { SkylinkSignalingServer } from '../server-communication/index';
import { peerLeft, serverPeerLeft } from '../skylin... |
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.protot... |
var http = require('http')
var express = require('express')
var server = http.Server(express())
var io = require('socket.io')(server, { cors: true })
var Tools = require('./tools')
var Config = require('./config')
const ChatBot = require('dingtalk-robot-sender')
const robot = new ChatBot(Config.Robot)
const at = {
... |
import { useContext, useState } from "react";
import AppContext from "../appContext/context";
import DatePicker, { registerLocale } from "react-datepicker";
import ptBR from "date-fns/locale/pt-BR";
registerLocale("ptBR", ptBR);
import { format } from "date-fns";
import "react-datepicker/dist/react-datepicker.css";
im... |
import * as JS from './external/YourJS.min';
import { getValueFormat } from './format-values';
const RGX_CELL_PLACEHOLDER = /\$\{(time)(?:-(to|from))?\}|\$\{(?:(value|cell|0|[1-9]\d*)|(col|join-col|var):((?:[^\}:\\]*|\\.)+))(?::(?:(raw)|(escape)|(param)(?::((?:[^\}:\\]*|\\.)+))?))?\}/g;
const RGX_OLD_VAR_WORKAROUND = ... |
/**
* 题库
**/
import React, { PureComponent } from 'react';
import {
FlatList,
TouchableOpacity,
Dimensions,
StyleSheet,
Image,
Text,
View,
Animated,
Easing,
ImageBackground,
Platform
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import Bar fro... |
import React, {createRef, useEffect,useRef , useCallback} from 'react';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import { makeStyles, withStyles } from '@material-ui/styles';
import {TextField, Avatar,IconButton,Input ,InputAdornment ,Hidden } from '@material-ui/core';
import {MyChatItem, OtherChatI... |
/* Author: <NAME> (B00857606) */
import React, { useState, useEffect } from 'react';
import AWS from 'aws-sdk';
import { CssBaseline, Grid, Paper, TextField, Typography, Button, CircularProgress, Card, CardContent } from '@material-ui/core';
import { useLocation, Link } from 'react-router-dom';
import { publishMessage,... |
const { XrplConstants } = require('../xrpl-common');
const { BaseEvernodeClient } = require('./base-evernode-client');
const { EvernodeEvents, EvernodeConstants, MemoFormats, MemoTypes, ErrorCodes } = require('../evernode-common');
const { XrplAccount } = require('../xrpl-account');
const { EncryptionHelper } = require... |
export function Color() {};
export var darker = 0.7;
export var brighter = 1 / darker;
var reHex3 = /^#([0-9a-f]{3})$/,
reHex6 = /^#([0-9a-f]{6})$/,
reRgbInteger = /^rgb\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*\)$/,
reRgbPercent = /^rgb\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
let _ = require('lodash');
let async = require('async');
const pip_services3_commons_node_1 = require("pip-services3-commons-node");
const pip_services3_commons_node_2 = require("pip-services3-commons-node");
const pip_services3_commons_node_3... |
var Test = require('../config/testConfig.js');
var BigNumber = require('bignumber.js');
contract('Flight Surety Tests', async (accounts) => {
var config;
const TEST_ORACLES_COUNT = 20;
const STATUS_CODE_UNKNOWN = 0;
const STATUS_CODE_ON_TIME = 10;
const STATUS_CODE_LATE_AIRLINE = 20;
const STATUS_CODE_LAT... |
"use strict";
const {
LUA_SIGNATURE,
constant_types: {
LUA_TBOOLEAN,
LUA_TLNGSTR,
LUA_TNIL,
LUA_TNUMFLT,
LUA_TNUMINT,
LUA_TSHRSTR
},
thread_status: { LUA_ERRSYNTAX },
is_luastring,
luastring_eq,
to_luastring
} = require('./defs.js');
const ldo... |
import {useState, useMemo, useEffect, useCallback, useContext} from 'react'
import PropTypes from 'prop-types'
import {useRouter} from 'next/router'
import MapGl from 'react-map-gl'
import {fromJS} from 'immutable'
import {Pane, EyeOffIcon, EyeOpenIcon} from 'evergreen-ui'
import MapContext from '@/contexts/map'
impor... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const demolishedEntity_1 = require("./demolishedEntity");
const Graph_1 = require("./Graph");
const TextureCache_1 = require("./TextureCache");
var Demolished;
(function (Demolished) {
class Rendering {
constructor(canvas, parent, ... |
import React, { useEffect, useState, useContext } from "react";
import {WappContext} from "wapplr-react/dist/common/Wapp";
import defaultQuizData from "../../data/quizdata";
import Logo from "../Logo";
import HighScores from "../HighScores";
import QuizStep from "./components/QuizStep";
import HeartIcon from "./comp... |
const fs = require('fs');
const http = require('http')//For jsdoc
const IncomingMessage = http.IncomingMessage
const makeRequest = require('./makeRequest');
const stream = require('stream');
var HttpsProxyAgent = require('https-proxy-agent');
const { Transform } = require('stream')
const util = require('util');
... |
/*
AES_Init: initialize the tables needed at runtime. Call this function
before the (first) key expansion.
*/
function AES_Init() {
AES_Sbox_Inv = new Array(256);
for(var i = 0; i < 256; i++)
AES_Sbox_Inv[AES_Sbox[i]] = i;
AES_ShiftRowTab_Inv = new Array(16);
for(var i = 0; i < 16; i++)
AES_... |
/*
** Variables
*/
let myHero; // stores the element with the Hero
let myPrize; // stores the element with the prize
let myScoreBox; // stores the element with the score box
let myFunctionList; // stores the element with the list of functions
let funList = []; // stores the list... |
export function createAztec(Hexagon, app) {
// createHexagon draws the Hexagon domino
let width = app.resizeTo.offsetWidth;
let height = app.resizeTo.offsetHeight;
// drawing options;
// draw edges
let lineThickness = Hexagon.lineThickness;
if (!Hexagon.draw_edges) {
lineThickness = 0;
}
// draw... |
const icons = {
play: (color) => `
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path d="M6.4 11.6L11.2 8 6.4 4.4v7.2zM8 0C3.584 0 0 3.584 0 8s3.584 8 8 8 8-3.584 8-8-3.584-8-8-8zm0 14.4A6.408 6.408 0 0 1 1.6 8c0-3.528 2.872-6.4 6.4-6.4 3.528 0 6.4 2.872 6.4 6.4 0 3.528-2.872 6.4-6.4 6.4z" fill="${c... |
'use strict'
import Logger from './utils/logger'
// import saveState from './models/saveState'
import sumBy from 'lodash/sumBy'
import find from 'lodash/find'
import Achievements from 'app/achievements'
import ClickStage from 'app/models/stages/clickStage'
import AutoStage from 'app/models/stages/autoStage'
import Even... |
'use strict';
var maxlistProductsToDisplay, numClicksAvailable;
var allProductList=[]; // array with products objects
var listProductsToDisplay=[]; // here I will storage the products to display in the page
var previousListProductsToDisplay=[]; // is a copy of the last listProductsToDisplay, so I dont duplicate in nex... |
'use strict';
// [order] 1: asc, -1: desc, 0/'': origin
function sortBy(list, field, order) {
if (!list || !list.sort || !list.length) return list
var sort = []
if (typeof field === 'string') {
sort.push([field, order === undefined ? 'asc' : String(order)])
} else if (Object.prototype.toString.call(field) ... |
function T1() {
var a = Number.parseInt(document.getElementById('a').value);
var b = Number.parseInt(document.getElementById('b').value);
var resp = 'O MDC é: ' + MDC(a,b);
document.getElementById('T1').innerHTML = resp;
}
function MDC(a,b){
if (b == 0) {
return a}
else {
return... |
// Needs to be at the top but belongs to object-curly-spacing
import { foo } from 'bar'
// Needs to be at the top but belongs to indent rule
import {
foosjdfhalsjkdhflasjdhfajashdlfjahsdlfjashdlfjaksdsadfaso,
barsjdfhalsjkdhflasjdhfajashdlfjahsdlfjashdlfjaksdsadfaso,
bazsjdfhalsjkdhflasjdhfajashdlfjahsdlfjashdlf... |
/**
* Edit On: april 2018
* Class: B3DLoader
* Description: Part extracted from 'itowns-legacy' {@link https://github.com/iTowns/itowns-legacy}
* project VIBES
* author: Adouni, Bouchaour, Grégoire, <NAME>, Schlegel
*/
import * as THREE from 'three';
import BinaryStream from './BinaryStream';
import PlatformInfo... |
#!/usr/bin/env node
const fs = require('fs');
const pg = require('pg');
const { Config } = require('./config');
const { shuffleArray } = require('./util');
const config = new Config();
const log = config.log;
const Client = pg.Client;
// Do not parse timestamp value to the Date, read it as a raw string value
pg.types... |
import axios from 'axios'
import qs from 'qs'
/**
* 基础模块
*/
export const Base = new class {
constructor(){
this.uploadApi = '/api/user/upload'; //上传
this.sendcodeApi = '/api/sms/send';//验证码
this.imgcodeApi = '/api/Captcha/get'; //图形验证码
this.bankApi = '/api/user/getbank... |
let Prompt = require('inquirer').prompt
let Clear = require('clear')
let Path = require('path')
let Chalk = require('chalk')
let Figlet = require('figlet')
let Common = require('../../../lib/common')
let Models = require('../lib/models')
let CONST = require('../../../lib/const')
let Debug = require('../../../lib/debug'... |
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
import {lex} from ".... |
function trace(message)
{
if (typeof console != 'undefined')
{
console.log(message);
}
}
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
var mn = $(".main-nav");
mns = "main-nav-scrolled";
hdr = $('header').heigh... |
// Modified from the base code from CS519 Visualization (Spring 2015).
var x_extent=[-1.0, 1.0];
var y_extent=[-1.0, 1.0];
var dx = 0.0001;
var dy = 0.0001;
var scalar_func = gaussian;
function main() {
// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.B... |
const API = '8b792d8469d79e6095dc88e95785615c'
let lon
let lat
// let weatherData = {current:{temp:''}};
const weatherCard = $('.1')
const weatherEl = $('.weather-container')
const futureWeatherEl = $('.future-weather')
const currentWeatherEl = $('.current-weather')
const weatherLocation = $('.weather-location')
cons... |
export const CHAR_TO_CODE= {
"Backspace":8,
"Tab":9,
"Enter":13,
"Shift":16,
"Ctrl":17,
"Alt":18,
"Pause/Break":19,
"CapsLock":20,
"Esc":27,
"Space":32,
"PageUp":33,
"PageDown":34,
"End":35,
"Home":36,
"Left":37,
"Up":38,
"Right":39,
"Down":40,
... |
import React, { Component } from 'react';
import get from 'lodash/get';
import omit from 'lodash/omit';
import defer from 'lodash/defer';
import findIndex from 'lodash/findIndex';
import findLastIndex from 'lodash/findLastIndex';
import isFunction from 'lodash/isFunction';
import isString from 'lodash/isString';
import... |
const express = require('express');
const router = express.Router();
const { Op } = require('sequelize');
const { auth } = require('../../../../middleware/auth.middleware');
const {
validateId,
validate,
validateValuesArray,
validateOptionalId,
} = require('../../../../middleware/validation.middleware');
const... |
const express = require('express');
const authRequired = require('../middleware/authRequired');
const Child = require('./childModel');
const dsModel = require('../dsService/dsModel.js');
const router = express.Router();
const jwt = require('jsonwebtoken');
const upload = require('../middleware/multer');
const multiUplo... |
// Array
var ourArray = ["banana" , "apple" , "melon"];
var ourFruit = ourArray[1]; // our fruit equals to apple
var carList = ["audi" , "volvo" , "nissan"];
var ourCar = carList[0]; // our car equals to audi
/* console.log(ourCar);
console.log(ourFruit); */
// change value out of attribute
ourArray[1]... |
//functions for actions that require more than one char, such as combat and range
function awareOfCheck(tP){
let tempArr = [];
let tp_sight = tP.sightRange + tP.sightRangeB;
let tp_fight = tP.fightRange + tP.fightRangeB;
players.forEach(function(oP,index){
if(oP.name != tP.name){
let dist = hypD(oP.x - tP.x... |
AOS.init();
$('#arrow').click(function(){
$(document).scrollTop(850) // Scroll to section on arrow click
});
let fill = document.getElementById("gauge-fill");
// Beeping audio
let warning = document.getElementById('warning');
warning.volume = 0.05;
warning.playbackRate = 0.5;
warning.loop = true;
function scroll (... |
"use strict";
const {core,utils} = require("@ckb-lumos/base");
const {ckbHash} = utils;
const {secp256k1Blake160Multisig, secp256k1Blake160} = require("@ckb-lumos/common-scripts");
const {initializeConfig} = require("@ckb-lumos/config-manager");
const {addressToScript, TransactionSkeleton, locateCellDep, sealTra... |
/** @jsx jsx */
import React, { Component, Fragment } from 'react'
import { jsx, Styled } from 'theme-ui'
import { FormattedMessage } from 'react-intl'
import Modal from 'react-modal'
import { graphql, useStaticQuery } from 'gatsby'
import styled from 'styled-components'
import Img from 'gatsby-image'
import PropTypes ... |
import * as Helper from "../Helper"
import React, { Component } from 'react';
import dataSourceStore from "../stores/DataSourceStore";
import {ActionKeyPathUi} from "../Shared/ActionKeyPathUi";
import Radio from '@material-ui/core/Radio';
import RadioGroup from '@material-ui/core/RadioGroup';
import FormControlLabel f... |
function loadPage() {
getAllUsers();
if (!data.admin && data.title != "Project Lead") {
window.location.replace('profile.html')
}
}
var done = false;
var populate = document.getElementById("zoe");
//reads all users from firestore
function getAllUsers() {
if (data.admin) {
db.collectio... |
import React, { useEffect, useState, useRef } from 'react';
import PropTypes from 'prop-types';
import * as R from 'ramda';
import moment from 'moment';
import { Link, navigate } from 'gatsby';
import html2canvas from 'html2canvas';
import { connect } from 'react-redux';
import Layout from '../components/layout'... |
/*
Copyright 2017 Vector Creations 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 writing, sof... |
/**
* Created by joel on 5/16/16.
*/
"use strict";
const tabs = {};
const nodeWidth = 256;
const nodeHeight = 172;
const imageSize = 64;
class Tab {
constructor(tab) {
tabs[tab.id] = this;
this.currentId = this.i = 0;
this.nodes = {};
this.selecting = false;
this.rootNo... |
// Hook in to constellation UI
var API = Package["constellation:console"].API;
var Constellation = Package["constellation:console"].Constellation;
API.addTab({
name: 'Schema',
menuContentTemplate: 'Constellation_schema_menu',
mainContentTemplate: 'Constellation_schema_main',
guideContentTemplate: 'Constel... |
"use strict";
const async = require("async");
const crypto = require("crypto");
const fs = require("fs-extra");
const { entries, isUndefined, omitBy, sortBy } = require("lodash");
const path = require("path");
const Bucket = require("../models/bucket");
const S3Object = require("../models/s3-object");
const utils = r... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var store_1 = require("../../store");
var path_1 = require("../../dataBase/store/path");
var fs = require("fs-extra");
var moment = require("moment");
var uuidv4 = require("uuid/v4");
var low = require("lowdb");
var FileAsync = require("lowdb/... |
const { RDSDataClient, ExecuteStatementCommand } = require("@aws-sdk/client-rds-data");
const { Client } = require("pg");
const jwt = require("jsonwebtoken");
const REGION = process.env.REGION;
const formatError = (err) => {
return typeof err === "object" ? JSON.stringify(err) : err;
};
//TODO better error handlin... |
import './cover.html'
import UnsplashSearch from 'unsplash-search';
//set unsplash constants for cover
const accessKey = 'a40bf3876f230abedda23394e4df9111ec3699037213fc002140e3a80693df13';
const provider = new UnsplashSearch(accessKey);
const defaultURL = 'https://images.unsplash.com/photo-1454166155302-ef4863c27e70?ix... |
"use strict";
// Custom error class with slug and HTTP response code stored
// Should correspond exactly to the errors we show in the errors field in API responses
function APIError(slug, responseCode, message) {
// capture stack trace
Error.call(this);
Error.captureStackTrace(this, this.constructor);
... |
import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import { Dropdown, Menu, Modal, Icon, Button, Input } from 'antd';
import PropTypes from 'prop-types';
import injectSheet from 'react-jss';
import { Link } from 'react-router-dom';
// API
import { suggestDeleteCollection, suggestMerg... |
/*
* @Author: <NAME>, NNG Experiments.
* @Version 1
* @XPath Finder/Genearator
* @Started 25 AUG 2017
* @Modified 08 Nov 2017 [Prototype-1 Ready October-2017][Prototype-2 Ready 08-November-2017]
* @license : MIT License 2017
* Use of this source code is open
**/
//==============================================... |
// @flow
import React, { useState, useEffect } from "react";
import cloneDeep from "lodash/cloneDeep";
import {
createMuiTheme,
ThemeProvider,
StylesProvider,
createGenerateClassName
} from "@material-ui/core/styles";
import Button from "@material-ui/core/Button";
import Dialog from "@material-ui/core/Dialog";... |
#!/usr/bin/env node
/*
* Pulley: Easy Github Pull Request Lander
* Copyright 2011 <NAME>
* MIT Licensed
*/
var // Application requirements
child = require( "child_process" ),
http = require( "https" ),
fs = require( "fs" ),
// Process references
exec = child.exec,
spawn = child.spawn,
// Process arguments... |
/* eslint-disable react-native/no-inline-styles */
/* eslint-disable prettier/prettier */
/* eslint-disable no-alert */
import React, { useState } from 'react';
import {
StyleSheet,
View,
Text,
TouchableOpacity,
ToastAndroid,
FlatList,
Image,
SafeAreaView,
} from 'react-na... |
import React, {useContext, useEffect, useState} from "react";
import {useDispatch, useSelector} from "react-redux";
import * as moment from "moment";
import i18n from "../../Translation/i18n";
import {UserContext} from "../Authentification/UserContext";
import {getUser, getHistorique} from "../../Actions/UserAction";
i... |
const _ = require("lodash");
const { getAWSSDK } = require("../lib/aws");
const { getQueueUrl } = require("../lib/sqs");
const { getTopicArn } = require("../lib/sns");
const { Command, flags } = require("@oclif/command");
const { checkVersion } = require("../lib/version-check");
const { track } = require("../lib/analyt... |
import { Server } from "https://js.sabae.cc/Server.js";
import fs from './node_fs.mjs'
import util from './util.mjs'
const PORT = parseInt(Deno.env.get('PORT')) || 8006
const encodeIP = function (ip) {
return ip.replace(/\.|:/g, '_')
}
const log = function (remoteAddr, name, json) {
//json.ip = getEncodedIP(req)
... |
/*
I found this at: https://gist.github.com/Snack-X/2547242e16bca29a0b00
But I guess the original is from Google: https://github.com/google/closure-library/blob/master/closure/goog/math/long.js
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
Additional versions found:
https://www.npmjs.com/p... |
'use strict'
// external deps
var ObjectId = require("mongodb").ObjectId;
var BaseManager = require("module-toolkit").BaseManager;
var moment = require("moment");
// internal deps
require("mongodb-toolkit");
var FPShipmentDocumentManager = require("../../managers/inventory/finishing-printing/fp-shipment-document-m... |
import React, {PropTypes} from 'react';
import {BootstrapTable, TableHeaderColumn} from 'components/ReactTable';
import moment from 'moment';
import {
Row,
Grid,
Col,
ButtonGroup,
ButtonToolbar,
Button,
InputGroup,
FormControl,
DropdownButton,
MenuItem,
Label,
AvatarImage... |
import React from 'react';
var AppStore = require('../../stores/app-store');
var AppActions = require('../../actions/app-actions');
var Pending = require('./pendingdeployments.js');
var Progress = require('./inprogressdeployments.js');
var Past = require('./pastdeployments.js');
var Report = require('./report.js');
va... |
/**
* @fileoverview functions for scanning an AST for globals including
* traversing referenced scripts.
* 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... |
let vscode = require('vscode');
class Resolver {
importClass() {
let activeEditor = this.activeEditor();
let resolving = this.resolving(activeEditor);
if (resolving === null) {
return this.showMessage(`$(issue-opened) No class is selected.`, true);
}
this.find... |
import { ProxyMessageCenter } from './proxy'
import { SelfClass } from '../observable'
import { Tool } from '../include'
import _ from 'lodash'
const logCord = '[SDK.Proxy.Client.Websocket.Node]'
const __key = 'proxy-client-websocket-node'
const __msgPrefix = __key + '-' + _.now() + _.uniqueId('id') + '-'
const TypeM... |
var test = require('tape')
var Mingo = require('../mingo')
var samples = require('./samples')
function ObjectId (id) {
this.id = id
}
var objectId = new ObjectId(100)
var obj = samples.person
obj['_id'] = objectId
obj['today'] = new Date()
test('Comparison, Evaluation, and Element Operators', function (t) {
t.p... |
"use strict";
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
timestamps = require('mongoose-timestamp');
var DataTable = require('mongoose-datatable');
DataTable.configure({
verbose: false,
debug: false
});
mongoose.plugin(DataTable.init);
var Dict = IN... |
function ___$insertStyle(css) {
if (!css) {
return;
}
if (typeof window === 'undefined') {
return;
}
var style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.innerHTML = css;
document.head.appendChild(style);
return css;
}
import React, { useRef, useState, ... |
import React, {Fragment} from 'react';
import { getUnixTime } from 'date-fns'
import './Snipper.scss';
import Cropper from "./Cropper";
const {
remote,
} = require('electron');
const {screen, desktopCapturer, ipcRenderer, shell } = remote;
const BrowserWindow = remote.BrowserWindow;
const dev = process.env.NODE_E... |
/*
Copyright (c) 2012, <NAME>, <NAME>
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, merge, publish, distr... |
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
import axios from 'axios';
import PropTypes from 'prop-types';
import Datetime from 'react-datetime';
class Register extends Component{
constructor(props) {
super(props);
this.state = {
meals: {},
date_from: undefined... |
import React, { Component } from "react";
import {
Grid,
Row,
Col,
Tabs,
Tab,
Glyphicon,
Button,
ButtonToolbar,
ButtonGroup,
Table,
DropdownButton,
MenuItem,
Well
} from "react-bootstrap";
import client from "../config/graphqlConfig";
import {
QUERY_ADD_STAR,
QUERY_REMOVE_STAR,
QUERY_WAT... |
/* index.js
all code specific to the index page, such as DOM manipulations and event handlers. */
var couponInput;
var searchBox;
function showAlertMessage(message) {
/* Show an alert message on the page using bootstrap
{param} message - string - Message to display
{return} None */
var aler... |
'use strict';
var fs = require('fs');
var path = require('path');
var channelCriteria = require('../input/channel-criteria');
var geoCriteria = require('../input/geo-criteria');
/**
* A mapping of what we call the position of an ad unit to how it is actually
* named in our DFP inventory.
* @type {Object}
*/
var ... |
import "./App.css";
import Home from "./pages/Home";
import Map from "./pages/Map";
import Stats from "./pages/Stats";
import Feed from "./pages/NewsFeed";
import Register from "./pages/Register";
import Login from "./pages/Login";
import Profile from "./pages/Profile";
import ReportsFeed from "./pages/ReportsFeed";
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.