code stringlengths 2 1.05M |
|---|
/*
*
* MassiveMap constants
*
*/
export const DEFAULT_ACTION = 'app/MassiveMap/DEFAULT_ACTION';
export const LOAD_HINTS = 'app/MassiveMap/LOAD_HINTS';
export const LOAD_HINTS_ERROR = 'app/MassiveMap/LOAD_HINTS_ERROR';
export const LOAD_HINTS_SUCCESS = 'app/MassiveMap/LOAD_HINTS_SUCCESS';
export const LOAD_STATUS ... |
var initializeDOM = function () {
// Clean the DOM
document.body.innerHTML = '';
var input = document.createElement('input');
input.value = 'TestValue';
input.id = '__REQUESTDIGEST';
document.body.appendChild(input);
};
initializeDOM();
|
/**
* Generics Support for Javascript
* Can be included in any class to enforce dynamic strong typing
**/
var Generics = (function() {
var privateData = new WeakMap();
function Generics(T){
var privateMembers = {};
if(T !== undefined && typeof T.constructor === 'function'){
privateMembers.type = T;
... |
// Generated by CoffeeScript 1.7.1
var addCommas, boundingBox, canvasHeight, canvasWidth, colorbrewerGreen, generateLineGraph, labelPadding, line, lowerErrorBand, margin, orgs, svg, tooltipOffset, upperErrorBand, xAxis, xScale, yAxis, yScale,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length;... |
/*global describe, it */
'use strict';
var assert = require('assert');
var PriorityQueue = require('../src/priority-queue-adt.js');
var pq = new PriorityQueue();
describe('PriorityQueue operations test', function () {
it('should create an empty priority-queue in the beginning', function(){
assert.equal(pq.isEmpty(... |
import {fromJS} from "immutable";
import {MESSAGE_SENT} from "../App/actions/responses";
import {CHANGE_MESSAGE} from "./actions";
import {INSERT_EMOJI} from "../EmojiList/actions";
import {INPUT_ID} from "./constants";
const initState = fromJS({});
export default function(state = initState, action, threadID) {
swi... |
'use strict'
// initialize global listing data object
const dev = '1oDO9zkpaK1wUSynqYgpQzIs3BJVZN9H19DtwQXBjNfw'
const staging = '1nz4bJDJdKXyGvMbzfAYol6TpwfsVyoeKWKLFFjYa1Hw'
const prod = '1oG10rZemC5R6-EcE8bLUofAMoJaqnsS-lgKxGUCuW2c'
let listingsObj
//
// Template Rendering Functions
//
// render template and re... |
// DATA_TEMPLATE: empty_table
oTest.fnStart("aoColumns.bSeachable");
$(document).ready(function () {
/* Check the default */
var oTable = $('#example').dataTable({
"sAjaxSource": "../../../examples/ajax/sources/objects.txt",
"aoColumns": [
{ "mData": "engine" },
{ "mData... |
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||... |
/**
* Created by Vahid on 09/06/15.
*/
/*
*
* A class holding a small list of unisex names (so they can fit any avatar)
*
* */
services.factory('nameGenerator', function () {
// Keeping 20 unisex names to suite the avatars
var nameGenerator = function () {
this.names = ['Addison', 'Ash', 'Bailey... |
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions a... |
version https://git-lfs.github.com/spec/v1
oid sha256:06e5791ea6422573abd377d4d24d3aae58d3cec1e81a860458938ceddbd7a982
size 408272
|
define(["amber/boot", "amber_core/Kernel-Objects", "amber_core/SUnit"], function($boot){"use strict";
if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals... |
/**
* Created by jaifar on 29/10/15.
*/
angular.module("otchi", []).controller("RecipeController", function ($scope, RecipeService) {
$scope.recipesList = RecipeService.fetchAllRecipes();
$scope.addRecipe = function () {
RecipeService.createRecipe($scope.recipe);
$scope.recipe = {};
}
}).... |
import React from 'react';
import { Well, Grid, Row, Col, Button } from 'react-bootstrap';
import ThemeSwitcher from './ThemeSwitcher';
import NewGameModal from './newGame/NewGameModal';
import SaveLoadGameModal from './saveLoadGame/SaveLoadGameModal';
export default class Header extends React.Component {
construct... |
define('pages.rooms', function () {
var listRooms = require('pages.rooms.listRoomslistRooms');
});
|
import NodeController from '../controllers/node.server.controller';
module.exports = function(app){
app.route('/node/list').post(NodeController.nodeList);
}; |
(function (exports) {
'use strict';
/**
* Module : Sparrow extend enum
* Author : Kvkens(yueming@yonyou.com)
* Date : 2016-07-27 21:46:50
*/
var U_LOCALE = "u_locale";
var enumerables = true;
var enumerablesTest = {
toString: 1
};
for(var i in enumerablesTest) {
enumerables = null;
}
if(enumerables) {
enum... |
var seneca = require('../seneca-client')
var sequelize = require('../sequelize').default
var Vendor = sequelize.model('Vendor')
var services = require('../openprices-services')
var Products = services.products
var Vendors = services.vendors
export function getVendors(req, res, next) {
Vendor.all().then(vendors =... |
API = {
authentication: function(apiKey){
return apiKey === Meteor.settings.PNCTSRC_ACCESS_KEY;
},
connection: function(request){
var getRequestContents = API.utility.getRequestContents(request),
apiKey = getRequestContents.api_key,
validUser = API.authentication(apiKey);
if(validUser... |
Package.describe({
summary: "Intercom package"
});
Package.on_use(function (api) {
api.add_files('intercom.js', 'client');
if(api.export)
api.export('Intercom');
});
|
function AngularParser(fileContents) {
this.fileContents = fileContents;
this.result = null;
}
AngularParser.prototype.PATTERNS = {
name: function function_name(type) {
return new RegExp(type + '\\s*\\([\'"](\\w+)[\'"]\\s*,\\s*(.*?)|[(\'")]', 'g');
},
dependencies: {
array: function (name, type) {
... |
/**
* Bootstrap Table Indonesian translation
* Author: Andre Gardiner<andre@sirdre.com>
*/
(function ($) {
'use strict';
$.fn.bootstrapTable.locales['id-ID'] = {
formatLoadingMessage: function () {
return 'Memuat, mohon tunggu...';
},
formatRecordsPerPage: function (pageN... |
import express from 'express';
import bodyParser from 'body-parser';
import http from 'http';
export default function setupApi(customPort, database, callback) {
const app = express();
const httpServer = http.createServer(app);
app.use(bodyParser.json());
app.get('/snapshots', (req, res)=> {
let query = {}... |
$(document).ready(function(){
$('.person:first').trigger('click');
var personName = $('.person:first').find('.name').text();
$('.right .top .name').html(personName);
var userImage = $('.person:first').find('.userimage').html();
$('.right .top .userimage').html(userImage);
var hideContent = $('.p... |
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2015-2016 Rick Wargo. All Rights Reserved.
//
// Licensed under the MIT License (the "License"). You may not use this file
// except in compliance with the License. A copy of the License is located at
// http://opensource.... |
class tvratings_evalrat_1 {
constructor() {
// int BlockedRatingAttributes (EnTvRat_System, EnTvRat_GenericLevel) {ge...
this.Parameterized = undefined;
// int BlockUnRated () {get} {set}
this.BlockUnRated = undefined;
}
// void MostRestrictiveRating (EnTvRat_System, EnTvR... |
var pix = [];
var myCanvas;
var glob;
var glob2;
var glob3;
var makeCanvas = function (elem) {
var retObj= {}, context = elem.getContext('2d'),
canvasArr = context.getImageData(0,0,elem.width,elem.height).data,
greenDist = {};
retObj.getRBG = function (x,y) {
pos1 = (x + elem.width*y)*4;... |
var wss = {
ws: window.WebSocket || window.MozWebSocket,
socket: "",
config: {
msgType: "registe",
body: {}
},
sendMsg: function(msg) {
if(!this.ws) return;
if(this.socket.readyState == WebSocket.OPEN){
this.socket.send(msg);
}else{
alert("WebSocket 连接没有建立成功!");
}
},
sendOper: function(from,... |
/**
* Babel Starter Kit (https://www.kriasoft.com/babel-starter-kit)
*
* Copyright © 2015-2016 Kriasoft, LLC. 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.
*/
class Greeting {
constructor(name) {
this.... |
/* jshint node:true, esnext:true */
"use strict";
var _ = require('lodash');
/**
@module Parcela
@submodule parcel
*/
/**
Represents a section of real state in the HTML page.
All Parcela apps should inherit from this class.
Several properties might be configured on instantiation:
* [containerType](#property_conta... |
'use strict';
const path = require('path');
const electron = require('electron');
const {Application} = require('spectron');
const assert = require('assert');
// DISABLE: tap failed with spectron
// issue reported: https://github.com/electron/spectron/issues/155
// const tap = require('tap');
// tap.test('electron', ... |
const uuid = require('node-uuid');
const crypto = require('crypto');
const {
GraphQLString,
GraphQLNonNull,
} = require('graphql');
const TokenResultType = require('../types/TokenResultType');
const AddProfileType = require('../inputTypes/AddProfileType');
const { profileModel } = require('models');
const { ge... |
var React = require('react');
var classes = require('classnames');
var Option = React.createClass({
propTypes: {
addLabelText: React.PropTypes.string, // string rendered in case of allowCreate option passed to ReactSelect
className: React.PropTypes.string, // className (based on mouse positio... |
/**
* Wraps the tests into a async try-catch
*
* @param {Function} An anonymous function that wraps the tests
* @param {Function} jasmine's done
*/
export default async (tests, done) => {
try {
await tests();
}
catch (e) {
console.error(e);
}
finally {
done();
}
};
|
import { CALCULATE_COLOR_PALETTE, LOAD_INITIAL_APPLICATION_STATE, LOAD_MORE_IMAGES } from '../constants/actionTypes';
import mathHelper from '../utils/mathHelper';
import * as images from '../data/urls';
import * as appConfig from '../constants/appConfig';
import objectAssign from 'object-assign';
import initialState f... |
var actionTypes = require('../constants/actionTypes/modelActionTypes');
const VEHICLES = require('../constants/models').VEHICLES;
const CONSUMERS = require('../constants/models').CONSUMERS;
const SETTINGS = require('../constants/models').SETTINGS;
var commonCRUD = require('../commons/commonReducerFunctions');
var mapAc... |
/**
* @fileOverview Comparison operation computations.
*
* Unlike `atum/value/compare`, these also handle object values.
*/
define(['exports',
'atum/compute',
'atum/fun',
'atum/operations/boolean',
'atum/operations/type_conversion',
'atum/operations/value_reference',
... |
module.exports = function() {
var mongoose = require('mongoose'),
config = require('./config');
// Connect to mongodb
var options = {
db: {
native_parser: true
},
server: {
poolSize: 5
},
user: appConfig.database['USER_NAME'],
... |
const fluentify = require('../fluentify');
const expect = require('chai').expect;
const sinon = require('sinon');
describe('Fluentify API', () => {
it('does not decorate underscore properties', () => {
const obj = {
_one: 1,
_two: '2',
_three: [3],
_four() { },
_five: {}
};
const fluentObj = flu... |
module.exports = (function () {
var _ = require('lodash');
'use strict';
/** route() - Create a middleware
*
* @method ExpressRedisCache.route
* @return {Function} middleware
*/
function route () {
/** The middleware to return
*
* @type Function
*/
var middleware;
... |
#!/usr/bin/env node
require('./modules/config.js').loadConfig();
require('./db');
var version = process.versions.node.split('.');
if (version[0] === 0 && version[1] < 10) {
console.error('Error: Cannot run in Node.js version < 0.10');
process.exit(1);
}
var optimist = require('optimist');
var args = process.argv... |
var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var Show = mongoose.model('Show');
router.get('/api/v1/shows', function(req, res, next) {
Show.find(function(err, shows){
if(err){
return next(err);
}
res.json(shows);
});
});
router.get('*', fun... |
'use strict';
var fs = require('fs');
setTimeout(function(){
fs.writeFile('./test.txt', 'I ran!', function(err){
if(err){
throw err;
}
});
}, 3000);
|
module.exports = (sequelize, DataTypes) => {
const UserGroups = sequelize.define('UserGroups', {
userId: {
allowNull: false,
type: DataTypes.INTEGER
},
groupId: {
allowNull: false,
type: DataTypes.INTEGER
}
}, {
classMethods: {
associate(models) {
},
}
... |
/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'liststyle', 'sr-latn', {
bulletedTitle: 'Bulleted List Properties',
circle: 'Circle',
decimal: 'Decimal (1, 2, 3, etc.)... |
import React from 'react';
import CustomLineDot from './CustomLineDot';
import { changeNumberOfData } from './utils';
import { ResponsiveContainer, LineChart, Line, XAxis, YAxis, ReferenceLine,
ReferenceDot, Tooltip, CartesianGrid, Legend, Brush } from 'recharts';
const data = [
{ name: 'Page A', uv: 400, pv: 2400... |
export { default } from "./../../_gen/openfl/events/TextEvent"; |
$(document).ready(function(){
var $btn_renew = $('#btn_renew');
var $btn_change = $('#btn_change');
var $btn_delete = $('#btn_delete');
var $table = $('#table');
//设置bootstrap-table插件
function setBSTable() {
$table.bootstrapTable({
toolbar : '#toolba... |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 13c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v10zm-6-7c.55 0 1-.45 1-1s-.45-1-... |
// This is the webpack config used for unit tests.
const path = require('path');
// var utils = require('./utils')
const webpack = require('webpack');
const merge = require('webpack-merge');
const baseConfig = require('../webpack.config');
const webpackConfig = merge(baseConfig, {
devtool: 'inline-source-map',
res... |
var through = require("through2"),
gutil = require("gulp-util"),
_ = require("lodash");
module.exports = function (options) {
"use strict";
// if necessary check for required options(s), e.g. options hash, etc.
if (!options) {
throw new gutil.PluginError("gulp-translate-html", "No options supplied");
}
// d... |
//= require graph/sigmajs.loadData
//= require graph/sigmajs.searchNode
//= require graph/sigmajs.fisheye
//= require graph/sigmajs.circularLayout
//= require graph/sigmajs.changeColors
//= require graph/sigmajs.selectNodes
//= require graph/sigmajs.buttonFilters
//= require graph/sigmajs.nodesInfo
//= require graph/si... |
/**
* Created by M08180 on 21/10/2015.
*/
import Reflux from "reflux";
import Actions from "../../actions/actions.js";
import MyCartStore from '../MyCart/MyCart.store.js';
import _ from 'lodash';
import http from '../../core/HttpClient';
let CommercialOffers = Reflux.createStore({
listenables: [Actions],
i... |
var should = require('chai').should()
, sinon = require('sinon')
, BusterGlob = require('buster-glob')
, fs = require('fs')
, JSHint = require('jshint')
, Lint = require('./../lib/lint');
var jshintSettings = {
"predef": [
],
"node" : true,
"camelcase" : true,
"indent" : 2,
"boss" : false,
"... |
export default (entityData = []) => (_, { id }) =>
entityData.find((d) => d.id == id);
|
const Joi = require('joi');
module.exports = {
schema: Joi.object().keys({
meta: Joi.object().keys({
id: Joi.string().required(),
description: Joi.string().required(),
name: Joi.string().required(),
repository: Joi.string().required(),
version: Joi.string().required(),
}).requir... |
import { setData } from '@progress/kendo-angular-intl';
setData({
name: "fr-CD",
likelySubtags: {
fr: "fr-Latn-FR"
},
identity: {
language: "fr",
territory: "CD"
},
territory: "CD",
calendar: {
patterns: {
d: "dd/MM/y",
D: "EEEE d MMMM ... |
module.exports = function(grunt) {
grunt.initConfig ({
sass: {
dist: {
files: {
'public/css/style.css' : 'src/scss/application.scss'
}
}
},
watch: {
options: {
livereload: true
},
source: {
files: ['gruntfile.js','src/scss/**/*.scss',... |
'use strict';
var frisby = require('frisby');
var config = require('../../test-config.json');
var args = config[process.env.test || 'local'];
var host = args.host,
clientId = args.clientId,
usr = args.user1,
pwd = args.password1;
//Testing the happy path for user-course CRUD
frisby.create('Log in')
.... |
import type { Config } from './../../types/Redis.type';
import type { Environment } from './../../types/Environment.type';
function config(environment: Environment = process.env): Config {
const isProd = environment.NODE_ENV === 'production';
return {
host: isProd ? environment.REDISHOST : '127.0.0.1',
po... |
'use strict'
module.exports = concatRows
var extend = require('util-extend')
var ops = require('ndarray-ops')
var pool = require('ndarray-scratch')
var defaults = {
dtype: 'double'
}
function concatRows () {
var output, input, inputs, options, d, i, shape, idx, l, slice
options = extend({}, defaults)
if (a... |
//
// Copyright (c) 2015 by Mattermind Labs. All Rights Reserved.
//
var React = require('react');
var SchemeStore = require('../stores/SchemeStore');
var PaletteStore = require('../stores/PaletteStore');
var SchemeVar = require('./SchemeVar.react');
var _ = require('lodash');
function getState() {
return {
sch... |
import { action, computed, observable } from 'mobx'
import api from './_api'
export default class ExamStore {
@observable words
@observable test
@observable done
@observable selectedWord
@observable hintLevel
@observable lastAnswer
@observable testPhase
@observable leitnerCats
constructor() {
th... |
if ( 'Promise' in ( typeof window !== 'undefined' ? window : self ) ) {
/*!
localForage -- Offline Storage, Improved
Version 1.3.1
https://mozilla.github.io/localForage
(c) 2013-2015 Mozilla, Apache License 2.0
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object... |
(function () {
'use strict';
var Marionette = require('backbone.marionette');
var Behaviors = {
/* your behaviors here */
};
Marionette.Behaviors.behaviorsLookup = function () {
return Behaviors;
};
})();
|
var MapProc = {
voronoi: new Voronoi(),
diagram: null,
margin: 0.0,
canvas: null,
numberOfNodes: 1000,
bbox: {
xl: 0,
xr: 800,
yt: 0,
yb: 600
},
numberOfPlates: 14,
plateRootIds: [],
sites: [],
numberOfIterations: 2,
showPla... |
// Allow a form to post without navigating to another page:
postForm = function(oFormElement) {
if (!oFormElement.action) { return; }
var oReq = new XMLHttpRequest();
if (oFormElement.method.toLowerCase() === "post") {
oReq.open("post", oFormElement.action);
oReq.send(new FormData(oFormEleme... |
var assert = require('assert');
var Client = require('../');
var Put = require('put');
var zmq = require('zmq');
var testLiveCli = require('./util').testLiveCli;
var config = {};
var port = config.blkport = config.txport = 'ipc:///tmp/ob-test-port';
var block0 = {
height: 0,
header: '0100000000000000000000000... |
(function() {
//Templates used here. Makes it easy to update.
var listBodyTemplate = '<input-list-body>' +
'<button data-list-id="%n-item-list" class="input-list-add-button">+</button>' +
'<span><input class="input-list-add-text" type="text" title="New Item" /></span>' +
'<ul id="%n-item-list" data-form-... |
#!/usr/bin/env node
/**
* Zenvia SMS Callbacks Server - Usage Examples
*
* Functions:
* startServer(port) - Set API Credentials
* events - Promise to listen received data from Zenvia SMS Servers
*
*
* Delivery status example:
* {
* "callbackMtRequest": {
* "status": "03",
* "st... |
(function($, undefined) {
/**
* Unobtrusive scripting adapter for jQuery
* https://github.com/rails/jquery-ujs
*
* Requires jQuery 1.8.0 or later.
*
* Released under the MIT license
*
*/
// Cut down on the number of issues from people inadvertently including jquery_ujs twice
// by detecting and raising an... |
!function($) {
"use strict";
var SweetAlert = function() {};
//examples
SweetAlert.prototype.init = function() {
//Basic
$('#sa-basic').click(function(){
swal("Here's a message!");
});
//A title with a text under
$('#sa-title').click(function(){
... |
var MidiWriter = require('..');
var track = new MidiWriter.Track();
track.addEvent([
new MidiWriter.NoteEvent({
pitch: 'C4',
duration: 'T50',
startTick: 0
}),
new MidiWriter.NoteEvent({
pitch: 'E4',
duration: 'T50',
startTick: 50
}),
new MidiWriter.NoteEvent({
pitch: ['G4', ... |
module.exports = (() => function(value){
// Another parseFloat b/c null isn't NaN, but parseFloat(null) is NaN
var isString = typeof value === "string";
var isNumeric = !isNaN(parseFloat(value));
if (isString) {
isNumeric = isNumeric && /^[\d\.]+$/.test(value);
var numberEndsOnDecimalPoi... |
'use strict';
const Path = require('upath');
const expect = require('unexpected').clone();
const helpers = require('../lib/helpers');
const babyTolk = require('@pingy/compile');
function getPath(path) {
return Path.join(process.cwd(), 'examples', 'site', path);
}
describe('helpers', function() {
describe('findSo... |
import Minesweeper, { BlockRecord } from './minesweeper';
const mw = Minesweeper();
const iterate = 100;
const counter = {
win: 0,
lose: 0
};
const now = new Date();
const testset = new Array(iterate).fill(0).map(() => {
mw.blocks = mw.reset(16, 16, 40, true, false);
counter[mw.solver(
mw.clickOn(new BlockRec... |
$( document ).ready(function() {
console.log( "document loaded" );
});
$(document).on('click',"[id^=btn_mood] , .p_day", function (event) {
// alert (var day=event.target.id;event.target.id);
var day_clicked=event.target.id;
$('#myModal').attr('data-id', day_cl... |
const _ = require('lodash')
const crypto = require('crypto')
const userRouter = require('../src/resource/user/user.router')
/**
* @param {object} supertest Supertest instance
* @return {object}
*/
module.exports = function testHelperFactory (supertest) {
return {
request (options) {
const ... |
const {User} = require('../models')
const jwt = require('jsonwebtoken')
const config = require('../config/config')
function jwtSignUser (user) {
const ONE_WEEK = 60 * 60 * 24 * 7
return jwt.sign(user, config.authentication.jwtSecret, {
expiresIn: ONE_WEEK
})
}
module.exports = {
async register (req, res) ... |
!function(){$(".mobile-menu__toggle").on("click",function(){$(".mobile-menu").slideToggle(),$(this).attr("src","img/cross.png")})}(); |
define([ 'config/types' ], function ( types ) {
'use strict';
return function ( tokens ) {
var i, current, backOne, backTwo, leadingLinebreak, trailingLinebreak;
leadingLinebreak = /^\s*\r?\n/;
trailingLinebreak = /\r?\n\s*$/;
for ( i=2; i<tokens.length; i+=1 ) {
current = tokens[i];
backOne = token... |
// app/models/assistanceRequest.js
// load the things we need
let mongoose = require('mongoose');
// define the schema for our user model
let assistanceRequestSchema = mongoose.Schema({
requestTime: {type: Date, default: Date.now},
student: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
course: {type: mongoos... |
var Hapi = require('hapi');
var server = new Hapi.Server();
server.route({
handler: function (request, reply){
request.response.header('X-Frame-Options', 'DENY')
}});
|
// Medication page spec
describe("medication-page", function () {
//browser.get('#/');
it("should load", function () {
// Login as an provider
element(by.model("loginData.username")).sendKeys("doctor1");
element(by.model("loginData.password")).sendKeys("Password1?");
element(by... |
(function(){
var redirectKey = 'ir.loginRedirectRoute';
Session.set(redirectKey, null);
_.extend(Router, {
_route: Router.route,
route: function(name, options){
function isLoggedIn() {
if(options.isLoggedIn !== undefined)
return options.isL... |
// Generated on 2015-06-02 using
// generator-webapp 0.5.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// If you want to recursively match all subfolders, use:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// Time how long tasks t... |
/**
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var isNumeric = require('fast-isnumeric');
// used in the drawing step for 'scatter' and 'scattegeo' and
// i... |
/**
* File-based data storage
*/
const fs = require('fs');
const path = require('path');
const args = process.argv.splice(2); // splice out "node cli_tasks.js" to elave arguments
const command = args.shift(); // pull out first argument (the command)
const taskDescription = args.join(' ');
const... |
var global = require("../global")
, SimpleOrm = require("../../simpleorm")
, Model = SimpleOrm.Model
, DbHelper = SimpleOrm.DbHelper
, Orms = require("./orms")
, Q = require("q")
, EventEmitter = require('events').EventEmitter;
function Metric (info){
var me = this;
EventEmitter.call(this);
this.set = functi... |
/*! jQuery UI - v1.9.2 - 2013-09-25
* http://jqueryui.com
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
jQuery(function(e){e.datepicker.regional.sv={closeText:"Stäng",prevText:"«Förra",nextText:"Nästa»",currentText:"Idag",monthNames:["Januari","Februari","Mars","April","Maj","Jun... |
// Regular expression that matches all symbols in the Vertical Forms block as per Unicode v8.0.0:
/[\uFE10-\uFE1F]/; |
module.exports = function abort(opts) {
if (typeof opts === 'number') {
opts = { delay: opts }
}
opts = opts || {}
var delay = +opts.delay || 10
return function abort(req, res, next) {
setTimeout(destroy, delay)
function destroy() {
if (req.socket.destroyed) {
if (!opts.next) retu... |
const fs = require('fs');
const path = require('path');
const babelcfg = JSON.parse(fs.readFileSync('./.babelrc'));
babelcfg.plugins.push([
'transform-es2015-modules-commonjs',
{ loose: true },
]);
require('babel-register')(babelcfg);
setTimeout(() => {
require(path.join(process.cwd(), '__manual__', `${process.a... |
/*
* Function utils `body()` tests
*/
var assert = require('assert')
var isArray = require('util').isArray
var fnutils = require('..')
describe('#body', function () {
describe('with an empty function', function () {
it('should return an empty string', function (done) {
function test () {}
assert.... |
export default {
title: 'Core/Template',
};
export const StringOnly = () =>
'<my-button :rounded="false">A Button with square edges</my-button>';
StringOnly.story = {
name: 'string only',
};
|
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import App from './containers/App';
import configureStore from './store/configureStore';
import './app.global.css';
const store = configureStore();
render(
<Provider store={store}>
<App />
</Provider>,
doc... |
const editorOptions = [
'minLines',
'maxLines',
'readOnly',
'highlightActiveLine',
'tabSize',
'enableBasicAutocompletion',
'enableLiveAutocompletion',
'enableSnippets',
]
export {
editorOptions,
} |
// in this file create an express application - use the middle-ware built into express
// to serve up static files from the public directory (index.html and client.js - you
// can also serve up css files from the public directory this way if you want)
// you need to support a '/trucks' endpoint, and a dynamic rout... |
MeteorOS.FS.ContextMenus.Dir = {
id: 'MeteorOS-FS-ContextMenus-Dir',
data : [
{
header: 'Main Actions'
},
{
icon: 'glyphicon-save-file',
text: 'Download Directory (as .zip)',
action: function(event, selector, context) {
cont... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.