code stringlengths 2 1.05M |
|---|
/*
* @Author: Mike Reich
* @Date: 2015-07-16 08:47:51
* @Last Modified 2016-05-20
*/
'use strict';
import {PluginManager} from '../../lib/'
describe("PluginManager", () => {
describe("Load", () => {
var instance;
it("should not be null", () => PluginManager.should.not.be.null)
it("should be instan... |
var Asteroid = require('asteroids-asteroid');
var Bullet = module.exports = function(initializer){
Asteroid.call(this, initializer);
}
Bullet.prototype = new Asteroid();
Bullet.prototype.ttl = function(timeToDeath){
if (timeToDeath != undefined) {
this.timeToDeath = timeToDeath;
}
return this.time... |
const DEFAULT_PUBLICATION = 'meteor_table_generic_pub';
const DEFAULT_TEMPLATE = 'meteor_table_generic_template';
const DEFAULT_ENTRIES = [10, 25, 50, 100];
/**
* The global namespace for Tables
* @namespace Tables
*/
Tables = {};
Tables.registered = {};
Tables.registerTable = function (options) {
if (typeof o... |
$(function () {
// Selection modal gets closed (cancelled or saved)
$("#selection-modal").on("hidden.bs.modal", function () {
updateSelection();
});
// User clicks save button in selection modal
$("#selection-modal-save").on("click", function () {
var entries = [];
$("td.se... |
/*! jQuery v3.2.0 | (c) JS Foundation and other contributors | jquery.org/license */
!function (a, b) {
"use strict";
"object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) {
if (!a.document)throw new Error("jQuery requires a window with a ... |
/* global ResearchItemTypes, Accomplishment, Project */
module.exports = {
tableName: 'research_item_type',
attributes: {
key: 'STRING',
label: 'STRING',
shortLabel: {
type: 'STRING',
columnName: 'short_label'
},
type: 'STRING',
}
};
|
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"jquery":true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
... |
'use strict';
//require('colors');
var express = require('express'),
bodyParser = require('body-parser'),
http = require('http'),
path = require('path'),
api = require('./routes/api'),
cors = require('cors');
var app = express();
app.set('port', process.env.PORT || 9000);
app.use(bodyParser.json());
app.u... |
/**
* Payment
*
* @copyright Copyright (c) 2015 PAYMILL GmbH (https://www.paymill.com)
*/
var prefilledInputValues = [];
$.noConflict();
jQuery(document).ready(function($) {
prefilledInputValues = getFormData();
/**
* Get values of PAYMILL-Payment form-inputs
* @return {[string]} array of PAYMILL form-inp... |
import awaitify from 'awaitify';
const asyncError = (statusCode) => {
return awaitify(function * (req, res) {
let viewFilePath = String(statusCode),
result = {
status: statusCode
};
try{
yield awaitify.cb((cb) => res.render(viewFilePath, cb));
res.render(viewFilePath);
} ... |
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import { RNEP } from 'react-native-exoplayer';
import PlayerView from './js/PlayerView';
import data from './data.js... |
module.exports = function (store) {
return {
name: 'connect.sid',
secret: 'sCzo&53ON&ePY@RwmbRCDd3^h7HiEn*QS%aYDBq5MuNCEale8y',
resave: true,
saveUninitialized: true,
store: store
};
};
|
// Acorn: Loose parser
//
// This module provides an alternative parser (`parse_dammit`) that
// exposes that same interface as `parse`, but will try to parse
// anything as JavaScript, repairing syntax error the best it can.
// There are circumstances in which it will raise an error and give
// up, but they are very r... |
goog.provide("A.B");
goog.provide("A.B.C");
/**
* @constructor
* @param {number} n
*/
A.B = function(n) {
/** @type {number} */
this.n = n;
};
// Aggressively export rather than create static methods/fields
/** @return {number} */
A.B.foo = function() { return 4; };
/** @type {number} */
A.B.num = 8;
/** @con... |
import fetch from 'node-fetch'
import moment from 'moment'
import fs from 'fs'
import { isArray } from 'lodash'
/**
* getGeoTiff
* datasource: https://www.nohrsc.noaa.gov/snowfall/
* NOHRSC uploads geotiffs of snowfall at certain times of day.
* We pull the previous 6 hours, 24 hours and season totals of snowfall
... |
/*
* Utilities.js
* Created by CreaturePhil
*
* This is where extraneous and important functions are stored.
*
*/
var Utilities = exports.Utilities = {
HueToRgb: function (m1, m2, hue) {
var v;
if (hue < 0)
hue += 1;
else if (hue > 1)
hue -= 1;
if (6 * hue < 1)
... |
var dojoConfig = { parseOnLoad:true };
var map;
require(["esri/map", "dojo/domReady!"], function(Map) {
map = new Map("mapDiv", {
center: [77.0907573, 28.6454414],
zoom: 10,
basemap: "streets"
});
});
|
// If no env is set, default to development
// This needs to be above all other require()
// modules to ensure config gets right setting.
// Module dependencies
var config = require('./config'),
express = require('express'),
when = require('when'),
_ = require('underscore'),
... |
var searchData=
[
['max_5fbuffer',['MAX_BUFFER',['../_serial_device_8h.html#a1d5dab30b404fab91608086105afc78c',1,'SerialDevice.h']]],
['message_5fid',['MESSAGE_ID',['../_r_f_i_d_message_8h.html#a62f2aa97339b42876202f212c647ae43',1,'RFIDMessage.h']]],
['msg_5flength',['MSG_LENGTH',['../_r_f_i_d_message_8h.html#aa2... |
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http:polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http:polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found... |
const assert = require('assert');
const dns = require('dns');
const StatsD = require('../lib/statsd');
const helpers = require('./helpers/helpers.js');
const closeAll = helpers.closeAll;
const createServer = helpers.createServer;
const createHotShotsClient = helpers.createHotShotsClient;
describe('#init', () => {
... |
export const KEYS = [
'AUTHOR',
'CONTRIBUTOR',
'FOLLOW'
];
export const LABELS = Object.freeze({
AUTHOR: "Documents I am author",
CONTRIBUTOR: "Documents I am contributor",
FOLLOW: "Documents I follow"
});
export const CHECKBOX_LABELS = Object.freeze({
AUTHOR: "Documents I am author",
... |
var http = require('http')
var url = process.argv[2]
http.get(url, res => {
res.setEncoding('utf8')
res.on('data', chunk => {
console.log(chunk)
})
res.on('end', () => {})
res.on('error', () => {})
}).on('error', (e) => {
console.error(`Got error: ${e.message}`);
}) |
import { combineReducers } from 'redux'
import tabs from './tabs'
import activeTab from './active-tab'
import input from './input'
import isInputFocus from './is-input-focus'
import isIncognito from './is-incognito'
export default combineReducers({
tabs,
activeTab,
input,
isInputFocus,
isIncognito,
})
|
class ReplicationInfo {
constructor () {
this.reset()
}
reset () {
this.progress = 0
this.max = 0
this.buffered = 0
this.queued = 0
}
}
module.exports = ReplicationInfo
|
/*global module, console*/
module.exports = function observable(base) {
'use strict';
let listeners = [];
base.addEventListener = function (types, listener, priority) {
types.split(' ').forEach(function (type) {
if (type) {
listeners.push({
type: type,
listener: listener,
priority: priority |... |
import config from './config';
import { collisionObjs } from './collision';
import { initName } from './utils';
let backBtn = document.querySelector('.back-btn');
let resetBtn = document.querySelector('.reset-btn');
let successMask = document.querySelector('.success-mask');
let goalGetBox = document.querySelector('.go... |
/* eslint no-unused-expressions: 0 */
/* global sinon */
import LayoutHelpers from "src/layout-helpers";
import { Scale } from "victory-util";
describe("layout-helpers", () => {
describe("getBarPosition", () => {
let sandbox;
beforeEach(() => {
sandbox = sinon.sandbox.create();
sandbox.spy(Layo... |
var should = require('should'),
done = require('../done'),
bee = require('../../bee/58.com/job');
describe('58 - 招聘详情', function () {
var url = 'http://gz.58.com/zpshengchankaifa/21243256343177x.shtml?PGTID=14290300745240.888409024104476&ClickID=7';
it('抓取招聘信息', done(bee, url));
}); |
'use strict';
angular.module('users').controller('AuthenticationController', ['$scope', '$http', '$location', 'Authentication',
function($scope, $http, $location, Authentication) {
$scope.authentication = Authentication;
// If user is signed in then redirect back home
if ($scope.authentication.user) $location.... |
'use strict';
/**
* Module dependencies.
*/
var $mongoose = require('mongoose'),
Schema = $mongoose.Schema,
$async = require('async'),
_ = require('lodash'),
$aclPlugin = require('../plugins/accessControlListsModel');
var routeSchema = new Schema({
path: {
type: String,
required: true
}
});
routeSchema.... |
module.exports = function(sequelize, Sequelize) {
// Sequelize user model is initialized earlier as User
var Provider = sequelize.define('provider', {
id: { autoIncrement: true, primaryKey: true, type: Sequelize.INTEGER},
provider_name: { type: Sequelize.STRING}
});
return Provider;
}
|
$(function () {
/**** Radar Charts: ChartJs ****/
var radarChartData = {
labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
datasets: [
{
label: "My First dataset",
backgroundColor: "rgba(220,220,220,0.2)",
... |
Dashboard.views.LabelShow = Marionette.View.extend({
template: "#js-label-show",
className: "container--small",
modelEvents: {
"change" : "render"
},
regions: {
"update": "#js-update-region"
},
onRender: function() {
this.showChildView('update', new Dashboard.views.LabelUpdate({model: this.... |
var MainApp = Em.Application.create({
LOG_TRANSITIONS: true,
ready: function () {
MainApp.AppContainerView = Em.ContainerView.extend({});
MainApp.ModalContainerView = Em.ContainerView.extend({});
Ember.run.later(this, function() {
MainAppController.getData();
}, 100);... |
function updateCountdown(a){var b=document.getElementById("clockdiv"),c=b.querySelector(".months"),d=b.querySelector(".days"),e=b.querySelector(".hours"),f=b.querySelector(".minutes");e.innerHTML=a.hours,d.innerHTML=a.days,c.innerHTML=a.months,f.innerHTML=a.minutes}new WOW({mobile:!1}).init();var timerID=countdown(func... |
"use strict";
var quoteLookup = require('../services/quoteLookup.js');
module.exports.quote = (req, res) => {
let lookupParam = req.params.quote;
quoteLookup.renderPage(lookupParam, res);
}; |
var casper = require('casper').create();
casper.start('http://www.wildesoft.net', function () {
this.echo(this.getTitle());
});
casper.thenOpen('http://www.meetup.com/Smart-Devs-User-Group', function () {
this.echo(this.getTitle());
this.capture("meetup.jpg");
});
casper.run(); |
import crypto from "crypto";
import { assign } from "lodash";
import { pluggable } from "pluggable";
/**
* Calculate the bundle's hash by invoking `update` with data from the bundle.
* `update` should be called with string data only.
*
* @param {Function} update Updates the ongoing computation of bundle hash.
... |
const type = {
name: "array",
structure: [
{ name: "type", match: "^array$" },
{ name: "content" },
],
child: "content",
identify,
validate,
next,
execute,
};
module.exports = type;
function identify({ current }) {
const regexp = new RegExp("^array$");
if (current.content &&
current.type &&
Object.k... |
import Ember from 'ember';
import DS from 'ember-data';
import DSpaceObject from './dspace-object';
export default DSpaceObject.extend({
bundleName: DS.attr('string'),
description: DS.attr('string'),
format: DS.attr('string'),
mimeType: DS.attr('string'),
sizeBytes: DS.attr('number'),
retrieveLink: DS.attr... |
exports.root_url = "http://jgao.me/";
exports.min_vanity_length = 4;
exports.num_of_urls_per_hour = 50;
exports.get_query = 'SELECT * FROM urls WHERE segment = {SEGMENT}';
exports.add_query = 'INSERT INTO urls SET url = {URL}, segment = {SEGMENT}, ip = {IP}';
exports.check_url_query = 'SELECT * FROM urls WHERE url = {... |
var $M = require("@effectful/debugger"),
$x = $M.context,
$ret = $M.ret,
$unhandled = $M.unhandled,
$brk = $M.brk,
$m = $M.module("file.js", null, typeof module === "undefined" ? null : module, null, "$", {
__webpack_require__: typeof __webpack_require__ !== "undefined" && __webpack_require__
}, n... |
var randomInArray = require('../src/randomInArray');
describe('randomInArray()', function() {
'use strict';
var array = [1, 'a', {object: true}, true, [1, 2, 3]];
it('only accepts arrays', function() {
randomInArray.bind(randomInArray, array).should.not.throw(Error);
randomInArray.bind(randomInArray, n... |
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var GetTileAt = require('./GetTileAt');
var GetTilesWithin = require('./GetTilesWithin');
/**
* Calculates interesti... |
var loopback = require('loopback');
var boot = require('loopback-boot');
var app = module.exports = loopback();
// boot scripts mount components like REST API
boot(app, __dirname);
app.start = function() {
// start the web server
return app.listen(process.env.PORT || 3000, function() {
app.emit('started');
... |
'use strict';
var sockjs = require('sockjs')
, http = require('http')
, SockJS = require('./');
//
// Setup a Sockjs server so we can listen for incoming connections and regular
// HTTP server to listen for incoming requests.
//
var realtime = sockjs.createServer()
, server = http.createServer();
realtime.on('... |
import React from "react";
import { ListGroupItem, ButtonToolbar, Button, Modal, Grid, Row, Col } from 'react-bootstrap';
class SearchListItem extends React.Component {
constructor() {
super()
this.state = {
showModal: false
}
}
closeModal() {
this.setState({
showModal: false
}... |
import { connect } from 'react-redux';
import { stopPresentation, previousSlide, nextSlide } from '../actions'
import Presentation from '../components/Presentation';
const mapStateToProps = (state, ownProps) => {
return {
slide: state.slides.length > state.presentation.currentIndex ? state.slides[state.pre... |
'use strict';
var bodyParser = require('body-parser');
var csv = require('csv');
var DEFAULT_TYPE = 'text/csv';
module.exports = function (textOptions, csvOptions) {
if (!textOptions) {
textOptions = {};
}
textOptions.type = textOptions.type || DEFAULT_TYPE;
var textMiddleware = bodyParser.text(textOption... |
import React from 'react';
import PropTypes from 'prop-types';
import Badge from '@mui/material/Badge';
import { withStyles } from '@mui/styles';
import IconButton from '@mui/material/IconButton';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
const StyledBadge = withStyles((theme) => ({
badge: {
... |
// call this from the developer console and you can control both instances
var calendars = {};
$(document).ready( function() {
// assuming you've got the appropriate language files,
// clndr will respect whatever moment's language is set to.
// moment.lang('ru');
// here's some magic to make sure the dates a... |
'use strict';
import { cloneDeep, remove } from 'lodash';
const Sections = {
TOP_FINANCIAL_CONTRIBUTORS: 'top-financial-contributors',
CONNECTED_COLLECTIVES: 'connected-collectives',
OUR_TEAM: 'our-team',
GOALS: 'goals',
UPDATES: 'updates',
CONVERSATIONS: 'conversations',
RECURRING_CONTRIBUTIONS: 'recur... |
'use strict';
const config = require('../../config');
module.exports = function * (next) {
const ua = this.request.headers['user-agent'] || '';
if (!config.useragent.pattern.test(ua)) {
yield this.render('useragent/ban', {
title: 'User agent',
});
this.status = 503;
... |
/*
Example:
_.module.define('ymaps', () => {
return _.deal((resolve, reject) => {
_.script('https://api-maps.yandex.ru/2.1/?lang=ru_RU').then(() => {
ymaps.ready(() => resolve(ymaps));
}, reject);
});
});
_.module('ymaps').then((ymaps) => {
});
*/
_.dependency('module', [ 'moduleProvider... |
'use strict';
const declarationValueIndex = require('../../utils/declarationValueIndex');
const getDeclarationValue = require('../../utils/getDeclarationValue');
const isSingleLineString = require('../../utils/isSingleLineString');
const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction');
const... |
Date.parseISO8601 = function(s){
var re = /(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(\.\d+)?(Z|([+-])(\d\d):(\d\d))?/;
var d = [];
d = s.match(re);
if (!d) {
throw "Couldn't parse ISO 8601 date string '" + s + "'";
}
var a = [1, 2, 3, 4, 5, 6, 10, 11];
for (var i in a) {
d[a[i]] = parseInt(d[a[i]], 10);
}... |
// user authentication will allow users (regardless of client)
// authenticated access to protected routes
import Boom from 'boom';
import config from 'config';
// Declare internals
const internals = {};
exports.register = (plugin, options, next) => {
plugin.auth.scheme('user', internals.implementation);
ne... |
var Magazine = Backbone.Model.extend({
defaults: {
title: '',
pubDate: '1/1',
image: ''
},
initialize: function(){
console.log("The model has been initialize");
this.on("change:title", function(){
console.log("The model's data has been change");
})
}
});
var MagazineCollection = B... |
/* eslint-disable no-new, class-methods-use-this */
/* global Breakpoints */
/* global Cookies */
/* global Flash */
import Cookies from 'js-cookie';
import './breakpoints';
import './flash';
const PipelinesTable = require('./commit/pipelines/pipelines_table');
/* eslint-disable max-len */
// MergeRequestTabs
//
//... |
/* ==========================================================================
Internal variables & dependencies
========================================================================== */
// ...
/* ==========================================================================
Tests
===============================... |
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
//
import { Advanced, Managers } from 'czechidm-core';
import { ProvisioningBreakRecipientManager } from '../../redux';
const manager = new ProvisioningBreakRecipientManager();
/**
* System provisioning break config basic information (info ca... |
var CommandParser = function() {
var parse = function(str, lookForQuotes) {
var args = [];
var readingPart = false;
var part = "";
for (var i = 0; i < str.length; i++) {
if (str.charAt(i) === " " && !readingPart) {
args.push(part);
part = "... |
var gulp = require('gulp');
var browserSync = require('browser-sync');
var cp = require('child_process');
/**
* Build site with Jekyll
*/
gulp.task('jekyll-build', function(done) {
browserSync.notify('building site');
return cp.spawn('rake', ['build_drafts'], {stdio: 'inherit'})
.on('close', done)
});
/**
... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
function getProductoAjEntradaxID(){
$(document).on("click", "#invajentradaitemxidgetbtn", function(e) {
var form = $(this).parents('form');
$(form).ajaxForm({
... |
app.factory('watsonSpeechModelFactory', function() {
console.log("Watson speech model factory!");
let fromController = function(watsonSpeechModelFactoryObject) { // phoneme from the controller, that the user clicked in the template
targetLanguage = watsonSpeechModelFactoryObject.targetLanguage;
setBroadban... |
/*!
* bespoke-oridomi v0.0.0
* https://github.com/ebow/bespoke-oridomi
*
* Copyright 2013, Tim Churchward
* This content is released under the MIT license
*/
(function(bespoke) {
bespoke.plugins.oridomi = function(deck, options) {
var oridomi_options = {
speed: 1200, // folding duration i... |
var gulp = require('gulp');
var minifyCSS = require('gulp-minify-css');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
var rename = require('gulp-rename');
var jade = require('gulp-jade');
var livereload = require('gulp-livereload');
var distDest = 'dist/';
var cssDistDest = distDest + 'c... |
// 初始化iCheck
function initiCheck() {
if ($('.icheck-cat').length > 0) {
$('input.icheck-cat').iCheck({
checkboxClass: 'icheckbox_square-grey',
radioClass: 'iradio_square-grey',
increaseArea: '20%'
});
}
}
// 初始化下拉框插件
$('.selectpicker').selectpicker();
// 新增分... |
import ffi from 'ffi';
import ref from 'ref';
const { bool, uint8, uint32 } = ref.types;
const voidPtr = ref.refType(ref.types.void);
const BLP = voidPtr;
const FILE = voidPtr;
export default new ffi.Library('libblp', {
blp_convert: [voidPtr, [FILE, BLP, uint8]],
blp_height: [uint32, [BLP, uint8]],
bl... |
(function () {
'use strict';
angular
.module('openSenseMapApp')
.controller('EditBoxExtensionsController', EditBoxExtensionsController);
EditBoxExtensionsController.$inject = ['notifications', 'boxData', 'AccountService'];
function EditBoxExtensionsController (notifications, boxData, AccountService) ... |
#!/usr/bin/env node
/* ------------------------------------------------------------------
* node-gotapi - index.js
*
* Copyright (c) 2017-2018, Futomi Hatano, All rights reserved.
* Released under the MIT license
* Date: 2018-11-17
* ---------------------------------------------------------------- */
'use strict';
proc... |
/**
* Copyright (c) 2014, 2017, Oracle and/or its affiliates.
* The Universal Permissive License (UPL), Version 1.0
*/
"use strict";
define(["ojs/ojcore","jquery","ojs/ojcomponentcore"],function(a,g){function c(a,c,e,f,g,k,l,m){this.Nd=a;this.kIa=c;this.UA=e;this.KL=f;g&&(g.xSa&&(this.DIa=g.xSa),g.gSa&&(this.THa=g.g... |
//= require ./groceries
// todos
|
module.exports = function(grunt) {
// Project configuration
'use strict';
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-regex-replace');
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Com... |
/*
* token manager
*/
import request from './request';
const API_BASE = 'http://localhost';
// let globalStore;
export function injectStoreToken(store) {
// globalStore = store;
console.log(store);
}
export function watchNRefreshToken() {
// refresh token in 5 hours
if (global.window.localStorage.refresh_... |
$(function() {
$( "#accordion_data, #accordion_usage, #accordion_server" ).accordion( { active: false, collapsible: true } );
$("#clean_compress_json_data_button").click(function()
{
$("#results_compress_json_data").html("");
return false;
});
$("#compress_json_data_1_button").click(function(event)
... |
var a = 1, b = 2, c =3;
(function firstFunction(){
var b= 5, c = 6;
(function secondFunction(){
var b = 8;
console.log("a: "+a+", b: "+b+",c: "+c);
(function thirdFunction(){
var a = 7, c = 9;
(function fourthFunction() {
var a = 1, c = 9;
... |
var http = require('http');
var path = require('path');
var express = require('express');
var router = express();
var server = http.createServer(router);
var bodyParser = require('body-parser');
// Routes for commands
router.use(bodyParser.json());
router.use(bodyParser.urlencoded({ extended: true }));
router.post('/c... |
import Emitter from "component-emitter";
import expect from "expect.js";
import ReconnectingProxy from "../src/reconnecting-proxy";
import sinon from "sinon";
class FakeClient extends Emitter {
open() { return this; }
close() { return this; }
}
describe("ReconnectingProxy", () => {
beforeEach(function() {
t... |
function fruitLandings(house, trees, numOfFruits, ap, org) {
var applesLanded = 0;
var orangesLanded = 0;
var apples = ap.map(function(val){
var apple = parseInt(trees[0]) + parseInt(val)
if ( apple >= house[0] && apple <= house[1] ) {
applesLanded++;
}
});
var... |
var validator = require("validator");
var exports = module.exports = {};
exports.sanitize = function(data) {
var newData = [];
for (var key in data) {
newData[key] = sanitizeString(data[key]);
}
return newData;
}
var sanitizeString = exports.sanitizeString = function(data) {
data = data.toString().tri... |
import moment from 'moment';
function selectedData(get) {
const selectedDate = moment(get('container.selectedDate')).format('DD-MM-YYYY');
return get(`container.data.data.${selectedDate}`);
}
export default selectedData;
|
"use strict";
let datafire = require('datafire');
let openapi = require('./openapi.json');
module.exports = datafire.Integration.fromOpenAPI(openapi, "roaring"); |
angular.module('queup.queue_list', [])
// Queue List Controller
// ---------------------
// Monitors current queue state, and manages socket interaction between teacher and server
.controller('Queue_listController', function($state, $scope, socket, teacherData, sinch){
var currentClass = teacherData.get('currentCl... |
/**
This object represents a point in the canvas..
author: Houman Kamran
**/
var Point = function(x, y) {
this.x = x;
this.y = y;
}; |
(function () {
'use strict';
const highlightClass = 'playing';
const keys = document.querySelectorAll('.key');
const sounds = document.querySelectorAll('audio');
const clearTransition = (event) => {
if (event.propertyName !== 'transform') {
return;
}
event.target.classList.remove(highligh... |
import * as productsPartials from '@/store/partials/products';
import {RecipeModel} from '@/models';
import Delta from 'quill-delta';
export const INIT_MODEL = new RecipeModel();
export const createState = () => ({
model : INIT_MODEL,
placeholder : null,
uploading : false,
imageProcessingUUID : null,
loaded :... |
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict-local
* @emails oncall+relay
*/
// flowlint ambiguous-object-type:error
'use strict';
const {
Mu... |
'use babel'
import {CompositeDisposable} from 'atom'
class RenameDialog {
constructor (identifier, callback) {
this.identifier = identifier
this.callback = callback
this.element = document.createElement('div')
this.element.classList.add('gorename')
this.subscriptions = new CompositeDisposable()... |
var path = require('path');
module.exports = {
devtool: 'source-map',
entry: './app/app.ts',
output: {
path: path.join(__dirname, 'app'),
filename: 'app.js'
},
resolve: {
extensions: ['', '.js', '.ts']
},
module: {
loaders: [{
test: /\.ts$/,
loader: 'ts',
include: [path.join(__dirname, 'src'), ... |
/**
* Created by jjohnson on 12/13/13.
*/
var should = require("should");
var OomnitzaNode = require("../lib/oomnitza-node.js");
var oom = new OomnitzaNode("domain", "user", "pass");
var checking = function(str) {
process.stdout.write("Checking " + str + "() ");
}
var log = function(str) {
process.stdout.wri... |
import React from 'react';
import ReactTestUtils from 'react/lib/ReactTestUtils';
import Pagination from '../src/Pagination';
describe('Pagination', () => {
it('Should have class', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Pagination>Item content</Pagination>
);
assert.ok(ReactTes... |
var mongoose = require('mongoose');
var uristring = 'mongodb://heroku_6tl56f0w:lpp8c3pu0t9n60vjee7da52l8s@ds141108.mlab.com:41108/heroku_6tl56f0w';
mongoose.connect(uristring, function(err) {
if(err) {
console.log('Error: Connection Failed!');
} else {
console.log('Connection established');
}
}); |
version https://git-lfs.github.com/spec/v1
oid sha256:21edeb54c32a6da198ec3296b4297a596e86c7fac2e2898f6b24527c83ee4420
size 115671
|
App.service('Sensor', /*@ngInject*/ function($http, $rootScope, Cache) {
function clearCache() {
Cache.clear('^/sensors/');
}
$rootScope.$on('sensor.value', function(event, data) {
clearCache();
$rootScope.$broadcast('sensor.update', data.sensorVo);
});
return {
ge... |
'use strict';
var expect = require('chai').expect;
var spawns = require('../');
var node_path = require('path');
var fs = require('fs');
var mix = require('mix2');
describe("spawns", function() {
it("normal", function(done) {
spawns(['ls', 'ls'], {
stdio: 'inherit'
}).on('close', function(code) {
... |
'use strict';
// jshint node:true
module.exports = function(grunt) {
var files = [
'src/load-dependency.js',
'src/ui-sortable-loader.js'
];
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'uglify': {
'options': {
'banner': '/*! <%= pkg.name %> <%= grunt.template.today... |
$(function() {
$('li#three').removeClass('hot');
$('li.hot').addClass('favorite');
$('ul').attr('id', 'group');
}); |
(function() {
window.Locomotive = {
mounted_on: window.Locomotive.mounted_on,
Views: {
Sessions: {},
Registrations: {},
Passwords: {},
CustomFields: {}
},
Flags: {}
};
}).call(this);
(function() {
var View;
View = Backbone.View;
Backbone.View = View.extend({
cons... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.