code
stringlengths
2
1.05M
var crypto = require('crypto'); var fs = require('fs'); var keypair = require('keypair'); var pair = keypair(); fs.writeFile('Publickey.pem', pair.public, function (err) { if (err) { console.log('Cant write Public key to file!'); } }); fs.writeFile('Privatekey.pem', pair.private, function (e...
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _stringify = require('babel-runtime/core-js/json/stringify'); var _stringify2 = _interopRequireDefault(_stringify); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); expor...
ngapp.controller('resolveModalController', function ($scope, errorTypeFactory, pluginErrorService, hotkeyService) { // HELPER FUNCTIONS let prepareResolutions = function() { $scope.resolutions = pluginErrorService.getResolutions($scope.error); $scope.selectedIndex = $scope.resolutions.indexOf($s...
$(document).ready(function(){ console.log('this is here'); global_force = null; track_submit(); }); function track_submit(){ $('#target_country').on('change', function(){ //empty the div $('#viz').empty(); $('#grouping').hide(); var target_country = this.value; var obj_ = {'team': target_country}; con...
module.exports = function(grunt) { "use strict"; grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), licence: grunt.file.read("LICENSE"), uglify: { options: { banner: "/*\n<%= pkg.name %> v<%= pkg.version %> \n\n<%= licence %>*/\n", preserveComments: "some" }, ...
var fs = require("fs"); var path = require("path"); fs.unlink(path.join(__dirname, "testFileThatMustExists.txt"), function (err) { if (err) throw err; console.log('successfully deleted testFileThatMustExists.txt'); });
/* global process, nodeRequire*/ (function () { const top= `${process.cwd().replace(/\\/g,"/")}`; const build= `${top}/build`; const www=`${top}/www`; const js=`${www}/js`; const gen=`${js}/g2`; //console.log(`${js}/reqConf2.js`); const fs=nodeRequire("fs"); //console.log(fs.existsSync(`...
export default { "davis_rain": { "desc": "降雨传感器", "port": "PI", "port_nums": [0, 1], "data_nums": [ { "data_num": 0, "unit": "mm", "type": "rain", "desc": "降雨量" } ] }, "mec10": { ...
module("basic context"); Handlebars.registerHelper('helperMissing', function(helper, context) { if(helper === "link_to") { return new Handlebars.SafeString("<a>" + context + "</a>"); } }); var shouldCompileTo = function(string, hashOrArray, expected, message) { shouldCompileToWithPartials(string, hashOrArra...
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { ext...
function randomPos(w, h) { return new Two.Vector(Math.random() * w, Math.random() * h); } function Model(world) { var self = this; this.world = world; this.despawn = function() { var agent = self.world.agents.pop(); self.publish('despawn', agent); } this.spawn = function() { var position = randomPos(sel...
class InvoicesAll{ constructor(){ if( $('#invoices').length == 0 ) return; this.bindEvents(); this.getUnpaidInvoices(); this.startLoading(); } bindEvents(){ var _this = this; $('[data-action="get-all-invoices"]').click(func...
// All symbols in the Small Form Variants block as per Unicode v6.0.0: [ '\uFE50', '\uFE51', '\uFE52', '\uFE53', '\uFE54', '\uFE55', '\uFE56', '\uFE57', '\uFE58', '\uFE59', '\uFE5A', '\uFE5B', '\uFE5C', '\uFE5D', '\uFE5E', '\uFE5F', '\uFE60', '\uFE61', '\uFE62', '\uFE63', '\uFE64', '\uFE65', '\uF...
import Draw from './L.PM.Draw'; Draw.Circle = Draw.extend({ initialize(map) { this._map = map; this._shape = 'Circle'; this.toolbarButtonName = 'drawCircle'; }, enable(options) { // TODO: Think about if these options could be passed globally for all // instances of L...
import Ember from 'ember'; import BasicMetadata from '../generics/basic-metadata'; /** * Defines a slot where items can be worn in * a body. Slots are defined per race. * * @class WearableSlot * @namespace Inventory * @extends {Ember.Object} * @uses BasicMetadata */ export default Ember.Object.extend(BasicMeta...
const test = require('ava'); var CssbeautifyCli = require('../lib/cssbeautify-cli'), cssbeautifyCli; test('withoutNew', function (test) { cssbeautifyCli = CssbeautifyCli(); test.is(cssbeautifyCli instanceof CssbeautifyCli, true); }); test('withNew', function (test) { cssbeautifyCli = new CssbeautifyCl...
import {extend} from './utils'; const DEFAULT_BASE_URL = '/fixtures'; const DEFAULT_RESET_URL = '/_ah/yawp/datastore/delete-all'; const DEFAULT_LAZY_PROPERTIES = ['id']; // needed till harmony proxies const DEFAULT_FETCH_OPTIONS = {}; export default (request) => { class Fixtures { constructor() { ...
import React from 'react' import R from 'ramda' import { connect } from 'react-redux' import h from "lib/ui/hyperscript_with_helpers" import { createObject } from 'actions' import { getIsCreating, getOrgRolesAssignable, getCurrentOrg, getApps, getImportErrors } from 'selectors' import {AppForm, UserForm} from...
'use strict' module.exports = { collections: { users: { username: { type: 'STRING 100' }, password: { type: 'STRING 60' }, role: { type: 'STRING 255', comment: 'May contain a comma-separated list of roles, e.g.: \'moderator, admin\'' } }, ...
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore, applyMiddleware } from 'redux'; import {Router, Route, IndexRoute, browserHistory} from 'react-router'; import reduxThunk from 'redux-thunk'; import axios from 'axios'; import requireAuth from './...
var AWS = require('../core'); AWS.Route53 = AWS.Service.defineService('route53', ['2012-12-12'], { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.on('build', this.sanitizeUrl); }, /** * @api private */ sanitizeUrl: function sanitiz...
!function(t){t.fn.datetimepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พ...
import test from 'ava' import {comparePolygons} from './helpers/asserts' test('comparePolygons on same single vertex', t => { let a = {vertices: [{_x: 0, _y: 0, _z: 0}]} t.true(comparePolygons(a, a)) }) test('comparePolygons on different vertices', t => { let a = {vertices: [{_x: 0, _y: 0, _z: 0}]}, b = {vertic...
var expect = require("expect.js"); var JsonDB = require("../JsonDB.js"); var DatabaseError = require("../lib/Errors").DatabaseError; var DataError = require("../lib/Errors").DataError; var fs = require('fs'); var testFile1 = "test/test_file1"; var testFile2 = "test/dirCreation/test_file2"; var faulty = "test...
/*! * Bootstrap v3.2.0 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=cac3ae4c7dbc1bbac143) * Config saved to config.json and https:...
var chatList = document.getElementById("chat-messages"); if (chatList) { // Get IRC updates from the couch Couch.urlPrefix = '/couch'; var db = Couch.db('rochackircmarkov'); db.changes(null, { include_docs: true, filter: 'couchgrams/text' }).onChange(function (resp) { if (re...
import React from 'react'; import { Link } from 'react-router-dom'; import { Field, FieldArray, reduxForm } from 'redux-form'; import { TextField } from 'redux-form-material-ui'; import api from 'lib/api'; import * as helper from 'lib/helper'; import messages from 'lib/text'; import style from './style.css'; import T...
d3.chart('BaseChart').extend('BarChart', { initialize: function() { var chart = this; chart.base .classed('Barchart', true); // make actual layers chart.layer('bars', chart.areas.plot, { // data format: // [ { name : x-axis-bar-label, value : N }, ...] dataBind : function(dat...
// Eloquent JavaScript // Run this file in your terminal using `node my_solution.js`. //Make sure it works before moving on! // Program Structure // Write your own variable and do something to it. var myName = "Erica"; //User Input // var fav = prompt("What's your favorite food?"); // if (fav) { // console.log("Hey...
/*! * rss controller */ const config = require('../config') const convert = require('data2xml')() const { Post } = require('../services/') const render = require('../common/render') const cache = require('../common/cache') /** * rss输出 * @param req * @param res * @param next */ exports.index = async (req, res,...
var os = require('os'); var CMD_SEPARATOR = "\r\n"; module.exports = function(commandLine, output, cb, socket) { var commandParts = commandLine.split(' '); if (commandParts.length != 2) { output('501 Syntax: HELO hostname' + CMD_SEPARATOR); } else { output('250 ' + os.hostname() + CMD_SEPAR...
version https://git-lfs.github.com/spec/v1 oid sha256:f2b63a5514ad1eaaecedf5c69e09d67a5ddeb1bf840e147a4d4c65f2c2b41ee4 size 1970
version https://git-lfs.github.com/spec/v1 oid sha256:9db15624b9307b4395766aa64e0887d6c2431edc356d1e19eb4c90968f3033fc size 87677
const Planet = require(__dirname + '/../model/model.js'); module.exports = [ { method: 'GET', path: '/planets', handler: function(req, reply) { Planet.find({}, (err, docs) => { if (err) { return reply(err); } return reply(docs); }); } }, { method:...
;(function(factory){var registeredInModuleLoader=false;if(typeof define==='function'&&define.amd){define(factory);registeredInModuleLoader=true;} if(typeof exports==='object'){module.exports=factory();registeredInModuleLoader=true;} if(!registeredInModuleLoader){var OldCookies=window.Cookies;var api=window.Cookies=fact...
/** * Created by hxsd on 2016/3/28. */ /*直接扩展与原型扩展的区别在于 原型扩展是对类型的 直接扩展是对实例的*/ /* 第一个 * 获取视口的宽度和高度,自定义函数 * */ window._width = function(){ var pageWidth = window.innerWidth; //若之前拿到的不是一个数 if(typeof pageWidth != "number"){ if(document.compatMode == "CSS1Compat"){ pageWidth = do...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* tslint:disable:no-unused-variable */ var app_component_1 = require("./app.component"); var testing_1 = require("@angular/core/testing"); var platform_browser_1 = require("@angular/platform-browser"); //////// SPECS ///////////// describe(...
'use strict'; // Init the application configuration module for AngularJS application var ApplicationConfiguration = (function() { // Init module configuration options var applicationModuleName = 'railway'; var applicationModuleVendorDependencies = ['ngResource', 'ngCookies', 'ngSanitize', 'ui.router', 'u...
/* *********************************************************** * This file was automatically generated on 2014-12-10. * * * * Bindings Version 2.0.4 * * * * If...
import moment from 'moment'; export function dateToString(date) { if (date) { return moment(date).format('MMM Do [at] h:mm A'); } return null; }
import React, { Component } from 'react'; import { Grid } from 'semantic-ui-react'; import PropTypes from 'prop-types'; import SocialLinkItem from './SocialLinkItem'; class SocialLinks extends Component { render() { const { links } = this.props; const { only } = this.props; const { textAlign } = this.pr...
// Create global ionic obj and its namespaces // build processes may have already created an ionic obj window.ionic = window.ionic || {}; window.ionic.views = {}; window.ionic.version = '<%= pkg.version %>'; (function (ionic) { ionic.DelegateService = function(methodNames) { if (methodNames.indexOf('$getByHan...
/** * This file/module contains all configuration for the build process. */ module.exports = { /** * The `build_dir` folder is where our projects are compiled during * development and the `compile_dir` folder is where our app resides once it's * completely built. */ src_dir: '../client', ...
/* * provider * * Copyright Cahoots.pw * MIT Licensed * */ /** * @author André König <andre@cahoots.ninja> * */ 'use strict'; var util = require('util'); var debug = require('debug')('cahoots:provider:person'); var mandatory = require('mandatory'); var VError = require('verror'); var BaseService = require...
import React, { Component } from 'react'; import { Field, reduxForm } from 'redux-form'; import LANGUAGES from './LANGUAGES'; import validate from './validate'; import MultiSelect from '../MultiSelect/MultiSelect'; import s from './styles.css'; const OPTIONS = [ { label: 'From Birth', value: 0 }, ]; for (let i = 1;...
import React, {Component} from 'react' import SectionMain from '../components/SectionMain' import styles from '../sass/App' import Actionbar from '../../shared/components/Actionbar' class App extends Component { constructor() { super() } componentDidMount() { const {actions, cats} = this.p...
require.define({ "program": function(require, exports, module) { var test = require('test'); test.assert(typeof require == 'function', 'require is a function'); test.assert(typeof exports == 'object', 'exports is an object'); test.assert(module.id == 'program', 'module.id is program'); require('a'); ...
module.exports = class Provider { constructor(data) { this.name = data.name; this.url = data.url; } };
import 'normalize.css/normalize.css'; import React, { Component } from 'react'; import FontFaceObserver from 'fontfaceobserver'; import classnames from 'classnames'; import './assets/base_scss/__base.scss'; import MosaicContainer from './components/Mosaic/MosaicContainer'; import ContentGridContainer from './component...
import React from 'react'; function Tip(props) { return ( <div className="Tip"> <span className="label"> {props.label} </span> <span className="value"> {props.value} </span> </div> ); } export default Tip;
import Vue from 'vue'; import { mountComponentWithStore } from 'helpers/vue_mount_component_helper'; import DraftsCount from '~/batch_comments/components/drafts_count.vue'; import { createStore } from '~/batch_comments/stores'; describe('Batch comments drafts count component', () => { let vm; let Component; bef...
/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Version: 1.1.0-pre * Requires jQuery 1.3+ * Docs: http://docs.jquery.com/Plugins/livequery ...
module.exports = require('./lib/scotty')
var mongoose = require('../../lib/mongodb'); const tools=require('../../lib/tools'); const coupon={ id: {type: Number, required: true, unique: true},//主键 cId:{type:Number,required:true,default:0},//优惠券ID code:{type:String,required:true,default:'',unique:true},//优惠码(加密) name:{type:String,required:true,d...
'use strict'; describe('Controller: MainController', function() { // load the controller's module beforeEach(module('voteroidApp')); beforeEach(module('socketMock')); var scope; var MainController; var $httpBackend; // Initialize the controller and a mock scope beforeEach(inject(function(_$httpBacke...
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.ex...
//PageHandlerSpec.js 'use strict'; describe('PageHandler', function(){ beforeEach(module('app.pagehandler')); var PageHandler; var randomFloat; beforeEach(inject(function (_PageHandler_) { PageHandler = _PageHandler_; randomFloat = Math.random(); })); it('should load the modul...
'use strict'; $(document).ready(function(){ var $slide1 = $("#slide1"), $slide1Header = $("#slide1 h1"), $slide1Img = $('#slide1 img'), $slide1Text = $('#slide1 p'), $slide2 = $("#slide2"), $slide2Header = $("#slide2 h1"), $slide2Img = $('#slide2 img'), $slide2Text = $('#...
(function (angular, _, moment) { 'use strict'; angular.module('aif-boolean-input', []).directive('aifBooleanInput', [ function () { return { restrict: 'A', replace: true, templateUrl: 'templates/aif/boolean-input.html', scope: ...
/** * * COMPUTE: nanmean * * * DESCRIPTION: * - Computes the arithmetic mean over an array of values ignoring any values which are not numeric. * * * NOTES: * [1] * * * TODO: * [1] * * * LICENSE: * MIT * * Copyright (c) 2014. Athan Reines. * * * AUTHOR: * Athan Reines. kgryte@gmail.com. 2014. * */ (function() {...
// directive skeleton taClassified.directive('ta-angry', function(){ return { restrict: 'E', template: '&gt;:( <span ng-transclude></span> !!', transclude: true, link: function($scope, element, attrs) { element.css({ 'background-color': 'yellow', color: 'red', padding: '10px', 'fo...
module.exports = config = function() { this.port = 3000; this.startSeed = ""; this.recacheIntervalInSeconds = "60"; this.isDebug = false; };
'use strict'; module.exports = function(app) { var photos = require('../controllers/photos.server.controller'); var photosPolicy = require('../policies/photos.server.policy'); // Photos Routes app.route('/api/photos').all() .get(photos.list).all(photosPolicy.isAllowed) .post(photos.create); app.rou...
var should = require( 'should' ); var _ = require( 'underscore' ); var testConfig = require( './config' ); var rongSDK = require( '../index' ); var chatroomIDs = _.keys( testConfig.chatroom.chatroomIdNamePairs ); var chatroomNames = _.values( testConfig.chatroom.chatroomIdNamePairs ); describe( 'Chatroom Te...
var assert = require('assert'); var checkval = require('../src/checkval'); describe('Validate alphaNumeric', function() { it('Throwing errors', function() { var value, isValid; value = '1234TeSt'; isValid = true; try { checkval().add(value, 'field').alphaNumeric().throw(); // valid } catch (err) { ...
var express = require('express'); var router = express.Router(); var bodyParser = require('body-parser'); var crypto = require('crypto'); var pool = app.get('pool'); router.use(bodyParser.json()); router.use(bodyParser.urlencoded({ extended: false })); function hash(password) { var key = crypto.pbkdf2Sync(passwor...
import mongoose from 'mongoose'; import config from '../config'; import {logDBStartUp} from './loggerService'; export function startDBLink() { const url = config.dbUrl; const options = {promiseLibrary: global.Promise}; mongoose.Promise = global.Promise; mongoose.connect(url, options, err => logDBStartUp(err));...
import chai from 'chai'; import MessageFactory from '../../src/services/message-factory.js'; import { Future } from 'ramda-fantasy'; import { SmsMessage } from '../../src/messages'; import { Typed } from 'typed-immutable'; chai.expect(); const expect = chai.expect; const assert = chai.assert; var reader, factory; co...
#!/usr/bin/env node var port = 8594; var url = "http://127.0.0.1:" + port ; const socket = require('socket.io-client')(url); console.log(process.argv); var args = process.argv; socket.on('connect', function(){ console.log('connected'); socket.emit('transcodeJob', args); socket.on('jobComplete', function(){ proc...
/** * DevExtreme (ui/slide_out_view.js) * Version: 16.2.5 * Build date: Mon Feb 27 2017 * * Copyright (c) 2012 - 2017 Developer Express Inc. ALL RIGHTS RESERVED * EULA: https://www.devexpress.com/Support/EULAs/DevExtreme.xml */ "use strict"; var $ = require("jquery"), fx = require("../animation/fx"), cli...
'use strict'; var getDomjs = require('es5-ext/function/pluck')('_domjs') , assign = require('es5-ext/object/assign') , forEach = require('es5-ext/object/for-each') , d = require('d') , autoBind = require('d/auto-bind') , lazy = require('d/lazy') , memoizeMe...
import { testSaga } from 'redux-saga-test-plan'; import { logoutSaga, watchLogoutSaga, logout } from '../logout.module'; import * as api from '../../../core/api'; import { setLocation } from '../../../../common/core/location'; import * as routes from '../../../../../common/routes'; test('logoutSaga should call signI...
var audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext); // use web audio context api to play sound of notification var beep = function(duration, frequency, volume, type, callback) { var oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); osc...
"use strict"; const log = require("npmlog"); const dedent = require("dedent"); const getFilteredPackages = require("./lib/get-filtered-packages"); module.exports = filterOptions; module.exports.getFilteredPackages = getFilteredPackages; function filterOptions(yargs) { // Only for 'run', 'exec', 'clean', 'ls', and ...
// @flow import React from 'react' import { merge } from 'lodash' import Form from './Form' import Code from './Code' import type { ConfigData } from '../types/ConfigData.type' import '../scss/index.scss' type State = { formData: ConfigData } class App extends React.Component<{}, State> { state = { formData: ...
import Client from './client' import Utils from './utils' import Storage from './storage' var Marketcloud = Marketcloud || {} // The client class Marketcloud.Client = Client // Interface to browser storage methods Marketcloud.Storage = Storage // Utility functions Marketcloud.Utils = Utils // Exporting to the win...
// ==UserScript== // @name Kykyruza EAN Saver // @namespace https://github.com/alezhu/kykyryza_ean_saver // @version 1.1.1 // @description Manage kykyruza EAN on login page // @author alezhu // @match https://oplata.kykyryza.ru/personal/pub/Entrance* // @match https://classic.oplata...
import pickBy from 'lodash/pickBy'; import uniq from 'lodash/uniq'; import unionBy from 'lodash/unionBy'; import union from 'lodash/union'; import shuffled from 'kolibri.utils.shuffled'; import { assessmentMetaDataState } from 'kolibri.coreVue.vuex.mappers'; import { ContentNodeResource, ContentNodeSearchResource } fro...
// good/index/index.js var app = getApp(); Page({ /** * 页面的初始数据 */ data: { good_list_url:"api/good/list",//商品列表--分页获取 aside_nav:"api/good/category",//侧栏分类导航栏 good_list_obj:{//分页获取商品的参数 page:1,//当前页默认1开始 dataCount:10,//每页显示的数据 sort: 1, //排序,sort=1:升序 , sort=0:降序 flag: 0, //...
var express = require('express'); var router = express.Router(); var tool = require('../utility/tool'); var path = require('path'); var passport = require('passport'); var Strategy = require('passport-local').Strategy; var logger = require('../utility/logger'); passport.use(new Strategy( { usernameField: '...
var gulp = require('gulp'), less = require('gulp-less'), rename = require('gulp-rename'); gulp.task('js', function () { gulp.src('src/**/*.js') .pipe(rename('popper.js')) .pipe(gulp.dest('dist/')); }); gulp.task('less', function () { gulp.src('src/**/*.less') .pipe(less()) .pipe(gulp.dest('dist/')...
// ==UserScript== // @name Myoot // @description Prevents any stray audio clips from automatically playing on AIM games. // @namespace kaffeinition@gmail.com // @include http://aimgames.forummotion.com/* // @version 1.9 // @icon http://www.mediafire.com/convkey/c313/jnx13q9ha6j01w9zg.jpg // ==/U...
/** * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. // For the complete reference: // http://docs.ckeditor.com/#!/...
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt // ------------- // Menu Display // ------------- // $(cur_frm.wrapper).on("grid-row-render", function(e, grid_row) { // if(grid_row.doc && grid_row.doc.fieldtype=="Section Break") { // $(grid_row.row).css({"font-...
'use strict'; /* Directives */ var app = angular.module('guestBook.directives', []); app.directive('message', function() { return { restrict: 'EA', scope: { from: '@', text: '@', date: '@', modDate: '@' }, replace: true, template: '<div>' + '<p>From: {{ from }}</p...
import EmberObject from '@ember/object'; import RSVP from 'rsvp'; import {defineProperty} from '@ember/object'; import {describe, it} from 'mocha'; import {expect} from 'chai'; import {settled} from '@ember/test-helpers'; import {setupTest} from 'ember-mocha'; import {task} from 'ember-concurrency'; describe('Unit: Co...
module.exports = ({ platosPorPromos }) => { return Promise.all( platosPorPromos.upsert({ platoId: 4, promoId: 1, }), platosPorPromos.upsert({ platoId: 3, promoId: 2, }) ); };
import { expect } from 'chai'; import { describeModule, it } from 'ember-mocha'; describeModule( 'route:characters/edit', 'CharactersEditRoute', { // Specify the other units that are required for this test. // needs: ['controller:foo'] }, function() { it('exists', function() { let route...
'use strict'; var React = require('react'); var validator = require('../validation'); var formValidation = new validator(); var Radio = React.createClass({ displayName: 'Radio', propTypes: { required: React.PropTypes.bool, name: React.PropTypes.string.isRequired, label: React.PropTypes.string, groupClassName...
import webpack from 'webpack'; import ExtractTextPlugin from 'extract-text-webpack-plugin'; import config from '../../config'; import _debug from 'debug'; const debug = _debug('app:webpack:production'); export default (webpackConfig) => { debug('Create configuration.'); if (config.compiler_source_maps) { deb...
/* * GET home page. */ module.exports = function(app) { app.get('/', function(req, res) { console.log('inside app.get("/")'); res.render('index', { title: 'The web app running Express Node Jade MongoDB' }); }); };
/* * ***** BEGIN LICENSE BLOCK ***** * Copyright (c) 2011-2012 VMware, Inc. * * For the license see COPYING. * ***** END LICENSE BLOCK ***** */ var AjaxBasedTransport = function() {}; AjaxBasedTransport.prototype = new BufferedSender(); AjaxBasedTransport.prototype.run = function(ri, trans_url, ...
export const root = (typeof self === 'object' && self.self === self && self) || (typeof global === 'object' && global.global === global && global) || this
'use strict'; var should = require('should'); var gutil = require('gulp-util'); var path = require('path'); var fs = require('fs'); var sass = require('../index'); var rimraf = require('rimraf'); var gulp = require('gulp'); var sourcemaps = require('gulp-sourcemaps'); var postcss = require('gulp-postcss'); var autopre...
import DefaultHandler from './default'; import constants from '../../constants'; export const supportedPages = constants.PAGE_NAMES .filter((p) => p.includes('.json')) .map((p) => p.replace('.json', '')); export const pageNameMap = { guardian_multifactor: 'guardian_mfa_page', password_reset: 'change_password'...
// This file configures the development web server // which supports hot reloading and synchronized testing. // Require Browsersync along with webpack and middleware for it import browserSync from 'browser-sync'; // Required for react-router browserHistory // see https://github.com/BrowserSync/browser-sync/issues/204#...
import Ajax from './libs/ajax'; /** * Class for a sample page - Register. * @constructor */ class Register { constructor() { this.ajaxToForm(); } ajaxToForm() { const register = document.querySelector('form#register'); if (register) { const ajax = new Ajax(register); ajax.run(); ...
var model = require("./loginModel"); exports.login = function (source) { // check if user is already logged in if (source.req.session.role) { return source.res.status(400).send("Already logged in"); } // get username and password var username = source.data.username; var password = sou...
#!/usr/bin/env node 'use strict' const ratio = require('..') const cli = require('meow')({ pkg: '../package.json', help: [ 'Usage', ' $ aspect-ratio <width><height>[options]', '\n options:', "\t -s\t specified a separator. (by default is ':').", '\t --version output the current version.'...
/** * Utility functions for dealing with DICOM */ var dicomParser = (function (dicomParser) { "use strict"; if(dicomParser === undefined) { dicomParser = {}; } // algorithm based on http://stackoverflow.com/questions/1433030/validate-number-of-days-in-a-given-month function daysInMonth(m, y) { // m...