code stringlengths 2 1.05M |
|---|
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Message Schema
*/
var MessageSchema = new Schema({
type: {
type: String,
default: 'validation-request'
},
direction: {
type: String,
default: 'forward'
... |
datab = [{},{"Coding Scheme Designator":{"colspan":"1","rowspan":"1","text":"SRT"},"Code Value":{"colspan":"1","rowspan":"1","text":"G-A139"},"Code Meaning":{"colspan":"1","rowspan":"1","text":"Superficial"},"SNOMED-CT Concept ID":{"colspan":"1","rowspan":"1","text":"26283006"},"UMLS Concept Unique ID":{"colspan":"1","... |
'use strict';
describe('Scope', function() {
beforeEach(module(provideLog));
describe('$root', function() {
it('should point to itself', inject(function($rootScope) {
expect($rootScope.$root).toEqual($rootScope);
expect($rootScope.hasOwnProperty('$root')).toBeTruthy();
}));
it('should ... |
L.BingLayer = L.TileLayer.extend({
options: {
subdomains: [0, 1, 2, 3],
attribution: 'Bing',
type:"Aerial",
culture: ''
},
initialize: function(key, options) {
L.Util.setOptions(this, options);
this._key = key;
//this._type = type;
this._url = null;
this.meta = {};
this.loadMetadata();
},
ti... |
const PageEventTypes={
created:'created',
edited:'edited',
deleted:'deleted'
}
export default PageEventTypes; |
const gulp = require('gulp')
const shell = require('shelljs')
gulp.task('lint', () => {
shell.exec('npm run lint')
})
const what = 'todomvc'
gulp.task('browserify', ['lint'], () => {
shell.exec(`npm run browserify:${what}`)
})
gulp.task('default', ['browserify'])
|
'use strict';
const electron = require('electron');
const app = electron.app;
// report crashes to the Electron project
require('crash-reporter').start();
// adds debug features like hotkeys for triggering dev tools and reload
require('electron-debug')();
// prevent window being garbage collected
let mainWindow;
fu... |
var _ = require('underscore');
var d3 = require('d3');
var c3 = require('./libs/c3-0.4.10/c3.min.js');
var data;
function buildGraph(data) {
data = _.sortBy(data, 'id');
var labels =[];
var dataset = [];
_.map(data, function (measurement) {
labels.push(new Date(measurement.date_measured));
dataset.push(... |
import he from 'he';
import endashes from 'typographic-en-dashes';
import er from 'easy-replace';
import withinRanges from 'ranges-is-index-within';
import splitLines from 'split-lines';
import replaceString from 'replace-string';
// default set of options
const opts = {
removeWidows: true,
convertEntities: true,
... |
module.exports = require('./lib/streamur'); |
/**
* Satellizer
* (c) 2014 Sahat Yalkabov
* License: MIT
*/
(function(window, angular, undefined) {
'use strict';
angular.module('satellizer', [])
.constant('satellizer.config', {
httpInterceptor: true,
loginOnSignup: true,
loginRedirect: '/',
logoutRedirect: '/',
signupRedi... |
'use strict';
const expect = require('chai').expect;
const minlen = require('../../lib/rules/minlen');
describe('rules:minlen', function () {
describe('should return true if', function () {
it('an array respects the minlen', function (cb) {
minlen([1], 1, (valid) => {
expect(valid).to.be.true;
... |
export default {
xvg: {
xvgCpSize: '0.75%',
xvgCpStroke: '#ff41b4',
xvgCpFill: '#fff',
xvgOutlineSize: '1%',
xvgOutlineColour: '#5e2ca5',
xvgHandleSize: '0.5%',
xvgHandleColour: '#ff41b4',
xvgArcGuideSize: '0.25%',
xvgArcGuideColour: '#96CCFF',
xvgZoom: true,
},
set: funct... |
var st;
$(document).ready(function()
{
var data = randomMovies(), html = $.trim($("#template").html()), template = Mustache.compile(html);
var view = function(record, index){
return template({record: record, index: index});
};
var $summary = $('#summary');
var $found = $('#found');
$('#found').hi... |
/**
* Created by Duy A. Nguyen on 3/30/2014.
*/
'use strict';
define('templates/helpers/baseUrl', ['hbs/handlebars'], function(Handlebars) {
if (!window.baseUrl) {
window.baseUrl = function(input) {
return window.config.baseUrl + input;
};
}
Handlebars.registerHelper('baseUrl', window.ba... |
'use strict';
let express = require('express');
let user = require('./controllers/user');
let bodyParser = require('body-parser');
let jwtMiddleware = require('./config/security');
let corsMiddleware = require('./config/cors');
let mongoose = require('mongoose');
let config = require('./config');
let log4js = require(... |
/// <binding Clean='clean' />
var gulp = require("gulp"),
del = require("del"),
concat = require("gulp-concat"),
cssmin = require("gulp-cssmin"),
uglify = require("gulp-uglify"),
jshint = require('gulp-jshint'),
csslint = require('gulp-csslint'),
project = require("./project.json"),
pa... |
import {AuthService} from 'aurelia-auth';
import {inject} from 'aurelia-framework';
import {HttpClient} from "aurelia-http-client";
import md5 from "md5";
import _ from "lodash";
let baseUrl = 'https://localhost:3001/users/plan';
@inject(HttpClient)
export class StripePlanCustomElement{
constructor(httpClient)... |
(function($) {
$(function() {
$('.button-collapse').sideNav();
$('.parallax').parallax();
}); // end of document ready
})(jQuery); // end of jQuery name space
function openModal(id) {
$('#' + id + ' :input').val('');
$('#' + id).openModal();
}
function closeModal(id) {
$('#' + i... |
const test = require('ava');
const td = require('testdouble');
const nodemailer = require('nodemailer');
td.replace(nodemailer, 'createTransport');
const fakeTransport = {
sendMail: td.function()
};
td.when(nodemailer.createTransport(td.matchers.anything(), td.matchers.anything())).thenReturn(fakeTransport);
const ... |
exports.createTextIndex = require('./create-text-index');
exports.deleteFromTextIndex = require('./delete-from-text-index');
exports.addJsonToTextIndex = require('./add-json-text-index');
exports.findRelatedConcepts = require('./find-related-concepts');
exports.analyzeSentiment = require('./analyze-sentiment');
exports... |
import{a as m}from"./chunk-6YSPEYEK.js";import{m as a}from"./chunk-OHKPSLFK.js";function o(t){let r=new FormData(t.target);t.submitter?.name&&r.append(t.submitter.name,t.submitter.value),m(`${a}?${new URLSearchParams(r).toString()}`)}export{o as a};
//# sourceMappingURL=chunk-B4EGYLBH.js.map
|
// import {groupBy, head, map, values, pipe, concat, prop, tap} from 'ramda'
import * as types from '../actionTypes'
const initialState = {
auth: {
},
errors: {
}
}
export default function (state = initialState, action) {
switch (action.type) {
case types.LOGIN_SUCCESS:
return ''
case types... |
var _ = require('lodash');
var moveHead = function(bb8) {
bb8.roll(0, Math.floor(Math.random() * 180));
};
module.exports = function (bb8) {
console.log('Place me in my charging station');
bb8.color('#000000');
moveHead(bb8);
var partiallyAppliedMoveHead = _.partial(moveHead, bb8);
retur... |
function GoogleMap(d,e,h){var k={fashion:{icon:"https://admin.apprecie.com/img/temp/map/apprecie.png"}},b=null,g=[],c=null;this.initialise=function(a){b={center:{lat:d,lng:e},zoom:h};c=new google.maps.Map(document.getElementById(a),b);loadMarkers()};this.addMarker=function(a,b,d){a=new google.maps.LatLng(a,b);var e=new... |
var youbmark = youbmark || {};
(function () {
var dc = function () { };
dc.prototype = {
save: function (bookmark) {
/// <summary>save bookmark to Persistent storage</summary>
/// <param name="json" type="String">bookmark object</param>
localStorage.setItem(bookmark... |
'use strict';
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var Packetizer = require('./packetizer');
var next_id = 0;
var WSClient = function (socket) {
EventEmitter.call(this);
this.socket = socket;
this.id = next_id;
next_id += 1;
var packetizer = new Packetiz... |
'use strict';
var path, mothership, packageName;
packageName = require('../package.json').name;
path = require('path');
mothership = require('mothership');
// these are the droids we are looking for...
function isMothership(packageJson) {
return !!(packageJson.dependencies && packageJson.dependencies[packageName])... |
var KNOX = { REVISION: '76', INFO: 'KNOXLABS framework, based on THREE.JS' };
console.log(KNOX.INFO, "r"+KNOX.REVISION); |
'use strict';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
class Search extends Component {
constructor() {
super();
}
search() {
console.log(`Now searching ${document.querySelector('input.search').value}`);
}
render() {
return (
<div className="searchWrapp... |
// load all files to run v86 in browser, uncompiled
(function()
{
"use strict";
var CORE_FILES =
"const.js config.js log.js cpu.js debug.js translate.js modrm.js string.js arith.js misc_instr.js instructions.js " +
"io.js main.js lib.js ide.js fpu.js pci.js floppy.js " +
"memory.js dma... |
import React from 'react';
import IconBase from 'react-icon-base';
export default class FaReddit extends React.Component {
render() {
return (
<IconBase viewBox="0 0 40 40" {...this.props}>
<g><path d="m24.4 26.1q0.4 0.3 0 0.6-1.3 1.4-4.4 1.4t-4.4-1.4q-0.4-0.3 0-0.6 0.1-0.2 0.3-... |
var config = require('../config/webpack')('production');
var gulp = require('gulp');
var logger = require('../lib/compileLogger');
var webpack = require('webpack');
gulp.task('webpack:production', function(cb) {
webpack(config, function(err, stats) {
logger(err, stats);
cb();
})
});
|
/**
* Created by g.kosharov on 8.4.2016 ã..
*/
import { CALL_HISTORY_METHOD } from 'react-router-redux'
/**
* This middleware captures CALL_HISTORY_METHOD actions to redirect to the
* provided history object. This will prevent these actions from reaching your
* reducer or any middleware that comes after this one.... |
'use strict';
const assert = require('assert');
const Browscap = require('../src/index.js');
suite('checking for issue 1035. (3 tests)', function () {
test('issue-1035-A ["Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13F69 Safari/601.1"]', funct... |
/**
* CONSTANTS
*/
ig.global.TILESIZE = 16;
ig.global.FIELD_COLS = 10;
ig.global.FIELD_ROWS = 19; // the actual playing area is 10x18, but the top row is required for the line-shaped block
ig.global.SHAPES = 7;
ig.global.SPAWN_POS_X = 240;
ig.global.SPAWN_POS_Y = 256;
ig.global.DROP_POS_X = 64;
ig.global.DROP_POS_Y ... |
/**
* Backbone.HammerJSView
*
* (c) 2015 Joe Bottigliero
* Backbone.HammerJSView may be freely distributed under the MIT license.
*/
/* global define, Backbone, _ */
(function(root, factory){
if (typeof define === 'function' && define.amd) {
define(['underscore', 'backbone'], factory);
} else {
... |
import * as multiple from './multiple';
const multiplyAndDivideBy1 = (val) => multiple.multiply(1, multiple.divide(val, 1));
export default multiplyAndDivideBy1;
|
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find, findAll, fillIn, typeIn } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import a11yAudit from 'ember-a11y-testing/test-support/audit';
module('Integration | Component | Bootstrap I... |
/**
* @author Jérémy BOUNY / https://github.com/jbouny | http://www.jeremybouny.fr
* @file js/window.js
*
* Part of the project gravitris https://github.com/jbouny/gravitris
*
* Manage the user actions and provide some callbacks to use them.
*/
var Window = {
ms_Width: 0,
ms_Height: 0,
ms_MiddleX: 0,
ms_... |
var mongoose = require('mongoose');
module.exports = mongoose.Schema({
uid: String
});
|
//~ name a330
alert(a330);
//~ component a331.js
|
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails react-core
* @jest-environment node
*/
'use strict';
let PropTypes;
let ReactFeatureFlags;
let React;
let ReactNoop;
... |
(function(){
'use strict';
angular
.module('steamWorks')
.controller('btCtrl', btCtrl);
btCtrl.$inject = ['$scope', '$state', 'deviceSvc'];
function btCtrl($scope, $state, deviceSvc){
var vm = this;
vm.devices = []; // the devices listed in the page
vm.scan = scan;
vm.connect = connect;... |
var express = require('express');
var app = express();
// Host the assets directory
app.use('/assets', express.static(__dirname + '/dist/assets/'));
var router = express.Router();
// Host the Rownd application on the root page
router.route('*').get(function(req, res) {
res.sendFile(__dirname + '/dist/index.html');... |
Template.exerciseLog.rendered = function() {
Session.set("strenghtOrCardio", true);
Session.set("viewRoutines", false);
}
Template.exerciseLog.helpers({
'completedStrengthExercise':function(){
// returns everything in the Cardio collection that has been added in the past amount of time specified by the users
f... |
var users = [{
name: 'Jack',
age: 21
}, {
name: 'Ben',
age: 23
}, {
name: 'Adam',
age: 22
}];
console.log(users.map((function(user) {
return user.age;
})));
|
/* Load the App's data here */
module.exports = function loadData(callback) { // fire the callback when done
DEBUG && App.log('Data loaded successfully');
callback();
};
|
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, settled } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | renderInPlace', function(hooks) {
setupRenderingTest(hooks);
test('false: renders in the bo... |
import React, { Component } from 'react';
import { View } from 'react-native';
import FullscreenVideo from 'react-native-fullscreen-video';
export default class App extends Component<{}> {
render() {
return (
<View style={{flex: 1}}>
<FullscreenVideo src={{uri: "http://techslides.com/demos/sample-v... |
import React from 'react';
import { connect } from 'react-redux';
export default function (ComposedComponent) {
class Authenticate extends React.Component {
componentWillMount() {
if (!this.props.isAuthenticated) {
this.context.router.push('/');
}
}
... |
var log = require('./createLog'),
Simulation = require('./simulation'),
simulation = new Simulation(),
Life = require('./life');
simulation.addLife(new Life());
simulation.on('tick', function(){
//log.print(-10);
console.log(JSON.stringify(simulation.stats, null, ' '));
});
simulation.tick(); |
/*
* mobile slider unit tests
*/
(function($){
var onChangeCnt = 0;
window.onChangeCounter = function() {
onChangeCnt++;
};
module('jquery.mobile.slider.js events', {
setup: function() {
// force the value to be an increment of 10 when we aren't testing the rounding
$("#stepped").val( 20 );
}
});
... |
// Copyright 2014 LastLeaf, LICENSE: github.lastleaf.me/MIT
'use strict';
var path = require('path');
var EventEmitter = require('events').EventEmitter;
var watchr = require('watchr');
var utils = require('../../utils.js');
module.exports = function(dir, keepWatch, cb){
// sync event emitter
var eventFuncs = {};
... |
/// <reference path="_references.js" />
/// <reference path="graph.js" />
/// <reference path="kineticjs-4.6.0.js" />
// width: 1000, height: 820
function Map(options) {
/**
* Settings object
*/
this.Settings = {
// масштаб
//globalScale: 1.2,
// координаты киоска
x: ... |
const encryption = require('../utilities/encryption')
// const User = require('mongoose').model('User')
const User = require('../models/User')
// const Role = require('mongoose').model('Role')
const Role = require('../models/Role')
module.exports = {
registerGet: (req, res) => {
res.render('users/register')
},... |
class Foo1 extends Component {
props: {
bar1?: string,
};
render() {}
}
export type Props2 = {
bar2?: string
}
class Foo2 extends Component {
props: Props2;
render() {}
}
type Props3 = {
bar3?: string,
}
function Foo3(props: Props3) {
return <div />;
}
|
function RG_Thumbnail(options, jquery)
{
this.name = 'Make thumbnail';
var $ = jquery || $ || jQuery;
var self = this;
var app = null;
var RESIZE_EVENT = 'resize.rgUploader';
var isMobile = false;
var resizeInterval = null;
if (!$) return;
this.file = null;
this.croppie = null;
this.$el = {
... |
// DOM Ready =============================================================
$(document).ready(function() {
// Populate the user table on initial page load
populateFields();
//Testing if populate Channels from JSON files work
//populateCountryCodes('US');
//populateACChannels('36');
//popula... |
describe('HomeControllerSpec', function () {
'use strict';
var _protractor = protractor.getInstance();
var _username;
var _token;
var _success;
var _error;
var _button;
beforeEach(function() {
_protractor.get('#/');
_username = by.model('user.username');
_token... |
const adventurer = {
name: 'Alice',
cat: {
name: 'Dinah'
}
};
const dogName = adventurer.dog?.name;
console.log(dogName);
// expected output: undefined
console.log(adventurer.someNonExistentMethod?.());
// expected output: undefined
console.log('---');
|
import colors from 'colors';
import loadConfig from './load-config';
jest.mock(`${__dirname}/../.repoir.json`, () => {
return {
hello: 'world',
foo: {
bar: true
}
};
}, { virtual: true });
jest.mock(`${process.cwd()}/.repoir.json`, () => {
return {
foo: {
bar: false
}
};
}, { virtual: true });
je... |
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.9.0-rc1-master-aff50d5
*/
!function(){"use strict";function n(n,t,e,i){function u(n){return angular.isDefined(n.href)||angular.isDefined(n.ngHref)||angular.isDefined(n.uiSref)}function a(n,t){return u(t)?'<a class="md-button" n... |
import { Feature } from 'toolkit/extension/features/feature';
import { isCurrentRouteBudgetPage } from 'toolkit/extension/utils/ynab';
import { controllerLookup, getEmberView } from 'toolkit/extension/utils/ember';
import { Settings as DisplayGoalAmountSettings } from './display-target-goal-amount';
export const GOAL_... |
$(function (){
var log = function (msg) {
return function () {
if (console) console.log(msg);
}
}
$('code').each(function () {
var $this = $(this);
$this.text($this.html());
})
var animateClasses = 'flash bounce shake tada swing wobble pulse flip flipInX... |
'use strict';
const Express = require('express');
const Router = Express.Router();
const Auth = require('../../helpers/authenticator');
const Proxy = require('express-http-proxy');
Router.all('*', Auth.Admin.Protection);
Router.get('/', (req, res, next) => {
res.render('admin/tasks', {
title: 'Tasks',
... |
'use strict';
var buildingMicroservicesApp = angular.module('myApp.buildingMicroservices', ['ngRoute', 'configuration']);
buildingMicroservicesApp.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/building_microservices', {
templateUrl: 'views/building_microservices/building_micr... |
// jQuery Minimal Tips | (c) 2014 vinicius-stutz.com | jquery.org/license
$.minimalTips=function(){var xOffset=20;var yOffset=20;var posX;var posY;var largura;var altura;function setPos(e){largura=$("#MinimalTip").width();altura=$("#MinimalTip").height();posX=e.pageX+largura+yOffset*2>$(window).width()?e.pageX-(largura... |
const fs = require('fs');
const path = require('path');
const lineReader = require('reverse-line-reader');
exports.readdir = folder => new Promise((resolve, reject) => {
fs.readdir(folder, (err, contents) => {
if (err) {
reject(err);
return;
}
const results = [];
Promise.all(contents.map(... |
module.exports = {
env: {
jest: true,
browser: true,
},
parserOptions: {
jsx: true,
useJSXTextNode: true,
},
rules: {
'import/extensions': 0,
'class-methods-use-this': 0,
},
extends: ['airbnb-typescript', '../../eslint-config-brainly-typescript'],
plugins: ['css-modules', 'react-... |
import {
Vector3,
Vector4
} from '../../../build/three.module.js';
/**
* NURBS utils
*
* See NURBSCurve and NURBSSurface.
**/
/**************************************************************
* NURBS Utils
**************************************************************/
class NURBSUtils {
/*
Finds knot vect... |
var express = require("express");
var bodyParser = require("body-parser");
var _ = require("underscore");
module.exports = function(port, middleware, callback) {
var app = express();
if (middleware) {
app.use(middleware);
}
app.use(express.static("public"));
app.use(bodyParser.json());
... |
'use strict';
angular.module('cm.controllers').controller('LogoCtrl', function($scope, $window) {
// Max size of logo is radius. Position it in the center.
var aWindow = angular.element($window)
,margin = 20
,width
,height
,radius;
function setLogoWidth() {
width = aWindow[0].innerWi... |
import React from 'react';
import {storiesOf} from '@storybook/react';
import Markdown from '../utils/Components/Markdown';
import TabbedView from '../utils/Components/TabbedView';
import CodeExample from '../utils/Components/CodeExample';
import Readme from '../../src/MultiSelect/README.md';
import ReadmeTestKit from ... |
export default {
"buildType": [
{
"id": "build_1_id",
"name": "build 1",
"webUrl": "http://testurl.com/viewType.html?buildTypeId=build_1_id",
"builds": {
"build": [
{
"number": "3.1.70.17327",
"status": "FAILURE",
"statusText": "Tests p... |
/**
* Create the store with asynchronously loaded reducers
*/
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import { fromJS } from 'immutable';
import { routerMiddleware } from 'react-router-redux';
import createReducer from './reducers';
export default function con... |
// 06. Write an expression that checks if given print (x, y) is within a circle K(O, 5).
var coordinateX = 5;
var coordinateY = 0;
var inCircle = ((coordinateX * coordinateX) + (coordinateY * coordinateY)) <= 25;
console.log("The point is within a circle K(O, 5): " + inCircle);
|
/*jshint laxcomma: true, smarttabs: true, node:true*/
'use strict';
/**
* filters documents where the field value matches the beginning of the document value
* @module tastypie-rethink/lib/resource/filters/size
* @author Eric Satterwhite
* @since 2.0.1
* @requires tastypie-rethink/lib/toField
* @example field__si... |
menuLayer = cc.Layer.extend({
init:function()
{
this._super();
var action1 = cc.TintBy.create(3, 255, 255, 255);
var action2 = cc.TintBy.create(3, 255, 255, 255);
var title = cc.Sprite.create("assets/game_title.png");
title.setPosition(400, 400);
ti... |
'use strict';
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var GameSchema = new Schema({
name: String,
info: String,
active: Boolean,
world: Schema.Types.Mixed
});
module.exports = mongoose.model('Game', GameSchema);
|
import CharacterSprite from './CharacterSprite.js'
import mockContext from '../../../spec-support/mockContext.js'
describe('Character Tests', function () {
var playerSprite
beforeEach(function () {
playerSprite = new CharacterSprite(10, 10, mockContext)
})
describe('Draw', function () {
it("Allows deve... |
/*!
* bespoke-fx v0.0.1
*
* Copyright 2014,
* This content is released under the MIT license
*
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof... |
/*
* moan
* https://github.com/neocotic/moan
*
* Copyright (c) 2015 Alasdair Mercer
* Licensed under the MIT license.
* https://github.com/neocotic/moan/blob/master/LICENSE.md
*/
'use strict'
const CLIEngine = require('eslint').CLIEngine
const path = require('path')
const moan = require('..')
const Utils = re... |
const _ = require('lodash')
function filter(propertyDefinitions) {
return propertyDefinitions.filter((propertyDef) => !_.startsWith(propertyDef.value, '@'))
}
module.exports = {
filter,
}
|
import intent from './intent';
import model from './model';
import view from './view';
export default function magicProduct({ props, DOM }){
return {
DOM : view(model(props)),
events: {
selected: intent(DOM, props).selected$
}
}
}
|
var validatorjs = require('validator');
function doValidateOne(k = '', value = undefined, validators = {}) {
var isValid = null;
var validate = validators.validate || [];
var result = [];
for (var i = 0; i < validate.length; i++) {
if (!validate[i].validator || validate[i].validator === 'undefined') { con... |
/*!
* promised-handlebars <https://github.com/nknapp/promised-handlebars>
*
* Copyright (c) 2015 Nils Knappmeier.
* Released under the MIT license.
*/
'use strict'
var deepAplus = require('deep-aplus')
var createMarkers = require('./lib/markers')
var utils = require('./lib/utils')
// Basic utility functions
var... |
import {some, forEach, find} from 'lodash'
import {ClientLinkRepository, ClientRepository, FormTemplateRepository} from '../repository'
import {makeHandleDelete, makeHandlePost} from './StandardController'
import {entityFromBody} from '../middlewares'
import {clientLinkSchema} from '../../modules/client-links/schema'
i... |
//start test/fixtures/copy-to-multiple-files-destination1.js
var testFunction = function() {
var destinationOneArray = ['1'];
return destinationOneArray;
};
//end test/fixtures/copy-to-multiple-files-destination1.js
//start test/fixtures/copy-to-multiple-files-destination2.js
var testFunction = function() {
var dest... |
const Raven = require('raven');
const debug = require('debug')('app');
const dsn = process.env.SENTRY_DSN;
function init() {
const client = new Raven.Client(dsn);
client.patchGlobal((logged, err) => {
debug(err.stack);
});
}
if (dsn) init();
module.exports = {
errorHandler: Raven.middleware.express.erro... |
class Text {
constructor(input_text, state_size, chain) {
// input_text: A string.
// state_size: An integer, indicating the number of words in the model's state.
// chain: A trained markovify.Chain instance for this text, if pre-processed.
this.input_text = input_text;
this.state_size = state_... |
"use strict";
const { utils: Cu, classes: Cc, interfaces: Ci } = Components;
Cu.import("chrome://kancollemodifier/content/FileManager.jsm");
Cu.import("chrome://kancollemodifier/content/KanColleDataModifier.jsm");
Cu.import("chrome://kancollemodifier/content/KanColleShipInfo.jsm");
let strBundle;
function updateMod... |
/*
* Anima Scroller
* Based Zynga Scroller (http://github.com/zynga/scroller)
* Copyright 2011, Zynga Inc.
* Licensed under the MIT License.
* https://raw.github.com/zynga/scroller/master/MIT-LICENSE.txt
*/
const isBrowser = typeof window === 'object'
const TEMPLATE = `
<div class="scroller-component" data-role="comp... |
define(['text!./addModal.tpl.html', './AddModalModel', 'css!./addModal.css'], function (addModalTpl, AddModalModel) {
'use strict';
return Marionette.LayoutView.extend({
id: "usercenter-user-addModal-" + _.now(),
className: 'modal hide fade usercenter-user-addModal',
serializeData: funct... |
/* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) {
return sequelize.define('tasktracker_type', {
userid: {
type: DataTypes.INTEGER(11),
allowNull: false,
defaultValue: '0',
primaryKey: true
},
type: {
type: DataTypes.INTEGER(11),
allowNull: true
... |
const Sequelize = require('sequelize');
const { FundError } = require('../../middleware/error-handler');
/**
* @param {string} auditApiCallUuid
* @param {object} fundCtrl Instance of FundCtrl
* @param {string} fundUuid UUID of the fund to update
* @param {string} name
*/
module.exports = async({
auditApiCallUu... |
/**
* Main access
*/
// Global modifiers
// ================
require('better-strings');
require('colors');
console = require('better-console');
require("console-stamp")(console, {
pattern: "HH:MM:ss",
metadata:'[' + process.pid + ']',
colors: {
stamp: "yellow",
label: "cyan",
met... |
import IconButton from 'material-ui/lib/icon-button';
import IconMenu from 'material-ui/lib/menus/icon-menu';
import MenuItem from 'material-ui/lib/menus/menu-item';
import MoreVertIcon from 'material-ui/lib/svg-icons/navigation/more-vert';
import React from 'react';
import { Link } from 'react-router';
import { getC... |
'use strict';
var Syntax = require('jstransform').Syntax;
/**
* Translate raw JSX syntax object to convenient form
*
* Example..
*
* Input tag: <TagName attr1="literal" attr2={this.props.foo} />
*
* Result object:
* {
* attr1: 'literal',
* attr2: {
* ... jstransformer attribute value object
* }
*... |
define(function(require, exports, module) {
exports.add = function() {
var sum = 0, i = 0, args = arguments, l = args.length;
while(i < l) {
sum += args[i++];
}
return sum;
}
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.