commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
e2fac6bb350ac744eb8ea66f8ff227e3d09ecaf7 | test/groupexists.js | test/groupexists.js | var assert = require('assert');
var ActiveDirectory = require('../index');
var config = require('./config');
describe('ActiveDirectory', function() {
describe('#groupExists()', function() {
var ad;
var settings = require('./settings').groupExists;
beforeEach(function() {
ad = new ActiveDirectory(co... | Add unit tests for groupExists() method call. | Add unit tests for groupExists() method call.
| JavaScript | mit | jsumners/node-activedirectory,BenPaster/node-activedirectory,gheeres/node-activedirectory,kattsushi/node-activedirectory | ---
+++
@@ -0,0 +1,37 @@
+var assert = require('assert');
+var ActiveDirectory = require('../index');
+var config = require('./config');
+
+describe('ActiveDirectory', function() {
+ describe('#groupExists()', function() {
+ var ad;
+ var settings = require('./settings').groupExists;
+
+ beforeEach(function... | |
18dd550415a86928b8a5bd1ddc0c6963d57172ad | app/app.js | app/app.js | (function(){
angular.module('MeanSocial', ['ui.router'])
.config(function ($stateProvider) {
$stateProvider
.state('signUp', {
url: '/signup',
templateUrl: "app/signup/signup.html",
controller: 'SignUpController'
... | Add signup state; inject ui-router | Add signup state; inject ui-router
| JavaScript | mit | DavidMax/mean-social,DavidMax/mean-social | ---
+++
@@ -0,0 +1,12 @@
+(function(){
+ angular.module('MeanSocial', ['ui.router'])
+ .config(function ($stateProvider) {
+
+ $stateProvider
+ .state('signUp', {
+ url: '/signup',
+ templateUrl: "app/signup/signup.html",
+ c... | |
c70d24c5f3492c85734a1975a51af96c3f5c18e9 | test/functional/realtime-session.js | test/functional/realtime-session.js | import SocketIO from 'socket.io-client';
const eventTimeout = 2000;
const silenceTimeout = 500;
/**
* Session is a helper class
* for the realtime testing
*/
export default class Session {
socket = null;
name = '';
static create(port, name = '') {
const options = {
transports: ['websocket']... | Add a helper class for simplyfy realtime testing | Add a helper class for simplyfy realtime testing
| JavaScript | mit | FreeFeed/freefeed-server,FreeFeed/freefeed-server | ---
+++
@@ -0,0 +1,63 @@
+import SocketIO from 'socket.io-client';
+
+const eventTimeout = 2000;
+const silenceTimeout = 500;
+
+/**
+ * Session is a helper class
+ * for the realtime testing
+ */
+export default class Session {
+ socket = null;
+ name = '';
+
+ static create(port, name = '') {
+ const options = {
... | |
1e1b0f3563c758f583cb3f00eaf1b2b7fcf0bff9 | tests/e2e/matchers/to-be-checked.js | tests/e2e/matchers/to-be-checked.js | /**
* Custom matcher for testing if a checkbox is checked or not.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* 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
*
* https://ww... | Add toBeChecked custom matcher for E2E. | Add toBeChecked custom matcher for E2E.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | ---
+++
@@ -0,0 +1,49 @@
+/**
+ * Custom matcher for testing if a checkbox is checked or not.
+ *
+ * Site Kit by Google, Copyright 2020 Google LLC
+ *
+ * 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 ... | |
533d1dd6f31fc174d9620ae935f19d0311c261db | js/Utilities/BackAndroid.windows.js | js/Utilities/BackAndroid.windows.js | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @provides... | Add BackAndroid JS module for Windows platform | feat(BackAndroid): Add BackAndroid JS module for Windows platform
The BackAndroid module provides a JS API for the native DeviceEventEmitter module to hook into back-button presses. This is needed, e.g., for Navigator.
Fixes #246
| JavaScript | mit | lbochenek/react-native-windows,lbochenek/react-native-windows,lbochenek/react-native-windows,lbochenek/react-native-windows | ---
+++
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2015-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in t... | |
651cd79f2ae92afeff6c519cdf30472b82c1a830 | webpack-hot-only-dev-server.js | webpack-hot-only-dev-server.js | // Modified copy of https://github.com/webpack/webpack/blob/v1.11.0/hot/only-dev-server.js
// (Added window.instrumentCodeGroupAsyncTopLevel)
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/*globals window __webpack_hash__ */
if(module.hot) {
var lastData;
var... | Add modified version of a Webpack hot loading file | Add modified version of a Webpack hot loading file
Which makes use of grouping calls, so you don’t get a crazy amount of
top-level calls when re-rendering React components. | JavaScript | mit | janpaul123/omniscient-debugging,Tug/omniscient-debugging | ---
+++
@@ -0,0 +1,82 @@
+// Modified copy of https://github.com/webpack/webpack/blob/v1.11.0/hot/only-dev-server.js
+// (Added window.instrumentCodeGroupAsyncTopLevel)
+
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+/*globals window __webpack_hash__ */
+if... | |
a4f50092575e1037d2bff0f992df836de797bb2e | src/mpayrollAPI.js | src/mpayrollAPI.js | const Hapi = require("hapi");
let port = 3000;
let ip = 'localhost';
const server = new Hapi.Server();
server.connection({
host: ip,
port: port
});
//Add Routes
server.route({
method: 'POST',
path: '/api_mpayroll/employees',
handler: function(request, reply){
//Stub out sending the emplo... | ADD - Minimal code for mPayroll API | ADD - Minimal code for mPayroll API
| JavaScript | mit | Bill-A/Correctness-DrivenDevelopment | ---
+++
@@ -0,0 +1,36 @@
+const Hapi = require("hapi");
+
+let port = 3000;
+let ip = 'localhost';
+
+const server = new Hapi.Server();
+
+server.connection({
+ host: ip,
+ port: port
+});
+
+//Add Routes
+server.route({
+ method: 'POST',
+ path: '/api_mpayroll/employees',
+ handler: function(request, ... | |
1e50ee02fb2e7ff80e62e6701fc9f8aa7e35c391 | lib/collections/questionsGroupsCollection.js | lib/collections/questionsGroupsCollection.js | QuestionsGroups = new Mongo.Collection('questionsGroups');
var Schemas = {};
Schemas.QuestionsGroups = new SimpleSchema({
level: {
type: Number,
label: 'Question group level'
},
version: {
type: Number,
label: 'Question group version'
},
deprecated: {
type: Boolean,
label: 'Is the question group depr... | Add collection managment for the questionsGroup | Add collection managment for the questionsGroup
| JavaScript | mit | EKlore/EKlore,EKlore/EKlore | ---
+++
@@ -0,0 +1,58 @@
+QuestionsGroups = new Mongo.Collection('questionsGroups');
+
+var Schemas = {};
+
+Schemas.QuestionsGroups = new SimpleSchema({
+ level: {
+ type: Number,
+ label: 'Question group level'
+ },
+ version: {
+ type: Number,
+ label: 'Question group version'
+ },
+ deprecated: {
+ type: Boo... | |
c1ddf25cfecccf75c006f79a38c45c380bb7e65f | bin/run-simple-global-site-test.js | bin/run-simple-global-site-test.js | //
// Ref) https://www.browserstack.com/automate/node#getting-started
//
var webdriver = require('browserstack-webdriver');
var browserstackConf = require('../browserstack-conf.json');
// Input capabilities
var capabilities = {
'browserName' : 'firefox',
'browserstack.user' : browserstackConf['browserstack.user'... | Add a simple global test | Add a simple global test
| JavaScript | mit | kjirou/browserstack-with-express | ---
+++
@@ -0,0 +1,29 @@
+//
+// Ref) https://www.browserstack.com/automate/node#getting-started
+//
+
+var webdriver = require('browserstack-webdriver');
+
+var browserstackConf = require('../browserstack-conf.json');
+
+// Input capabilities
+var capabilities = {
+ 'browserName' : 'firefox',
+ 'browserstack.user'... | |
0fdd3fd1f0df888cf13e1e13e2418307bca407ae | week-7/game.js | week-7/game.js | // Design Basic Game Solo Challenge
// This is a solo challenge
// Your mission description:
// Overall mission:
//You're an astronaut and you need to get back to the spaceship. There is a martian trying to stop you so you have to shoot at him as you make your way back to safety.
// Goals:
//Get back to spaceship... | Add mission outline and pseudocode | Add mission outline and pseudocode
| JavaScript | mit | cstallings1/phase-0,cstallings1/phase-0,cstallings1/phase-0 | ---
+++
@@ -0,0 +1,73 @@
+// Design Basic Game Solo Challenge
+
+// This is a solo challenge
+
+// Your mission description:
+// Overall mission:
+ //You're an astronaut and you need to get back to the spaceship. There is a martian trying to stop you so you have to shoot at him as you make your way back to safety.
+... | |
a2748c414a629b1b909de14bd927428055f30adc | migrations/1.3.0.js | migrations/1.3.0.js | 'use strict';
var async = require('async');
var openVeoAPI = require('@openveo/api');
var db = openVeoAPI.applicationStorage.getDatabase();
module.exports.update = function(callback) {
process.logger.info('Publish 1.3.0 migration launched.');
db.get('videos', {}, null, null, function(error, value) {
if (erro... | Add migration script to rewrite files property into sources property | Add migration script to rewrite files property into sources property
| JavaScript | agpl-3.0 | veo-labs/openveo-publish,veo-labs/openveo-publish,veo-labs/openveo-publish | ---
+++
@@ -0,0 +1,55 @@
+'use strict';
+
+var async = require('async');
+var openVeoAPI = require('@openveo/api');
+var db = openVeoAPI.applicationStorage.getDatabase();
+
+
+module.exports.update = function(callback) {
+ process.logger.info('Publish 1.3.0 migration launched.');
+ db.get('videos', {}, null, null, ... | |
4736c2be21a62e675ff895a0201416c6b660a019 | experiments/GitHubGistUserCreator.js | experiments/GitHubGistUserCreator.js | const bcrypt = require('bcrypt');
const github = require('github-api');
const { User } = require('../models');
const { email } = require('../utils');
const GITHUB_API_TOKEN = process.env.GITHUB_TOKEN;
const GITHUB_GIST_ID = process.env.GITHUB_GIST_ID;
// Authenticate using a GitHub Token
const ghClient = new github(... | Create users from static data | Create users from static data
This pulls down a given GitHub Gist that contains a JSON file.
It then parses the data, creates a new password, creates a User, and
then it emails the user with their new password.
| JavaScript | mit | osumb/challenges,osumb/challenges,osumb/challenges,osumb/challenges | ---
+++
@@ -0,0 +1,25 @@
+const bcrypt = require('bcrypt');
+const github = require('github-api');
+
+const { User } = require('../models');
+const { email } = require('../utils');
+
+const GITHUB_API_TOKEN = process.env.GITHUB_TOKEN;
+const GITHUB_GIST_ID = process.env.GITHUB_GIST_ID;
+
+// Authenticate using a GitH... | |
53e25a15e0444f525166ed04305dcd6889815b2d | magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.spec.js | magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.spec.js | /**
* (c) Copyright 2016 NEC Corporation
*
* 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
*
* Unless required by applicable law or... | Add javascript tests for ClusterTemplateModel | Add javascript tests for ClusterTemplateModel
This patch adds javascript tests for the following modules.
- horizon.dashboard.container-infra.cluster-templates.model
Change-Id: I7f7b720ef8d8e69ecf8ea7994db77f74baba4cd2
| JavaScript | apache-2.0 | openstack/magnum-ui,openstack/magnum-ui,openstack/magnum-ui,openstack/magnum-ui | ---
+++
@@ -0,0 +1,83 @@
+/**
+ * (c) Copyright 2016 NEC Corporation
+ *
+ * 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
+ *
+ *... | |
722e50efcd1d64f36472f0722cf5e95933ed2767 | js/util.js | js/util.js | // 使い方
// getCurrentLocation()
// .done(function(location) {
// // success
// })
// .fail(function() {
// // faile
// });
function getCurrentLocation() {
var dfd = $.Deferred();
if(!navigator.geolocation) {
alert('Geolocation API is unavalable.');
dfd.reject();
}
navigator.geoloca... | Implement function getting current location by using jQuery.Defferred | Implement function getting current location by using jQuery.Defferred
| JavaScript | mit | otknoy/michishiki | ---
+++
@@ -0,0 +1,28 @@
+// 使い方
+// getCurrentLocation()
+// .done(function(location) {
+// // success
+// })
+// .fail(function() {
+// // faile
+// });
+
+function getCurrentLocation() {
+ var dfd = $.Deferred();
+
+ if(!navigator.geolocation) {
+ alert('Geolocation API is unavalable.');
+ ... | |
366c22009a3bda07c84790c91f567f57d8fa381c | src/reducers/r.spec.js | src/reducers/r.spec.js | import reducer from './r'
describe('r', () => {
it('Should return the initial state', () => {
expect(
reducer(undefined, {})
)
.toEqual(null)
})
it('Should handle LOGIN_SUCCESS', () => {
expect(
reducer(
// State,
null,
// Action
{
type: 'LOG... | Add reddit client reducer tests | Add reddit client reducer tests
| JavaScript | mit | antoinechalifour/Reddix,antoinechalifour/Reddix | ---
+++
@@ -0,0 +1,37 @@
+import reducer from './r'
+
+describe('r', () => {
+ it('Should return the initial state', () => {
+ expect(
+ reducer(undefined, {})
+ )
+ .toEqual(null)
+ })
+
+ it('Should handle LOGIN_SUCCESS', () => {
+ expect(
+ reducer(
+ // State,
+ null,
+ ... | |
69d5639b0e71f598a2830f01195adb6628aec744 | src/app/controllers/MainController.js | src/app/controllers/MainController.js | (function(){
angular
.module('app')
.controller('MainController', [
'navService', '$mdSidenav', '$mdBottomSheet', '$log', '$q', '$state', '$mdToast',
MainController
]);
function MainController(navService, $mdSidenav, $mdBottomSheet, $log, $q, $state, $mdToast) {
var vm... | Build a main layout for home page and customize layout sizes. | Build a main layout for home page and customize layout sizes.
| JavaScript | mit | happyboy171/DailyReportDashboard-Angluar-,happyboy171/DailyReportDashboard-Angluar- | ---
+++
@@ -0,0 +1,81 @@
+(function(){
+
+ angular
+ .module('app')
+ .controller('MainController', [
+ 'navService', '$mdSidenav', '$mdBottomSheet', '$log', '$q', '$state', '$mdToast',
+ MainController
+ ]);
+
+ function MainController(navService, $mdSidenav, $mdBottomSheet, $lo... | |
201eecdca92ac97ed3f84717d1fa69f4155a09de | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var psi = require('psi');
var site = 'http://www.html5rocks.com';
var key = '';
// Please feel free to use the `nokey` option to try out PageSpeed
// Insights as part of your build process. For more frequent use,
// we recommend registering for your own API key. For more info:
// https://d... | var gulp = require('gulp');
var psi = require('psi');
var site = 'http://www.html5rocks.com';
var key = '';
// Please feel free to use the `nokey` option to try out PageSpeed
// Insights as part of your build process. For more frequent use,
// we recommend registering for your own API key. For more info:
// https://d... | Use tabs rather as psi is using tabs | Use tabs rather as psi is using tabs | JavaScript | mit | Jazz-Man/psi-gulp-sample,addyosmani/psi-gulp-sample | ---
+++
@@ -9,21 +9,21 @@
// https://developers.google.com/speed/docs/insights/v1/getting_started
gulp.task('mobile', function (cb) {
- psi({
- // key: key
- nokey: 'true',
- url: site,
- strategy: 'mobile',
- }, cb);
+ psi({
+ // key: key
+ nokey: 'true',
+ url: site,
+ strategy: 'mobil... |
9e3d376c072775c93f456402786871c1f7060cdf | spec/helpers-spec.js | spec/helpers-spec.js | const path = require('path')
const helpers = require('../lib/helpers')
describe('Helpers', () => {
describe('getFullExtension', () => {
it('returns the extension for a simple file', () => {
expect(helpers.getFullExtension('filename.txt')).toBe('.txt')
})
it('returns the extension for a path', () => {
expe... | Add dedicated specs for getFullExtension | Add dedicated specs for getFullExtension
| JavaScript | mit | jarig/tree-view,atom/tree-view | ---
+++
@@ -0,0 +1,25 @@
+const path = require('path')
+
+const helpers = require('../lib/helpers')
+
+describe('Helpers', () => {
+ describe('getFullExtension', () => {
+ it('returns the extension for a simple file', () => {
+ expect(helpers.getFullExtension('filename.txt')).toBe('.txt')
+ })
+
+ it('returns the ... | |
c4be15ab7481215f39571fd7ec4c6ccff75457a6 | spec/all-spec.js | spec/all-spec.js | var FS = require("q-io/fs");
var PATH = require("path");
var RELATIVE_LIB = PATH.join("..", "lib");
var ABSOLUTE_LIB = PATH.join(__dirname, RELATIVE_LIB);
FS.listTree(ABSOLUTE_LIB, function (path, stat) {
return !!path.match(/.js$/);
})
.then(function (tree) {
tree.forEach(function (path) {
require(p... | Add "spec" to load all lib files | Add "spec" to load all lib files
To get true code coverage
| JavaScript | bsd-3-clause | pchaussalet/mop,thibaultzanini/mop | ---
+++
@@ -0,0 +1,15 @@
+var FS = require("q-io/fs");
+var PATH = require("path");
+
+var RELATIVE_LIB = PATH.join("..", "lib");
+var ABSOLUTE_LIB = PATH.join(__dirname, RELATIVE_LIB);
+
+
+FS.listTree(ABSOLUTE_LIB, function (path, stat) {
+ return !!path.match(/.js$/);
+})
+.then(function (tree) {
+ tree.forE... | |
a65eafa20a6862ddea627cf1dde438e680fa3fc1 | addon/-private/apollo/setup-hooks.js | addon/-private/apollo/setup-hooks.js | import Component from '@ember/component';
import Route from '@ember/routing/route';
const hooks = {
willDestroyElement() {
this.unsubscribeAll(false);
},
beforeModel() {
this.markSubscriptionsStale();
},
resetController(_, isExiting) {
this.unsubscribeAll(!isExiting);
},
willDestroy() {
... | Add setup hooks thanks @tchak | Add setup hooks thanks @tchak
The original idea here came from @tchak in his branch https://github.com/tchak/ember-apollo-client/tree/drop-mixins.
The only difference is that I default to willDestroy hook, not only for ember objects. This is to add support for Glimmer Components, in which they don't extend EmberObjec... | JavaScript | mit | bgentry/ember-apollo-client,bgentry/ember-apollo-client | ---
+++
@@ -0,0 +1,46 @@
+import Component from '@ember/component';
+import Route from '@ember/routing/route';
+
+const hooks = {
+ willDestroyElement() {
+ this.unsubscribeAll(false);
+ },
+
+ beforeModel() {
+ this.markSubscriptionsStale();
+ },
+
+ resetController(_, isExiting) {
+ this.unsubscribeAl... | |
b1f3cbd648ab6245ce13219f83173e2c2619fa5d | Specs/Scene/PrimitivePipelineSpec.js | Specs/Scene/PrimitivePipelineSpec.js | /*global defineSuite*/
defineSuite([
'Scene/PrimitivePipeline',
'Core/BoundingSphere',
'Core/BoxGeometry',
'Core/Cartesian3',
'Core/ComponentDatatype',
'Core/Geometry',
'Core/GeometryAttribute',
'Core/GeometryAttributes',
'Core/PrimitiveTy... | Add specs for PrimitivePipline geometry packing. | Add specs for PrimitivePipline geometry packing.
| JavaScript | apache-2.0 | omh1280/cesium,aelatgt/cesium,kiselev-dv/cesium,kiselev-dv/cesium,jason-crow/cesium,emackey/cesium,hodbauer/cesium,soceur/cesium,AnimatedRNG/cesium,denverpierce/cesium,AnimatedRNG/cesium,emackey/cesium,CesiumGS/cesium,likangning93/cesium,wallw-bits/cesium,AnalyticalGraphicsInc/cesium,geoscan/cesium,denverpierce/cesium,... | ---
+++
@@ -0,0 +1,67 @@
+/*global defineSuite*/
+defineSuite([
+ 'Scene/PrimitivePipeline',
+ 'Core/BoundingSphere',
+ 'Core/BoxGeometry',
+ 'Core/Cartesian3',
+ 'Core/ComponentDatatype',
+ 'Core/Geometry',
+ 'Core/GeometryAttribute',
+ 'Core/GeometryAt... | |
599b32f2b2c0c29337a053a6b6a28d61f92c1241 | karma.conf.js | karma.conf.js | module.exports = function (config) {
config.set({
frameworks: ['mocha'],
exclude: ['build/test/external.spec.js'],
files: [
'vendor/rsvp.js',
'vendor/unexpected-magicpen.min.js',
'build/test/promisePolyfill.js',
'unexpected.js',
'build/test/common.js',
'build/test/**/... | module.exports = function (config) {
config.set({
frameworks: ['mocha'],
exclude: ['build/test/external.spec.js'],
files: [
'vendor/rsvp.js',
'vendor/unexpected-magicpen.min.js',
'build/test/promisePolyfill.js',
'unexpected.js',
'build/test/common.js',
'build/test/**/... | Set browserStack timeout in an attempt to fix failing CI builds | Set browserStack timeout in an attempt to fix failing CI builds
| JavaScript | mit | unexpectedjs/unexpected | ---
+++
@@ -32,6 +32,9 @@
!process.env.TRAVIS_PULL_REQUEST_BRANCH // Catch Travis "PR" builds
? 'unexpected'
: 'unexpected-dev',
+ // Attempt to fix timeouts on CI:
+ // https://github.com/karma-runner/karma-browserstack-launcher/pull/168#issuecomment-582373514
+ timeout:... |
4f76060e328e0ef864bde3a138bce7c3135d60a2 | lib/moment.js | lib/moment.js | moment.locale('fr', {
months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),
monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),
weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),
weekda... | Add config to display date in french | Add config to display date in french
| JavaScript | mit | dexterneo/mangatek,dexterneo/mangatek,dexterneo/mangas,dexterneo/mangas | ---
+++
@@ -0,0 +1,58 @@
+moment.locale('fr', {
+ months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),
+ monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),
+ weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi... | |
a3519ec3e332e9825645cf02e614c724c30c8a46 | src/dsp/DiscontinuityDetector.js | src/dsp/DiscontinuityDetector.js | /**
* @depends ../core/AudioletNode.js
*/
var DiscontinuityDetector = new Class({
Extends: PassThroughNode,
initialize: function(audiolet, threshold, callback) {
PassThroughNode.prototype.initialize.apply(this, [audiolet, 1, 1]);
this.linkNumberOfOutputChannels(0, 0);
this.threshold ... | Add discontinuity detector - a debugging tool for my crappy dsp | Add discontinuity detector - a debugging tool for my crappy dsp
| JavaScript | apache-2.0 | kn0ll/Audiolet,mcanthony/Audiolet,kn0ll/Audiolet,oampo/Audiolet,Kosar79/Audiolet,oampo/Audiolet,Kosar79/Audiolet,mcanthony/Audiolet,Kosar79/Audiolet,bobby-brennan/Audiolet,bobby-brennan/Audiolet | ---
+++
@@ -0,0 +1,57 @@
+/**
+ * @depends ../core/AudioletNode.js
+ */
+
+var DiscontinuityDetector = new Class({
+ Extends: PassThroughNode,
+ initialize: function(audiolet, threshold, callback) {
+ PassThroughNode.prototype.initialize.apply(this, [audiolet, 1, 1]);
+ this.linkNumberOfOutputChan... | |
dc76f34b8688ecaab77e43d3c74521c640f70971 | support/find_urls.js | support/find_urls.js | // Find urls within selected domain in posts
//
'use strict';
const _ = require('lodash');
const argparse = require('argparse');
const Promise = require('bluebird');
const mongoose = require('mongoose');
const pump = require('pump');
const stream = require('stream');
const URL = require('url');
... | Add script to dump links from a particular domain | Add script to dump links from a particular domain
| JavaScript | mit | rcdesign/rcd-nodeca,rcdesign/rcd-nodeca | ---
+++
@@ -0,0 +1,88 @@
+// Find urls within selected domain in posts
+//
+
+'use strict';
+
+
+const _ = require('lodash');
+const argparse = require('argparse');
+const Promise = require('bluebird');
+const mongoose = require('mongoose');
+const pump = require('pump');
+const stream = require('stream... | |
bb1a00d28bb36c0919968bb1ee02510dccd3caf0 | test/virtual-loopback-test.js | test/virtual-loopback-test.js | var midi = require("../build/default/midi.node");
var output = new midi.output();
var input = new midi.input();
output.openVirtualPort("node-midi Virtual Output");
input.on('message', function(deltaTime, message) {
console.log('m:' + message + ' d:' + deltaTime);
output.sendMessage([
message[0],
message[1... | Add a test that uses a virtual input and virtual output to make a loopback. | Add a test that uses a virtual input and virtual output to make a loopback.
| JavaScript | mit | Cycling74/node-midi,drewish/node-midi,Cycling74/node-midi,brandly/node-midi,brandly/node-midi,szymonkaliski/node-midi,drewish/node-midi,Cycling74/node-midi,Cycling74/node-midi,drewish/node-midi,brandly/node-midi,justinlatimer/node-midi,brandly/node-midi,julianduque/node-midi,drewish/node-midi,julianduque/node-midi,Cycl... | ---
+++
@@ -0,0 +1,19 @@
+var midi = require("../build/default/midi.node");
+
+var output = new midi.output();
+var input = new midi.input();
+
+output.openVirtualPort("node-midi Virtual Output");
+input.on('message', function(deltaTime, message) {
+ console.log('m:' + message + ' d:' + deltaTime);
+ output.sendMes... | |
a6f899f06258ca0b01eb33d965b10cfcde74a92a | test/unit/traderTickerTest.js | test/unit/traderTickerTest.js | 'use strict';
var assert = require('chai').assert;
var hock = require('hock');
var uuid = require('node-uuid').v4;
var Trader = require('../../lib/trader.js');
var PostgresqlInterface = require('../../lib/protocol/db/postgresql_interface.js');
var db = 'psql://lamassu:lamassu@localhost/lamassu-test';
var psqlInterfac... | Add a unit test for ticker | Add a unit test for ticker
| JavaScript | unlicense | lamassu/lamassu-server,joshmh/lamassu-server,naconner/lamassu-server,naconner/lamassu-server,joshmh/lamassu-server,joshmh/lamassu-server,naconner/lamassu-server,joshmh/lamassu-server,lamassu/lamassu-server,evan82/lamassu-server,lamassu/lamassu-server | ---
+++
@@ -0,0 +1,55 @@
+'use strict';
+
+var assert = require('chai').assert;
+var hock = require('hock');
+var uuid = require('node-uuid').v4;
+var Trader = require('../../lib/trader.js');
+var PostgresqlInterface = require('../../lib/protocol/db/postgresql_interface.js');
+
+var db = 'psql://lamassu:lamassu@local... | |
ae753386502263230e7616e9436a41dd43c07e21 | direct-demo/direct-demo.js | direct-demo/direct-demo.js | /**
* Copyright (C) 2009-2013 Akiban Technologies, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
... | Add a small demo file | Add a small demo file | JavaScript | agpl-3.0 | ngaut/sql-layer,jaytaylor/sql-layer,qiuyesuifeng/sql-layer,relateiq/sql-layer,jaytaylor/sql-layer,relateiq/sql-layer,relateiq/sql-layer,shunwang/sql-layer-1,jaytaylor/sql-layer,shunwang/sql-layer-1,wfxiang08/sql-layer-1,qiuyesuifeng/sql-layer,ngaut/sql-layer,shunwang/sql-layer-1,wfxiang08/sql-layer-1,relateiq/sql-layer... | ---
+++
@@ -0,0 +1,47 @@
+/**
+ * Copyright (C) 2009-2013 Akiban Technologies, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at... | |
17a2a18e5c7cf0b52059ef70a28dccfd66de6c1b | packages/activemodel-adapter/tests/integration/active-model-adapter-serializer-test.js | packages/activemodel-adapter/tests/integration/active-model-adapter-serializer-test.js | var env, store, adapter, User;
var originalAjax;
module("integration/active_model_adapter_serializer - AMS Adapter and Serializer", {
setup: function() {
originalAjax = Ember.$.ajax;
User = DS.Model.extend({
firstName: DS.attr()
});
env = setupStore({
user: User,
adapter: DS.Activ... | Test that active model adapter passes errors to serializer | Test that active model adapter passes errors to serializer
Thanks to @pangratz for putting this test together. Currently we only have tests
for the adapter and serializer correctly behaving in isolation.
| JavaScript | mit | HeroicEric/data,simaob/data,PrecisionNutrition/data,yaymukund/data,minasmart/data,danmcclain/data,splattne/data,yaymukund/data,tonywok/data,H1D/data,offirgolan/data,Eric-Guo/data,duggiefresh/data,intuitivepixel/data,gabriel-letarte/data,webPapaya/data,dustinfarris/data,greyhwndz/data,fsmanuel/data,kappiah/data,dustinfa... | ---
+++
@@ -0,0 +1,54 @@
+var env, store, adapter, User;
+var originalAjax;
+
+module("integration/active_model_adapter_serializer - AMS Adapter and Serializer", {
+ setup: function() {
+ originalAjax = Ember.$.ajax;
+
+ User = DS.Model.extend({
+ firstName: DS.attr()
+ });
+
+ env = setupStore({
+ ... | |
dbe09fc00bb05ada08a0497e7242199e0935f464 | solutions/uri/1006/1006.js | solutions/uri/1006/1006.js | const input = require('fs').readFileSync('/dev/stdin', 'utf8')
const [a, b, c] = input
.trim()
.split('\n')
.map(x => parseFloat(x))
console.log(`MEDIA = ${((a * 2.0 + b * 3.0 + c * 5.0) / 10.0).toFixed(1)}`)
| Solve Average 2 in javascript | Solve Average 2 in javascript
| JavaScript | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | ---
+++
@@ -0,0 +1,8 @@
+const input = require('fs').readFileSync('/dev/stdin', 'utf8')
+
+const [a, b, c] = input
+ .trim()
+ .split('\n')
+ .map(x => parseFloat(x))
+
+console.log(`MEDIA = ${((a * 2.0 + b * 3.0 + c * 5.0) / 10.0).toFixed(1)}`) | |
352ab0a798ed1529f30563cfec997b24569a81a9 | src/framework/framework_pack.js | src/framework/framework_pack.js | pc.extend(pc, function () {
var Pack = function (data) {
this.hierarchy = data.hierarchy;
this.settings = data.settings;
};
Pack.prototype = {
};
return {
Pack: Pack,
/**
* @function
* @name pc.loadPack
* @description Load ... | pc.extend(pc, function () {
var Pack = function (data) {
this.hierarchy = data.hierarchy;
this.settings = data.settings;
};
return {
Pack: Pack
};
}()); | Remove pc.loadPack from the docs since the function doesn't actually exist - it's commented out in the sourcebase. | Remove pc.loadPack from the docs since the function doesn't actually exist - it's commented out in the sourcebase.
| JavaScript | mit | SuperStarPL/engine,nizihabi/engine,MicroWorldwide/PlayCanvas,RainsSoft/engine,horryq/engine-1,shinate/engine,guycalledfrank/engine,aidinabedi/playcanvas-engine,horryq/engine-1,sanyaade-teachings/engine,sanyaade-teachings/engine,sereepap2029/playcanvas,H1Gdev/engine,guycalledfrank/engine,playcanvas/engine,nizihabi/engin... | ---
+++
@@ -4,48 +4,7 @@
this.settings = data.settings;
};
- Pack.prototype = {
-
- };
-
return {
- Pack: Pack,
- /**
- * @function
- * @name pc.loadPack
- * @description Load and initialise a new Pack. The Pack is loaded, added to the root of the hiera... |
3dc57d08a8944ebc3b4a60622118e10ceaeca116 | lib/bramqp.js | lib/bramqp.js | var specification = require('./specification');
var ConnectionHandle = require('./connectionHandle');
exports.initialize = function(socket, spec, callback) {
socket.on('error', callback);
socket.on('connect', function() {
var handle = new ConnectionHandle(socket, spec);
handle.once('init', function() {
callb... | var specification = require('./specification');
var ConnectionHandle = require('./connectionHandle');
exports.initialize = function(socket, spec, callback) {
socket.once('connect', function() {
var handle = new ConnectionHandle(socket, spec);
handle.once('init', function() {
callback(null, handle);
});
});... | Fix initialize running callback multiple times | Fix initialize running callback multiple times
| JavaScript | mit | bakkerthehacker/bramqp,sega-yarkin/bramqp | ---
+++
@@ -3,8 +3,7 @@
var ConnectionHandle = require('./connectionHandle');
exports.initialize = function(socket, spec, callback) {
- socket.on('error', callback);
- socket.on('connect', function() {
+ socket.once('connect', function() {
var handle = new ConnectionHandle(socket, spec);
handle.once('init',... |
40d3b9d9bd8657769d9ea162dc0a41b4322f4af2 | lib/withdrawal_payments_queue.js | lib/withdrawal_payments_queue.js | var gateway = require('./gateway');
var EventEmitter = require("events").EventEmitter;
var util = require('util');
var queue = new EventEmitter;
function pollIncoming(fn) {
gateway.payments.listIncoming(function(err, payments) {
if (err) {
console.log('error:', err);
} else {
if (payments[0]) {... | Add withdrawal payments queue event emitter. | [FEATURE] Add withdrawal payments queue event emitter.
| JavaScript | isc | whotooktwarden/gatewayd,xdv/gatewayd,Parkjeahwan/awegeeks,crazyquark/gatewayd,zealord/gatewayd,xdv/gatewayd,crazyquark/gatewayd,Parkjeahwan/awegeeks,zealord/gatewayd,whotooktwarden/gatewayd | ---
+++
@@ -0,0 +1,27 @@
+var gateway = require('./gateway');
+var EventEmitter = require("events").EventEmitter;
+var util = require('util');
+
+var queue = new EventEmitter;
+
+function pollIncoming(fn) {
+ gateway.payments.listIncoming(function(err, payments) {
+ if (err) {
+ console.log('error:', err);
... | |
a7642fe014cf295e43d65435879b96789c6509dd | cli/main.js | cli/main.js | #!/usr/bin/env node
'use strict'
require('debug').enable('UCompiler:*')
const UCompiler = require('..')
const knownCommands = ['go', 'watch']
const parameters = process.argv.slice(2)
if (!parameters.length || knownCommands.indexOf(parameters[0]) === -1) {
console.log('Usage: ucompiler go|watch [path]')
process.ex... | Add a basic cli script | :new: Add a basic cli script
| JavaScript | mit | steelbrain/UCompiler | ---
+++
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+'use strict'
+
+require('debug').enable('UCompiler:*')
+const UCompiler = require('..')
+const knownCommands = ['go', 'watch']
+const parameters = process.argv.slice(2)
+
+if (!parameters.length || knownCommands.indexOf(parameters[0]) === -1) {
+ console.log('Usage: uco... | |
d5f135f198a4855564c381e375f4c3a8fad97a63 | Native/Test/Fabric/fixed-array-member-access.js | Native/Test/Fabric/fixed-array-member-access.js |
FABRIC = wrapFabricClient(createFabricClient());
node = FABRIC.DependencyGraph.createNode("foo");
node.addMember( "foo", "Integer[5]" );
node.setData( "foo", [6,4,7,2,1] );
print( node.getDataSize( "foo", 0 ) );
print( node.getDataElement( "foo", 0, 3 ) );
| FC = createFabricClient();
FABRIC = wrapFabricClient(FC);
node = FABRIC.DependencyGraph.createNode("foo");
node.addMember( "foo", "Integer[5]" );
node.setData( "foo", [6,4,7,2,1] );
print( node.getDataSize( "foo", 0 ) );
print( node.getDataElement( "foo", 0, 3 ) );
FABRIC.flush();
FC.dispose();
| Verify no memory leaks in test | Verify no memory leaks in test
| JavaScript | agpl-3.0 | chbfiv/fabric-engine-old,chbfiv/fabric-engine-old,chbfiv/fabric-engine-old,errordeveloper/fe-devel,errordeveloper/fe-devel,chbfiv/fabric-engine-old,chbfiv/fabric-engine-old,errordeveloper/fe-devel,chbfiv/fabric-engine-old,errordeveloper/fe-devel,errordeveloper/fe-devel,chbfiv/fabric-engine-old,errordeveloper/fe-devel,e... | ---
+++
@@ -1,8 +1,11 @@
-
-FABRIC = wrapFabricClient(createFabricClient());
+FC = createFabricClient();
+FABRIC = wrapFabricClient(FC);
node = FABRIC.DependencyGraph.createNode("foo");
node.addMember( "foo", "Integer[5]" );
node.setData( "foo", [6,4,7,2,1] );
print( node.getDataSize( "foo", 0 ) );
print( node... |
cbd87c2bff4d9c03d21853079734e7ed3efdd58a | app/mixins/tooltip-enabled.js | app/mixins/tooltip-enabled.js | import Ember from 'ember';
export default Ember.Mixin.create({
/**
* Attribute bindings for mixin's component element
* @property {array} attributeBindings
*/
attributeBindings: [ 'data-placement', 'title' ],
/**
* Enables the tooltip functionality, based on a passed-in `title` attrib... | Add TooltipEnabled mixin for title-based tooltips | Add TooltipEnabled mixin for title-based tooltips
| JavaScript | mit | juwara0/sl-ember-components,Suven/sl-ember-components,alxyuu/sl-ember-components,theoshu/sl-ember-components,azizpunjani/sl-ember-components,jonathandavidson/sl-ember-components,softlayer/sl-ember-components,Suven/sl-ember-components,notmessenger/sl-ember-components,alxyuu/sl-ember-components,notmessenger/sl-ember-comp... | ---
+++
@@ -0,0 +1,20 @@
+import Ember from 'ember';
+
+export default Ember.Mixin.create({
+
+ /**
+ * Attribute bindings for mixin's component element
+ * @property {array} attributeBindings
+ */
+ attributeBindings: [ 'data-placement', 'title' ],
+
+ /**
+ * Enables the tooltip functionali... | |
4201b52166149eba80a446731517e7ef4532fdd7 | src/store/configureStore.dev.js | src/store/configureStore.dev.js | // This file merely configures the store for hot reloading.
// This boilerplate file is likely to be the same for each project that uses Redux.
// With Redux, the actual stores are in /reducers.
import {createStore, compose, applyMiddleware} from 'redux';
import reduxImmutableStateInvariant from 'redux-immutable-state... | // This file merely configures the store for hot reloading.
// This boilerplate file is likely to be the same for each project that uses Redux.
// With Redux, the actual stores are in /reducers.
import {createStore, compose, applyMiddleware} from 'redux';
import reduxImmutableStateInvariant from 'redux-immutable-state... | Upgrade for the Redux DevTools extension. | Upgrade for the Redux DevTools extension.
| JavaScript | mit | danpersa/remindmetolive-react,svitekpavel/chatbot-website,coryhouse/react-slingshot,flibertigibet/react-redux-starter-kit-custom,akataz/theSite,barbel840113/testapp,garusis/up-designer,aaronholmes/yelp-clone,barbel840113/testapp,luanatsainsburys/road-runner,danpersa/remindmetolive-react,svitekpavel/Conway-s-Game-of-Lif... | ---
+++
@@ -19,9 +19,9 @@
thunkMiddleware,
];
- const store = createStore(rootReducer, initialState, compose(
- applyMiddleware(...middlewares),
- window.devToolsExtension ? window.devToolsExtension() : f => f // add support for Redux dev tools
+ const composeEnhancers = window.__REDUX_DEVTOOLS_EXTE... |
c1a1cdd460d1057be1ea1ca322950640d2823944 | src/components/InfiniteList.react.js | src/components/InfiniteList.react.js | import React, { Component, PropTypes } from 'react';
class InfiniteList extends Component {
constructor(props, context) {
super(props, context);
}
render() {
return null;
}
}
export default InfiniteList;
| Add in an infinite list component. | Add in an infinite list component.
| JavaScript | mit | mareksuscak/surfing-gallery,mareksuscak/surfing-gallery | ---
+++
@@ -0,0 +1,13 @@
+import React, { Component, PropTypes } from 'react';
+
+class InfiniteList extends Component {
+ constructor(props, context) {
+ super(props, context);
+ }
+
+ render() {
+ return null;
+ }
+}
+
+export default InfiniteList; | |
d8eb90edcf34e1c15cf862eece8fef831f10c105 | packages/core/src/contexts/listSpacing.js | packages/core/src/contexts/listSpacing.js | // #FIXME: use React navive context API when upgraded to v16+
import createReactContext from 'create-react-context';
const ListSpacingContext = createReactContext(true);
export default ListSpacingContext;
| Create a context for configuring vertical spacing of <List> | Create a context for configuring vertical spacing of <List>
| JavaScript | apache-2.0 | iCHEF/gypcrete,iCHEF/gypcrete | ---
+++
@@ -0,0 +1,6 @@
+// #FIXME: use React navive context API when upgraded to v16+
+import createReactContext from 'create-react-context';
+
+const ListSpacingContext = createReactContext(true);
+
+export default ListSpacingContext; | |
5135bd1a50894c11f09cc982f0f140222fe0d691 | backend/servers/mcapi/db/model/sample-common.js | backend/servers/mcapi/db/model/sample-common.js | module.exports = function(r) {
return {
removeUnusedSamples
};
function* removeUnusedSamples(sampleIds) {
for (let i = 0; i < sampleIds.length; i++) {
let sampleId = sampleIds[i];
let p2s = yield r.table('process2sample').getAll(sampleId, {index: 'sample_id'});
... | Create a module for commonly needed sample functionality. | Create a module for commonly needed sample functionality.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | ---
+++
@@ -0,0 +1,28 @@
+module.exports = function(r) {
+ return {
+ removeUnusedSamples
+ };
+
+ function* removeUnusedSamples(sampleIds) {
+ for (let i = 0; i < sampleIds.length; i++) {
+ let sampleId = sampleIds[i];
+ let p2s = yield r.table('process2sample').getAll(sa... | |
894ca9adcb73e6f799aa6e1ca4bb59ba3ea45166 | src/create-schedule.js | src/create-schedule.js | const fs = require('fs');
const PDFDocument = require('pdfkit');
var doc = new PDFDocument();
doc.pipe(fs.createWriteStream('templates/resources/pdf/schedule.pdf'));
doc
.moveTo(0,0)
.lineTo(100, 100)
.stroke();
doc.end();
| Create a skeletal pdf generation file | Create a skeletal pdf generation file
| JavaScript | mit | Balletboetiek/website,Balletboetiek/website,Balletboetiek/website | ---
+++
@@ -0,0 +1,13 @@
+const fs = require('fs');
+
+const PDFDocument = require('pdfkit');
+
+var doc = new PDFDocument();
+doc.pipe(fs.createWriteStream('templates/resources/pdf/schedule.pdf'));
+
+doc
+ .moveTo(0,0)
+ .lineTo(100, 100)
+ .stroke();
+
+doc.end(); | |
6dc3d5db2efcd632b0a46f86394408aefe868967 | test/pem_as_hmac_key_spec.js | test/pem_as_hmac_key_spec.js |
describe('pem-as-hmac-key', function ()
{
var token;
before(function ()
{
// generate HS256 token using public PEM string as key
var expires = new Date();
expires.setSeconds(expires.getSeconds() + 60);
token = new jsjws.JWT().generateJWTByKey({ alg: 'HS256' }, payload, exp... | Add test to check we can restrict alg when PEM is used | Add test to check we can restrict alg when PEM is used
| JavaScript | mit | davedoesdev/node-jsjws,davedoesdev/node-jsjws,davedoesdev/node-jsjws | ---
+++
@@ -0,0 +1,46 @@
+
+
+describe('pem-as-hmac-key', function ()
+{
+ var token;
+
+ before(function ()
+ {
+ // generate HS256 token using public PEM string as key
+ var expires = new Date();
+ expires.setSeconds(expires.getSeconds() + 60);
+ token = new jsjws.JWT().generate... | |
058ec9922c74ee76837b0a91bf5e4b85a7ac07e2 | test/exception-bad-this.js | test/exception-bad-this.js | // Copyright (C) 2014 Domenic Denicola. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Array.prototype.includes should fail if used on a null or undefined this
---*/
assert.throws(TypeError, function () {
Array.prototype.includes.call(null, 'a');
});... | Add test for throwing on bad `this` | Add test for throwing on bad `this`
Fixes @caitp's review comment at https://codereview.chromium.org/771863002/diff/60001/test/mjsunit/harmony/array-includes-to-object.js.
| JavaScript | bsd-2-clause | tc39/Array.prototype.includes,tc39/Array.prototype.includes,tc39/Array.prototype.includes | ---
+++
@@ -0,0 +1,14 @@
+// Copyright (C) 2014 Domenic Denicola. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Array.prototype.includes should fail if used on a null or undefined this
+---*/
+
+assert.throws(TypeError, function () {
+ Array.pro... | |
4295d68d536a8f9597cae00f932170523e4b89c0 | static/script/devices/exit/openclosewindow.js | static/script/devices/exit/openclosewindow.js | /**
* @fileOverview Requirejs module for openclosewindow exit strategy.
* Uses a workaround to make the browser think the current window
* was opened by JavaScript, allowing window.close() to close it.
*
* @preserve Copyright (c) 2013 British Broadcasting Corporation
* (http://www.bbc.co.uk) and TAL Contrib... | Add a new exit strategy, calling window.open() before window.close(), as a workaround for LG devices that do not currently allow window.close() if the current window was not opened by a script. | Add a new exit strategy, calling window.open() before window.close(), as a workaround for LG devices that do not currently allow window.close() if the current window was not opened by a script.
| JavaScript | apache-2.0 | ZeboFranklin/tal,joeyjojo/tal,ZeboFranklin/tal,joeyjojo/tal,joeyjojo/tal,ZeboFranklin/tal,ZeboFranklin/tal,joeyjojo/tal,joeyjojo/tal,ZeboFranklin/tal | ---
+++
@@ -0,0 +1,46 @@
+/**
+ * @fileOverview Requirejs module for openclosewindow exit strategy.
+ * Uses a workaround to make the browser think the current window
+ * was opened by JavaScript, allowing window.close() to close it.
+ *
+ * @preserve Copyright (c) 2013 British Broadcasting Corporation
+ * (http://ww... | |
823b15e51314bf335a50d775d0e5399f489c5066 | examples/_mac-terminal-app/index.js | examples/_mac-terminal-app/index.js | #!/usr/bin/env node
//
// Can Terminal.app (Mac OS X) accept mouse events?
//
// * click needs "Option" pressing
//
console.log('Start');
process.stdin.setRawMode(true);
process.stdin.resume();
var onData = function onData(aInput) {
console.log(aInput, aInput.toString());
if (aInput.toString() === 'q') {
pr... | Add a sample of Terminail.app mouse events | Add a sample of Terminail.app mouse events
| JavaScript | mit | kjirou/nodejs-codes | ---
+++
@@ -0,0 +1,23 @@
+#!/usr/bin/env node
+
+//
+// Can Terminal.app (Mac OS X) accept mouse events?
+//
+// * click needs "Option" pressing
+//
+
+console.log('Start');
+
+process.stdin.setRawMode(true);
+process.stdin.resume();
+
+var onData = function onData(aInput) {
+ console.log(aInput, aInput.toString());... | |
bbfd9a2a613d55a16a7db5ef1e6b572137861cb4 | web/src/js/components/General/AuthUserComponent.js | web/src/js/components/General/AuthUserComponent.js | import React from 'react';
import FullScreenProgress from 'general/FullScreenProgress';
import { getCurrentUser } from '../../utils/cognito-auth';
import { goToLogin } from 'navigation/navigation';
class AuthUserComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
userId... | Add a wrapper component for the queryrenders that requiere the userId. Pass any extra variables to the wrapper instead. | Add a wrapper component for the queryrenders that requiere the userId. Pass any extra variables to the wrapper instead.
| JavaScript | mpl-2.0 | gladly-team/tab,gladly-team/tab,gladly-team/tab | ---
+++
@@ -0,0 +1,63 @@
+import React from 'react';
+import FullScreenProgress from 'general/FullScreenProgress';
+import { getCurrentUser } from '../../utils/cognito-auth';
+import { goToLogin } from 'navigation/navigation';
+
+class AuthUserComponent extends React.Component {
+
+ constructor(props) {
+ super(... | |
8dcdaa48cf23a5fec53013b4af63a29fc4d786d2 | app/assets/javascripts/sencha_base/placeholder_fallback.js | app/assets/javascripts/sencha_base/placeholder_fallback.js | // Placeholder fallback for browsers that don't support it.
//
// Requirements:
// Modernizr
//
// Instructions:
// 1. Require sencha_base/placeholder_fallback after Modernizr and before any
// other on submit events are binded, so the placeholder attribute is reset and
// not posted as the field value.
//
// 2. Add 'p... | Add placeholder fallback for older browsers. | Add placeholder fallback for older browsers.
| JavaScript | mit | jvcanote/SenchaBase,hypertiny/SenchaBase,hypertiny/SenchaBase,jvcanote/SenchaBase,hypertiny/SenchaBase,jvcanote/SenchaBase | ---
+++
@@ -0,0 +1,56 @@
+// Placeholder fallback for browsers that don't support it.
+//
+// Requirements:
+// Modernizr
+//
+// Instructions:
+// 1. Require sencha_base/placeholder_fallback after Modernizr and before any
+// other on submit events are binded, so the placeholder attribute is reset and
+// not posted... | |
c86b7b6126ce716d8ff685c1dd105ed660054ac9 | client/components/lists/ManageSubscribersTable.js | client/components/lists/ManageSubscribersTable.js | import React, { PropTypes } from 'react';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
import BSTyle from 'react-bootstrap-table/dist/react-bootstrap-table.min.css';
export default class ManageSubscribersTable extends React.Component {
constructor(props) {
super(props);
this.st... | import React, { PropTypes } from 'react';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
import BSTyle from 'react-bootstrap-table/dist/react-bootstrap-table.min.css';
export default class ManageSubscribersTable extends React.Component {
constructor(props) {
super(props);
this.st... | Fix initial state of list subscribers table | Fix initial state of list subscribers table
| JavaScript | bsd-3-clause | zhakkarn/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,karuppiah7890/Mail-for-Good | ---
+++
@@ -7,7 +7,7 @@
super(props);
this.state = {
- data: this.props.data
+ data: this.props.data || []
};
}
@@ -30,7 +30,7 @@
render() {
return (
- <BootstrapTable data={this.props.data}
+ <BootstrapTable data={this.state.data}
pagination=... |
86ab0e203fb62f1d3b1e13445966f72567f6cbd8 | bin/cliHelper.js | bin/cliHelper.js | var q = require('q');
var childProcess = require('child_process');
var CLI_PATH = 'node /Users/andresdom/dev/protractor/lib/cli.js ' +
'--elementExplorer true ' +
'--debuggerServerPort 6969';
var startProtractor = function() {
var deferred = q.defer();
console.log('Starting protractor with command: [%s]'... | Add helper to start protractor | Add helper to start protractor
| JavaScript | mit | andresdominguez/elementor,andresdominguez/elementor | ---
+++
@@ -0,0 +1,35 @@
+var q = require('q');
+var childProcess = require('child_process');
+
+var CLI_PATH = 'node /Users/andresdom/dev/protractor/lib/cli.js ' +
+ '--elementExplorer true ' +
+ '--debuggerServerPort 6969';
+
+var startProtractor = function() {
+ var deferred = q.defer();
+
+ console.log('S... | |
5acf747c9025491ab5198dc80a5b0c13c2e568ac | projectSlug.js | projectSlug.js | var rest = require('./rest');
/**
* Fetches a project by project id, then fetches its project slug for use
* when working with tasks.
*
* @param {int} projectid - AC project id
* @param {Function} cb - function to be called once project slug has
* been fetched and calculated
... | Add module 2 work out project slug from project id | Add module 2 work out project slug from project id
| JavaScript | mit | mediasuitenz/node-activecollab | ---
+++
@@ -0,0 +1,19 @@
+var rest = require('./rest');
+
+/**
+ * Fetches a project by project id, then fetches its project slug for use
+ * when working with tasks.
+ *
+ * @param {int} projectid - AC project id
+ * @param {Function} cb - function to be called once project slug has
+ * ... | |
8f4d41cecdeb357cdc1ebb6ca2bc3a3a1661467b | BakinBaconApi.js | BakinBaconApi.js | 'use strict';
import React, {
AsyncStorage,
AlertIOS
} from 'react-native';
var SERVER_URL = 'https://ziiwfyoc40.execute-api.us-east-2.amazonaws.com/prod
var BACON_URL = SERVER_URL + '/bacon-bit';
export class BakinBaconApi
{
constructor() {
}
postBaconBit(baconBit, onBaconing) {
try... | Add initial client API with bacon bit post | Add initial client API with bacon bit post
| JavaScript | mit | bakin-bacon/app | ---
+++
@@ -0,0 +1,46 @@
+'use strict';
+import React, {
+ AsyncStorage,
+ AlertIOS
+} from 'react-native';
+
+var SERVER_URL = 'https://ziiwfyoc40.execute-api.us-east-2.amazonaws.com/prod
+var BACON_URL = SERVER_URL + '/bacon-bit';
+
+export class BakinBaconApi
+{
+ constructor() {
+
+ }
+
+ postB... | |
111688be26d8647ca3c2a42633007f9e298ff2d7 | website/static/js/fileRevisions.js | website/static/js/fileRevisions.js | 'use strict';
var ko = require('knockout');
require('knockout-punches');
var $ = require('jquery');
var $osf = require('osfHelpers');
var bootbox = require('bootbox');
var waterbutler = require('waterbutler');
ko.punches.enableAll();
var Revision = function(data) {
var self = this;
$.extend(self, data);
... | Add @jmcarp filerevision ko model from osfstorage | Add @jmcarp filerevision ko model from osfstorage
| JavaScript | apache-2.0 | felliott/osf.io,pattisdr/osf.io,lyndsysimon/osf.io,kushG/osf.io,lamdnhan/osf.io,kushG/osf.io,bdyetton/prettychart,DanielSBrown/osf.io,barbour-em/osf.io,caseyrollins/osf.io,GaryKriebel/osf.io,doublebits/osf.io,cslzchen/osf.io,abought/osf.io,cldershem/osf.io,amyshi188/osf.io,dplorimer/osf,RomanZWang/osf.io,zachjanicki/os... | ---
+++
@@ -0,0 +1,95 @@
+'use strict';
+
+var ko = require('knockout');
+require('knockout-punches');
+var $ = require('jquery');
+var $osf = require('osfHelpers');
+var bootbox = require('bootbox');
+var waterbutler = require('waterbutler');
+
+ko.punches.enableAll();
+
+var Revision = function(data) {
+
+ var s... | |
eaa48afb8c904527c71a7953d037133b92e90015 | i18n/jquery.spectrum-fr.js | i18n/jquery.spectrum-fr.js | // Spectrum Colorpicker
// French (fr) localization
// https://github.com/bgrins/spectrum
(function ( $ ) {
var localization = $.spectrum.localization["fr"] = {
cancelText: "Annuler",
chooseText: "Valider",
clearText: "Effacer couleur sélectionnée",
noColorSelectedText: "Aucune cou... | // Spectrum Colorpicker
// French (fr) localization
// https://github.com/bgrins/spectrum
(function ( $ ) {
var localization = $.spectrum.localization["fr"] = {
cancelText: "Annuler",
chooseText: "Valider",
clearText: "Effacer couleur sélectionnée",
noColorSelectedText: "Aucune cou... | Fix capitalization in French language file. | Fix capitalization in French language file.
| JavaScript | mit | bgrins/spectrum,ajssd/spectrum,bgrins/spectrum,ginlime/spectrum,GerHobbelt/spectrum,safareli/spectrum,armanforghani/spectrum,kotmatpockuh/spectrum,shawinder/spectrum,GerHobbelt/spectrum,maurojs25/spectrum,kotmatpockuh/spectrum,liitii/spectrum,safareli/spectrum,maurojs25/spectrum,c9s/spectrum,armanforghani/spectrum,ginl... | ---
+++
@@ -9,8 +9,8 @@
chooseText: "Valider",
clearText: "Effacer couleur sélectionnée",
noColorSelectedText: "Aucune couleur sélectionnée",
- togglePaletteMoreText: "plus",
- togglePaletteLessText: "moins"
+ togglePaletteMoreText: "Plus",
+ togglePaletteLessTex... |
1c8dd493e796d7b576e4b1b09e8415306a6ab1b6 | src/lib/convertInventorySlotId.js | src/lib/convertInventorySlotId.js | module.exports = { fromNBT, toNBT };
const replace = {
"100": 8, "101": 7, "102": 6, "103": 5, "-106": 45
}
function fromNBT(slotId) {
let slot;
if (slotId >= 0 && slotId < 9) {
slot = 36 + slotId
}
return replace[String(slotId)] || slot;
}
function toNBT(slotId) {
let slot;
const invertReplace = O... | Add library for converting slot IDs from/to NBT format | Add library for converting slot IDs from/to NBT format
| JavaScript | mit | mhsjlw/flying-squid,demipixel/flying-squid,PrismarineJS/flying-squid | ---
+++
@@ -0,0 +1,22 @@
+module.exports = { fromNBT, toNBT };
+
+const replace = {
+ "100": 8, "101": 7, "102": 6, "103": 5, "-106": 45
+}
+
+function fromNBT(slotId) {
+ let slot;
+ if (slotId >= 0 && slotId < 9) {
+ slot = 36 + slotId
+ }
+ return replace[String(slotId)] || slot;
+}
+
+function toNBT(slotI... | |
80ad17a9ce1223e19fd0be5cbfa5bd901a40ecb8 | 3/moment-setfulltime_utc.js | 3/moment-setfulltime_utc.js | var moment = require('moment');
console.log(moment("2014-12-11 21+0800").format());
console.log(moment("2014-W50-4 21+08:00").format());
console.log(moment("2014-12-11 21Z").format());
| Add the example to use moment to set a full time with utc. | Add the example to use moment to set a full time with utc.
| JavaScript | mit | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | ---
+++
@@ -0,0 +1,5 @@
+var moment = require('moment');
+
+console.log(moment("2014-12-11 21+0800").format());
+console.log(moment("2014-W50-4 21+08:00").format());
+console.log(moment("2014-12-11 21Z").format()); | |
e1fa882726ce18c9a9fb4092d8663d33b75ad96a | app/marked/Dedicated/script.js | app/marked/Dedicated/script.js | const input = document.getElementById("input-message");
const output = document.getElementById("output-message");
let worker;
function onMessageReceived(event) {
// progressively display worker's messages
console.log("OUTSIDE::received MessageEvent", event, "\ndata:", event.data);
output.value += (output.value ... | Add code to run on the main thread for Dedicated Worker example | feat(worker-example): Add code to run on the main thread for Dedicated Worker example
| JavaScript | mit | Velenir/workers-journey,Velenir/workers-journey | ---
+++
@@ -0,0 +1,79 @@
+const input = document.getElementById("input-message");
+const output = document.getElementById("output-message");
+
+let worker;
+
+function onMessageReceived(event) {
+ // progressively display worker's messages
+ console.log("OUTSIDE::received MessageEvent", event, "\ndata:", event.data);... | |
a9227099dc30d67315ba7a6075c0243fc9b87504 | blueprints/app/files/config/environment.js | blueprints/app/files/config/environment.js | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: '<%= modulePrefix %>',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.... | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: '<%= modulePrefix %>',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.... | Disable default lookup & active generation logging | Disable default lookup & active generation logging | JavaScript | mit | airportyh/ember-cli,aceofspades/ember-cli,tsing80/ember-cli,HeroicEric/ember-cli,dosco/ember-cli,slindberg/ember-cli,beatle/ember-cli,kanongil/ember-cli,scalus/ember-cli,pzuraq/ember-cli,trabus/ember-cli,samselikoff/ember-cli,alefteris/ember-cli,acorncom/ember-cli,searls/ember-cli,eoinkelly/ember-cli,michael-k/ember-cl... | ---
+++
@@ -21,10 +21,10 @@
if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
- ENV.APP.LOG_ACTIVE_GENERATION = true;
+ // ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
- ENV.APP.LOG_VIEW_LOOKUPS = t... |
91564336b9e0dc02bf0025b90e15c34801b20fbe | frontend/src/components/ViewTrips/change-collaborator-type-button.js | frontend/src/components/ViewTrips/change-collaborator-type-button.js | import React from 'react';
import app from '../Firebase';
import Button from 'react-bootstrap/Button';
import authUtils from '../AuthUtils';
import * as DB from '../../constants/database.js';
const db = app.firestore();
/**
* {@link TripData} defined originally in `ViewTrips/trip.js`.
*/
/**
* Component that op... | Add button that moves the collaborator from one collaborator type (uid arr) to the other. | Add button that moves the collaborator from one collaborator type (uid arr) to the other.
| JavaScript | apache-2.0 | googleinterns/SLURP,googleinterns/SLURP,googleinterns/SLURP | ---
+++
@@ -0,0 +1,73 @@
+import React from 'react';
+
+import app from '../Firebase';
+import Button from 'react-bootstrap/Button';
+
+import authUtils from '../AuthUtils';
+import * as DB from '../../constants/database.js';
+
+const db = app.firestore();
+
+/**
+ * {@link TripData} defined originally in `ViewTrips/... | |
99dd1d8abc174cb8682958ad1bd9138989c8a6c4 | examples/getting-started.js | examples/getting-started.js |
/* Outside of this project, change to:
*
* const SBOLDocument = require('sboljs')
*/
const SBOLDocument = require('../lib/SBOLDocument')
/* prefix string for example purposes
*/
const prefix = 'http://sbolstandard.org/example/'
/* create a new empty SBOL doc
*/
const doc = new SBOLDocument()
/* create compo... | Add getting started example to the repo | Add getting started example to the repo
| JavaScript | bsd-2-clause | ICO2S/sboljs,ICO2S/sboljs | ---
+++
@@ -0,0 +1,62 @@
+
+
+/* Outside of this project, change to:
+ *
+ * const SBOLDocument = require('sboljs')
+ */
+const SBOLDocument = require('../lib/SBOLDocument')
+
+/* prefix string for example purposes
+ */
+const prefix = 'http://sbolstandard.org/example/'
+
+/* create a new empty SBOL doc
+ */
+const... | |
76ae0e7258d2a952f2a187c2abd574dadd87ef21 | spec/store/markers-spec.js | spec/store/markers-spec.js | "use babel";
import { Range } from "atom";
import MarkerStore from "../../lib/store/markers";
describe("MarkerStore", () => {
let store;
beforeEach(() => {
store = new MarkerStore();
});
it("correctly initializes MarkerStore", () => {
expect(store.markers).toEqual(new Map());
});
it("clears mar... | Add tests for marker store | Add tests for marker store
| JavaScript | mit | nteract/hydrogen,nteract/hydrogen,xanecs/hydrogen,rgbkrk/hydrogen | ---
+++
@@ -0,0 +1,73 @@
+"use babel";
+
+import { Range } from "atom";
+
+import MarkerStore from "../../lib/store/markers";
+
+describe("MarkerStore", () => {
+ let store;
+ beforeEach(() => {
+ store = new MarkerStore();
+ });
+
+ it("correctly initializes MarkerStore", () => {
+ expect(store.markers).to... | |
9f88221838c29374d8845e5dd7c5895953ba37af | test/RowSpec.js | test/RowSpec.js | import React from 'react';
import ReactTestUtils from 'react/lib/ReactTestUtils';
import Row from '../src/Row';
describe('Row', function () {
it('uses "div" by default', function () {
let instance = ReactTestUtils.renderIntoDocument(
<Row />
);
assert.equal(React.findDOMNode(instance).nodeName, 'D... | Add missing tests for 'Row' | Add missing tests for 'Row'
| JavaScript | mit | dongtong/react-bootstrap,egauci/react-bootstrap,gianpaj/react-bootstrap,JimiHFord/react-bootstrap,HorizonXP/react-bootstrap,react-bootstrap/react-bootstrap,jakubsikora/react-bootstrap,Sipree/react-bootstrap,Terminux/react-bootstrap,chrishoage/react-bootstrap,xuorig/react-bootstrap,azmenak/react-bootstrap,mmarcant/react... | ---
+++
@@ -0,0 +1,36 @@
+import React from 'react';
+import ReactTestUtils from 'react/lib/ReactTestUtils';
+import Row from '../src/Row';
+
+describe('Row', function () {
+ it('uses "div" by default', function () {
+ let instance = ReactTestUtils.renderIntoDocument(
+ <Row />
+ );
+
+ assert.equal(Re... | |
a07c46d7cc3861ac98c98bcf0a179f8285dc9182 | app/assets/javascripts/autosave.js | app/assets/javascripts/autosave.js | function autosaveSnippet () {
var $url = $('.edit_snippet')[0].action;
var $data = $('.edit_snippet').serialize();
$.ajax({
type: "PATCH",
url: $url,
data: $data,
dataType: "text"
}).done(function(response){
console.log(response);
$(".autosave").html(response);
});
}
function autosave... | function autosaveSnippet () {
var $url = $('.edit_snippet')[0].action;
var $data = $('.edit_snippet').serialize();
$.ajax({
type: "PATCH",
url: $url,
data: $data,
dataType: "text"
}).done(function(response){
console.log(response);
$(".autosave").html(response);
});
}
function autosave... | Add an extra blank line | Add an extra blank line
| JavaScript | mit | pearlshin/StoryVine,mxngyn/StoryVine,mxngyn/StoryVine,SputterPuttRedux/storyvine_clone,SputterPuttRedux/storyvine_clone,mxngyn/StoryVine,pearlshin/StoryVine,pearlshin/StoryVine,SputterPuttRedux/storyvine_clone | ---
+++
@@ -44,4 +44,5 @@
clearInterval(autosaveOnFocus);
console.log(autosaveOnFocus);
})
+
}); |
daa98b6991b4997deb5202ae4e5dbc307d720226 | src/main/webapp/resources/marketplace/js/AlertManager.js | src/main/webapp/resources/marketplace/js/AlertManager.js | /**
* Copyright (c) 2015, CoNWeT Lab., Universidad Politécnica de Madrid
* Code licensed under BSD 3-Clause (https://github.com/conwetlab/WMarket/blob/master/LICENSE)
*/
WMarket.alerts = (function () {
"use strict";
var AlertManager = {
'info': function info(messageContent, extraClass) {
... | Add module JS to manage alerts | Add module JS to manage alerts
Signed-off-by: Aitor Magán García <a93a7d273b830b2e8a26461c1a80328a1d7ad27a@conwet.com>
| JavaScript | bsd-3-clause | Fiware/apps.WMarket,conwetlab/WMarket,conwetlab/WMarket,Fiware/apps.WMarket,Fiware/apps.WMarket,conwetlab/WMarket,Fiware/apps.WMarket,conwetlab/WMarket | ---
+++
@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2015, CoNWeT Lab., Universidad Politécnica de Madrid
+ * Code licensed under BSD 3-Clause (https://github.com/conwetlab/WMarket/blob/master/LICENSE)
+ */
+
+WMarket.alerts = (function () {
+
+ "use strict";
+
+ var AlertManager = {
+
+ 'info': function in... | |
f0fff4fe4f8e5fffa984b55d90c0a70d6e302fe2 | openstack_dashboard/static/app/core/images/details/details.module.spec.js | openstack_dashboard/static/app/core/images/details/details.module.spec.js | /**
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* ... | Add unit test for image detail | Add unit test for image detail
Change-Id: I8ae82e37be53b8b7642534e4f6772cb1e52ef3d6
| JavaScript | apache-2.0 | openstack/horizon,openstack/horizon,NeCTAR-RC/horizon,openstack/horizon,NeCTAR-RC/horizon,ChameleonCloud/horizon,ChameleonCloud/horizon,NeCTAR-RC/horizon,ChameleonCloud/horizon,openstack/horizon,ChameleonCloud/horizon,NeCTAR-RC/horizon | ---
+++
@@ -0,0 +1,31 @@
+/**
+ *
+ * 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
+ *
+ * Unless required by applicable law or... | |
41667f629da4f51769d8849df9465ef9da75ea47 | gulpfile.babel.js | gulpfile.babel.js | const gulp = require('gulp'),
bs = require('browser-sync').create(),
nunjucks = require('gulp-nunjucks-render'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps');
function html() {
return gulp.src('src/index.njk')
.pipe(nunjucks({
path: 'src/'
}))
.pipe(g... | Rename Gulpfile to use Babel. | Rename Gulpfile to use Babel.
| JavaScript | mit | majtom2grndctrl/design-guide-scaffold,majtom2grndctrl/design-guide-scaffold | ---
+++
@@ -0,0 +1,49 @@
+const gulp = require('gulp'),
+ bs = require('browser-sync').create(),
+ nunjucks = require('gulp-nunjucks-render'),
+ sass = require('gulp-sass'),
+ sourcemaps = require('gulp-sourcemaps');
+
+function html() {
+ return gulp.src('src/index.njk')
+ .pipe(nunjucks({
+ ... | |
a2f4e0a23386678a46fceaa4efd8802d8dd5d6bd | 17/amqp-server-worker.js | 17/amqp-server-worker.js | var amqp = require('amqp');
var connection = amqp.createConnection({
host: 'localhost'
});
connection.on('ready', function () {
connection.queue('task-queue', { autoDelete: false, durable: true }, function(q) {
q.bind('#');
q.subscribe({ ack: true, prefetchCount: 1 }, function(message) {
... | Add the example to the worker for RabbitMG server. | Add the example to the worker for RabbitMG server.
| JavaScript | mit | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | ---
+++
@@ -0,0 +1,15 @@
+var amqp = require('amqp');
+
+var connection = amqp.createConnection({
+ host: 'localhost'
+});
+
+connection.on('ready', function () {
+ connection.queue('task-queue', { autoDelete: false, durable: true }, function(q) {
+ q.bind('#');
+ q.subscribe({ ack: true, prefetc... | |
d11e67d241fd12daff2ec7ea2c2ad5ef1d8bb166 | index.js | index.js | "use strict";
// Export the most important modules
global[ "ResourceBundle" ] = require( "./lib/resource-bundle" );
global[ "Locale" ] = require( "./lib/locale" );
global[ "Currency" ] = require( "./lib/currency" );
global[ "Format" ] = require( "./lib/format" );
global[ "FieldPosition" ] = require( "./lib/field-posi... | Add the package main file | Add the package main file
| JavaScript | mit | yannickebongue/text-formatjs,yannickebongue/text-formatjs | ---
+++
@@ -0,0 +1,18 @@
+"use strict";
+
+// Export the most important modules
+
+global[ "ResourceBundle" ] = require( "./lib/resource-bundle" );
+global[ "Locale" ] = require( "./lib/locale" );
+global[ "Currency" ] = require( "./lib/currency" );
+global[ "Format" ] = require( "./lib/format" );
+global[ "FieldPosi... | |
1ab91d4923ece874474ae08934452b35609c4124 | metashare/media/js/jsi18n.js | metashare/media/js/jsi18n.js | /* gettext library */
// This function is copied from django admin path
var catalog = new Array();
function pluralidx(count) { return (count == 1) ? 0 : 1; }
function gettext(msgid) {
var value = catalog[msgid];
if (typeof(value) == 'undefined') {
return msgid;
} else {
return (typeof(value) == 'string') ? value : ... | Manage default editor group on a single page | Manage default editor group on a single page
| JavaScript | bsd-3-clause | MiltosD/CEF-ELRC,MiltosD/CEF-ELRC,zeehio/META-SHARE,MiltosD/CEFELRC,JuliBakagianni/META-SHARE,JuliBakagianni/CEF-ELRC,zeehio/META-SHARE,MiltosD/CEFELRC,JuliBakagianni/CEF-ELRC,JuliBakagianni/META-SHARE,MiltosD/CEF-ELRC,MiltosD/CEFELRC,JuliBakagianni/META-SHARE,JuliBakagianni/CEF-ELRC,zeehio/META-SHARE,zeehio/META-SHARE... | ---
+++
@@ -0,0 +1,35 @@
+/* gettext library */
+// This function is copied from django admin path
+
+var catalog = new Array();
+
+function pluralidx(count) { return (count == 1) ? 0 : 1; }
+
+
+function gettext(msgid) {
+var value = catalog[msgid];
+if (typeof(value) == 'undefined') {
+return msgid;
+} else {
+retu... | |
54a5a217282470916cbc97c08209f39f89296f19 | test/mecab_test.js | test/mecab_test.js | 'use strict';
const assert = require('assert');
const Mecab = require('../lib/mecab');
describe('Mecab', () => {
const tests = [
{argv: '本日は晴天なり', expected: ['本日', 'は', '晴天', 'なり']},
{argv: '\r\n 本日は晴天なり \r\n \r\n', expected: ['本日', 'は', '晴天', 'なり']},
];
tests.forEach(test => {
... | Add test cases of mecab.js | Add test cases of mecab.js
| JavaScript | mit | tanikawa04/kyrica | ---
+++
@@ -0,0 +1,20 @@
+'use strict';
+
+const assert = require('assert');
+
+const Mecab = require('../lib/mecab');
+
+describe('Mecab', () => {
+ const tests = [
+ {argv: '本日は晴天なり', expected: ['本日', 'は', '晴天', 'なり']},
+ {argv: '\r\n 本日は晴天なり \r\n \r\n', expected: ['本日', 'は', '晴天', 'なり']},
+ ... | |
a3b279660d21b9e4453a68f9cbfaae7d0cef1ef0 | public/modules/core/directives/focusOn.js | public/modules/core/directives/focusOn.js | /*global angular*/
(function () {
'use strict';
angular.module('core').directive('focusOn', ["$timeout", "$parse", function ($timeout, $parse) {
return {
link: function (scope, element, attrs) {
var expr = $parse(attrs.focusOn);
scope.$watch(expr, function (... | Add directive to focus an element based on an expression (useful for search inputs). | Add directive to focus an element based on an expression (useful for search inputs).
| JavaScript | mit | tmol/iQSlideShow,tmol/iQSlideShow,tmol/iQSlideShow | ---
+++
@@ -0,0 +1,20 @@
+/*global angular*/
+(function () {
+ 'use strict';
+
+ angular.module('core').directive('focusOn', ["$timeout", "$parse", function ($timeout, $parse) {
+ return {
+ link: function (scope, element, attrs) {
+ var expr = $parse(attrs.focusOn);
+
+ ... | |
043fec02cb4d1ad6c90422701079f12d80662811 | app/assets/javascripts/unit_toggler.js | app/assets/javascripts/unit_toggler.js | $(function() {
$('.toggleDeadlineUnitDate').on('click', function(e) {
e.preventDefault();
$(this).replaceWith("<label for='project_goal_deadline_date'>Goal Deadline Date</label><input type='date' name='project[goal_deadline_date]' id='project_goal_deadline_date'></input>");
$('.toggleDeadlineUnitHours').r... | Add JS date toggle file and functionality. | Add JS date toggle file and functionality.
| JavaScript | mit | tiger-swallowtails-2014/write-now,tiger-swallowtails-2014/write-now | ---
+++
@@ -0,0 +1,14 @@
+$(function() {
+ $('.toggleDeadlineUnitDate').on('click', function(e) {
+ e.preventDefault();
+ $(this).replaceWith("<label for='project_goal_deadline_date'>Goal Deadline Date</label><input type='date' name='project[goal_deadline_date]' id='project_goal_deadline_date'></input>");
+ ... | |
45e9577cad2e3955edc60e3acb831ef1445c38e6 | lib/middleware/timeout.js | lib/middleware/timeout.js | /*!
* Connect - timeout
* Ported from https://github.com/LearnBoost/connect-timeout
* MIT Licensed
*/
/**
* Module dependencies.
*/
var debug = require('debug')('connect:timeout');
/**
* Timeout:
*
* Times out the request in `ms`, defaulting to `5000`. The
* method `req.clearTimeout()` is added to revert t... | /*!
* Connect - timeout
* Ported from https://github.com/LearnBoost/connect-timeout
* MIT Licensed
*/
/**
* Module dependencies.
*/
var debug = require('debug')('connect:timeout');
/**
* Timeout:
*
* Times out the request in `ms`, defaulting to `5000`. The
* method `req.clearTimeout()` is added to revert t... | Fix status code in documentation | Fix status code in documentation
Fix a mismatch between the documented status code (408) and the one set by the middleware | JavaScript | mit | behind2/connect,chinazhaghai/connect,liuwei9413/connect,khirayama/connect,austincitylimits/connect,RoseTHERESA/connect,lian774739140/connect,davehorton/drachtio,tanveer12332/connect,khalerc/connect,qitianchan/connect,gtomitsuka/connect,RickyDan/connect,dkfiresky/connect,mi2oon/connect,keenwon/connect,llwanghong/connect... | ---
+++
@@ -19,7 +19,7 @@
*
* The timeout error is passed to `next()` so that you may customize
* the response behaviour. This error has the `.timeout` property as
- * well as `.status == 408`.
+ * well as `.status == 503`.
*
* @param {Number} ms
* @return {Function} |
bd532c391431ab5f097fbf15e36a5db9b4e8415a | src/utils/config.js | src/utils/config.js | // node modules
import fs from 'fs';
// npm modules
import homedir from 'homedir';
const configFilePath = `${homedir()}/.urcli/config.json`;
export class Config {
constructor() {
try {
const config = JSON.parse(fs.readFileSync(configFilePath));
Object.assign(this, config);
} catch (e) {
//... | // node modules
import fs from 'fs';
// npm modules
import homedir from 'homedir';
const configFilePath = `${homedir()}/.urcli/config.json`;
export class Config {
constructor() {
try {
const config = JSON.parse(fs.readFileSync(configFilePath));
Object.assign(this, config);
} catch (e) {
//... | Save the object itself, rather than a list of arguments | Save the object itself, rather than a list of arguments
| JavaScript | mit | trolster/urcli,gabraganca/ur-cli,trolster/ur-cli | ---
+++
@@ -18,11 +18,10 @@
}
}
}
- save(configValues) {
- Object.assign(this, configValues);
- const config = JSON.stringify(this, null, 2);
+ save() {
+ const newConfigs = JSON.stringify(this, null, 2);
try {
- fs.writeFileSync(configFilePath, config);
+ fs.writeFileSync(con... |
a7c95c5cdccf0ec21ce2da6d71e4fb756059dc5b | tools/distServer.js | tools/distServer.js | // This file configures a web server for testing the production build
// on your local machine.
import browserSync from 'browser-sync';
import historyApiFallback from 'connect-history-api-fallback';
// Run Browsersync
browserSync({
port: 3000,
ui: {
port: 3001
},
server: {
baseDir: 'dist'
},
file... | // This file configures a web server for testing the production build
// on your local machine.
import browserSync from 'browser-sync';
import historyApiFallback from 'connect-history-api-fallback';
import {chalkProcessing} from './chalkConfig';
/* eslint-disable no-console */
console.log(chalkProcessing('Opening pr... | Add message when opening prod build | Add message when opening prod build
| JavaScript | mit | svitekpavel/Conway-s-Game-of-Life,danpersa/remindmetolive-react,svitekpavel/chatbot-website,waneka/codenames,PatrickHai/react-client-changers,danpersa/remindmetolive-react,lisavogtsf/canned-react-slingshot-app,aaronholmes/yelp-clone,oded-soffrin/gkm_viewer,kpuno/survey-app,akataz/theSite,oshalygin/react-slingshot,oshal... | ---
+++
@@ -3,6 +3,11 @@
import browserSync from 'browser-sync';
import historyApiFallback from 'connect-history-api-fallback';
+import {chalkProcessing} from './chalkConfig';
+
+/* eslint-disable no-console */
+
+console.log(chalkProcessing('Opening production build...'));
// Run Browsersync
browserSync({ |
82d1b94903536e70edf56faa5011246be9c67be3 | scripts/bugs/math_pow.js | scripts/bugs/math_pow.js | 'use strict';
var x = 10;
var y = 308;
var actual = Math.pow( x, y );
var expected = 1e308;
console.log( 'pow(%d,%d) = %d. Expected: %d.', x, y, actual, expected );
actual = pow( x, y );
console.log( 'pow(%d,%d) = %d. Expected: %d.', x, y, actual, expected );
// See https://bugs.chromium.org/p/v8/issues/detail?id=3... | Add script showing Math.pow bug | Add script showing Math.pow bug
| JavaScript | mit | kgryte/talks-nodejs-interactive-2016,kgryte/talks-nodejs-interactive-2016 | ---
+++
@@ -0,0 +1,30 @@
+'use strict';
+
+var x = 10;
+var y = 308;
+var actual = Math.pow( x, y );
+var expected = 1e308;
+
+console.log( 'pow(%d,%d) = %d. Expected: %d.', x, y, actual, expected );
+
+actual = pow( x, y );
+console.log( 'pow(%d,%d) = %d. Expected: %d.', x, y, actual, expected );
+
+// See https://b... | |
8f141dc580a0168927441745c824a7e98382e805 | boxcharter/common/status_types.js | boxcharter/common/status_types.js | /*
* Copyright (c) 2017 Bonnie Schulkin. All Rights Reserved.
*
* This file is part of BoxCharter.
*
* BoxCharter is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, ... | Add status type object for consistent use across client / server. | Add status type object for consistent use across client / server.
| JavaScript | agpl-3.0 | flyrightsister/boxcharter,flyrightsister/boxcharter | ---
+++
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Bonnie Schulkin. All Rights Reserved.
+ *
+ * This file is part of BoxCharter.
+ *
+ * BoxCharter is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU Affero General Public License as published by the Free
+ * Software Foundation... | |
24136b649067029c3d0f8be4254accc50a68c455 | Medium/073_Set_Matrix_Zeroes.js | Medium/073_Set_Matrix_Zeroes.js | /**
* @param {number[][]} matrix
* @return {void} Do not return anything, modify matrix in-place instead.
*/
var setZeroes = function(matrix) {
var zeroes = [];
for (var i = 0; i < matrix.length; i++) {
for (var j = 0; j < matrix[i].length; j++) {
if (matrix[i][j] === 0) {
... | Add solution to question 73 | Add solution to question 73
| JavaScript | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | ---
+++
@@ -0,0 +1,23 @@
+/**
+ * @param {number[][]} matrix
+ * @return {void} Do not return anything, modify matrix in-place instead.
+ */
+var setZeroes = function(matrix) {
+ var zeroes = [];
+
+ for (var i = 0; i < matrix.length; i++) {
+ for (var j = 0; j < matrix[i].length; j++) {
+ if ... | |
1067669be2af48b5f8f55411c0c7d35438535438 | src/common.js | src/common.js | const symbols = {
'~': 'tilde',
'`': 'backtick',
'!': 'exclamation',
'@': 'at',
'#': 'pound',
$: 'dollar',
'%': 'percent',
'^': 'carat',
'&': 'ampersand',
'*': 'asterisk',
'(': 'paren-open',
')': 'paren-close',
'-': 'hyphen',
_: 'underscore',
'=': 'equals',
'+': 'plus',
'[': 'square-op... | Add a list of useful regex. | Add a list of useful regex.
| JavaScript | mit | kroogs/scanty | ---
+++
@@ -0,0 +1,120 @@
+const symbols = {
+ '~': 'tilde',
+ '`': 'backtick',
+ '!': 'exclamation',
+ '@': 'at',
+ '#': 'pound',
+ $: 'dollar',
+ '%': 'percent',
+ '^': 'carat',
+ '&': 'ampersand',
+ '*': 'asterisk',
+ '(': 'paren-open',
+ ')': 'paren-close',
+ '-': 'hyphen',
+ _: 'underscore',
+ '='... | |
faa58cbd818d4bfcdc2861301d5cd2415b432ac5 | js/nav_menu.js | js/nav_menu.js | /**
* Handle the custom post type nav menu meta box
*/
jQuery( document ).ready( function($) {
$( '#submit-mlp_language' ).click( function( event ) {
event.preventDefault();
var items = $( '#' + mlp_nav_menu.metabox_list_id + ' li :checked' ),
submit = $( '#submit-mlp_language' ),
languages = []... | Add missing nav menu js | Add missing nav menu js
| JavaScript | mit | inpsyde/multilingual-press,inpsyde/multilingual-press | ---
+++
@@ -0,0 +1,40 @@
+/**
+ * Handle the custom post type nav menu meta box
+ */
+jQuery( document ).ready( function($) {
+ $( '#submit-mlp_language' ).click( function( event ) {
+ event.preventDefault();
+
+ var items = $( '#' + mlp_nav_menu.metabox_list_id + ' li :checked' ),
+ submit = $( '#submit... | |
d2b3e46f9f58b3b47dcec1032401885b2ea139cf | JS-Fundamentals-Homeworks/Operators-and-Expressions/02.Divide-by-7-and-5.js | JS-Fundamentals-Homeworks/Operators-and-Expressions/02.Divide-by-7-and-5.js | function solve(argument) {
var n = parseInt(argument[0]);
if (n % 7 === 0 && n % 5 === 0) {
console.log("true " + n);
} else {
console.log("false " + n);
}
} | Solve problem 02. Divide by 7 and 5 | Solve problem 02. Divide by 7 and 5
| JavaScript | mit | Gyokay/Telerik-Academy-Homeworks,Gyokay/Telerik-Homeworks,Gyokay/Telerik-Academy-Homeworks,Gyokay/Telerik-Homeworks,Gyokay/Telerik-Academy-Homeworks | ---
+++
@@ -0,0 +1,9 @@
+function solve(argument) {
+ var n = parseInt(argument[0]);
+
+ if (n % 7 === 0 && n % 5 === 0) {
+ console.log("true " + n);
+ } else {
+ console.log("false " + n);
+ }
+} | |
f4b135a3897e708a6332aebc307cc0d6602cef3b | app/js/GameOfLife.js | app/js/GameOfLife.js | var GameOfLife = (function () {
var ALIVE = "alive", DEAD = "dead";
function Cell(initialState) {
var state = initialState || DEAD;
function getNumberOfAlive(neighbours) {
var nbAliveCells = 0;
neighbours.forEach(function (neighbor) {
if (neighbor.isAliv... | Move game of life module to its own file | Move game of life module to its own file
| JavaScript | mit | velcrin/GameOfLife | ---
+++
@@ -0,0 +1,45 @@
+var GameOfLife = (function () {
+ var ALIVE = "alive", DEAD = "dead";
+
+ function Cell(initialState) {
+ var state = initialState || DEAD;
+
+ function getNumberOfAlive(neighbours) {
+ var nbAliveCells = 0;
+ neighbours.forEach(function (neighbor) {... | |
102429aa5b8f3c56f2aa64ab5cc09b4c6bb1e7de | src/components/PreviewPane.js | src/components/PreviewPane.js | import React, { PropTypes } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Widgets from './Widgets';
export default class PreviewPane extends React.Component {
previewFor(field) {
const { entry, getMedia } = this.props;
const widget = Widgets[field.get('widget')] || Widgets.... | import React, { PropTypes } from 'react';
import { render } from 'react-dom';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Widgets from './Widgets';
class Preview extends React.Component {
previewFor(field) {
const { entry, getMedia } = this.props;
const widget = Widgets[field.get('widg... | Make preview pane render to an iframe | Make preview pane render to an iframe
| JavaScript | mit | dopry/netlify-cms,netlify/netlify-cms,Aloomaio/netlify-cms,netlify/netlify-cms,Aloomaio/netlify-cms,netlify/netlify-cms,netlify/netlify-cms,dopry/netlify-cms | ---
+++
@@ -1,8 +1,9 @@
import React, { PropTypes } from 'react';
+import { render } from 'react-dom';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Widgets from './Widgets';
-export default class PreviewPane extends React.Component {
+class Preview extends React.Component {
previewFor(fi... |
1a2b5a507dbfd75fdaf8630f6b29907d813c3bb9 | scripts/points-url-data-to-new-bucket.js | scripts/points-url-data-to-new-bucket.js | const promise = require("bluebird");
const options = {
// Initialization Options
promiseLib: promise, // use bluebird as promise library
capSQL: true, // when building SQL queries dynamically, capitalize SQL keywords
};
const pgp = require("pg-promise")(options);
const connectionString = process.env.DATABASE_URL;... | Create a script to update old photo URL to new URL | Create a script to update old photo URL to new URL
| JavaScript | mit | participedia/api,participedia/api,participedia/api,participedia/api | ---
+++
@@ -0,0 +1,60 @@
+const promise = require("bluebird");
+const options = {
+ // Initialization Options
+ promiseLib: promise, // use bluebird as promise library
+ capSQL: true, // when building SQL queries dynamically, capitalize SQL keywords
+};
+const pgp = require("pg-promise")(options);
+const connectio... | |
4ce36f3443a3385468fd6fde0ae9f27d54ea1d37 | spec/frontend/notes/stores/utils_spec.js | spec/frontend/notes/stores/utils_spec.js | import { hasQuickActions } from '~/notes/stores/utils';
describe('hasQuickActions', () => {
it.each`
input | expected
${'some comment'} | ${false}
${'/quickaction'} | ${true}
${'some comment with\n/quickaction'} | ${true}
`('retur... | Add failing test for hasQuickActions | Add failing test for hasQuickActions
| JavaScript | mit | stoplightio/gitlabhq,stoplightio/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq | ---
+++
@@ -0,0 +1,17 @@
+import { hasQuickActions } from '~/notes/stores/utils';
+
+describe('hasQuickActions', () => {
+ it.each`
+ input | expected
+ ${'some comment'} | ${false}
+ ${'/quickaction'} | ${true}
+ ${'some comment with\n... | |
fecd3b971f6536a7ef289640168d33d981ac5c66 | tests/commands/cenTests.js | tests/commands/cenTests.js | var cen = require("__buttercup/classes/commands/command.cen.js");
module.exports = {
setUp: function(cb) {
this.command = new cen();
(cb)();
},
errors: {
groupNotFoundThrowsError: function (test) {
var fakeSearching = {
findGroupByID: function (a, b) {
return false;
}... | Test error for cen command | Test error for cen command
| JavaScript | mit | buttercup/buttercup-core,buttercup/buttercup-core,buttercup/buttercup-core,perry-mitchell/buttercup-core,buttercup-pw/buttercup-core,perry-mitchell/buttercup-core,buttercup-pw/buttercup-core | ---
+++
@@ -0,0 +1,25 @@
+var cen = require("__buttercup/classes/commands/command.cen.js");
+
+module.exports = {
+ setUp: function(cb) {
+ this.command = new cen();
+ (cb)();
+ },
+
+ errors: {
+ groupNotFoundThrowsError: function (test) {
+ var fakeSearching = {
+ findGroupByID: function (a,... | |
ad3e5c3f9a4529819b26ebeef3ba2ec94eaecf83 | string-truncate.js | string-truncate.js | const stringTruncate = (str, lgt) => {
if (str.length > lgt) {
return str.substring(0, lgt) + "...";
}
return str;
};
stringTruncate("hello mortal world", 13);
| Truncate a string with a specific length | Truncate a string with a specific length
| JavaScript | mit | divyanshu-rawat/Basic-JS-Algorithms | ---
+++
@@ -0,0 +1,8 @@
+const stringTruncate = (str, lgt) => {
+ if (str.length > lgt) {
+ return str.substring(0, lgt) + "...";
+ }
+ return str;
+};
+
+stringTruncate("hello mortal world", 13); | |
7a45e111d37b899432e191e439f7c843e74b3455 | router.js | router.js | var Router = (function() {
var routes = [],
redirects = [];
/**
* Add a set of routes and their callbacks to the Router
* Params: alternating RegExp objects and functions are expected
*/
function setRoutes() {
if (arguments.length % 2 != 0) {
throw new Error("Even... | Add initial version of routes.js | Add initial version of routes.js
| JavaScript | mit | AndreiDuma/router.js | ---
+++
@@ -0,0 +1,100 @@
+var Router = (function() {
+ var routes = [],
+ redirects = [];
+
+ /**
+ * Add a set of routes and their callbacks to the Router
+ * Params: alternating RegExp objects and functions are expected
+ */
+ function setRoutes() {
+ if (arguments.length % 2 != ... | |
cb14823f8fb538a662e7220740aa46af93b36bc1 | replaceHtml.js | replaceHtml.js | function replaceHtml(htmlString, hashObject) {
const filesArray = Object.keys(hashObject)
let newHtmlString = htmlString
function replaceSrc(file) {
const srcAttributeDblQuote = `src="${file}"`
const srcAttributeSingQuote = `src='${file}'`
const hash = hashObject[file]
const classAttribute = `c... | Replace src in html with class=hash | Replace src in html with class=hash
| JavaScript | mit | CarolAG/WebFlight,coryc5/WebFlight | ---
+++
@@ -0,0 +1,24 @@
+function replaceHtml(htmlString, hashObject) {
+ const filesArray = Object.keys(hashObject)
+ let newHtmlString = htmlString
+
+ function replaceSrc(file) {
+ const srcAttributeDblQuote = `src="${file}"`
+ const srcAttributeSingQuote = `src='${file}'`
+ const hash = hashObject[... | |
e308516a1407f64f9642fadf0ca51707340a56bc | test/bin.js | test/bin.js | var expect = require('chai').expect;
var fs = require("fs");
var exec = require('child_process').exec;
describe('Smoke test for the executable script', function () {
beforeEach(function () {
fs.writeFileSync(
"test/test-data.js",
'var foo = 10;\n' +
'[1, 2, 3].map(function(x) { return x*x });'
... | Add smoke test for running the executable script | Add smoke test for running the executable script
It's slow, but we only need a few of these just to ensure that
everything has been wired together correctly.
| JavaScript | mit | lebab/lebab,mohebifar/xto6,mohebifar/lebab | ---
+++
@@ -0,0 +1,50 @@
+var expect = require('chai').expect;
+var fs = require("fs");
+var exec = require('child_process').exec;
+
+describe('Smoke test for the executable script', function () {
+ beforeEach(function () {
+ fs.writeFileSync(
+ "test/test-data.js",
+ 'var foo = 10;\n' +
+ '[1, 2, ... | |
fa12c52231dd91e2485433cbd9df2161b8839c7a | migrations/3_deploy_crowdsale_contract.js | migrations/3_deploy_crowdsale_contract.js | var NeufundTestToken = artifacts.require("./NeufundTestToken.sol");
var Crowdsale = artifacts.require("./Crowdsale.sol");
module.exports = function (deployer) {
/**
* address ifSuccessfulSendTo,
* uint fundingGoalInEthers,
* uint durationInMinutes,
* uint etherCostOfEachToken,
* Token addr... | Add migration for a crowdsale contract | Add migration for a crowdsale contract
| JavaScript | mit | Neufund/Contracts | ---
+++
@@ -0,0 +1,26 @@
+var NeufundTestToken = artifacts.require("./NeufundTestToken.sol");
+var Crowdsale = artifacts.require("./Crowdsale.sol");
+
+module.exports = function (deployer) {
+ /**
+ * address ifSuccessfulSendTo,
+ * uint fundingGoalInEthers,
+ * uint durationInMinutes,
+ * uint eth... | |
adf64a16d81e5c2968b4d572d9cb649b48d92910 | scripts/mocha.js | scripts/mocha.js | var system = require('system')
, webpage = require('webpage');
var page = webpage.create()
, passes = 0
, failures = 0
, total;
page.onAlert = function(msg) {
var a = JSON.parse(msg)
switch(a.event) {
case 'start':
total = a.params.total;
break;
case 'pass':
console.log('[ ok ]... | Add PhantomJS script to report test results. | Add PhantomJS script to report test results.
| JavaScript | mit | jaredhanson/phantomjs-mocha | ---
+++
@@ -0,0 +1,62 @@
+var system = require('system')
+ , webpage = require('webpage');
+
+var page = webpage.create()
+ , passes = 0
+ , failures = 0
+ , total;
+
+page.onAlert = function(msg) {
+ var a = JSON.parse(msg)
+ switch(a.event) {
+ case 'start':
+ total = a.params.total;
+ break;
+ ... | |
4b051356414093bcee39a46d0ab727261e6d4a54 | maintenance/recompute-indexed-geometry.js | maintenance/recompute-indexed-geometry.js | #!/usr/bin/env node
/*jslint node: true */
/*
* Compute a new indexedGeometry field for every Response document.
* We should run this if we significantly change our algorithm for computing
* the indexedGeometry field.
*
* Usage:
* $ envrun -e my-deployment.env --path recompute-indexed-geometry.js
*
* Or run ... | Add maintenance script for recomputing indexed geometries | Add maintenance script for recomputing indexed geometries
| JavaScript | bsd-3-clause | LocalData/localdata-api,LocalData/localdata-api,LocalData/localdata-api | ---
+++
@@ -0,0 +1,95 @@
+#!/usr/bin/env node
+/*jslint node: true */
+
+/*
+ * Compute a new indexedGeometry field for every Response document.
+ * We should run this if we significantly change our algorithm for computing
+ * the indexedGeometry field.
+ *
+ * Usage:
+ * $ envrun -e my-deployment.env --path recomp... | |
b395f02cf30a64bd21af14bfd0883467962b4902 | 16/sharp-toFormat.js | 16/sharp-toFormat.js | var sharp = require('sharp');
var dirpath = 'images/';
var imgname = 'download-logo.png';
var tmppath = 'tmp/'
sharp(dirpath + imgname)
.jpeg()
.toFile(tmppath + 'New_' + 'output.jpeg', function (err, info) {
if (err)
throw err;
console.log('done');
});
sharp(dirpath + imgn... | Add the example to change format of image via sharp. | Add the example to change format of image via sharp.
| JavaScript | mit | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | ---
+++
@@ -0,0 +1,21 @@
+var sharp = require('sharp');
+
+var dirpath = 'images/';
+var imgname = 'download-logo.png';
+var tmppath = 'tmp/'
+
+sharp(dirpath + imgname)
+ .jpeg()
+ .toFile(tmppath + 'New_' + 'output.jpeg', function (err, info) {
+ if (err)
+ throw err;
+ console.log... | |
f9c48d88a67fed97610ba82106df668abca53698 | scripts/opendata_manual_update.js | scripts/opendata_manual_update.js | 'use strict';
const co = require('co');
const logger = require('../modules').logger;
const mongooseHelper = require('../modules').mongooseHelper;
const opendata = require('../worker').opendata;
const rollbarHelper = require('../modules').rollbarHelper;
mongooseHelper.connect()
.then(() => rollbarHelper.init())
.t... | Add script to execute manually to update parkings | Add script to execute manually to update parkings
| JavaScript | mit | carparker/carparker-server | ---
+++
@@ -0,0 +1,23 @@
+'use strict';
+
+const co = require('co');
+const logger = require('../modules').logger;
+const mongooseHelper = require('../modules').mongooseHelper;
+const opendata = require('../worker').opendata;
+const rollbarHelper = require('../modules').rollbarHelper;
+
+mongooseHelper.connect()
+ .... | |
2f234f6ce007a625382f597af0cd017d8ca044ac | server/startup/migrations/v095.js | server/startup/migrations/v095.js | RocketChat.Migrations.add({
version: 95,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
const emailHeader = RocketChat.models.Settings.findOne({ _id: 'Email_Header' });
const emailFooter = RocketChat.models.Settings.findOne({ _id: 'Email_Footer' });
const startWithHTML = emailH... | Add <html> tags to email header and footer | Add <html> tags to email header and footer
| JavaScript | mit | mrinaldhar/Rocket.Chat,fatihwk/Rocket.Chat,mrsimpson/Rocket.Chat,galrotem1993/Rocket.Chat,inoio/Rocket.Chat,danielbressan/Rocket.Chat,k0nsl/Rocket.Chat,Sing-Li/Rocket.Chat,4thParty/Rocket.Chat,cnash/Rocket.Chat,4thParty/Rocket.Chat,k0nsl/Rocket.Chat,Sing-Li/Rocket.Chat,4thParty/Rocket.Chat,nishimaki10/Rocket.Chat,VoiSm... | ---
+++
@@ -0,0 +1,25 @@
+RocketChat.Migrations.add({
+ version: 95,
+ up() {
+ if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
+ const emailHeader = RocketChat.models.Settings.findOne({ _id: 'Email_Header' });
+ const emailFooter = RocketChat.models.Settings.findOne({ _id: 'Email_Footer' })... | |
73a91ee247e43d67fb586b5b0c7b8e2694c14345 | src/modules/gallery-lazy-load.js | src/modules/gallery-lazy-load.js | import axios from 'axios';
function Loader(options = {}) {
this.page = options.page || 0;
this.limit = options.limit || 1;
this.url = options.url || '';
this.nextPage = () => {
this.page += 1;
return axios.get(this.url, {
params: {
page: this.page,
limit: this.limit,
},
... | Add lazy loader client script | Add lazy loader client script
| JavaScript | mit | tuelsch/bolg,tuelsch/bolg | ---
+++
@@ -0,0 +1,59 @@
+import axios from 'axios';
+
+function Loader(options = {}) {
+ this.page = options.page || 0;
+ this.limit = options.limit || 1;
+ this.url = options.url || '';
+
+ this.nextPage = () => {
+ this.page += 1;
+ return axios.get(this.url, {
+ params: {
+ page: this.page,
... | |
9f495fe9c7edb89cdf9226007715b55a6f5fb15f | tests/record.js | tests/record.js | var expect = require('chai').expect,
models = require('../models'),
Record = require('../models/record'),
connection = require('../lib/datastore').connection;
describe('Record retrieved from database', function () {
var wantid
var rec;
before(function (done) {
connection.query('SELECT i... | Add simple unit test for Record model | Add simple unit test for Record model
| JavaScript | agpl-3.0 | jcamins/biblionarrator,jcamins/biblionarrator | ---
+++
@@ -0,0 +1,25 @@
+var expect = require('chai').expect,
+ models = require('../models'),
+ Record = require('../models/record'),
+ connection = require('../lib/datastore').connection;
+
+describe('Record retrieved from database', function () {
+ var wantid
+ var rec;
+ before(function (done) ... | |
05131a5eaf5c4bdab431a8de4d86f3ce726fc7e4 | server/labyrinthdb.js | server/labyrinthdb.js | 'use strict';
var r = require('rethinkdb');
export class LabyrinthDB {
constructor (conn, dbName) {
this.conn = conn;
this.dbName = dbName;
this.tableList = ['chat'];
this.checkDB();
}
checkDB () {
const _this = this;
r.dbList().run(this.conn, function (err, dbList) {
if (err)... | Add first prototype of LabyrinthDB. | Add first prototype of LabyrinthDB.
| JavaScript | mit | nobus/Labyrinth,nobus/Labyrinth | ---
+++
@@ -0,0 +1,46 @@
+'use strict';
+
+var r = require('rethinkdb');
+
+
+export class LabyrinthDB {
+ constructor (conn, dbName) {
+ this.conn = conn;
+ this.dbName = dbName;
+
+ this.tableList = ['chat'];
+
+ this.checkDB();
+ }
+
+ checkDB () {
+ const _this = this;
+
+ r.dbList().run(this... | |
e8bebebe19e64d664069f23e534b173ca50e4d2f | ui/src/status/apis/index.js | ui/src/status/apis/index.js | import {get} from 'utils/ajax'
export const getJSONFeed = url => get(url)
| import {get} from 'utils/ajax'
import {fixtureJSONFeed} from 'src/status/fixtures'
// TODO: remove async/await & object return, uncomment get(url) when proxy route implemented
export const getJSONFeed = async url => {
return await {data: fixtureJSONFeed}
// get(url)
}
| Return fixture data until json feed proxy implemented | Return fixture data until json feed proxy implemented
| JavaScript | mit | li-ang/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,influxdb/influxdb,li-ang/influxdb,influxdb/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdata/influxdb,mark... | ---
+++
@@ -1,3 +1,8 @@
import {get} from 'utils/ajax'
-export const getJSONFeed = url => get(url)
+import {fixtureJSONFeed} from 'src/status/fixtures'
+// TODO: remove async/await & object return, uncomment get(url) when proxy route implemented
+export const getJSONFeed = async url => {
+ return await {data: fix... |
d2b27174c997b0bda5836ade508511fd3a21c9cf | js/api-server.js | js/api-server.js | var lightResource,
sensor = require( "./mock-sensor" )(),
iotivity = require( "iotivity" ),
device = iotivity.OicDevice(),
settings = {
role: "server",
connectionMode: "acked",
info: {
uuid: "INTEL"
}
};
device.configure( settings );
sensor.on( "change", function( newData ) {
var index,
updates = [... | Add API observable server example | Examples: Add API observable server example
| JavaScript | mit | zqzhang/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node | ---
+++
@@ -0,0 +1,51 @@
+var lightResource,
+ sensor = require( "./mock-sensor" )(),
+ iotivity = require( "iotivity" ),
+ device = iotivity.OicDevice(),
+ settings = {
+ role: "server",
+ connectionMode: "acked",
+ info: {
+ uuid: "INTEL"
+ }
+ };
+
+device.configure( settings );
+
+sensor.on( "change", funct... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.