code stringlengths 2 1.05M |
|---|
const assert = require('assert');
const Browser = require('../src/zombie');
const { brains } = require('./helpers');
describe("EventLoop", function() {
let browser;
before(function() {
browser = Browser.create();
brains.get('/eventloop/function', function(req, res) {
res.send(`
<h... |
/**
* Created by maglo on 08/09/2016.
*/
Ext.define("JS.numerojournal.Form", {
//extend: "JS.panel.Form",
extend: "Xfr.Component",
config: {
dynamicTpl: false,
panelData: {
formUrl: Routing.generate("get_numerojournal", {id: "new", _format: 'html'})
},
listener... |
/*!
* Alertiny v1.0.0 (https://github.com/markcell/jQuery-Alertiny)
* Copyright (c) 2015 Celso Marques
* Licensed under MIT (https://github.com/markcell/jQuery-Alertiny/blob/master/LICENSE)
*/
/**
* @description Tiny plugin to show alert from Bootstrap
* @version 1.0.0
* @author Celso Marques
*/
if (typeof jQ... |
// Generated by CoffeeScript 1.12.6
(function() {
var Project;
Project = (function() {
function Project(repo, number, client) {
this.repo = repo;
this.number = number;
this.client = client;
}
Project.prototype.info = function(cb) {
return this.client.get("/repos/" + this.repo +... |
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var partials=require('express-partials');
var routes = require('./routes/index');
var app = expr... |
/**=========================================================
* Module: helpers.js
* Provides helper functions for routes definition
=========================================================*/
(function() {
'use strict';
angular
.module('app.routes')
.provider('RouteHelpers', RouteHelpersPro... |
var expect = require('chai').expect;
var gama = require('../src/gama');
describe('gama.axes', function() {
it('calculates axes', function() {
expect(gama.axes(gama.Polygon([
gama.Point(0, 0),
gama.Point(2, 0),
gama.Point(2, 2),
gama.Point(0, 2)
]))).to.eql([
{x: 2, y: 0},
... |
/**
* @author Arno Prinz
*
* global helper-functions and variables
*
*/
var hpCurMouseGrip={
flagDown:false,
flagOver:false,
flagClick:false,
h:0,
w:0,
background:'#327a87',
obj:{},
ident:'',
ttype:'nil',
clear:function(){
flagDown=false;
flagOver=false;
h=0;
w=0;
background='black';
obj=n... |
import { createSelector } from 'reselect';
import isEmpty from 'lodash/isEmpty';
export const getSelectedLocationsFilter = getSelectedLocations =>
createSelector(getSelectedLocations, selectedLocations => {
if (!selectedLocations) return null;
return selectedLocations
.split(',')
.filter(l => !pa... |
function isEmpty(xs) {
for(var i=0; i<xs.length; ++i)
return false;
return true;
}
function desk(xs) {
for(var i=0; i<xs.length; ++i)
if(xs[i] < xs[0])
return "yellow";
return [];
}
|
import angular from 'angular';
import uirouter from 'angular-ui-router';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/js/bootstrap.js'
import '../style/app.css';
import {trustUrl, routing} from './app.config';
import listShots from './features/listShots';
const MODULE_NAME = 'app';
angular.modul... |
function smoothList(points) {
if (points.length < 3) {
return ["M", points[0], points[1]];
}
var dx = [], dy = [], result = ['M'],
i, ln = points.length;
for (i = 0; i < ln; i += 2) {
dx.push(points[i]);
dy.push(points[i + 1]);
}
dx = Ext.draw.Draw.spline(dx);
... |
/*
* The MIT License (MIT)
* Copyright (c) 2016 Jim Liu
*
* 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... |
var app2 = angular.module('user_app', ["bw.paging"]);
app2.filter('categorySelection', ['filterFilter', function(filterFilter) {
return function categorySelection(input, prop) {
return filterFilter(input, {
selected: true
}).map(function(data) {
return data[prop];
})... |
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(d... |
'use strict';
var EventEmitter = require('events').EventEmitter;
var inherits = require('util').inherits;
function MockWS() {
this.upgradeReq = {
headers: { foo: 'bar' },
connection: { remoteAddress: '1.1.1.1' }
};
EventEmitter.call(this);
}
inherits(MockWS, EventEmitter);
MockWS.prototype.close ... |
/* disable some rules until we refactor more completely; fixing them now would
cause conflicts with some open PRs unnecessarily. */
/* eslint react/jsx-sort-prop-types: 0, react/sort-comp: 0, react/prop-types: 0 */
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.leng... |
/*
Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._editor.plugins.EnterKeyHandling"]){ //_hasResource checks added by build. Do not use _hasReso... |
var module = angular.module("example", ["angularGrid"]);
module.controller("exampleCtrl", function($scope, $http) {
var columnDefs = [
{displayName: "Athlete", field: "athlete", width: 200},
{displayName: "Age", field: "age", width: 90, cellRenderer: ageRenderer},
{displayName: "Gold", fi... |
var elProto = window.HTMLElement.prototype;
var nativeMatchesSelector = (
elProto.matches ||
elProto.msMatchesSelector ||
elProto.webkitMatchesSelector ||
elProto.mozMatchesSelector ||
elProto.oMatchesSelector
);
// Only IE9 has this msMatchesSelector bug, but best to detect it.
var hasNativeMatchesSelectorD... |
describe("module stop", function(){
var App;
beforeEach(function(){
App = new Backbone.Marionette.Application();
});
describe("when stopping a module that has been started", function(){
var mod1, mod2, mod3;
beforeEach(function(){
mod1 = App.module("Mod1", function(Mod1){
Mod1.addFi... |
import Ember from 'ember';
import EmberCliWat from 'ember-cli-wat/components/ember-cli-wat';
export default EmberCliWat;
|
var path = require('path');
function install(ajgenesis, cb) {
ajgenesis.fs.createDirectory('ajgenesis');
ajgenesis.fs.createDirectory(path.join('ajgenesis', 'modules'));
ajgenesis.fs.createDirectory(path.join('ajgenesis', 'modules', 'hello'));
ajgenesis.fs.copyDirectory(path.join(__dirname, 'mo... |
// Accompanying JS file for the page edit template.
// Describes the page's metadata and actions.
Template.sidebar_left_edit.events = {
'submit #pageEditForm': events.savePage,
'click #deletePage': events.showDeletePageModal,
'click .delete-page': events.deletePage
};
|
(function() {
'use strict';
angular
.module('antidote')
.filter('range', function() {
return function(range, min, max, step) {
step = step || 1;
for (var i = min; i <= max; i += step) {
range.push(i);
}
... |
var ge; //this is the hugly but very friendly global var for the gantt editor
$(document).ready(function () {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', initAppGantt);
});
function initAppGantt() {
if(spPageInEditMode()){
return;
}
//load templates
$("#ganttemplates").loadTempl... |
/**
* @fileOverview Shows a panel above SVG elements with controls for the
* hovered element. A single panel moves to the location of the currently
* hovered chart. The panel can be minimized to be a single symbol.
*/
/**
* @namespace
*/
var contextPanel = {
/**
* The chart this panel is currently associat... |
// 定义一个混合对象
module.exports = {
template: '<div>EMPTY</div>',
methods: {
beforeModal: function() {
},
/**
* 弹出对话框
*/
showModal: function() {
this.beforeModal();
this.$children[0].show();
},
/**
* 关闭对话框
... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransformClassToClass = void 0;
const ClassTransformer_1 = require("../ClassTransformer");
/**
* Return the class instance only with the exposed properties.
*
* Can be applied to functions and getters/setters only.
*/
function Tran... |
const path = require('path'),
assert = require('yeoman-assert'),
helpers = require('yeoman-test');
describe('generator-angular-bro:mock', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../../generators/mock'))
.withPrompts({componentPath: 'testModule'})
... |
import React, { PropTypes } from 'react';
import classNames from 'classnames';
import { validateWine } from '../utils';
class WineForm extends React.Component {
static propTypes = {
wine: PropTypes.object,
errors: PropTypes.array,
submit: PropTypes.func.isRequired,
};
static defaultProps = {
win... |
define(function(require) {
var
$ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
Template = require('text!application/views/buttonset/TemplateButton.html'),
defaults = {
label: 'no label',
title: 'no title'
}
;
require('jqueryui');
return Backbone.View.extend({
... |
"use strict";
var $__alphaRenameThisAndArguments_46_js__,
$___46__46__47_syntax_47_trees_47_ParseTrees_46_js__,
$__TempVarTransformer_46_js__,
$___46__46__47_syntax_47_TokenType_46_js__,
$___46__46__47_syntax_47_trees_47_ParseTreeType_46_js__,
$___46__46__47_syntax_47_Token_46_js__,
$__ParseTree... |
var Dispatcher = require('flux-dispatcher');
var FluxStore = require('flux-store');
var CloneDeep = require('lodash/lang/cloneDeep');
var Constants = require('../Constants');
var ParseValidation = require('../../../helpers/parseValidation');
var ActionTypes = Constants.ActionTypes;
var Store = FluxStore.extend({
... |
EmberNvd3.ApplicationAdapter = DS.FixtureAdapter;
|
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
gulp.task('default', ['scripts', 'scripts-minify']);
gulp.task('scripts', function() {
return gulp.src(['Micro.js', './src/*.js'])
.pipe(concat('micro.js'))
.pipe(gulp.dest('./build/'));
});
gulp.task('scr... |
import 'isomorphic-fetch'
import fs from 'fs'
import mkdirp from 'mkdirp'
import client from './apollo'
import gql from 'graphql-tag'
import chalk from 'chalk'
import present from 'present'
import moment from 'moment'
import minimist from 'minimist'
import { getSupertype, getType, getSubtype } from './types'
import { g... |
var app = app || {};
(function(){
app.TestButton = React.createClass({displayName: "TestButton",
handleClick: function() {
this.props.submitTestTask(this.props.btnType);
},
render: function() {
return ( React.createElement("button", {onClick: this.handleClick,
... |
export default function all(propTypes) {
if (propTypes === undefined) {
throw new Error('No validations provided');
}
if (!(propTypes instanceof Array)) {
throw new Error('Invalid argument must be an array');
}
if (propTypes.length === 0) {
throw new Error('No validations provided');
}
retu... |
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
compress: false,
sourceMap: true,
sourceMapFilename: '<%= pkg.csspath %>main.css.map',
sourceMapURL: 'main.css.map',
sourceMapRootpath: '/'
},
files: {
... |
(function($) {
QUnit.module('jQuery#placeholder');
var test = QUnit.test;
test('caches results of feature tests', function(assert) {
assert.strictEqual(typeof $.fn.placeholder.input, 'boolean', '$.fn.placeholder.input');
assert.strictEqual(typeof $.fn.placeholder.textarea, 'boolean', '$.fn.placeholder.textare... |
var assert = require("chai").assert
var data = require("../generate")
describe("Test arrayToSpecialObj",function(){
/**
* Test for match mode
*/
describe("Match mode",function(){
/**
* Section Special Object Size testing
*/
describe("Special Object Size",function(){
/**
... |
/**
* 点击波纹效果
*
* @param {[event]} e [description]
* @param {[Object]} arg_opts [description]
* @return {[bollean]} [description]
*/
export default function(e, arg_opts) {
var opts = Object.assign({
ele: e.target, // 波纹作用元素
type: 'hit', // hit点击位置扩散center中心点扩展
bgc: 'rg... |
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = createAshElementTree;
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { 'default': obj };
}
var _internalsIsAshElement = require('../internals/isAshElement');
var _internalsIsAshElement2 = _i... |
'use strict';
angular.module('transcript.app.taxonomy', ['ui.router'])
.config(['$stateProvider', function($stateProvider) {
$stateProvider.state('transcript.app.taxonomy', {
abstract: true,
views: {
"page" : {
template: '<div ui-view="page"></di... |
var EventEmitter = require('events').EventEmitter
, inherits = require('util').inherits
, HISTOGRAM = require('./plot-settings').HISTOGRAM
module.exports = Router
// Emit events when the user hits the back/forward button
// so that the keys can be re-plotted and settings kept in sync.
//
// location - Loca... |
angular.module('menushop.controllers', [])
.controller('MenuShopCtrl', function($scope,$state) {
$scope.gotoDrink =function(){
$state.go('drink')
}
$scope.gotoCart =function(){
$state.go('cart')
}
$scope.gotoCoffeeShop1 =function(){
$state.go('coffeeshop1')
}
}) |
(function(){
'use strict';
var module_list = angular.module('list')
.directive('list', function() {
return {
restrict: 'E',
templateUrl: 'src/panel/lists/wrap.html',
controller: 'List'
};
});
module_list.controller('List',
['$scope', '$on... |
var Nut = require('../node-nut');
nut = new Nut(3493, '10.30.21.11');
nut.on('error', err => {
console.log('There was an error: ' + err);
});
nut.on('close', () => {
console.log('Connection closed.');
});
nut.on('ready', () => {
nut.GetUPSList((upslist, err) => {
if (err) console.log('Error: ' +... |
(function () {
'use strict';
angular
.module('password.help')
.controller('HelpController', HelpController);
function HelpController(config, $window, $location, $scope) {
var vm = this;
vm.config = config;
vm.selectedTab = 0;
vm.history = $window.history;
... |
/*jslint white: true, nomen: true */
(function(win) {
'use strict';
/*global window, document */
/*global APP */
win.APP.maps = win.APP.maps || {};
win.APP.maps.skirmish_001_009 = {
version: 6,
type: 'skirmish',
size: {width: 15, height: 15},
maxPlayers: 2,
... |
import React from 'react';
import { Component } from 'react';
import { Tabs, Pane } from 'toggler';
export default class App extends Component {
render() {
return (
<div id='tabs-container'>
<Tabs selected={0}>
<Pane label='First'>
<div>
<p> Content for the first... |
/**
* Created by Vicky on 6/5/2017.
*/
function solve(input) {
let speed = input[0];
let zone = input[1];
let limit = getLimit(zone);
let infraction = getInfraction(speed, limit);
if (infraction){
console.log(infraction);
}
function getInfraction(speed, limit) {
let overspe... |
/**
* CSSS javascript code
* @author Lea Verou (http://leaverou.me)
* @version 1.0
*/
(function(){
// Cache <title> element, we may need it for slides that don't have titles
var documentTitle = document.getElementsByTagName('title')[0].textContent;
window.SlideShow = function(container, slide) {
var me = this;
... |
import { Joi } from './base'
const pageNotFound = Joi.object().provideId('404').keys({
// Optional
path: Joi.string().default('404'),
title: Joi.string().default('Page not found'),
id: Joi.string(),
})
export default pageNotFound
|
module.exports = {
"env": {
"node": true,
"es6": true
},
"root": true,
"extends": "defaults/configurations/eslint",
"rules": {
"eqeqeq": [1, "smart"],
"space-before-function-paren": [1, "always"],
"semi": [2, "always"],
"no-var": 1,
"prefer-const": 1,
... |
import Ember from 'ember';
const { Mixin } = Ember;
export default Mixin.create({
normalize(modelClass, resourceHash) {
return Ember.typeOf(resourceHash) === 'array' ?
this.normalizeResponse(this.store, modelClass, resourceHash, null, 'findAll') :
this._super(modelClass, resourceHash);
}
});
|
/* ==========================================================
* bootstrap-pivot.js v1.0
* http://aozora.github.com/bootmetro/
* ==========================================================
* Copyright 2012 Marcello Palmitessa
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not... |
'use strict';
var async = require('async');
var TokenValidatorFatory = require('../auth/token-validator');
var AuthorizerFactory = require('../auth/authorizer');
var SchoolFormValidatorFactory = require('./school-form-validator');
var SchoolFactory = require('./school-factory');
var SchoolSaverFactory = require('./sc... |
import sharedCopy from './sharedCopy';
import { readFixedString } from './byteArrayParser';
/**
*
* Internal helper class to assist with parsing. Supports reading from a byte
* stream contained in a Uint8Array. Example usage:
*
* var byteArray = new Uint8Array(32);
* var byteStream = new dicomParser.ByteStrea... |
/**
* 2D vector
* @typedef {Object} vector
* @type {vector}
* @property {number} x x-component of a 2d vector
* @property {number} y y-component of a 2d vector
*/
/**
* @class
* @param {number} x
* @param {number} y
*/
var vector = function ( x, y ) {
... |
/* @requires
mapshaper-polygon-intersection
mapshaper-dissolve2
mapshaper-path-index
*/
// assumes layers and arcs have been prepared for clipping
MapShaper.clipPolygons = function(targetShapes, clipShapes, nodes, type) {
var arcs = nodes.arcs;
var clipFlags = new Uint8Array(arcs.size());
var routeFlags = new Ui... |
/**
* @module models/user
* @license MIT
*/
/** Dependencies */
const mongoose = require('mongoose');
const strings = require('../helpers/strings');
/** Schema */
const Schema = mongoose.Schema;
const userSchema = new Schema({
id: Number,
first_name: String,
last_name: String,
username: String,
bio: Stri... |
import React,{Component} from 'react';
import { Field, reduxForm } from 'redux-form';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import { createPost } from '../actions/index';
class PostsNew extends Component{
//field element possui event handlers que liga o <Field> ao elemento re... |
var assert = require('assert'),
instant = require('../lib/instantsfun');
describe('InstantsFun', function() {
describe('#getAllList()', function() {
it('should return an object', function(done) {
this.timeout(15000);
instant.getAllList(function(obj) {
assert.throws(function() {
... |
'use strict';
const debug = require('debug')('ways2go:way');
const createError = require('http-errors');
const jsonParser = require('body-parser').json();
const Promise = require('bluebird');
const mongoose = require('mongoose');
mongoose.Promise = Promise;
const parseLocationGoogle = require('../lib/parse-location-g... |
function Dice() {
this.MAX_FACE = 6;
this.face = 0;
this.selected = false;
this.locked = false;
}
function diceRoller(dice) {
dice.face = Math.floor(Math.random() * 6) + 1;
}
function Hand() {
this.dices = [new Dice(),
new Dice(),
new Dice(),
... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.placements = exports.InnerPopper = undefined;
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
v... |
ChartAPI.Range = {};
/**
* return unified Range data object (plain object which does not have prototyped method)
* @param {{start: string|number|Date|null, end: string|number|Date|null, length: string|number|null, maxLength: string|number|null, unit: string|null, dataType: string|null}}
* @return {{start: Date, end:... |
#!/usr/bin/env node
"use strict";
import * as Path from 'path';
import * as fs from 'fs';
import * as os from 'os';
import * as yargs from 'yargs';
import {isInteger} from 'lodash';
import * as packageJson from '../package';
import {red, magenta, yellow, blue, green, reset} from './colors';
import {console, create a... |
BN.addDecl('article').dataTemplate(function(ctx){
var nid = ctx.param('newsid');
return BN('pressa-api').get(nid).then(function(data){
ctx.param('currentarticle', data);
});
}); |
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var config = require('./config')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = require('./webpack.config')
// default port where dev server listens for incoming traffic
var port = process.env.PORT... |
(function () {
'use strict'
const { makeInstructions } = window.c64.cpu
function makeState ({ programStart }) {
return {
memory: new Uint8Array(0x10000),
programCounter: programStart,
status: {
negative: 0,
overflow: 0,
decimal: 0,
interrupt: 0,
zero: 0,
carry: 0,
},
stackP... |
'use strict';
module.exports = {
wrap: require('./Wrap.jsx'),
};
|
module.exports = require('./lib/NodeSoul'); |
import Immutable from 'immutable'
export default new Immutable.OrderedMap(
{ 0: 'Image'
, 1: 'YouTube'
})
|
'use strict'
const TCP = require('libp2p-tcp')
const WS = require('libp2p-websockets')
const mplex = require('libp2p-mplex')
const { NOISE } = require('@chainsafe/libp2p-noise')
const defaultsDeep = require('@nodeutils/defaults-deep')
const libp2p = require('../../..')
async function createLibp2p(_options) {
const ... |
define (
[
'kbwidget',
'bootstrap',
'jquery',
'kbwidget'
], function(
KBWidget,
bootstrap,
$,
KBWidget
) {
return KBWidget({
name: "KBaseInferelatorHitsCard",
version: "1.0.0",
options: {
title: "Inferelator Hits",
isInCard: false,
... |
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])... |
'use strict';
const assert = require('chai').assert;
const ProxyServer = require('../proxy_server');
const Regaliator = require('../../lib/regaliator');
describe('Regaliator', () => {
describe('Rates', () => {
describe('History', () => {
it('Not implemented');
});
describe('List', () => {
... |
import fs from "fs";
import path from "path";
import KoaRouter from "koa-router";
import send from "koa-send";
import _ from "lodash";
import RouteReact from "./RouteReact";
import RouteStatic from "./RouteStatic";
export default class Router {
constructor(props, parent) {
this.parent = parent;
this.api = n... |
#!/usr/local/bin/lycheejs-helper env:node
const _child_process = require('child_process');
const _fs = require('fs');
const _path = require('path');
const _BINARY = process.execPath;
const _SELF = process.argv[1];
const _PROCESSES = [];
const _ROOT = process.env.LYCHEEJ... |
var toArray = require("to-array")
, mutation = require("./mutation")
module.exports = remove
function remove(first) {
var list = toArray(arguments)
list.map(function (elem) {
if (elem && elem.view && elem.view.nodeType) {
return elem.view
}
return elem
}).forEach(... |
const tester = require('../Tester')('wikitree-person');
describe('wikitree-person', () => {
it('basic test', tester.test(
'Theodore Roosevelt Jr',
'http://www.wikitree.com/wiki/Roosevelt-18'
));
after(() => {
tester.cleanup();
});
});
|
// test basic blog template
var fs = require('fs');
var common = require('./common');
var assert = common.assert;
var whiskers = common.whiskers;
common.expected = 1;
var template = fs.readFileSync('test/server/templates/blog.html', 'utf8');
var context = {
blog: {
title: "Scrumptious lessons"
},
posts: [
... |
'use strict'
function ProjectsSanitizer(projects, platform) {
this.projects = projects
this.platform = platform
this.sanitizer = new Sanitizer()
}
ProjectsSanitizer.prototype = {
sanitize: function() {
return this.sanitizer.keepProjectsTargetingPlatform(this.projects, this.platform)
}
}
/* Internal */
... |
angular.module('myMoviesModule'). //jshint ignore:line
directive('myMovies', function (movieService) {
return {
templateUrl: '../js/directives/my-movies/my-movies.template.html',
controller: ['$http', '$scope',
function SeacrhController($http, $scope) {
//movieService.movies = ["tt1323594", "tt0... |
/**
* @param {string} word1
* @param {string} word2
* @return {number}
*/
const minDistance = (word1, word2) => {
/*
let dist[i][j] be the edit distance between
string word1[0..i) and word2[0..j) (using positional index)
- dist[0][j] = j (delete all chars)
- dist[i][0] = i (insert all chars)
... |
/*----------------------------------------------------------*/
/* This is the witica.js client library to access items */
/* from a witica WebTarget including base classes and */
/* common function to write your site specific renderers */
/*----------------------------------------------------------*/
/*--... |
var Monologue = require( 'monologue.js' );
var _ = require( 'lodash' );
var metrics = require( './metricsAdapter' );
var systemMetrics = require( './system' );
var os = require( 'os' );
var convert = require( './converter' );
var hostName, processTitle;
var conversion = {
ns: 1,
us: 1e3,
ms: 1e6,
s: 1e9
};
var de... |
var testality = (function() {
var json = {
parse: function(str) {
var res;
if(window.JSON)
res = JSON.parse(str);
else
res = (new Function("return " + str)) ();
return res;
},
stringify: function(data) {
var res;
if(window.JSON) {
res = JSON.stringify(data);
... |
/*!
* $script.js Async loader & dependency manager
* https://github.com/ded/script.js
* (c) Dustin Diaz, Jacob Thornton 2011
* License: MIT
*/
(function (name, definition, context) {
if (typeof context['module'] != 'undefined' && context['module']['exports']) context['module']['exports'] = definition()
el... |
db.collection('pages', function(err, collection) {
if (err) {
console.log(err);
} else {
console.log('pages');
var page = {'url': '/', 'title': 'Home Page', 'body': 'This is the home page.'};
collection.insert(page);
page = {'url': '/about', 'title': 'About us', 'body': 'Why do we exist? That is... |
var t = require('../index'),
should = require('should'),
fs = require('fs')
describe('tin', function(){
it('should create a TIN from a set of points', function(done){
t.load(__dirname+'/testIn/Points3.geojson', function(err, points){
var syncTin = t.tin(points, 'elevation', function(err, tin){
... |
var fs = require("fs");
var jsonfile = require("jsonfile");
var config = require("./lib/data/config.json");
var dataPath = "../../data/";
if (!fs.existsSync(dataPath)) {
fs.mkdirSync(dataPath);
}
if (!fs.existsSync(dataPath + "config.json")) {
fs.createReadStream("./lib/data/config.json").pipe(fs.createWriteS... |
'use strict';
const UserResponses = require('./../UserResponse/UserResponseModel.js');
const Questions = require('./../Questions/QuestionsModel.js');
const gatherResults = {
getAllData(req, res, next) {
// Gather all response data for all users
UserResponses.findAll({
where: {
questionid: {
... |
'use strict';
/**
* Module dependencies.
*/
var should = require('should'),
mongoose = require('mongoose'),
User = mongoose.model('User'),
Seed = mongoose.model('Seed');
/**
* Globals
*/
var user, seed;
/**
* Unit tests
*/
describe('Seed Model Unit Tests:', function() {
beforeEach(function(done) {
... |
var searchData=
[
['t_5frun',['t_run',['../namespaceparams.html#a923cab407956c82921069b7ec0e69eb9',1,'params']]],
['t_5ftrans',['t_trans',['../namespaceparams.html#aabf0943afa2272a8bbbd58c49ad0db38',1,'params']]],
['ta0',['ta0',['../namespaceparams.html#af3fdd8c130a667bca95de5ebf9e5f492',1,'params']]],
['tltens... |
'use strict';
var insertVersion = require('./insert-version');
var stringConstant = require('./string-constant');
var R = require('ramda');
var utcNow = require('utc-now');
exports.create = function(opts) {
return {
__host: R.always(stringConstant(opts.host)),
__secureHost: R.always(stringConstant(opts.secu... |
module.exports = {
test: () => 'model.loader.foo.fooCamel.test',
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.