code stringlengths 2 1.05M |
|---|
'use strict';
var encryption = require('../utilities/encryption');
var mongoose = require('mongoose');
var DEFAULT_PAGE_SIZE = 10;
var User = mongoose.model('User');
function createUser(req, res, next) {
var newUserData = {
username: req.body.username,
email: req.body.email
};
... |
/*! chessboard.js v0.3.0 | (c) 2013 Chris Oakman | MIT License chessboardjs.com/license */
(function(){function l(f){return"string"!==typeof f?!1:-1!==f.search(/^[a-h][1-8]$/)}function Q(f){if("string"!==typeof f)return!1;f=f.replace(/ .+$/,"");f=f.split("/");if(8!==f.length)return!1;for(var b=0;8>b;b++)if(""===f[b]||8... |
/*jshint esversion: 6 */
import { Template } from 'meteor/templating';
import './autoForm.html';
|
require.paths.unshift(process.cwd() + './../Source/');
var Deck = require('deck').setup(GLOBAL, 'node');
var http = require('http');
/* App */
var Application = function(request, response){
response.setStatus(200);
response.setHeader('content-type', 'text/html');
if (request.params.name) response.write(['Hello ', r... |
module.exports = deactivate
deactivate.usage = "npm deactivate <pkg>"
deactivate.completion = function (args, index, cb) {
var installedPkgs = require("./utils/completion/installed-packages")
installedPkgs(args, index, false, false, cb)
}
var npm = require("../npm")
, fs = require("./utils/graceful-fs")
, l... |
"use strict";
/**
* @module opcua.server
*/
require("requirish")._(module);
var Dequeue = require("collections/deque");
var subscription_service = require("lib/services/subscription_service");
var NotificationMessage = subscription_service.NotificationMessage;
var StatusChangeNotification = subscription_service.Sta... |
module.exports = function (Restangular) {
return function (gain) {
var deferred = new $.Deferred();
Restangular
.all("codes")
.post({type: "promo", number: gain})
.then(deferred.resolve, deferred.reject);
return deferred.promise();
};
};
|
/* Lyle Scott, III
* lyle@digitalfoo.net
* http://digitalfoo.net
*/
DEBUG = true
var KEY_ENTER = 13;
var HOST = 'http://localhost:5000';
var identifier = location.hostname + '_' + $.browser.version.replace(/[^A-Za-z0-9]+/, '');
function debug(msg) {
if (DEBUG && typeof console !== undefined) {
console.log(msg... |
import PageObject from 'kube-admin/tests/page-object';
let {
text,
count,
clickable
} = PageObject;
export default {
submit: clickable('[data-autoid=submit-file]'),
error: text('.ui.negative.message'),
success: text('.ui.positive.message'),
messageCount: count('.ui.message'),
create(manifest) {
t... |
'use strict';
require('../../init');
let createClient = require('../../../lib/client');
const async = require('async');
describe('removeStream', function() {
it('Should work', function(done) {
createClient({ legacy: true }, clientCreated);
function clientCreated(err, client) {
if (err)... |
angular.module('category.category').controller('CategoryController', ['$scope', '$routeParams', '$location', 'Global', 'Category', function ($scope, $routeParams, $location, Global, Category) {
$scope.global = Global;
$scope.find = function () {
Category.query(function (category) {
$scope.c... |
import React, { Component } from 'react'
import Footer from './Footer/Footer'
import ReactDOM from 'react-dom'
import { newPassword } from '../actions/user'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import Auth from '../helpers/token'
class EditPassword extends Component {
cons... |
/*
* Orange angular-swagger-ui - v0.2.1
*
* (C) 2015 Orange, all right reserved
* MIT Licensed
*/
'use strict';
angular
.module('swaggerUi')
.service('swaggerClient', ['$q', '$http', 'swaggerModules', function($q, $http, swaggerModules) {
var baseUrl;
/**
* format API explorer response before display
... |
/*
Careful foxy watches all incoming messages:
catches mentions, or can play with other bots or users
*/
let botCommands = undefined;
String.prototype.regexIndexOf = function(regex, startpos) {
let indexOf = this.substring(startpos || 0).search(regex);
return (indexOf >= 0) ? (indexOf + (startpos ... |
var testdata = require('./testdata.json');
var len = Math.max(testdata.stdout.length, testdata.stderr.length);
for (var i = 0; i < len; i++) {
if (i < testdata.stdout.length){
console.log(testdata.stdout[i]);
}
if (i < testdata.stderr.length){
console.error(testdata.stderr[i]);
}
}
|
/**
* @fileoverview Rule to flag use of unary increment and decrement operators.
* @author Ian Christian Myers
* @author Brody McKee (github.com/mrmckeb)
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------... |
import _ from 'lodash'
import React from 'react'
import { Link } from 'react-router'
import './HomeView.scss'
import { resolveLocalizationGet } from 'helpers/localize'
import LoadingSpinnerFlower from 'components/LoadingSpinnerFlower/LoadingSpinnerFlower'
import EllipseDotAnimation from 'components/EllipseDotAnimati... |
'use strict';
/* Controllers */
var companiesServiceURL = 'http://serene-bayou-4553.herokuapp.com';
var companiesApp = angular.module('companies-angularjs-demo.controllers', []);
companiesApp.controller('CompanyListController', ['$scope', '$http', '$route', function($scope, $http, $route) {
$http.get(companiesServ... |
/**
* @file 设置自动调整字形位置
* @author mengke01(kekee000@gmail.com)
*/
define(
function (require) {
var i18n = require('../i18n/i18n');
var tpl = require('../template/dialog/setting-glyf.tpl');
var string = require('fonteditor-core/ttf/util/string');
var unicodeREG = /^(?:\$[A-F0-9]+)(... |
const frisby = require('frisby')
const Joi = frisby.Joi
const insecurity = require('../../lib/insecurity')
const API_URL = 'http://localhost:3000/api'
const authHeader = { 'Authorization': 'Bearer ' + insecurity.authorize(), 'content-type': 'application/json' }
describe('/api/Recycles', () => {
it('POST new recycl... |
var Class = require( "ee-class" );
module.exports = new Class( {
render: function( data, request, response, callback ){
response.setHeader( "Content-Type", "Application/JSON" );
callback( JSON.stringify( data ) );
}
} ); |
var searchData=
[
['onapplicationquit',['onApplicationQuit',['../class_buffer_synchronizer.html#a65548865ccdf9703fcfc6887f1a48e29',1,'BufferSynchronizer']]],
['oncreate',['onCreate',['../class_record_tab_handler.html#a17ea59082d2d9e7638fffc96a9f0717b',1,'RecordTabHandler']]],
['opendirectorydialog',['openDirector... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _identity = require('lodash/identity');
var _identity2 = _interopRequireDefault(_identity);
var _createTester = require('./internal/createTester');
var _createTester2 = _interopRequireDefault(_createTester);
var _eachOf = require('... |
// IDEA: DEFAULT
var path = require('path'),
Argv = require('minimist')(process.argv);
// IDEA: COMMON modules
var fs = require('fs-extra'),
clc = require('cli-color'),
extend = require('node.extend');
// TODO: task
var task = {
todo:[],
setting:{},
status:{
warns:[],
error:[],
msg:{
... |
jest.dontMock('../evaluate_key.js');
var evaluateKey = require('../evaluate_key.js')
describe('evaluating the key', function(){
it('return mod properly', function(){
navigator.platform = 'yo';
expect( evaluateKey({keyCode: 17}) ).toEqual('mod');
expect( evaluateKey({keyCode: 224}) ).not.toEqual('mod');
... |
// Platform: ios
// commit cd29cf0f224ccf25e9d422a33fd02ef67d3a78f4
// File generated at :: Mon Apr 29 2013 16:14:47 GMT-0700 (PDT)
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
rega... |
"use strict"
// module Test.Phantomjs.Object
exports.addCookie = function (cookie) {
return function () {
return phantom.addCookie(cookie)
}
}
exports.clearCookies = function () {
return phantom.clearCookies()
}
exports.getCookies = function () {
return phantom.cookies
}
exports.setCookies = function (... |
'use strict';
/**
* This method initializes a web server with certificates if needed and returns a promise
* @param app
* @param settings
* @param certificates
* @param leSettings
* @param log
* @param adapter
* @returns {Promise<unknown>}
*/
async function createServerAsync(app, settings, certificates, leSet... |
'use strict';
angular.module('openDeskApp.appDrawer', ['ngMaterial']); |
/**
* React Starter (https://github.com/erichardson30/react-starter)
*
* Copyright © 2016 Eric Richardson. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import { IndexRoute, Rou... |
import CreateActions from '../../utils/ActionsConstructor';
export default CreateActions(
{
fetch: {},
selectPricingPlan: {},
setInstances: {},
sliderChange: {},
submitPlan: {},
getBillingPlans: {},
updateBillingProfile: {
asyncResult: true,
children: ['completed', 'failure'],... |
define(function (require) {
const [$, $$] = require('/vools.js')
const Profile = require('controller/editor/profile/profile.js')
const Editor = require('controller/editor/editor.js')
const input = $$('[name="link_symbol"]', Profile.container)
Editor.addProperty('link_symbol', () => {
const value = inpu... |
//Proplem 7. Write an expression that checks if given positive integer number n (n ≤ 100) is prime//
jsConsole.writeLine('Problem 7. Is prime')
var input = [1, 2, 3, 4, 9, 37, 97, 51, -3, 0],
len = input.length,
number,
i;
for (i = 0; i < len; i++) {
number = input[i]
result = ((number % 2) != 0 &&... |
var statements = require('../statements');
var SyntaxError = require('../SyntaxError');
/**
* Shifts data from the stack
*
* @param {String} args The arguments to the command
* @constructor
*/
function ReadCommand(args) {
var parsed = new statements.ArgumentStatement(args);
for (var i = 0; i < parsed.args... |
import { invariant } from '../helpers';
import { getOwnPropertyDescriptor } from '../Reflect';
export function deleteProperty(trapResult, target, key) {
if (!trapResult) {
return false;
}
var targetDesc = getOwnPropertyDescriptor(target, key);
if (targetDesc !== undefined && !targetDesc.configurable) {
... |
#!/usr/bin/env node
var program = require('commander');
var nStore = require('nstore');
function list(val) {
return val.split(',').map(Number);
}
program
.version('0.0.1')
.option('-c, --clear', 'delete all todo items')
program.on('--help', function(){
console.log(' Examples:');
console.log('');
console... |
import api from './api';
export default {
api
}
|
/**
* THIS FILE IS AUTO-GENERATED
* DON'T MAKE CHANGES HERE
*/
import { absDependencies } from './dependenciesAbs.generated'
import { addDependencies } from './dependenciesAdd.generated'
import { conjDependencies } from './dependenciesConj.generated'
import { equalScalarDependencies } from './dependenciesEqualScalar... |
$Behavior.photoCategoryDropDown = function()
{
$('.js_photo_category').click(function()
{
var iId = this.id.replace('js_photo_category_', '');
var iItemId = $(this).parents('div:first').parent().parent().parent().find('.js_photo_item_id').html();
var sValue = $(this).html();
$('#js_photo_catego... |
Game.GemsCrusher = function(board) {
this.board = board;
this.crushCounter = 0;
}
Game.GemsCrusher.prototype = {
run: function(gems) {
var self = this,
crushCounterTemHash = {};
gems.forEach(function(gem) {
if(!crushCounterTemHash[gem.id]) {
self.crushCounter += 1;
crushCou... |
var common = require('../../common');
var assert = require('assert');
var pool = common.createPool();
pool.query('SELECT 1', function (err, _rows, _fields) {
if (err) throw err;
rows = _rows;
fields = _fields;
pool.end();
});
process.on('exit', function () {
assert.deepEqual(ro... |
import _ from 'lodash'
import {
assert, splitAt, debug,
regexpmatch, does_match, types,
} from './utils'
const EMBEDDED = ['javascript']
const makeNode = (type, payload) => ({type, payload})
const regexp = {
matchElement: /^([a-z#.][^ :]*) *([|= ]|==|$)((?: *[^ ]+)*)$/i,
matchInline: /^([^: ]+): *(.*)/,
t... |
import React from 'react';
import EntypoIcon from '../EntypoIcon';
const iconClass = 'entypo-svgicon entypo--GraduationCap';
let EntypoGraduationCap = (props) => (
<EntypoIcon propClass={iconClass} {...props}>
<path d="M3.302,12.238c0.464,1.879,1.054,2.701,3.022,3.562C8.293,16.66,9.228,17.6,10,17.6c0.771,... |
import { isAdded, getFilename } from './utils/files_to_commit';
export default function registerCheckAddedFilenames(grunt) {
grunt.registerTask('checkAddedFilenames', function () {
grunt.task.requires('collectFilesToCommit');
const invalid = grunt.config
.get('filesToCommit')
.map(getFilename)
.... |
'use strict';
angular.module('core.utils', []); |
const { EPS } = require('../../constants')
//const FuzzyShape2Factory = require('../FuzzyFactory2d')
const fromSides = require('./fromSides')
const vec2 = require('../../../math/vec2')
const shape2FromFuzzyFactory = (factory, sourceShape) => {
let _factory = factory
const newsides = sourceShape.sides
.map(side... |
'use strict'
import angular from 'angular'
import homeController from '../views/home/home-controller'
import captureController from '../views/capture/capture-controller'
export default () => {
angular.module('app')
.controller('HomeController',
['$scope', 'FirebaseFactory', homeController])
... |
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M12 8c1.93 0 3.5 1.57 3.5 3.5S13.93 15 12 15s-3.5-1.57-3.5-3.5S10.07 8 12 8zm4.53.38l3.97-3.96V7h2V1h-6v2h2.58l-3.97 3.97C14.23 6.36 13.16 6 12 6s-2.23.36-3.11.97l-.65-.65 1.41-1.41-1.41-1.42L6.8... |
/*
"rpd-util"
Personal Utilities Libary
Language: JavaScript
Author: Richard Price <rich@richardprice.com>
For author's reference:
http://www.w3schools.com/js/js_function_parameters.asp
*/
// JResig like 'log' function
function log(target, debug){
// NEED TO ADD VARIABLE TRAVERSING HERE!!!
// WHAT if it's null t... |
var base = require('./karma.base.js')
module.exports = function (config) {
config.set(Object.assign(base, {
browsers: ['Chrome'],
reporters: ['progress'],
singleRun: true
}))
}
|
module.exports = {
require: jest.fn(),
match: jest.fn(),
app: jest.fn(),
remote: jest.fn(),
dialog: jest.fn()
};
module.exports.app = { getPath: jest.fn() } |
var test = require('tape'),
diffo = require('../');
test('Simple object', function(t){
var a = {
foo: 'bar'
},
b = {
foo: 'bar',
bar: 'foo'
},
expectedOutput = {
bar: 'foo'
};
t.plan(1);
var result = diffo(a, b);
... |
console.log('options.js');
/**
* Create an optionsview and bind it to the dom with the config and accounts
*/
optionsview = new OptionsView({
el: $('#content'),
model: config,
collection: accounts,
});
/**
* When both are readdy render the finished UI
*/
config.on('ready', optionsview.ready);
accounts.on(... |
/**
* Created by toni on 19.7.2017.
*/
define([
"components/elementStyles",
"utils/eventListeners",
"configuration/classNames",
"utils/graphUtils",
"utils/gwClient",
"components/menuItems",
"components/nodeForm/nodeForm"
],
function (elementStyles, eve... |
/* http://keith-wood.name/datepick.html
Datepicker Validation extension for jQuery 4.0.6.
Requires Jörn Zaefferer's Validation plugin (http://plugins.jquery.com/project/validate).
Written by Keith Wood (kbwood{at}iinet.com.au).
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LIC... |
/* global KkSimple */
KkSimple.Item = function Item(itemData, map, x, y) {
KkSimple.Unit.call(this, itemData.ch, map, x, y);
this._code = itemData.code;
};
KkSimple.Item.prototype = Object.create(KkSimple.Unit.prototype);
KkSimple.Item.prototype.constructor = KkSimple.Item;
KkSimple.Item.prototype.getCode = func... |
require('./proof')(2, prove)
function prove (async, okay) {
var strata = createStrata({ directory: tmp, leafSize: 3, branchSize: 3 })
async(function () {
serialize(__dirname + '/fixtures/leaf-three.before.json', tmp, async())
}, function () {
strata.open(async())
}, function () {
... |
Flame.LabelView = Flame.View.extend(Flame.ActionSupport, {
layout: { left: 0, top: 0 },
classNames: ['flame-label-view'],
classNameBindings: ['textAlign', 'isSelectable'],
defaultHeight: 22,
defaultWidth: 200,
isSelectable: false,
handlebars: '{{value}}',
render: function(buffer) {
... |
var MashThickness, VolSparge, PreviousSparge, PreviousThickness;
$(document).ready(function() {
$('#calcForm').delegate('input[type=text]', 'change', function() {
if (validateField(this)) {
updateCalc();
}
}).submit(function(e) {
e.defaultPrevented;
updateCalc();
});
$('#Volume').focus(... |
/* jslint node: true */
'use strict';
var TraversalTracker = require('./traversalTracker');
/**
* Creates an instance of DocumentContext - a store for current x, y positions and available width/height.
* It facilitates column divisions and vertical sync
*/
function DocumentContext(pageSize, pageMargins) {
this.pa... |
define(function(require, exports, module) {
var $ = require("$"),
$window = $(window),
$document = $(document),
ie6 = $.browser.msie && $.browser.version == "6.0";
var loadingHtml = '<div style="width:200px;height:100px;background:url(http://cn-style.gcimg.net/static/work/global/1.0.1/loadi... |
// Test geo.polygonFeature and geo.gl.polygonFeature
var $ = require('jquery');
var geo = require('../test-utils').geo;
var mockVGLRenderer = geo.util.mockVGLRenderer;
var restoreVGLRenderer = geo.util.restoreVGLRenderer;
var vgl = require('vgl');
var waitForIt = require('../test-utils').waitForIt;
// var closeToArray... |
version https://git-lfs.github.com/spec/v1
oid sha256:886f050bd2bc75d42e00242b1114602ac8bc4f0fdbf371824344c425679077f8
size 5631
|
var webpack = require('webpack');
module.exports = {
entry: './src/index.js',
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/
},
]
},
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
},
output: {
filename: 'd... |
/**[@test({ "title": "Test.mock.mocked.MockElement" })]*/
function testMockElement(act, assert, callback, module) {
var mock, el, createElement, mockEl;
act(function () {
el = {};
createElement = callback(el);
mock = callback(el);
mockEl = module(['TruJS.test.mock.mocked._MockEl... |
function menu(href) {
document.location.href=href;
load();
}
function load() {
var hrefPart = document.location.href.split('#')[1];
var chart = document.getElementById('chart');
chart.style.display = 'block';
chart.src = 'fund.html?' + hrefPart;
}
function defaultMenu(item) {
var href = document.loca... |
'use strict';
(function(mod) {
const homeController = {};
homeController.index = function() {
$('html').css({'height':'100%', 'margin':'auto', 'padding':'inherit'});
$('section').fadeOut();
$('#home').fadeIn();
};
mod.homeController = homeController;
})(window);
|
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
var leftEmitter;
var rightEmitter;
function preload() {
game.load.image('sky', 'assets/skies/cavern2.png');
game.load.spritesheet('balls', 'assets/sprites/balls.png', 17, 17);
}
funct... |
var searchData=
[
['search_2ejs',['search.js',['../d2/d19/search_8js.html',1,'']]],
['searchdata_2ejs',['searchdata.js',['../df/d80/searchdata_8js.html',1,'']]],
['sequence_2ec',['sequence.c',['../d4/d43/sequence_8c.html',1,'']]],
['sequence_2eh',['sequence.h',['../db/df3/sequence_8h.html',1,'']]],
['string_2... |
// Adapted from https://github.com/rubenv/angular-gettext/blob/master/src/directive.js
function generateDirective( attrName ) {
function normalizeAttributeName(attributeName) {
// copied from angular.js v1.2.2
// (c) 2010-2012 Google, Inc. http://angularjs.org
// License: MIT
// Co... |
module.exports = {
"extends": "@17media/eslint-config-17media/node"
};
|
'use strict';
/* jshint ignore:start */
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
/* jshint ignore:end */
var _ = require('lodash'); /* jshint ignore:line */
var CompositionHookList = require('./v1/compositionHook').CompositionHookList;
var Co... |
/*
## @author github.com/tarampampam
## @project Wget GUI Light
## @package Google Chrome Extension
## @copyright 2014 <github.com/tarampampam>
## @license MIT <http://opensource.org/licenses/MIT>
## @github https://github.com/tarampampam/wget-gui-light
## @version Look in 'manifest.json'
*/
'use strict';... |
/*
* /MathJax-v2/localization/gl/MathML.js
*
* Copyright (c) 2009-2018 The MathJax Consortium
*
* 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/lice... |
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SelectionHandleType;
(function (SelectionH... |
var searchData=
[
['accept_5fexternal_5frng',['accept_external_rng',['../classsnemo_1_1simulation_1_1gg__step__hit__processor.html#ae528939e0d8212f34bba17111c99f705',1,'snemo::simulation::gg_step_hit_processor']]],
['adc_5fmax_5fvalue',['ADC_MAX_VALUE',['../classsnemo_1_1datamodel_1_1raw__calorimeter__hit.html#a6ea... |
'use strict';
module.exports = {
db: 'mongodb://alberts:F1la50won@ds035617.mongolab.com:35617/albertsdormont',
port: 3001,
app: {
title: 'Albert\'s | Dormont'
},
facebook: {
clientID: process.env.FACEBOOK_ID || '613888522032151',
clientSecret: process.env.FACEBOOK_SECRET || '3640cb46e64ae4fc9963ce17a8c657f1... |
/**
* @author mrdoob / http://mrdoob.com/
* @author Larry Battle / http://bateru.com/news
* @author bhouston / http://exocortex.com
*/
var THREE = { REVISION: '66dev' };
self.console = self.console || {
info: function () {},
log: function () {},
debug: function () {},
warn: function () {},
error: function (... |
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.9.6
*/
!(function(e, t, n) {
'use strict';
function r(e, t) {
e.decorator('$$rAF', ['$delegate', o]),
t
.theme('default')
.primaryPalette('indigo')
.accentPalette('pink')
.warnPalet... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actions from '../qualityCenterActions';
export class QualityCenterQueryViewer extends Component {
componentDidMount() {
console.log('QualityCenterQueryViewer.componentDidMount... |
/**
* _____ __
* / ___// /_ _____
* \__ \/ / / / / _ \
* ___/ / / /_/ / __/
* /____/_/\__, /\___/
* /____/
* Copyright 2017 Slye Development Team. All Rights Reserved.
* Licence: MIT License
*/
/**
* Events
* @param esy
*/
function events(esy) {
const {regex, block, compile} = ... |
/**
* Created by mlennox on 22/05/2016.
*/
const stored_consoles = {
log: console.log,
warn: console.warn,
error: console.error
}
const console_target = {
log: 'log',
warn: 'warn',
error: 'error'
}
const create_mock = (test_context, target) => {
console[target] = (...messages) => {
... |
var _a, _b;
// @ts-ignore
var STORAGE_KEY = "SAVED_SAMPLE";
var ENDPOINT_KEY = "SAVED_ENDPOINT";
var existing = localStorage.getItem(STORAGE_KEY);
// @ts-ignore
var editor = monaco.editor.create(document.getElementById("container"), {
value: existing || "",
language: "typescript",
minimap: { enabled: false ... |
/*
|-----------------------------------------------------------------------------
| Screens https://tailwindcss.com/docs/responsive-design
|-----------------------------------------------------------------------------
|
| Screens in Tailwind are translated to CSS media queries. They define the
| re... |
'use strict';
//Games service used for games REST endpoint
angular.module('mean.games').factory('Games', ['$resource',
function($resource) {
return $resource('games/:gameId', {
gameId: '@_id'
}, {
update: {
method: 'PUT'
}
});
}
]);
|
'use strict'
// delete for real -- KHCL
const db = require('APP/db')
, {User, Thing, Favorite, Promise} = db
, {mapValues} = require('lodash')
function seedEverything() {
const seeded = {
users: users(),
things: things(),
}
seeded.favorites = favorites(seeded)
return Promise.props(seeded)
}... |
'use strict'
const proxyquire = require('proxyquire').noCallThru()
describe('bootstrap', () => {
let premiddleware,
app,
db,
appEnv,
result,
mongodbUri,
authService,
http
const controllers = {}
const formattedDbUri = 'mongodb formatted uri'
be... |
import { Palindromes } from './palindrome-products';
describe('Palindromes', () => {
test('smallest palindrome from single digit factors', () => {
const palindromes = Palindromes.generate({ maxFactor: 9, minFactor: 1 });
const smallest = palindromes.smallest;
const expected = {value: 1, factors: [[1, 1]]... |
/**
* Context menu
* @file contextMenu.js
* @author Qwant
*/
'use strict';
document.addEventListener("contextmenu", handleContextMenu, false);
/**
* Handle context menu
* @function handleContextMenu
* @param event
*/
function handleContextMenu (event) {
var sel = window.parent.getSelection().toString();
... |
const defaults = require('../../src/defaults').init
module.exports = {
name: 'init',
command: 'init [dir]',
description: 'initializes a boilerplate elm-factory application',
options: {
dir: {
description: 'the project directory',
},
f: {
alias: 'force',
description: 'ignore existi... |
'use strict';
require('dotenv').load();
var User = require('../models/users');
var TwitterStrategy = require('passport-twitter').Strategy;
module.exports = function(passport){
passport.serializeUser(function (user, done) {
done(null, user._id);
});
passport.deserializeUser(function (id, done) {
User.findById... |
const FileSystem = require('./fs');
const SimpleStorageService = require('./s3');
const Storage = (config) => {
const storageServices = {
fs: FileSystem,
s3: SimpleStorageService,
};
const storageType = config.storage.type;
if (storageServices[storageType] == null) {
throw new Error(`Storage serv... |
import 'whatwg-fetch';
import _ from 'lodash';
import { getJSON, deleteObject, putJSON } from "../utils/apiRequest";
// ------------------------------------
// Constants
// ------------------------------------
export const SEARCH_GROUPS_SUCCESS = 'SEARCH_GROUPS_SUCCESS';
// ------------------------------------
// Act... |
import Flip from './Flip';
import FlipGroup from './FlipGroup';
jest.mock('./Flip');
Flip.mockImplementation();
describe('FlipGroup', () => {
test("It shouldn't be possible to add elements which are not Flip instances", () => {
const element = 2;
const group = new FlipGroup();
group.addElement(element);
... |
var gulp = require('gulp')
, sequence = require('run-sequence')
gulp.task('build', function(done) {
sequence( 'config:prompt'
, 'config:print'
, 'clean'
, [ 'browserify', 'assets', 'manifest:prod' ]
, 'compress'
, done )
})
|
'use strict';
define(['d3', 'jquery', 'bootstrap'], function (d3, $) {
var drawRMCPChart = function (container, data, sample, titleName, callout) {
var containerSelector = container,
dataset = data,
sampleSize = sample,
titleText = titleName,
chartObject = {};
var dimensions = {
height: 500,
wid... |
(function(){
var express = require('express');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
// Create the application.
var app = express();
// Add Middleware necessary for REST API's
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
ap... |
var path = require('path');
var testInfo = require('ember-cli-test-info');
var stringUtil = require('ember-cli-string-utils');
var isPackageMissing = require('ember-cli-is-package-missing');
var getPathOption = require('ember-cli-get-component-path-option');
var useTestFrameworkDetector = require('../l... |
'use strict';
import Emitter from 'utils/Emitter';
import {
WINDOW_RESIZE,
WEBGL_MESH_LOADED,
WEBGL_IS_INTERSECTING,
WEBGL_IS_NOT_INTERSECTING,
WEBGL_CLICK_ON_OBJECT
} from '../../config/messages';
import InfoSectionComponent from 'components/info-section';
import WebglExperienceComponent from 'components/... |
import Config from './config/users';
module.exports = (server, options) => [ // eslint-disable-line no-unused-vars
{
method: 'GET',
path: '/users',
config: Config.find,
},
{
method: 'POST',
path: '/users',
config: Config.create,
},
{
method: 'GET',
path: '/users/{id}',
con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.