text stringlengths 3.07k 16k |
|---|
import _ from 'underscore';
const SHIFTNUMS = {
'`': '~',
'1': '!',
'2': '@',
'3': '#',
'4': '$',
'5': '%',
'6': '^',
'7': '&',
'8': '*',
'9': '(',
'0': ')',
'-': '_',
'=': '+',
';': ':',
"'": '"',
',': '<',
'.': '>',
'/': '?',
'\\': '|'
};
const SPECIALKEYS = {
esc: 27,
esc... |
const util = require('util');
const sketch = require('sketch/dom');
const { Document, Slice, Rectangle, ShapePath } = require('sketch/dom');
module.exports.isGroup = function(layer) {
const types = ['Group', 'Artboard', 'SymbolMaster'];
return types.includes(layer.type);
}
module.exports.isShape = function(la... |
//CONFIG===============================================
// Uses the slack button feature to offer a real time bot to multiple teams
var Botkit = require('botkit');
var mongoUri = process.env.MONGODB_URI || 'mongodb://localhost/sentiment-analysis';
var botkit_mongo_storage = require('../../config/botkit_mongo_storage')... |
/**
* Tencent is pleased to support the open source community by making Tars available.
*
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a c... |
const opentracing = require('opentracing')
const CallableInstance = require('callable-instance')
const EventEmitter = require('eventemitter3')
const genUuid = require('../utils/genUuid')
const parseEvent = require('../utils/parseEvent')
const getStackLine = require('../utils/getStackLine')
const throwAsException = requ... |
'use strict';
// console.log("proof of life");
// global variables
var picOne = document.getElementById("pic1");
var picTwo = document.getElementById("pic2");
var picThree = document.getElementById("pic3");
var picArray = [];
var picvote = document.getElementById('picVote');
var voteRounds = 25;
var pictureC... |
var TWO_WEEKS = 1000 * 60 * 60 * 24 * 14; // in milliseconds
var async = require('async'),
Boom = require('boom'),
browse = require('../../services/registry/methods/getBrowseData'),
Hapi = require('hapi'),
parseLanguageHeader = require('accept-language-parser').parse,
fmt = require('util').format,
... |
/**
* Copyright IBM Corp. 2016, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* Code generated by @carbon/icon-build-helpers. DO NOT EDIT.
*/
'use strict';
var iconPropTypes = require('./iconPropTypes-b9203099.js');
va... |
'use strict';
/**
* Creating the Lambda function that will later be used to deploy API
* Gateway instances via CloudFormation
*/
const AWS = require('aws-sdk');
const chalk = require('chalk');
const Promise = require('bluebird');
const Configstore = require('configstore');
const path = require('path');
const dot... |
import React from 'react';
import Button from '@material-ui/core/Button';
import CssBaseline from '@material-ui/core/CssBaseline';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Switch from '@material-ui/core/Switch';
import { withStyles } from '@material-ui/core/styles';
import Container fro... |
var http = require('http');
var formidable = require('formidable');
var fs = require('fs');
// Imports the Google Cloud client library
const vision = require('@google-cloud/vision');
// Creates a client
const client = new vision.ImageAnnotatorClient();
http.createServer(function (req, res) {
if (req.url == '/visio... |
import React, { Component, PropTypes } from 'react';
import moment from 'moment'
import { connect } from 'react-redux';
import { Link } from 'react-router'
import Checkbox from '../../components/commons/Checkbox'
import * as Const from '../../constants/Constants';
import ReactPaginate from 'react-paginate';
import { fe... |
// Look at my detail blog post at - https://rohan-paul.github.io/javascript/2018/04/29/2-sum/
/*https://leetcode.com/problems/two-sum/description/
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution,... |
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
// import readline from "readline"
const googleapis_1 = req... |
import React, { PureComponent } from 'react';
import { connect } from 'react-redux';
import { View, Alert, findNodeHandle } from 'react-native';
import { NavigationActions } from 'react-navigation';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import * as _ from 'lodash';
import H... |
/*
* @Author: limin
* @Date: 2018-08-15 15:34:10
* @Last Modified by: limin
* @Last Modified time: 2018-08-16 23:48:07
*/
var _this = null
var mouseX = 0
var mouseY = 0
window.requestAnimFrame = (function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
win... |
const CalendarEvents = require(basedir+'/modules/CalendarEvents')
class Appointments extends CalendarEvents {
constructor(data){
super(data)
this.statuses = [
{text:'None', value:'appointment-none'},
{text:'Unconfirmed', value:'appointment-unc... |
/*jshint node:true, laxcomma:true */
/*
* Flush stats to Splunk HEC (http://dev.splunk.com/view/event-collector/SP-CAAAE6M)
*
* backends: ["splunk-statsd-backend"]
* splunk:
* splunkHost: '127.0.0.1', // the hostname of the Splunk Collector you wish to send metrics (default: 127.0.0.1)
* splunkPort: 8088... |
var Twit = require('twit');
var pubsub = require('@google-cloud/pubsub')();
var storage = require('@google-cloud/storage')();
var cmudict;
exports.fetch = function(req, res) {
var topic = pubsub.topic('tweets');
var bucket = storage.bucket('longest-poem-in-the-world.appspot.com');
bucket.file('twitter.json').dow... |
import getConfig, {info, iviewConfig} from './config';
import mergeProps from '@caxa-form/utils/lib/mergeprops';
import is, {hasProperty} from '@caxa-form/utils/lib/type';
import extend from '@caxa-form/utils/lib/extend';
function tidy(props, name) {
if (!hasProperty(props, name)) return;
if (is.String(props[n... |
/* Helper function for pushing bulk events to the API. */
function bulkAddEvents(events) {
fetch(`http://${restServer}/tracers/events/bulk`, {
headers: {
Hoot: "!",
"Content-Type": "application/json; charset=UTF-8"
},
method: "POST",
body: JSON.stringify(events)
}).catch(err =>
setTi... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = Timeline;
var _react = _interopRequireWildcard(require("react"));
var _T = _interopRequireDefault(require("./T.js"));
require("./index.css");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj... |
import {utc} from 'moment';
import * as bodyParser from 'body-parser';
import * as compression from 'compression';
import * as http from 'http';
import * as express from 'express';
import * as session from 'express-session';
import * as connectRedis from 'connect-redis';
import * as Sentry from '@sentry/node';
import {... |
/**
* Tencent is pleased to support the open source community by making WePY available.
* Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the Lic... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototy... |
// Task Detail Page
import React, { useState } from "react";
import { useParams, Link, useNavigate } from "react-router-dom";
import { useMutation, useQuery } from "@apollo/client";
import { QUERY_PROJECT, QUERY_TASK, QUERY_ME } from "../../utils/queries";
import { DELETE_TASK, UPDATE_TASK } from "../../utils/mutation... |
"use strict";
var sharedb = require("sharedb/lib/client");
var Cookies = require("js-cookie");
function generateRandomUID() {
return new Array(64)
.fill(0)
.map(x =>
String.fromCharCode(
"A".charCodeAt(0) + Math.floor(Math.random() * 26)
)
)
... |
import React, { useContext, useState, useEffect, useRef } from 'react';
import { Table, Input, Button, Popconfirm, Form, Space,Image,Typography,InputNumber} from 'antd';
import Highlighter from 'react-highlight-words';
import { SearchOutlined } from '@ant-design/icons';
import "../../css/AdminPage.css";
import {getBook... |
'use strict'
/*!
* Popup
*/
const whatLink = document.querySelector('#what')
const whatPopup = document.querySelector('#what-popup')
const whatClose = document.querySelector('#what-close')
whatLink.addEventListener('click', function (event) {
event.preventDefault()
whatPopup.dataset.visible = 'true'
})
whatCl... |
/**
* @file The main server file.
*
* @copyright noCopyright 2021-present, ChatCord, Inc.
*
* @license This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
*
* @author CodeWithArif
*/
"use strict";
const express = require('express');
const a... |
import React from 'react';
import { PropTypes } from 'prop-types';
import { Button, Modal, Form } from 'react-bootstrap';
import _ from 'lodash';
import axios from 'axios';
import InfoTooltip from '../../util/InfoTooltip';
import reportError from '../../util/ReportError';
class Jurisdiction extends React.Component {
... |
import React, { useState, useEffect } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import {
ChevronDown,
Trash,
Search
} from 'react-feather'
import DataTable from 'react-data-table-component'
import {
Card,
CardHeader,
CardTitle,
Input,
Badge
} from 'reactstrap'
import "flatpickr... |
/*
* Websocket controller and connection notifier
*/
const main = require('./main'),
{_, common, config, connSM, state, SockJS} = main,
lang = main.lang.sync;
let socket, attempts, attemptTimer;
function send(msg) {
// need deferral or reporting on these lost messages...
if (connSM.state != 'synced' && connSM.... |
/*
The MIT License (MIT)
Copyright (c) 2017 Microsoft Corporation
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... |
'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]; } } }... |
// Ajax Call ########################################################################
/**
* The name of the class
* @const
* @type {String}
* @private
*/
var _AJAX_CALL = 'AjaxCall',
/**
* Available classifications for a call to reside in.
* Gives flexibility to a call to be in a classification
* tha... |
import React, { Component } from "react"
import API from "../utils/API";
import SuccessAlert from "../components/SuccessAlert";
import "./PantryCard.css";
import DeleteSuccess from "../components/DeleteSuccess";
import todayDate from "../lib/todayDate";
class PantryCard extends Component {
state = {
foodPa... |
/*
* refactor from: grunt-mootools-packager
* to be used as a library for Grunt specs and compiler for source codes
*
* https://github.com/ibolmo/grunt-mootools-packager
*
* Copyright (c) 2014 <NAME>
* Licensed under the MIT license.
*/
'use strict';
var fs = require('fs');
var YAML = require('js-yaml');
var... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestRunner = void 0;
const createSessionGroups_1 = require("./createSessionGroups");
const getTestCoverage_1 = require("../coverage/getTestCoverage");
const TestScheduler_1 = require("./TestScheduler");
const TestSessionManager_1 = req... |
const inquirer = require('inquirer');
const mysql = require('mysql');
const fs = require('fs');
const { allowedNodeEnvironmentFlags } = require('process');
const table = require('console.table');
// ---------------------------------------------
var connection = mysql.createConnection({
host: 'localhost',
port:... |
import React , {Component} from 'react';
import axios from 'axios';
import {withRouter} from 'react-router-dom';
import { ClipLoader } from 'react-spinners';
import * as actions from '../../store/actions/index';
import Alert from 'react-s-alert';
import { connect } from 'react-redux';
import { Link } from 'react-router... |
import test from "ava";
import { World } from "../../src/World";
import { System } from "../../src/System";
import { Component } from "../../src/Component";
import {
createType,
copyCopyable,
cloneClonable,
Types,
} from "../../src/Types";
import { Vector3 } from "../helpers/customtypes";
import {loggerSetup, s... |
var config = global.appconfig;
var logger = require('../../logger');
var http = require('http');
var restify = require('restify');
var COAP_RESULT_SUCCESS = 0;
var COAP_ERROR_INVALID_REQUEST = 1;
var COAP_ERROR_INVALID_REQUEST_FUNC = 2;
var COAP_SERVER_ERROR = 3;
function http_send(action, payload) {
var url = c... |
var familyMembers = [{
mother: '<NAME>',
father: '<NAME>',
children: ['<NAME>']
}, {
mother: '<NAME>',
father: '<NAME>',
children: ['<NAME>',
'<NAME>']
}, {
mother: '<NAME>',
father: 'xxx',
children: ['<NAME>']
}];
var stage = new Kinetic.Stage({
container: 'kinetic-con... |
const {exec} = require("child_process");
const path = require('path');
const util = require('util');
/*
To-do: June 2, 2021
- Refine regex on function grepper.
Current issue: Partial names return results. It should be complete names.
(I think this is fixed. Needs further testing.)
- Proper sort of date... |
import fetch from 'dva/fetch';
import { notification } from 'antd';
import { routerRedux } from 'dva/router';
import store from '../index';
import { setAccessToken, getAccessToken } from './token';
const codeMessage = {
200: '服务器成功返回请求的数据。',
201: '新建或修改数据成功。',
202: '一个请求已经进入后台排队(异步任务)。',
204: '删除数据成功。',
400:... |
import { React, useEffect, useState } from 'react';
//utilities
import { makeStyles, useTheme } from '@material-ui/core/styles';
//components
import { Typography, Divider, Select, InputLabel, MenuItem, FormControl, Switch, Container, IconButton } from '@material-ui/core'
//icons
import { Close } from '@material-ui/... |
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import omit from 'lodash/omit';
import { toastr } from 'react-redux-toastr';
// Redux
import { connect } from 'react-redux';
// services
import {
fetchDataset,
createDataset,
updateDataset
} from 'services/dataset';
import { fetch... |
$(document).ready(function(){
var rs = $("textarea[name='reason']").text();
if($(".table-form tr").length<=7){
addReceptionStaff()
}
});
function addReceptionStaff(){
var tr = $("<tr class='addTr'></tr>");
tr.append('<td class="tit">日期</td>');
tr.append('<td><input name="planDate" type="text"><span id="planDa... |
/*
## Content-Security-Policy
options are a dictionary that can include
{
policyName: examplePolicy, // use a specific policy
reportOnly: true, // Enable report only header
}
*/
module.exports = function (options) {
var policyName = 'defaultPolicy';
var reportOnly = false;
var enforcePolicy = fal... |
import * as cookie from "cookie"
import * as URL from "url"
import * as querystring from "querystring"
import parser from "yargs-parser"
/**
* given this: [ 'msg1=value1', 'msg2=value2' ]
* output this: 'msg1=value1&msg2=value2'
* @param dataArguments
*/
const joinDataArguments = (dataArguments) => {
... |
import React, { Component } from 'react'
import { withTranslation } from 'react-i18next'
import PropTypes from 'prop-types'
import Dropzone from 'react-dropzone'
import { connect } from 'react-redux'
import classNames from 'classnames'
import Camera from 'src/components/Camera/Camera'
import IntroBox from 'src/compone... |
let addDays = (dateObj, numDays) => {
dateObj.setDate(dateObj.getDate() + numDays);
return dateObj;
};
let monthNames = [
"Jan",
"Feb",
"Mar",
"April",
"May",
"June",
"July",
"Aug",
"Sept",
"Oct",
"Nov",
"Dec"
];
// today
let today = new Date();
let monthToday = monthNames[today.getMonth()... |
import React, { Component } from 'react'
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import MobileStepper from '@material-ui/core/MobileStepper';
import Paper from '@material-ui/core/Paper';
import Typography from '@material-ui/core/Typography';
import Button from '@materi... |
/*
Copyright (c) 2015, SerGIS Project Contributors. All rights reserved.
Use of this source code is governed by the MIT License, which can be found
in the LICENSE.txt file.
*/
// our modules
var config = require("../../config");
// The Game model (created in the `module.exports` function below)
var Game;... |
'use strict';
const path = require('path');
const fs = require('fs-extra-promise');
const spawn = require('child_process').spawn;
const {TaskType} = require('../../../shared/tasks');
const readline = require('readline');
const config = require('../../lib/config');
// File name of every build output
const JOB_FILE_NAME... |
// @flow
import React, { useCallback } from 'react'
import { Platform, View } from 'react-native'
import Wrapper from '../../common/layout/Wrapper'
import Text from '../../common/view/Text'
import NavBar from '../../appNavigation/NavBar'
import { withStyles } from '../../../lib/styles'
import { theme as mainTheme } fro... |
/* global process:false */
"use strict";
var _ = require("lodash");
var sauceConnectLauncher = require("sauce-connect-launcher");
function registerSauceBrowsers(config, sauceBrowsers, configFile) {
function capitalize(string) {
if(!string.charAt) {
return string;
}
return str... |
import React, { useState } from 'react';
import { View, Dimensions } from 'react-native';
import { MentionInput } from 'react-native-controlled-mentions';
import { withStyles, Icon } from '@ui-kitten/components';
import PropTypes from 'prop-types';
import { useDispatch, useSelector } from 'react-redux';
import Attachme... |
/**
* @file JS script to compile and run a WebPPL file.
*
* SYNOPSIS:
*
* npm run wppl SCRIPT [n] [-- batch]
*
* DESCRIPTION
*
* Runs the WebPPL SCRIPT specified by the script, n number of times. It has two
* modes of operation: online (default) and batch mode (specified by the optional
* argument `-- batch`, note th... |
var birch = new (require('events').EventEmitter)(),
net = require('net'),
irc = require('slate-irc'),
consumers = {};
// Property filtering functions
function filterProps(props, filters) {
var out = {};
filters.forEach(function (filter) {
if(props[filter]) {
out[filter] = props[filter];
}
});
return o... |
//=============================================================================
// SilvSkillGem_Support_Basics.js
// Version: 1.01
//=============================================================================
/*:
* @plugindesc v1.01 + Silv SG Support Basics. Support-addon for "Silvers Skill Gem". <SilvAddon_Basics>
... |
var Connection = require('tedious').Connection;
var Request = require('tedious').Request;
var RateLimiter = require('limiter').RateLimiter;
var q = require('q');
const grApi = require('./gr-api.js');
const AccountManager = require('./accountmanager.js');
var sessionStore = require('express-session'),
passportSock... |
'use strict'
const pino = require('pino')
const serializers = require('pino-std-serializers')
const URL = require('fast-url-parser')
const startTime = Symbol('startTime')
function pinoLogger (opts, stream) {
if (opts && opts._writableState) {
stream = opts
opts = null
}
opts = Object.assign({}, opts)
... |
import { GlButton, GlDropdown, GlDropdownItem, GlLink, GlFormInput } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import { STATUSES } from '~/import_entities/constant... |
import React, { useState, useEffect } from 'react';
import { CSSTransitionGroup } from 'react-transition-group';
import { getDefaultState, getSets, isSet, getFormattedTime, getSetAnalysis, localStorageName } from './_set-util';
import SetHelp from './SetHelp';
import SetCard from './SetCard';
import SetsPossible from ... |
import React, { useState, useEffect, useContext } from 'react';
import Button from '../../components/Button/index';
import Header from '../../components/Header/index';
import Logo from '../../components/Logo/index';
import { StyledNav } from './styles';
import { useHttpClient } from '../../hooks/http-hook';
import Loa... |
/**
* The copyright in this software is being made available under the BSD License,
* included below. This software may be subject to other third party and contributor
* rights, including patent rights, and no such rights are granted under this license.
*
* Copyright (c) 2013, Dash Industry Forum.
* All rights re... |
// Minicar TCP communicating protocol:
// steerer(1byte) + angle(2byte) + driver(1byte) + speed(2byte) + others(2byte)
// steerer:
// front: f >>> 0x66
// left : l >>> 0x6c
// right: r >>> 0x72
// driver:
// coast(park): c >>> 0x63
// brake(park): b >>> 0x62
// forward : f >>> 0x66
// ... |
// Round 1 ... FIGHT!
// Write a function lengths that accepts a single parameter as an argument, namely an array of strings. The function should return an array of numbers. Each number in the array should be the length of the corresponding string. To get you started, you'll need to loop through each string in the arra... |
/* Author:
*/
jQuery.fn.rotate = function() {
var image = $("#photothumbs img#foo"+this.attr("class")).get(0);
var canvas = this;
var canvasContext = canvas.get(0).getContext('2d');
var width = this.width();
var height = this.height();
canvas.attr('width', height);
canvas.attr('height', w... |
'use strict'
/***********************************************************************
*
* A custom-logger based on picolog and chalk
*
**********************************************************************/
const anylogger = require('anylogger')
const log = anylogger('plog')
const chalk = require('chalk')
cons... |
"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... |
/**
*
* PatientRegister
*
*/
import { Button, Form, Icon, Input, notification, PageHeader, Modal } from 'antd';
import PropTypes from 'prop-types';
import React, { memo, useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Link, withRouter } from 'react-router-dom';
import { compose ... |
import { isArray } from 'vega-util';
import { isFieldDef, isValueDef, vgField } from '../../channeldef';
import { MAIN } from '../../data';
import { isAggregate, pathGroupingFields } from '../../encoding';
import { AREA, isPathMark, LINE, TRAIL } from '../../mark';
import { isSortByEncoding, isSortField } from '../../s... |
// val.js
// (c) <NAME> 2021 <https://gonyyi.com/copyright.txt>
// Usage: (using class name defined in body.onload, and it uses title attr)
// <body onload="VAL('valhtml',true);">
// ...
// <li class="valhtml" url="https://gonyyi.com"></li>
let gyy_status_css_class_prefix = "";
let gyy_status_base_url = ... |
/**
* This service calls the Kali server and gets the
* result of testing a project
*
* @param projectId
* @param files
* @param options
*/
var config = require('../config/config.js'),
http = require('http'),
Promise = require('bluebird'),
request = Promise.promisifyAll(require('request')); // use bluebird... |
/**
* @author <NAME> <<EMAIL>>
* Last modified: 2019-11-3
*/
import _css from './rl-memory-css.js'
import _html from './rl-memory-html.js'
import './game-card.js'
const _cardBack = './resources/rl-memory/0.png'
const _cardFronts = []
_cardFronts.push('./resources/rl-memory/1.png')
_cardFronts.push('./resources/rl-... |
import PIXI from 'pixi.js/bin/pixi';
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { animate, reportParser } from 'javascript/utils';
import {
selectHexAction, zoomInAction, zoomOutAction, selectHexAndZoomInAction
} from 'javascript/actions/map.actions';
import Ma... |
/**
* @file 评论模块
* @author fl
*/
const { CustomElement, util } = MIP
const { css } = util
export default class MIPMhotComment extends CustomElement {
build () {
let bnum = 0
let nnum = 0
let mclassifyCont = this.element.querySelectorAll('#mclassifyCont')[0]
let ztheader = this.element.querySelect... |
import defined from "../Core/defined.js";
import DeveloperError from "../Core/DeveloperError.js";
/**
* A function to port GLSL shaders from GLSL ES 1.00 to GLSL ES 3.00
*
* This function is nowhere near comprehensive or complete. It just
* handles some common cases.
*
* Note that this function requires the pres... |
const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
const passport = require('passport');
const Profile = require('../../models/Profile'); // Profile model
const Recipe = require('../../models/Recipe'); // Model
const validateRecipeInput = require('../../validati... |
/* global Angel */
"use strict";
import Calcu from './src/Calcu';
import Canvas from './src/Canvas';
import Store from './src/Store';
import CONST from './src/CONST';
class Tree {
constructor(opt = {}, container){
this.opt = opt;
this.canvasInfo = Canvas.init(container, {
repaint: (cent... |
/* eslint-disable no-unused-vars */
import React, { Component } from "react";
import PropTypes from "prop-types";
import { getEventTransfer } from "slate-react";
import Html from "slate-html-serializer";
import InsertMedia from "../../../data-connectors/InsertMedia";
import UpdatePost from "../../../data-connectors/Up... |
import React, { memo } from "react";
import { Typography, Form, Input, Button, Spin, Progress, Table } from "antd";
import "./style.css";
/**
* 1) Enter code (enterCode)
* 2) Wait until start (startWait)
* 3) N question (question)
* 4) Wait until next question (questionWait)
* 5) Your result (result)
*/
const ... |
import React from 'react'
import Header from './Component/Header'
import { connect } from 'react-redux'
import routes from './routes'
import { Classic as Page, Logo, History } from '@hi-ui/classic-theme'
import locales from '../locales'
import designs from '../pages/designs'
import pages from '../pages/components'
impo... |
// Copyright 2020 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.
'use strict';
// Original color.
const originalColor = 'rgb(255, 0, 0)'; // red
// Injected color.
const injectedColor = 'rgb(0, 128, 0)'; // green
/... |
// ladataan tarvittavat moduulit
const mongoose = require('mongoose')
const config = require('../utils/config')
mongoose.connect(config.MONGODB_URI, {
useNewUrlParser: true ,
useFindAndModify: false,
useCreateIndex: true
})
// ladataan apumoduuli testejä varten
const helper = require('./test_helper')
... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _events = require("events");
var _dataType = require("./data-type");
var _errors = require("./errors");
class Request extends _events.EventEmitter {
constructor(sqlTextOrProcedure, callback) {
super()... |
/* eslint-disable no-unused-expressions */
/** @jsx jsx */
import { jsx } from "@emotion/core";
import React, { useState } from "react";
import Modal from "react-modal";
import Calendar from "./Calendar";
import { useUser } from "../contexts/user";
import { createRequest } from "../services/request";
import NewCalendar... |
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GnomeDesktop = imports.gi.GnomeDesktop;
const Lang = imports.lang;
const Main = imports.ui.main;
const St = imports.gi.St;
const ONES = [
'zero',
'one',
'two',
'three',
'four',
'five',
'six',
'seven',
... |
tributary.enabled = false;
//$("#play_button").css("opacity", "0.3");
//for some reason i needed to move the audio stuff out into global namespace. could use some refactoring for sure
var context;
var source;
var analyser;
var buffer;
var audioBuffer;
(function() {
tributary.Flow = tributary.Tributary.extend({
... |
function Pizza(pizzaSize, cheese) {
this.pizzaSize = pizzaSize;
this.cheese = cheese;
this.meatToppings = [];
this.vegToppings = [];
}
Pizza.prototype.addMeat = function(meat) {
this.meatToppings.push(meat);
}
Pizza.prototype.addVeg = function(veggie) {
this.vegToppings.push(veggie);
}
Pizza.prototype.refre... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.stylesForImage = stylesForImage;
exports.validateExistence = validateExistence;
exports.getFile = getFile;
exports.createMediaConvertJob = createMediaConvertJob;
var _awsSdk = require('aws-sdk');
var _awsSdk2 = _interopRequireDefa... |
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {getPosts} from '../actions/posts';
import {submitPost, getPicture} from '../actions/posts';
import Comments from './comment';
import {uploadPic} from '../actions/posts';
import {getComments} from '../actions/comments';
import { makeSty... |
/*ES6解构*/
/**
* 1.对象解构
*/
let node = {
type : "node5",
name : "lg"
};
let {type,name,value} = node;
console.log(type); //node5
console.log(name); //lg
console.log(value); //undefined
//如果没有则默认
//let {type,name,value=true} = node;
//console.log(value);//true
/**
* When using destructuring to declare variables... |
/**
* Washington State Sales Tax Calculator
*
* Valid only for Washington State.
* This library contains no official endorsements or guarantees of accuracy.
* See README and LICENSE for more details.
*/
const allRates = require('./taxrates.js');
const request = require('superagent');
const zipcodes = require('zip... |
import React, { useState } from 'react';
import Axios from 'axios';
import { makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableContainer from '@material-ui/core/... |
import React from 'react'
import {
CButton,
CCard,
CCardBody,
CCardHeader,
CCol,
CRow,
CInput,
CLabel,
CToast,
CToastBody,
CToastHeader,
CToaster,
} from '@coreui/react'
import Select from 'react-select'
import PouchDB from 'pouchdb';
import AddUser from "./db/AddUser";
import DeleteUser from ".... |
'use strict'
//
// We are going to use axios with SSL for our RESTconf calls to the WLC,
// so we'll need these node-modules
const https = require('https')
const axios = require('axios')
axios.defaults.withCredentials = true
//
// Setting up a few constant variables for reference
const packageJson=require('./packag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.