code stringlengths 2 1.05M |
|---|
'use strict';
/**
* Delete schedule command
*
* Delete a schedule by id
*/
class DeleteSchedule {
/**
* Constructor
*
* @param {string} scheduleId Schedule Id or Schedule object
*/
constructor(scheduleId) {
this.scheduleId = String(scheduleId);
}
/**
* Invoke command
*
* @param {C... |
var suites = [
require('./paths'),
require('./route')
];
run();
function run() {
if (suites.length === 0) {
console.log('finished');
return;
}
var suite = suites.shift();
console.log('starting ' + suite.name);
suite.on('complete', function() {
console.log('completed... |
/**
* @module
* 装备额外属性收益
* 340. **152mm/55 三連装速射砲**
* 341. **152mm/55 三連装速射砲改**
*/
const { CL_Abruzzi, CL_Gotland, CLV_Gotland } = require('../../ship-classes');
module.exports = [
// ========================================================================
// 152mm/55 三連装速射砲
// https://wikiwiki.jp/ka... |
// { "framework": "Vue" }
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/*****... |
// AJAX
// AJAX不是JavaScript的规范,它只是一个哥们“发明”的缩写:
// Asynchronous JavaScript and XML,意思就是用JavaScript执行异步网络请求。
// Web的运作原理:一次HTTP请求对应一个页面。
// 如果要让用户留在当前页面中,同时发出新的HTTP请求,就必须用JavaScript发送这个新请求,接收到数据后,
// 再用JavaScript更新页面,这样一来,用户就感觉自己仍然停留在当前页面,但是数据却可以不断地更新。
// 用JavaScript写一个完整的AJAX代码并不复杂,但是需要注意:AJAX请求是异步执行的,也就是说,要通过回调函数获得... |
const restore_options = () => {
chrome.storage.sync.get(['tokens'], (items) => {
document.getElementById('tokens-id').value = items.tokens;
});
};
const save_options = () => {
const tokens = document.getElementById('tokens-id').value;
chrome.storage.sync.set({
tokens: tokens
}, () => {
chrome.ru... |
'use strict';
/**
* @fileOverview
* Based store for all DataStore classes.
*
* @author Ben Stahl <bhstahl@gmail.com>
*/
const Uid = require('../models/Uid');
const File = require('../models/File');
const EventEmitter = require('events');
const ERRORS = require('../constants').ERRORS;
const EVENTS = require('../c... |
Ext.define('Siccad.view.layout.Header', {
extend : 'Ext.Component',
alias : 'widget.layoutheader',
id: 'header',
region: 'north',
html: '<div class="dv-top"><img alt="Logo Siccad" id="tit_geral" src="/bundles/sicoobsiccad/images/tit_topo_siccad.png" border="0" title="Siccad - Sistema de Gestão ... |
'use strict';
angular.module('mean.practice', ['angularFileUpload','gridster','pageslide-directive','angularModalService','fundoo.services']);
|
module.exports = {
normalizeEntityName: function() {
// allows us to run ember -g ember-cli-bootstrap and not blow up
// because ember cli normally expects the format
// ember generate <entitiyName> <blueprint>
},
afterInstall: function () {
return this.addBowerPackageToProject('sweetalert', '~1.... |
'use strict';
/* Controllers */
function YTCtrl($scope,ytplayer,ytdataapi) {
$scope.player=ytplayer;
$scope.$on('apiReady',function () {
$scope.player.loadPlayer(function() {
if ($scope.muted) {
$scope.player.muteVideo();
}
});
});
}
YTCtrl.$inject = ['$scope','youtubePlayer',... |
// @flow
import React, { type Node } from 'react'
import Head from 'next/head'
type Props = { pageTitle?: string, pageUrl: string }
const SEO = (props: Props): Node => (
<Head>
<title>
{`gitmoji ${
props.pageTitle ? '| ' + props.pageTitle + ' |' : '|'
} An emoji guide for your commit message... |
//arr.join和+=的性能对比
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite();
var oa = {};
var ob = {};
var oc = {};
var od = {};
suite
.add('use delete', function () {
if (!oa.a) {
oa.a = 1;
}else{
delete oa.a;
}
})
.add('use null', function () {
if (!ob.a) {
ob.a = 1;
}el... |
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'artsper.com',
version:'0.1',
prepareImgLinks:function (callback) {
var res = [];
hoverZoom.urlReplace(res,
'img[src*="artsper"]',
['_p.', '_s.', '_m.', '_f.', '_grid.'],
... |
/*
* Copyright (c) André Bargull
* Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms.
*
* <https://github.com/anba/es6draft>
*/
/*---
id: ...
description: >
Iterators should be closed via their `return` method when iteration is
interrupted via a `continue` statement.
features:... |
import Ember from 'ember';
export default Ember.Service.extend({
activeTab: ''
});
|
'use strict';
module.exports = {
timestamp( )
{
return ( new Date( ) ).toString( );
},
};
|
const soap = require('soap')
module.exports = s => soap.createClientAsync(s.er14.path)
|
describe("About Generators", function () {
describe("Usage", function () {
it("should understand syntax", function () {
// `*` immediately after `function` denotes a generator
function* createGenerator() {
//`yield` keyword exits function execution
yield 1;
}
// invokin... |
var express = require('express');
var app = express();
var robot = require('kbm-robot');
var path = require('path');
robot.startJar();
app.get('/', function (req, res) {
res.sendFile(path.resolve("./assets/commands.html"));
});
app.get('/press/:key', function (req, res) {
robot.press(req.params.key).go();
res.sen... |
(function() {
'use strict';
angular
.module('app.list')
.controller('ListController', ListController);
/** @ngInject */
function ListController(initData, customerService, session, logger) {
var vm = this;
session.setCustomers(initData);
vm.customers = session.getFilteredCustomers();
//... |
/*global define, module, window*/
(function () {
var serloSpecificCharsToEncode,
latexoutput = function () {
return [{
type: 'output',
filter: function (text) {
return encodeSerloSpecificChars(text);
}
}];
};... |
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... |
import {GET_USER_INFO, GET_IS_LOGIN} from 'src/store/getters/type'
export default {
// 获取用户信息
[GET_USER_INFO]: state => {
return state.userInfo || {}
},
// 判断是否登录
[GET_IS_LOGIN]: state => !!state.userInfo && JSON.stringify(state.userInfo) !== '{}'
}
|
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.16/esri/copyright.txt for details.
//>>built
define(["require","exports","./PointSizeAlgorithm","./PointSizeFixedSizeAlgorithm","./PointSizeSplatAlgorithm"],function(e,a,b,c,d){Object.defineProperty(a,"__esMo... |
const URI = require('url');
const qs = require('querystring');
const pkg = require('./package');
const EventEmitter = require('events');
const request = (method, url, payload, headers) => {
const { protocol } = URI.parse(url);
const client = require(protocol.slice(0, -1));
return new Promise((resolve, reject) =>... |
/* eslint no-var: 0, babel/object-shorthand: 0, vars-on-top: 0 */
require('babel-register')
var isCI = process.env.CONTINUOUS_INTEGRATION === 'true'
var reporters = ['mocha', /* 'saucelabs', */ 'coverage']
var singleRun = true
var webpack = require('./test/test.config.es6.js')
var sauceParams = {
testName: "react-s... |
import { Memory as MemoryStorage } from 'odd-storage'
import AbstractBlockchainSyncStorage from './abstractsync'
/**
* @class MemoryBlockchainStorage
* @extends AbstractBlockchainSyncStorage
*/
export default class MemoryBlockchainStorage extends AbstractBlockchainSyncStorage {
/*
* @param {Object} [opts]
... |
git://github.com/mparke/linkedlist.js.git
|
import React from 'react';
import IconBase from '@suitejs/icon-base';
function MdDirectionsBoat(props) {
return (
<IconBase viewBox="0 0 48 48" {...props}>
<path d="M40 42c-2.78 0-5.56-.94-8-2.65-4.88 3.42-11.12 3.42-16 0C13.56 41.06 10.78 42 8 42H4v4h4c2.75 0 5.48-.69 8-1.99a17.445 17.445 0 0 0 16 0C34.52... |
import React, { Component } from 'react';
import { StyleSheet, Text, TouchableHighlight } from 'react-native';
export default class Button extends Component {
static displayName = '@app/Button';
render() {
const {
accessibilityLabel,
color,
disabled,
onPress,
style,
textSty... |
// NOTE: This example uses the next generation Twilio helper library - for more
// information on how to download and install this version, visit
// https://www.twilio.com/docs/libraries/node
var apiKeySid = 'SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var apiKeySecret = 'your_api_key_secret';
var accountSid = process.env.TWI... |
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/localization/ca/TeX.js
*
* Copyright (c) 2009-2013 The MathJax Consortium
*
* Licensed under the Apache License, Version 2.0 (t... |
export default class NewEmployeeDialogController {
constructor(EmployeeService) {
this.EmployeeService = EmployeeService;
}
ok() {
this.EmployeeService.addEmployee({
name: this.name,
age: this.age,
gender: this.gender
}).then(result => this.dialog.onOk(result));
}
}
NewEmployeeDialogController.$in... |
//Ultima HTML5 Landing Page v2.1
//Copyright 2014 8Guild.com
//All scripts for Ultima Landing Page version #2
/*Page Preloading*/
$(window).load(function() {
$('#spinner').fadeOut();
$('#preloader').delay(300).fadeOut('slow');
// setTimeout(function(){$('.first-slide div:first-child').addClass('fadeInDown');},100);
... |
$(function(){
$.ajax({
url: 'tpls/subnav.html',
dataType: 'html',
async: false,
success: function(data){
$('.mc-subNav').html(data);
}
})
$.ajax({
url: 'tpls/header.html',
dataType... |
module.exports = (function(){
'use strict';
var E = require("Element");
function formatTime(time) {
var hr = ~~(time/60),
APM = hr >= 12 ? "PM" : "AM";
return ((hr = hr%12) ? hr : 12) + ":" + ("0"+(~~time)%60).slice(-2) + APM;
}
/*
function findColumn(evnt, columns){
var i = 0;
// Declare as a... |
var expect = require('expect.js');
var Pagination = require('../pagination.js');
var $= require('jquery');
describe('pagination', function() {
beforeEach(function () {
// 测试元素1
var elem = [];
elem.push('<div id="content">');
elem.push('</div>');
element1 = $(elem.join('')).... |
(function() {
// Uncomment and customize the code below to run a function when your
// specific snippet is shown to the user.
/*
var snippet = document.getElementById('snippet-id')
snippet.addEventListener('show_snippet', function() {
// Insert on-show code here.
}, false);
*/
})();
|
import {ipcRenderer} from 'electron';
var dispatcher = {
send: function(message, content) {
content = content || null;
if (content == null) {
ipcRenderer.send(message);
} else {
ipcRenderer.send(message, content);
}
console.log('Sending ' + message);
},
createCallback: function(ch... |
import IdentitySelectFormAttributeRenderer from './IdentitySelectFormAttributeRenderer';
/**
* Identity select component with support select disabled identity.
*
* @author Radek Tomiška
* @since 10.5.0
*/
export default class IdentityAllowDisabledSelectFormAttributeRenderer extends IdentitySelectFormAttributeRend... |
var mongoose = require("mongoose"),
jsonSelect = require('mongoose-json-select'),
helpers = require("../lib/helpers"),
_ = require("underscore")
module.exports = function(db) {
var schema = require("../schemas/employee.js")
var modelDef = db.getModelFromSchema(schema)
modelDef.schema.methods.toHAL = functio... |
var users = {
admin: {id:1, username:"admin", password:"1234"},
pepe: {id:2, username:"pepe", password:"5678"}
};
//Comprueba si el usuario esta registrado en users
//Si autenticación falla o hay errores se ejecuta callback(error).
exports.autenticar = function(login, password, callback) {
if (users[login]) {
... |
import reducer, { initialState } from './reducer';
describe('<%= featureName %>', () => {
describe('reducer', () => {
it('should have a default state', () => {
const expected = { ...initialState };
const actual = reducer(undefined, { type: null });
expect(expected).toEqual(actual);
});
... |
'use strict';
/**
* Module dependencies.
*/
var _ = require('lodash'),
errorHandler = require('../errors.server.controller'),
mongoose = require('mongoose'),
passport = require('passport'),
async = require('async'),
nodemailer = require('nodemailer'),
config = require('../../../config/config'),
mandril... |
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal').modal();
});
document.getElementById('noJava').style.display = 'none';
function MenuItem(id,longName,price){
this.id = id;
this.longName = longName;
this.pric... |
// All symbols in the `Old_Hungarian` script as per Unicode v8.0.0:
[
'\uD803\uDC80',
'\uD803\uDC81',
'\uD803\uDC82',
'\uD803\uDC83',
'\uD803\uDC84',
'\uD803\uDC85',
'\uD803\uDC86',
'\uD803\uDC87',
'\uD803\uDC88',
'\uD803\uDC89',
'\uD803\uDC8A',
'\uD803\uDC8B',
'\uD803\uDC8C',
'\uD803\uDC8D',
'\uD803\uDC... |
// @ts-check
const isWindows = require('./isWindows');
/**
* Escape the circumflex character when we are on Windows
* since Batch will interpret it.
*
* @param {string[]} strings
*/
function escapeArguments(strings) {
return isWindows() ? strings.map(arg => arg.replace(/\^/g, '^^^^')) : strings;
}
module.export... |
window.onload = function () {
// var blue = '#10FDDD';
var l = Snap('#logo');
var p = l.select('path');
l.append(p);
// p.attr({
// fill: blue,
// stroke: '#0066CC',
// });
setTimeout( function() {
// modify this one line below, and see the result !
var logoTitle = 'folding the future ... |
import axios from 'axios';
import { API_BASE_URL } from '../constants';
export function getPeople() {
return axios.get(`${ API_BASE_URL }/people`);
}
export function deletePerson(id) {
return axios
.delete(`${ API_BASE_URL }/people/${ id }`)
.then(() => ({
_id: id,
}));
}
export function addPer... |
import * as path from 'path';
import fs from 'fs';
import { fileURLToPath } from 'url';
import { default as readdirp } from 'readdirp';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
test('Imports in thunderbird need .js', (done) => {
var addonPath = path.join(__dirname, '../../addon/');
functio... |
/*jslint browser: true */
/*globals hljs: true, jQuery: true */
(function ($, window, document, undefined) {
"use strict";
// Setup our defaults, there are only three options for the plugin, set out below (and in more details in the README)
var pluginName = 'prettyGist',
defaults = {
showHeader: true,
extend... |
// generator: none
// int8
let byteArr = Int8Array.of(1, 127, 66, 48);
console.log(byteArr);
byteArr.set(Int8Array.of());
console.log(byteArr);
byteArr.set(Int8Array.of(13));
console.log(byteArr);
byteArr.set(Int8Array.of(21, 39, 43, 66));
console.log(byteArr);
byteArr.set(Int8Array.of(68, 69), 1);
console.log(byt... |
var searchData=
[
['deltatimemonitor_2ecpp_336',['DeltatimeMonitor.cpp',['../_deltatime_monitor_8cpp.html',1,'']]],
['deltatimemonitor_2eh_337',['DeltatimeMonitor.h',['../_deltatime_monitor_8h.html',1,'']]],
['dimension_2eh_338',['Dimension.h',['../_dimension_8h.html',1,'']]]
];
|
//export module
module.exports = {
//prepare normal text to send
getTmplText: function(data) {
var tmpl;
tmpl = {
text: data.response
};
return tmpl;
},
//prepare option list to send
getTmplOptionList: function(data) {
var tmpl,
list ... |
(function(BrawlIO) {
var _ = BrawlIO._;
var error_tolerance = 0.00001;
var GameState = function(options) {
this.start_round = options.round;
this.start_time = BrawlIO.get_time();
this.trigger_action = options.trigger;
this.end_round = options.end_round || undefined;
this.moving_object_states = options.moving_obj... |
/*
jQuery TextAreaResizer plugin
Created on 17th January 2008 by Ryan O'Dell
Version 1.0.4
Converted from Drupal -> textarea.js
Found source: http://plugins.jquery.com/misc/textarea.js
$Id: textarea.js,v 1.11.2.1 2007/04/18 02:41:19 drumm Exp $
1.0.1 Updates to missing global 'var', added extra glo... |
import axios from 'axios';
import omit from 'lodash/omit';
import types from './actionTypes';
/**
// * createDocument - create documents action
* @param {object} data document data
* @return {object} return an object
*/
export function loadDocumentSuccess(data) {
return {
type: types.LOAD_DOCUMENTS_SUCCESS... |
/* Show .js_enabled */
$('.js_enabled').show();
/* GIF control */
var $gifs = [];
$('img[src*=".gif"]').each(function(index, img_tag) {
// Initiate images and add controls container
$(img_tag)
.attr('rel:animated_src', $(img_tag).attr('src'))
.after('<div class="first-load" data-img-controls="' + index + '... |
/**
* @file Store
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @private
*/
import { Log } from '../globals.js'
import { getTypedArray } from '../utils.js'
/**
* Store base class
* @interface
*/
class Store {
/**
* @param {Integer} [size] - initial size
*/
constructor (size) {
this._fi... |
/**
* @author Kai Salmen / https://kaisalmen.de
* Development repository: https://github.com/kaisalmen/WWOBJLoader
*/
'use strict';
if ( THREE.LoaderSupport === undefined ) { THREE.LoaderSupport = {} }
/**
* Validation functions.
* @class
*/
THREE.LoaderSupport.Validator = {
/**
* If given input is null ... |
{
(this.defaults = e),
(this.interceptors = {
request: new s(),
response: new s()
});
}
|
"use strict";
import React from 'react';
import Item from "./ItemBasket";
export default class Basket extends React.Component{
render(){
let items = this.props.basket.products.map( (item) => <Item key={item.id} data={item} /> )
return (
<div>
<h1>Basket</h1>
<ul>{items}</ul>
<... |
"use strict";
import { BNFLexer } from "occam-lexers";
import { BNFParser } from "../../index"; ///
import View from "../view";
const { bnf } = BNFParser;
export default class BNFView extends View {
Lexer = BNFLexer;
Parser = BNFParser;
heading = "BNF parser example";
initialContent = bnf; ///
getPar... |
version https://git-lfs.github.com/spec/v1
oid sha256:3d0b1541a605c48d2628dc003ce14c7efddd0f7ffe20399235bcab8c58442392
size 7154
|
/*
* This module helps create error responses in predefined format.
* These structured error messages are helpful especially if API Gateway is chosen as trigger to your Lambda function.
* One could map each error message to HTTP response with desired status code and body.
*
* For detail information:
* https://aws... |
AT.prototype.bindTargetEvents = function () {
var self = this,
isTouch = self.options.isTouch;
function bindTarget(index, domEle) {
var eventHandler = function () {
ArcherTarget.fireEvent(domEle.el, 'targetClick.archerTarget', {index: index});
};
var el = domEle.el.parentNode;
el.addEventListener(... |
/**
* @author bhouston / http://exocortex.com
*/
QUnit.module( "Ray" );
QUnit.test( "constructor/equals", function( assert ) {
var a = new THREE.Ray();
assert.ok( a.origin.equals( zero3 ), "Passed!" );
assert.ok( a.direction.equals( zero3 ), "Passed!" );
a = new THREE.Ray( two3.clone(), one3.clone() );
assert... |
'use strict';
/* eslint no-invalid-this:0, no-undef:0, no-unused-vars:0 */
const Benchmark = require('benchmark');
const _ = require('highland');
const Rx = require('rx');
const RxJS = require('rxjs');
const Kefir = require('kefir');
const most = require('most');
const mostSubject = require('most-subject');
const mo... |
var assert = require("chai").assert;
var optAndRun = require("./utils/optAndRun");
suite("optimize", function() {
test("define", function() {
var b = optAndRun("b.js").module.exports;
assert.deepEqual(b, { msg: "Hello world!" });
});
test("require", function() {
var glob = optAndRun("a.js").global;
... |
import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import reducer from './reducer'
const middlewares = [
thunk,
]
if (__DEV__) {
const { createLogger } = require('redux-logger') // eslint-disable-line
middlewares.push(createLogger({ collapsed: true }))
}
const store = createSt... |
/**
* Basic router plugin
*/
/*jshint node: true, white: true, newcap: true, eqnull: true, eqeqeq: true, curly: true, boss: true */
var Selector = require(__dirname + '/selector.js'),
Collection = require(__dirname + '/collection.js'),
utils = require(__dirname + '/../../utils/utils.js');
var handleJetCall... |
exports.list = function (req, res) {
var owner = req.app.get("config").gh_owner;
var auth_token = req.app.get("config").gh_auth_token;
console.log(owner, " :: ", auth_token);
var gh_client = require("../lib/GhClient")(auth_token);
var repos_uri = "/users/" + owner + "/repos";
console.log("REPOS URI:... |
var argv = require('./argv');
var options = Object.assign({}, require('xebia-web-common/cli-options'), {
//create-components-directories options
override: argv._ ? (argv._.indexOf("override") >= 0) : false,
removeExistingIndex: argv._ ? (argv._.indexOf("removeExistingIndex") >= 0) : false
});
module.exports = opti... |
import React, { Component } from 'react';
import Menu from './Menu';
import Svg from '../../../public/assets/sigfox.svg';
class Header extends Component {
render() {
return (
<Menu>
</Menu>
);
}
}
export default Header; |
"use strict";
// Copyright 2015 Rocky Bernstein
var columnize = require('../columnize'),
fs = require('fs'),
path = require('path'),
utilCompat = require('../utilcompat');
/*===============================
Debugger 'help' command
=================================*/
var util = require('util');
function... |
var utils = require('./utils'),
dateFormatter = require('./dateformatter');
/**
* Helper method to recursively run a filter across an object/array and apply it to all of the object/array's values.
* @param {*} input
* @return {*}
* @private
*/
function iterateFilter(input) {
var self = this,
out = {};
... |
const { fork } = require('child_process');
const { join, dirname } = require('path');
const DEV_SCRIPT = join(__dirname, '../packages/plutarch/bin/plutarch.js');
function startDevServer(opts = {}) {
const { port = 3001, cwd } = opts;
return new Promise(resolve => {
console.log(`Start dev server for ${cwd}`);
... |
import React, { Component } from 'react'
import { render } from 'react-dom'
import { createStore, combineReducers, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import { createLogger } from 'redux-logger'
import createSagaMiddleware from 'redux-saga'
import { createAction, createReducer } from '... |
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
const notifi... |
import React, { Component } from "react"
import * as PropTypes from "prop-types"
let stylesStr
if (process.env.NODE_ENV === `production`) {
try {
stylesStr = require(`!raw-loader!../public/styles.css`)
} catch (e) {
console.log(e)
}
}
const propTypes = {
headComponents: PropTypes.node.isRequired,
bo... |
import React, {Component} from 'react'
import {PanelGroup, Panel} from 'react-bootstrap'
import Signup from './Signup'
import Login from './Login'
import OAuth from './OAuth'
import {auth} from 'APP/db/firebase' // even though it isn't used, it initializes firebase auth
export default class LandingPage extends Compone... |
// First we need to import the HTTP module. This module contains all the logic for dealing with HTTP requests.
const httpServer = require('http');
const qs = require('querystring');
const concat = require('concat-stream');
const liners = require('./liners');
let culprit;
let responseBody;
// We define the port we want... |
/* syntax.js
* apply simple syntax highlighting to Tetra code
*/
/* lists of highlighted elements */
keywords = ["class", "def", "if", "elif", "else", "while", "for", "in", "parallel", "return", "open", "import", "lambda", "background", "wait", "lock", "var", "init", "self", "constant", "none", "global"];
types = ["... |
const babel = require('@babel/core')
const transformPlugin = require('./babel-transform-imports/index')
const map = require('vux/src/components/map.json')
function transform (code, filename) {
const rs = babel.transform(code, {
plugins: [[transformPlugin, {
vux: {
preventFullImport: true,
l... |
/*global foo:false */
switch (foo) {
case 'foo':
console.log('foo');
break;
case 'bar':
console.log('bar');
break;
default:
console.log('baz');
}
switch (foo) {
case 1:
console.log('foo');
break;
case 2:
console.log('bar');
break;
default:
console.log('baz');
}
switch (foo) {
case 'foo':
{
... |
/**
* `danger` object may contains some attribute
* that we do not want.
* @param {object} danger The object that needs filter.
* @param {object} defaults
*/
export default function (danger, defaults) {
let rets = {};
Object.keys(danger).map(function (key) {
if (key in defaults) {
rets[key] = dang... |
import expect from 'expect';
import * as actions from '../js/actions/AppActions';
import * as constants from '../js/constants/AppConstants';
describe('AppActions', () => {
describe('changeOwnerName', () => {
it('should change the owner name', () => {
const name = 'samsmith';
const expectedResult = {
... |
import thinky from '../thinky';
let type = thinky.type;
let Article = thinky.createModel('Article', {
id : type.string().optional(), // Optional => not specified in bodies but generated by RethinkDB
name : String,
stock : Number,
alcohol : type.number().default(0), // Alcohol amoun... |
/* Licensed under the MIT license: see LICENCE.txt */
// wave module
// this module requires Base64.encode() method.
Anzu.wave = function(){
function intToBin2(s){
return String.fromCharCode((s >> 0 & 0xFF),
(s >> 8 & 0xFF));
}
function intToBin4(s){
return String.fromCharCode((s >> 0 & 0xFF)... |
'use strict';
module.exports = {
init: function () {
},
getAPIVersion: function(req, res){
res.send({ 'success':'true', 'version': '1.0.0' });
}
}; |
(function() {
'use strict';
angular
.module('rtsApp')
.directive('hasAnyAuthority', hasAnyAuthority);
hasAnyAuthority.$inject = ['Principal'];
function hasAnyAuthority(Principal) {
var directive = {
restrict: 'A',
link: linkFunc
};
retu... |
'use strict';
define([
'angular',
'angularRoute',
'css'
], function(angular) {
return angular.module('myApp', ['ngRoute', 'LocalStorageModule'])
.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
//$locationProvider.html5Mode(true);
$routeProvider.when('/logi... |
var icsTransControllers = angular.module('icsTransControllers', []);
icsTransControllers.controller('mainCtrl', [
'$scope', '$location', '$http',
function ($scope, $location, $http) {
$scope.phrase = '';
$scope.title = '';
$scope.options = {};
$scope.year = (new Date).getFullYear();
$sco... |
import React from 'react'
import { noop } from '../ReactCommon'
const PropTypes = React.PropTypes;
/**
* Creates a multi-select control.
* isFlat controls whether the selectors are interpreted as containing optgroups.
* If isFlat is true selectors will be a two level array of arrays. The top level will be pairs o... |
for(var i = 0; i < 50; i++) { var scriptId = 'u' + i; window[scriptId] = document.getElementById(scriptId); }
$axure.eventManager.pageLoad(
function (e) {
});
gv_vAlignTable['u20'] = 'center';gv_vAlignTable['u22'] = 'center';gv_vAlignTable['u24'] = 'center';gv_vAlignTable['u26'] = 'center';gv_vAlignTable['u28']... |
import OAuth2Client from "../common/OAuth2Client"
const attachAuthorization = (session, request) => {
const tokens = session.content || {}
if (tokens.accessToken) {
/*
* We have to create a new request based on the old one because the headers of the
* original request are immutable in ServiceWorker... |
/*!
* clean.js
*
* Copyright 2016 Achraf Chouk
* Achraf Chouk (https://github.com/crewstyle)
*/
module.exports = {
main: [
'./dist/**/*'
]
};
|
'use strict';
var t = require('tcomb-react');
module.exports = t.enums.of('pills tabs', 'NavBsStyle');
|
define([], function() {
function copy(text) {
if (window.clipboardData && window.clipboardData.setData) {
// IE specific code path to prevent textarea being shown while dialog is visible.
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.