code stringlengths 2 1.05M |
|---|
import ChildCard from 'oasis/child-card';
import PeerCard from 'oasis/peer-card';
export default class Oasis {
constructor() {
window.addEventListener('message', this);
this.pendingCards = [];
this.peerCardHandlers = {};
this.peerCards = [];
}
createCard(url, opts={}) {
let card = new ChildC... |
'use strict';
// User routes use users controller
var users = require('../controllers/users');
var config = require('../../../config/config');
var _ = require('lodash');
module.exports = function(app, passport) {
app.get('/signin', users.signin);
app.get('/signup', users.signup);
app.get('/signout', user... |
'use babel';
import {
CompositeDisposable,
} from 'atom';
import DafnyRunner from './runner/dafny-runner.js';
import DafnyStatusBarView from './status-bar-view/dafny-status-bar-view.js';
import DafnyOutputParser from './output-parser/dafny-output-parser.js';
let subscriptions;
let dafnyRunners;
let dafnyStatusBarV... |
(function(JST) {
var TablarListGroup;
TablarListGroup = (function() {
function TablarListGroup() {}
TablarListGroup.prototype.parseData = function(args) {
return args;
};
TablarListGroup.prototype.render = function(obj) {
var $root;
if (obj == null) {
obj = {};
}
... |
/**
* @jsx React.DOM
*/
var Immutable, ImmutableRenderMixin, Row, Table;
Immutable = require('immutable');
ImmutableRenderMixin = require('react-immutable-render-mixin');
Row = require('./Row');
Table = React.createClass({
mixins: [ImmutableRenderMixin],
propTypes: {
rows: function(value) {
return ... |
define([
'./rb-nav-bar.tpl.html'
], function (template) {
/**
* @ngdoc directive
* @name rbNavBar
* @module rb-nav-bar
*
* @restrict E
*
* @deprecated
* Please use rg-header, which encompases functionality from this component.
*
* @description
*
* `<r... |
/* This note applies to jquery, react, and underscore.
*
* We're faking a node module for this package by just exporting the global.
* There are a few complications which led us to this solution as a temporary
* fix.
*
* - Browserify can slow down a lot when you include the other packages (and
* their dependen... |
import { connect } from 'react-redux';
import SearchBar from '../components/SearchBar';
import { geocoding, geocoded, failedGeocoding } from '../actions/searchActions';
import Geocoder from 'react-native-geocoder';
Geocoder.fallbackToGoogle('AIzaSyCn-tBq6mf4YLayRZPfbh2egqV3GHVX9hQ');
function mapStateToProps (state... |
import React from 'react';
import { Route, IndexRoute, Router, browserHistory, Redirect } from 'react-router';
import ArtLabelsIndexContainer from './ArtLabelsIndexContainer';
import ArtLabelShowContainer from './ArtLabelShowContainer';
// import ArtLabelFormContainer from './ArtLabelFormContainer';
const App = (props... |
define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ValidationRenderer = undefined;
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeEr... |
/**
* @todo Complete the test
* This example is not perfect.
* The `link` function is not tested.
* (malarkey usage, addClass, $watch, $destroy)
*/
describe('directive malarkey', function() {
let vm;
let element;
beforeEach(angular.mock.module('feTest'));
beforeEach(inject(($compile, $rootScope, githubCo... |
// # Amp Content Helper
// Usage: `{{amp_content}}`
//
// Turns content html into a safestring so that the user doesn't have to
// escape it or tell handlebars to leave it alone with a triple-brace.
//
// Converts normal HTML into AMP HTML with Amperize module and uses a cache to return it from
// there if available. T... |
'use strict';
require('should');
const path = require('path');
const Config = require('../lib/classes/Config');
describe('The Config', () => {
let config;
it('should be there', () => {
Config.should.be.Function();
});
it('can construct', () => {
config = new Config(path.resolve(__dirname, 'fixture'... |
/**
* @license Angulartics v0.8.5
* (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics
* License: MIT
*/
(function(angular, analytics) {
'use strict';
var angulartics = window.angulartics || (window.angulartics = {});
angulartics.waitForVendorApi = function (objectName, delay, registerFn) {
if (!Obje... |
//process.traceDeprecation = true
const webpack = require('webpack');
const path = require("path");
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const autoprefixer = require("autoprefixer");
module.exports = {
optimization: {
... |
exports.attach = function(Handlebars) {
// BEGIN(BROWSER)
Handlebars.VM = {
template: function(templateSpec) {
// Just add water
var container = {
escapeExpression: Handlebars.Utils.escapeExpression,
invokePartial: Handlebars.VM.invokePartial,
programs: [],
program: functi... |
import axios from 'axios';
export default function graphqlFetch(operationName, query, variables = {}, baseUrl = '') {
return axios({
method: 'POST',
url: `${baseUrl}/graphql`,
data: {
query,
variables: JSON.stringify(variables),
},
});
}
|
/*global astar Graph*/
let AI = require('./AI.js');
class AStarAI extends AI{
/**
* Use A* search method to look for optimal path. Uses this library
* https://github.com/bgrins/javascript-astar
*/
aStarPath(){
let graph = new Graph(this.map.graphNodes());
let start ... |
// Generated by CoffeeScript 1.8.0
var port, start;
start = function(port, callback) {
return require('americano').start({
name: 'Calendar',
port: port,
host: process.env.HOST || "0.0.0.0",
root: __dirname
}, function(app, server) {
var Realtimer, User, localization, realtime;
User = requir... |
import { Path } from 'slate'
export const input = {
path: [1, 4],
another: [1, 2],
}
export const test = ({ path, another }) => {
return Path.isSibling(path, another)
}
export const output = true
|
// @flow
export type EventId = {
id: number
}
export type EventProps = {
id: ?number,
name: string,
description: string,
quota: number,
eventStartsAt: string,
eventEndsAt: string,
withinDeadline: boolean,
participants: Object[],
errors: ?string[]
}
export type UserParticipation = {
registered: ... |
import { assert, JSData } from '../../_setup'
describe('Container#update', function () {
it('should be an instance method', function () {
const Container = JSData.Container
const store = new Container()
assert.equal(typeof store.update, 'function')
assert.strictEqual(store.update, Container.prototype... |
/* global describe,it,before*/
require("requirish")._(module);
var should = require("should");
var UAVariableType = require("lib/address_space/ua_variable_type").UAVariableType;
var StatusCodes = require("lib/datamodel/opcua_status_code").StatusCodes;
var DataType = require("lib/datamodel/variant").DataType;
var Attrib... |
// Load the game
ejecta.include('lib/impact/impact.js');
ejecta.include('lib/game/main.js'); |
(function() {
(typeof exports !== "undefined" && exports !== null ? exports : this).numberFormat = function(number, decimals, dec_point, thousands_sep) {
var decimal, decimalPoint, negative;
if (decimals == null) decimals = 0;
if (dec_point == null) dec_point = '.';
if (thousands_sep == null) thousan... |
var sourceMap = require('source-map');
var path = require('path');
var fs = require('fs');
var toFileURL = require('./utils').toFileURL;
var fromFileURL = require('./utils').fromFileURL;
var wrapSourceMap = function(map) {
return new sourceMap.SourceMapConsumer(map);
};
var sourceMapRegEx = /^\s*\/\/[@#] ?(sourceU... |
const _ = require('lodash');
const Promise = require('bluebird');
const htmlToText = require('html-to-text');
const common = require('../../../../lib/common');
const mobiledocLib = require('../../../../lib/mobiledoc');
module.exports.config = {
transaction: true
};
module.exports.up = (options) => {
const col... |
'use strict';
// Js Samples View
module.exports = angular.module('modules.js', [])
.directive('jsView', require('./jsDirective'))
.controller('JsCtrl', require('./JsController'))
.config(require('./jsRoutes')); |
/*! firebase-admin v5.1.0 */
"use strict";
/*!
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unles... |
module.exports = {
setupFiles: ['<rootDir>/projects/ng-dynamic-component/src/polyfills.ts'],
coverageDirectory: '<rootDir>/coverage/ng-dynamic-component',
coveragePathIgnorePatterns: ['/node_modules/', '/src/test/'],
globals: {
'ts-jest': {
// TS throws warnings when module=es2015|esnext is used
... |
const gitPusher = require('../')
test('main', () => {
expect(typeof gitPusher).toBe('object')
})
|
exports.info = { FormatID: '1424',
FormatName: 'Apple Disk Copy Image',
FormatVersion: '4.2',
FormatAliases: '',
FormatFamilies: '',
FormatTypes: 'Aggregate',
FormatDisclosure: '',
FormatDescription: 'Disk Copy 4.2 (DC42) is the common name used to refer to disk images of floppy disks created by the 4.2 v... |
// flow-typed signature: a9aedeb72d5d82becb950b3acc9f9e57
// flow-typed version: <<STUB>>/webpack-cli_v^3.2.1/flow_v0.91.0
/**
* This is an autogenerated libdef stub for:
*
* 'webpack-cli'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with th... |
Package.describe({
"summary": "Simple configurable session timeout"
});
Package.on_use(function (api) {
api.use(['coffeescript', 'underscore'], ['server', 'client']);
api.use(['accounts-base'], 'server');
api.use(['jquery', 'deps'], 'client');
api.add_files([
'server/server_timeout.coffee',... |
define([
'controllers/module'
], function(controllers) {
'use strict';
controllers.controller('siteController', ['$scope', function($scope) {
$scope.$on('$viewContentLoaded', function() {
var siteUrls = document.getElementsByTagName('a'),
paths = ['projects', 'resources'... |
const {Addon, singleton} = require('opentmi-addon');
const _ = require('lodash');
const Jenkins = require('./jenkins');
class AddonJenkins extends Addon {
constructor(...args) {
super(...args);
this._name = 'jenkins addon';
this._description = 'Provide Jenkins integration';
const options = {
... |
import React from 'react'
import generateUrl from './mapOverlay/generateUrl'
import legends from './mapOverlay/legends'
import sortBy from 'lodash.sortby'
import last from 'lodash.last'
import timeSlider from './mapOverlay/timeSlider'
import moment from 'moment'
import wxtiles from './wxtiles'
var findBestTimeStepsFor... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.16/esri/copyright.txt for details.
//>>built
define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/JSONSupport ../core/lang ../core/accessorSupport/decorators... |
import React from 'react'
import glamorous from 'glamorous'
import HeroesList from './HeroesList'
const Container = glamorous.div({
display: 'flex',
alignItems: 'center',
flexDirection: 'column',
color: 'white',
padding: 30,
})
const Title = glamorous.div({
fontSize: '2em',
fontWeight: 'bold',
})
const... |
'use strict';
describe('Controller: AboutCtrl', function () {
// load the controller's module
beforeEach(module('metricsApp'));
var AboutCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
AboutCtrl = $con... |
var _ = require('../lib/not_');
describe('Checks not underscore (not_)', function() {
it('isString', function() {
assert.isTrue(_.isString("This is a string"))
assert.isNotTrue(_.isString(1))
assert.isNotTrue(_.isString({ }))
});
it('isUndefined and isDefined', function() {
assert.isTrue(_.isDefined("This... |
'use strict';
let root = '../../../src/',
path = require('path');
var AbstractMapper = require(root + 'Chromabits/Mapper/AbstractMapper.js'),
DirectoryMapper = require(root + 'Chromabits/Mapper/DirectoryMapper.js'),
ClassMap = require(root + 'Chromabits/Mapper/ClassMap.js');
describe('Chromabits/Mapper/D... |
/* eslint-disable prefer-destructuring */
import { createOverlay } from '../../util/overlay-manager';
const ANIMATE_DELAY = 200;
export default function dialog(options) {
const {
content,
closeOnEscape = true,
onClose,
} = options;
const oldOverflow = document.body.style.overflow;
let element;
... |
import React from 'react';
import { Route, IndexRoute } from 'react-router';
// Container
import AppContainer from './components/AppContainer';
import KeymapsContainer from './components/1_Keymaps/KeymapsContainer';
import AuthConnector from './components/2_Users/AuthContainer';
export default (
<Route path="/" co... |
var mongoose = require('mongoose');
module.exports = function() {
// Set an error handler
mongoose.connection.on('error', function(err) {
console.error('MongoDB Error:', err);
});
// Set a disconnected handler
mongoose.connection.on('disconnected', function() {
console.warn('Di... |
/* ------------------------------------------------------------------------------
*
* # Advanced datatables
*
* Specific JS code additions for datatable_advanced.html page
*
* Version: 1.0
* Latest update: Aug 1, 2015
*
* ---------------------------------------------------------------------------- */
$(function() ... |
var slideParticles = (function (window, document, undefined) {
"use strict";
var fn, filter, proceed, modes, filters, nextSlideAnim, matrixMethod, oo = {}, getProto = Object.getPrototypeOf,
// Defaults settings.
defaults = {
height: 500,
width: 500,
background: '#fff',
t... |
'use strict';
describeComponent('component/splash', function () {
// Initialize the component and attach it to the DOM
beforeEach(function () {
setupComponent();
});
it('should be defined', function () {
expect(this.component).toBeDefined();
});
it('should do something', function () {
expect... |
//var _ = require('lodash');
var path = require('path');
var should = require('should');
var Compiler = require('../lib/compiler');
var goodFile = path.join(__dirname, './fixtures/program1/file1.ts');
var missingFile = path.join(__dirname, './fixtures/program1/missing-file.ts');
var syntaxError = path.join(__dirname... |
/**
Created by paper on 15/8/3.
House Robber II
https://leetcode.com/problems/house-robber-ii/
Note: This is an extension of House Robber.
After robbing those houses on that street,
the thief has found himself a new place for his thievery so that he will not get too much attention.... |
'use strict';
var pasquaJoveApp;
pasquaJoveApp = angular
.module('pasquaJove', [
'ngRoute',
'pascalprecht.translate'
]);
pasquaJoveApp.config(configFunction);
configFunction.$inject = ['$routeProvider', '$translateProvider'];
function configFunction($routeProvider, $translateProvider) {
$translateProvider.... |
define([
'dojo/text!agrc/widgets/locate/templates/FindRouteMilepost.html',
'dojo/_base/declare',
'dojo/_base/lang',
'dojo/_base/Color',
'dojo/dom-class',
'dojo/string',
'dojo/io/script',
'dojo/when',
'dojo/query',
'dijit/_WidgetBase',
... |
var RingTargetBuilder = require('../RingTargetBuilder');
module.exports = new RingTargetBuilder()
.setFrontSize(.4578)
.setNumbersFrom(1)
.setNumbersTo(8)
.setRingSizes([1., .8916, .7831, .6747, .5663, .4578, .3494, .2410, .1325, .0241])
.getTarget();
|
const libms = require('ms')
const Utilities = require('../../../Utilities')
const AccessToken = require('../../../AccessToken')
const UserIdentifier = require('../../../UserIdentifier')
module.exports = function generate(userId) {
const internals = arguments[0]
userId = arguments[1]
return new Promise(function(reso... |
/**
* Settings Controller
*
* @description Controller for the settings area
*/
(function() {
'use strict';
angular
.module('starter.controllers')
.controller('SettingsCtrl', SettingsCtrl);
SettingsCtrl.$inject = ['$scope', '$rootScope', '$ionicPopup', '$ionicLoading', '$location', 'devUtils', 'vsnUti... |
const childExec = require('child_process').exec;
const anonymize = require('../lambda-function/lib/dat-node')({ jarPath: '../lambda-function/lib/DicomAnonymizerTool/DAT.jar' })
.anonymize;
const inPath = __dirname + '/01.dcm';
const outPath = __dirname + '/output/01-anon.dcm';
anonymize(
{
in: inPath,
out... |
var path = require('path');
var express = require('express');
var hbs = require('express-handlebars')
var bodyParser = require('body-parser');
var PORT = 3000
var app = express()
var routes = require('./routes');
// bodyParser makes req.body possible
app.use(bodyParser.urlencoded({
extended: true
}))
app.engine('... |
// Line rendering style
import log from '../../utils/log';
import {Style} from '../style';
import StyleParser from '../style_parser';
import gl from '../../gl/constants'; // web workers don't have access to GL context, so import all GL constants
import Texture from '../../gl/texture';
import VertexLayout from '../../g... |
#!/usr/bin/env node
const fs = require('fs')
const path = require('path')
const _ = require('lodash')
const Paquet = require('../index.js')
const pkg = require(path.join(__dirname, '../package.json'))
const CLI = function (args) {
if (args[0] && fs.existsSync(__dirname+"/"+args[0]+".js")) require("./"+args[0]+".js"... |
(function (URLSearchParamsProto) {
var iterable = (function () {
try {
return !!Symbol.iterator;
} catch(error) {
return false;
}
}());
// mostly related to issue #24
if (!('forEach' in URLSearchParamsProto)) {
URLSearchParamsProto.forEach = function forEach(callback, thisArg) {
... |
define(['Views/AddView', 'Models/User'], function(AddView, User){
function start() {
AddView.render();
bindEvent();
}
function bindEvent(){
document.getElementById('add').addEventListener('click', function(){
var users = JSON.parse(localStorage.users);
var user_name = document.getElementB... |
var async = require('..');
async()
.data(10)
.then(function (data, next) {
console.log(data);
next(null, data + 1);
})
.then(function (data, next) {
console.log(data);
});
|
'use strict';
angular.module('kinetics-problems.firstOrderPostdict', ['ngRoute', 'n3-line-chart'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/firstOrderPostdict', {
templateUrl: 'firstOrderPostdict/firstOrderPostdict.html',
controller: 'firstOrderP... |
import { combineReducers } from 'redux'
import alerts from './alerts';
import auth from './auth';
import feed from './feed';
import user from './user';
const rootReducer = combineReducers({
alerts,
auth,
feed,
user,
})
export default rootReducer;
|
import { push, goBack } from 'react-router-redux';
import { reduxForm } from 'redux-form';
import loadable from '../../../common/components/loadable';
import validate from './validate';
import CreateForm from './CreateForm';
import { fetchCategories, sendChallenge } from '../create.actions';
import { resetState, fetchC... |
/* jshint expr:true */
import { A } from '@ember/array';
import EmberObject from '@ember/object';
import { it, describe, before, after } from 'mocha';
import { setupComponentTest } from 'ember-mocha';
import { find, click } from 'ember-native-dom-helpers';
import Notify from 'ember-notify';
import hbs from 'htmlbars-in... |
const settings = require('../settings.json');
exports.run = function(client, message, args) {
let modRole = message.guild.roles.find('name', 'delet Mod');
let messagecount = parseInt(args.join(' '));
if (!message.member.roles.has(modRole.id)) {
return message.reply('you have insufficient permissions... |
'use strict';
const {isUndefined, isArray, isEmpty, isFunction, isPlainObject, isString} = require('lodash');
const SUPPORTED_CONTROL_TYPES = Object.values(require('../gui/constants/custom-gui-control-types'));
const assertSectionGroupType = (context, type) => {
if (isUndefined(type)) {
throw new Error(`... |
if(typeof define !== 'function') {
var define = require('amdefine')(module);
}
define(['../src/networkconnection', '../src/eventemitter'], function(NetworkHostFactory, EventEmitter) {
var hostFactory = new NetworkHostFactory('peer');
var port = 9000;
function setUp(callback) {
callback();
... |
import { toggleOverlay, togglePlaylistManager } from '../../actions/OverlayActionCreators';
import { selectPlaylist } from '../../actions/PlaylistActionCreators';
export function openPlaylist(playlistID) {
return function (dispatch) {
dispatch(togglePlaylistManager());
dispatch(selectPlaylist(playlistID));
... |
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: './index.js',
output: { path: __dirname, filename: 'bundle.js'},
module: {
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['... |
// This code uses:
//
// * babel-polyfill (https://babeljs.io/docs/usage/polyfill/)
// * whatwg-fetch (https://github.github.io/fetch/)
// * uppy (https://uppy.io)
function singleFileUpload(fileInput) {
var imagePreview = document.getElementById(fileInput.dataset.previewElement)
var formGroup = fileInput.parent... |
var boardModel = require('../models/Board');
var playerModel = require('../models/Player')
var bodyParser = require('body-parser');
module.exports = {
// Replace enemy tokens with a blank piece (the backside) so that
// each player only sees their own tokens.
emptyTrayId: function(color) {
var lo;
var h... |
/**
* d3.tip
* Copyright (c) 2013 Justin Palmer
*
* Tooltips for d3.js SVG visualizations
*/
// eslint-disable-next-line no-extra-semi
;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module with d3 as a dependency.
define([
'd3-collecti... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var ic_no_encryption = exports.ic_no_encryption = { "viewBox": "0 0 24 24", "children": [{ "name": "path", "attribs": { "d": "M21 21.78L4.22 5 3 6.22l2.04 2.04C4.42 8.6 4 9.25 4 10v10c0 1.1.9 2 2 2h12c.23 0 .45-.05.66-.12L19.78 23 21 21.78z... |
// This file is part of the Shapy project.
// Licensing information can be found in the LICENSE file.
// (C) 2015 The Shapy Team. All rights reserved.
goog.provide('shapy.editor.Mesh');
goog.require('goog.webgl');
/**
* Mesh class containing renderable information about an object.
*
* @constructor
*
* @param {... |
function contarCaracteres(campo) {
$('#qtd_caracteres').text(campo.val().length);
}
var errosEnvio = 0;
function valida_envio_push_notifications() {
var retorno = false;
var mensagem = $('#mensagem');
var dispositivo = $('#selecione_dispositivo option:selected')
if(mensagem.val() == ''){
retorno = false;
aler... |
import React, { Component, } from 'react';
import { StyleSheet, Text, View, ListView, ScrollView, Image, Platform, } from 'react-native';
import styles from '../../../../app/components/Styles/shared';
import ActivityIndicator from '../../../../app/components/LoadingIndicator';
import Layout from '../../../../app/compon... |
/**
* Socket Configuration
*
* These configuration options provide transparent access to Sails' encapsulated
* pubsub/socket server for complete customizability.
*
* For more information on using Sails with Sockets, check out:
* http://sailsjs.org/#documentation
*/
module.exports.sockets = {
// This custo... |
import alt from '../local_libraries/alt';
class CharacterListActions {
constructor() {
this.generateActions(
'getCharactersSuccess',
'getCharactersFail'
);
}
getCharacters(payload) {
let url = '/api/characters/top';
let params = {
race: payload.race,
bloodline: payload.bl... |
var tls = require('tls'),
fs = require('fs'),
msg = [
".-..-..-. .-. .-. .--. .---. .-. .---. .-.",
": :; :: : : :.-.: :: ,. :: .; :: : : . :: :",
": :: : : :: :: :: :: :: .': : : :: :: :",
": :: :: : : `' `' ;: :; :: :.`.: :__ : :; ::_;",
... |
angular.module("movies").directive("awFilme", function () {
return {
restrict: "A",
scope: {
filme: '=awFilme',
fnFechar: '&'
},
templateUrl: "scripts/components/movieDirective/movie.directive.html",
link: function (scope, element, attr) {
element.addClass('filme com-cartaz');
... |
(function () {
'use strict';
describe('Pieces Route Tests', function () {
// Initialize global variables
var $scope,
PiecesService;
//We can start by loading the main application module
beforeEach(module(ApplicationConfiguration.applicationModuleName));
// The injector ignores leading a... |
/**
* Sends the instance's attributes off as parameters the the specified URL on the server.
*
* @param {string} url The URL to to send the attributes.
* @param {string} method The HTTP method to use.
*
* @returns {undefined}
*/
Instance.prototype.send = function( url, method, validation ) {
if ( validation ... |
//------------------------------------------------------------------------------------------------------------------------
function setupMessageHandlers()
{
Shiny.addCustomMessageHandler("roi",
function(message) {
console.log("roi message");
... |
window.Lunchiatto.Behaviors.Selectable = Marionette.Behavior.extend({
ui: {
select: 'select'
},
onShow() {
this.ui.select.chosen({width: '100%'});
}
});
|
'use strict';
var chai = require('chai');
var api = require('../index.js');
require('dotenv').load();
chai.should();
describe('Unsplash API public endpoints', function() {
api.init(process.env.CLIENT_ID);
describe('User', function() {
describe('getUserPhotos', function() {
it('should return without er... |
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
} = React;
var GeoImages = React.createClass({
render: function() {
return (
<View style={styles.container}>
<Text st... |
import {angRange2PI} from '../helper/math'
import angdiff from 'touche/helper/math/angdiff'
import {sub2d} from '../helper/2d'
export default ({
center0,
pointers0,
center,
pointers,
}) => {
let sangle = 0
pointers.forEach((p, i) => {
let p0 = pointers0[i]
sangle += angdiff(sub2d(p, center), sub2d(... |
'use strict';
/**
* Module dependencies.
*/
var _ = require('lodash'),
multiparty = require('multiparty'),
uuid = require('node-uuid'),
fs = require('fs'),
errorHandler = require('../errors.server.controller.js'),
mongoose = require('mongoose'),
passport = require('passport'),
User = mongoose.model('User'),
... |
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
// from http://stackoverflow.com/questions/28802179/how-to-create-a-react-modalwhich-is-append-to-body-with-transitions
export default class Portal extends Component {
constructor(props) {
super(props);
this.portalId = pro... |
'use strict';
const path = require('path');
module.exports = (periodic) => {
let reactadmin = periodic.app.controller.extension.reactadmin;
// console.log('`${reactadmin.manifest_prefix}api/oauth2async/signin?format=json`',
// `${reactadmin.manifest_prefix}api/oauth2async/signin?format=json`);
// consol... |
// DecentCMS (c) 2014 Bertrand Le Roy, under MIT license. See license.txt for licensing details.
'use strict';
// TODO: move all require statements closer to usage in order to speed up startup time. Services are required when the server boots, which slows down things for complex dependencies.
var domain = require('do... |
'use strict';
const AError = require('./../../core/AzuriteError'),
N = require('./../../core/HttpHeaderNames'),
ErrorCodes = require('./../../core/ErrorCodes');
/**
* Checks whether the total number of committed blocks present in this append blob does not exceed 50,000.
*
* @class AppendMaxBlobCommittedB... |
'use strict';
var path = require('path'),
winston = require('winston'),
defaultData = require(path.resolve('./config/defaultvalues/advanced_settings'));
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.sequelize.query('DELETE FROM advanced_settings WHERE id > 0')
.then(f... |
/*
* slush-twg
* https://github.com/themarkappleby/slush-twg
*
* Copyright (c) 2015, Mark Appleby
* Licensed under the MIT license.
*/
var path = require('path');
var defaults = getDefaults();
var questions = [
{
name: 'appName',
message: 'What is the name of your project?',
default: defaults.appN... |
/**
* SPAPI - A library to simplify working with SharePoint's Web Services
* Version 0.9.1
* @requires jQuery v1.11 or higher - jQuery 1.11+ recommended
*
* Copyright (c) 2013-2016 Nuvem, Inc.
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
**/
/************************... |
const fs = require("fs")
const path = require("path")
const restify = require("restify")
const corsMiddleware = require("restify-cors-middleware")
const cors = corsMiddleware({
origins: ["*"],
allowHeaders: ["Authorization", "X-Custom-Header", "X-Custom-Header-2", "X-Custom-Header-3", "X-Custom-Header-4"],
... |
const SOCKET_STATES = {connecting: 0, open: 1, closing: 2, closed: 3}
const CHANNEL_EVENTS = {
close: "phx_close",
error: "phx_error",
join: "phx_join",
reply: "phx_reply",
leave: "phx_leave"
}
class Push {
// Initializes the Push
//
// chan - The Channel
// event - The event, ie `"phx_join"`
// p... |
taskName = "Problem 6. Larger than neighbours";
function Main(bufferElement) {
var input = [3, 2, 3, 4, 1, 2, 4, 2, 3, 1, 4, 2, 3, 2],
pos;
WriteLine(input);
pos = prompt('position =');
largerThanNeighbours(input, pos);
function largerThanNeighbours(arr, pos) {
pos = pos*1;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.