commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
92d3cafe6788d0a0f7e8ed382ac9e9e2aebf4cdf | js/popup.js | js/popup.js | //Function to create an DOM with the provided message string
//<div class='msgbox'><span class='deletebtn'>×</span>msgString</div>
function notesCreateMsgBoxDom(msgString) {
return "<div class='msgbox'><span class='deletebtn'>×</span>"+ msgString + "</div>";
}
$(function(){
//Get elements from b... | //Function to create an DOM with the provided message string
//<div class='msgbox'><span class='deletebtn'>×</span>msgString</div>
function notesCreateMsgBoxDom(msgString) {
return "<div class='msgbox'><span class='deletebtn'>×</span>"+ msgString + "</div>";
}
$(function(){
//Get elements from b... | Use message is extracted from the input form | Use message is extracted from the input form
| JavaScript | bsd-2-clause | johnkishorem/WebBrowserNotes,johnkishorem/WebBrowserNotes |
11e0e84ce666aaa1f99bc24e38a48c981b233545 | src/components/footer/FooterDirective.js | src/components/footer/FooterDirective.js | import { FooterController } from './FooterController';
export function FooterDirective(){
return {
restrict: 'E',
controller: FooterController,
controllerAs: 'footer',
scope: true,
bindToController: {
paging: '=',
onPage: '&'
},
template:
`<div class="dt-footer">
... | import { FooterController } from './FooterController';
export function FooterDirective(){
return {
restrict: 'E',
controller: FooterController,
controllerAs: 'footer',
scope: true,
bindToController: {
paging: '=',
onPage: '&'
},
template:
`<div class="dt-footer">
... | Divide count by page size to determine if we should show the pager footer. | Divide count by page size to determine if we should show the pager footer.
| JavaScript | mit | kuzman/angular-data-table,gabigeo/angular-data-table,kuzman/angular-data-table |
49066ae121525b32b476f7932038f0002b99a231 | vendor/gobierto_engines/custom-fields-progress-plugin/app/javascripts/custom_fields_progress_plugin/modules/progress_plugin.js | vendor/gobierto_engines/custom-fields-progress-plugin/app/javascripts/custom_fields_progress_plugin/modules/progress_plugin.js | window.GobiertoAdmin.GobiertoCommonCustomFieldRecordsProgressPluginController = (function() {
function GobiertoCommonCustomFieldRecordsProgressPluginController() {}
var grid;
GobiertoCommonCustomFieldRecordsProgressPluginController.prototype.form = function(opts = {}) {
_handlePluginData(opts.uid);
};
... | window.GobiertoAdmin.GobiertoCommonCustomFieldRecordsProgressPluginController = (function() {
function GobiertoCommonCustomFieldRecordsProgressPluginController() {}
GobiertoCommonCustomFieldRecordsProgressPluginController.prototype.form = function(opts = {}) {
_handlePluginData(opts.uid);
};
function _ha... | Change progress plugin javascript to replace progress with custom field value | Change progress plugin javascript to replace progress with custom field value
| JavaScript | agpl-3.0 | PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev |
9354efe5c0582bc1cacc0f0734b50565bc193992 | spec/artist.spec.js | spec/artist.spec.js | require("../www/discography/js/lib/model.js");
require("../www/discography/js/models/artist.js");
require("../www/discography/js/lib/ajax.js");
require("../www/discography/js/lib/promise.js");
/******************************************************************************/
//
// Jasmine Docs: https://jasmine.github.io... | require("../www/discography/js/lib/model.js");
require("../www/discography/js/models/artist.js");
require("../www/discography/js/lib/ajax.js");
require("../www/discography/js/lib/promise.js");
/******************************************************************************/
//
// Jasmine Docs: https://jasmine.github.io... | Rename a variable so it makes a bit more sense | Rename a variable so it makes a bit more sense
| JavaScript | bsd-2-clause | rm-training/advanced-js,rm-training/advanced-js |
19ea2b66db87de4a0d3ff4d6407dc33f5ff9bf39 | hilbert/static/js/jquery.dj.hilbert.js | hilbert/static/js/jquery.dj.hilbert.js | if(!window.console) console = {log: function() {}};
| if(!window.console) console = {log: function() {}};
$(function(){
$('body').ajaxComplete(function(event, XmlHttpRequest, ajaxOptions){
if (XmlHttpRequest.getResponseHeader('X-Django-Requires-Auth')) {
var next = window.location.pathname + window.location.hash;
window.location = XmlH... | Handle login required headers on the client side. | Handle login required headers on the client side.
| JavaScript | bsd-2-clause | mlavin/django-hilbert,mlavin/django-hilbert |
dc9f5e39abbb76145e12021608c28e97b43a381b | src/instrumentation/angular/factories.js | src/instrumentation/angular/factories.js | var utils = require('../utils')
module.exports = function ($provide, traceBuffer) {
return {
instrumentAll: function (modules) {
modules.forEach(function (name) {
$provide.decorator(name, ['$delegate', '$injector', function ($delegate, $injector) {
utils.instrumentObject($delegate, $injec... | var utils = require('../utils')
module.exports = function ($provide, traceBuffer) {
return {
instrumentAll: function (modules) {
modules.forEach(function (name) {
$provide.decorator(name, ['$delegate', '$injector', function ($delegate, $injector) {
utils.instrumentObject($delegate, $injec... | Fix wrong type and prefix for Angular Factory traces | Fix wrong type and prefix for Angular Factory traces | JavaScript | mit | jahtalab/opbeat-js,opbeat/opbeat-react,opbeat/opbeat-js-core,opbeat/opbeat-angular,opbeat/opbeat-react,opbeat/opbeat-react,opbeat/opbeat-angular,jahtalab/opbeat-js,opbeat/opbeat-angular,opbeat/opbeat-js-core,jahtalab/opbeat-js |
94ebcdd9c58588e6112cd73f4837931a9c3e8782 | src/ExtensionAPI.js | src/ExtensionAPI.js | define(function(require) {
'use strict';
var zrUtil = require('zrender/core/util');
var echartsAPIList = [
'getDom', 'getZr', 'getWidth', 'getHeight', 'dispatchAction', 'isDisposed',
'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption'
];
function ExtensionAP... | define(function(require) {
'use strict';
var zrUtil = require('zrender/core/util');
var echartsAPIList = [
'getDom', 'getZr', 'getWidth', 'getHeight', 'dispatchAction', 'isDisposed',
'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption'
];
function ExtensionAP... | Remove namespace add in previous commit | Remove namespace add in previous commit
| JavaScript | apache-2.0 | 100star/echarts,ecomfe/echarts,chenfwind/echarts,apache/incubator-echarts,100star/echarts,ecomfe/echarts,chenfwind/echarts,apache/incubator-echarts |
a7e9351e57c3b661e1863add2c7472196e6428fe | vendor/elevio-shim.js | vendor/elevio-shim.js | // jscs:disable
/* globals define */
String.prototype.toSnakeCase = function() {
return this.replace(/([A-Z])/g, function(string) {
return '_' + string.toLowerCase();
});
};
(function() {
'use strict';
var _elev = window._elev = {};
function _setup(config) {
if (!config.enabled) {
return;
... | // jscs:disable
/* globals define */
String.prototype.toSnakeCase = function() {
return this.replace(/([A-Z])/g, function(string) {
return '_' + string.toLowerCase();
});
};
(function() {
'use strict';
var _elev = window._elev = {};
function _setup(config) {
if (config.enabled === false) {
ret... | Fix enabled flag not working when the user doesnt explicity set enabled to true in config | Fix enabled flag not working when the user doesnt explicity set enabled
to true in config
| JavaScript | mit | seawatts/ember-elevio,seawatts/ember-elevio |
6eed1c2dd7563f5121b00ac29f7abde400eb11d1 | packages/data-mate/bench/data-frame-search-suite.js | packages/data-mate/bench/data-frame-search-suite.js | 'use strict';
const { Suite } = require('./helpers');
const { config, data } = require('./fixtures/data.json');
const { DataFrame } = require('./src');
const run = async () => {
const suite = Suite('Search');
const dataFrame = DataFrame.fromJSON(config, data);
suite.add('using query: "age:<20"', {
... | 'use strict';
const { Suite } = require('./helpers');
const { config, data } = require('./fixtures/data.json');
const { DataFrame } = require('./src');
const run = async () => {
const suite = Suite('Search');
const dataFrame = DataFrame.fromJSON(config, data);
suite.add('using query: "age:<20"', {
... | Improve data frame search benchmark | Improve data frame search benchmark
| JavaScript | apache-2.0 | terascope/teraslice,terascope/teraslice,terascope/teraslice,terascope/teraslice |
717cd57875662679bf5918e268fb82468a80c6d6 | lib/main.js | lib/main.js | var canvas = document.querySelector("#gamevas");
canvas.width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
canvas.height = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var ctx = canvas.getContext("2d");
var player, enemies, goal, held = 0, difficulty = 1, ticks ... | var canvas = document.querySelector("#gamevas");
canvas.width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
canvas.height = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var ctx = canvas.getContext("2d");
var player, enemies, boosts, goal, held = 0, difficulty = 1... | Replace spurts with boost powerups. | Replace spurts with boost powerups.
| JavaScript | mit | podiumnet/A-Void,podiumnet/A-Void |
96b7b621a6517445e5009ae085ed877b0807d113 | src/main.js | src/main.js | #!/usr/bin/env node
var raml2html = require('raml2html')
function die(message) {
console.error(message)
process.exit(1)
}
var args = process.argv.slice(2)
if (args.length !== 1) {
die('Expected one argument: input RAML file')
}
var input = args[0]
var https = true
var config = raml2html.getDefaultConfi... | #!/usr/bin/env node
var raml2html = require('raml2html')
function die(message) {
console.error(message)
process.exit(1)
}
var args = process.argv.slice(2)
if (args.length !== 1) {
die('Expected one argument: input RAML file')
}
function template(x) {
return path.join(__dirname, 'templates', x)
}
var... | Load templates relative to source file | Load templates relative to source file
| JavaScript | mit | janrain/raml-fleece |
4b409ffd6f9d1c1dfe783df455f88e999a1d7bb3 | src/main.js | src/main.js | require("pixi.js");
import TileType from "./TileType";
var tileTypes;
/**
* Load game tile types...
*/
function loadTileTypes() {
console.log("Loading tile types...");
var tileTypeConfig = require("../assets/tiles/tiles.json");
var tileTypes = {};
for (var tileTypeId in tileTypeCon... | require("pixi.js");
import TileType from "./TileType";
// Constants
const ASSET_URL = "assets";
var tileTypes;
/**
* Load game tile types...
*/
function loadTileTypes() {
console.log("Loading tile types...");
var tileTypeConfig = require("../assets/tiles/tiles.json");
var tileTypes = ... | Test tile now gets it's texture from the tile type array. | Test tile now gets it's texture from the tile type array.
| JavaScript | mit | mitchfizz05/ashardalon,mitchfizz05/ashardalon |
4975ef960c28dc50b7c3155bd0c165b6289d78c0 | dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateProgramStageForm.js | dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateProgramStageForm.js | var duplicate = false;
jQuery( document ).ready( function()
{
showHideUserGroup();
checkValueIsExist( "name", "validateProgramStage.action", {id:getFieldValue('programId'), programStageId:getFieldValue('id')});
jQuery("#availableList").dhisAjaxSelect({
source: "../dhis-web-commons-ajax-json/getDataElem... | var duplicate = false;
jQuery( document ).ready( function()
{
checkValueIsExist( "name", "validateProgramStage.action", {id:getFieldValue('programId'), programStageId:getFieldValue('id')});
jQuery("#availableList").dhisAjaxSelect({
source: "../dhis-web-commons-ajax-json/getDataElements.action?domain=patien... | Fix bug where non-existing function was being called | Fix bug where non-existing function was being called
| JavaScript | bsd-3-clause | hispindia/dhis2-Core,uonafya/jphes-core,jason-p-pickering/dhis2-core,msf-oca-his/dhis-core,jason-p-pickering/dhis2-persian-calendar,msf-oca-his/dhis-core,msf-oca-his/dhis2-core,vmluan/dhis2-core,dhis2/dhis2-core,msf-oca-his/dhis2-core,msf-oca-his/dhis2-core,hispindia/dhis2-Core,vietnguyen/dhis2-core,jason-p-pickering/d... |
39fe09cf9cd85ad89af6c49d83ae9b84eabe6a53 | src/server/controllers/userController.js | src/server/controllers/userController.js | const User = require('../../models/User');
const Elo = require('arpad');
function findUsersOfLeague(req, res) {
User.findAll({ where: { league: req.params.league } }).then((data) => {
console.log(data);
res.json(data)
});
}
function findUser(req, res) {
User.find({ where: { username: req.params.username... | const User = require('../../models/User');
const Elo = require('arpad');
function findUsersOfLeague(req, res) {
User.findAll({ where: { league: req.params.league } }).then((data) => {
console.log(data);
res.json(data)
});
}
function findUser(req, res) {
User.find({ where: { username: req.params.username... | Update elo in database on click | Update elo in database on click
| JavaScript | apache-2.0 | wdavew/king-pong |
f822740b10133dba3fad6f1feb4129b6701da697 | src/send.js | src/send.js | import { busy, scheduleRetry } from './actions';
import { JS_ERROR } from './constants';
import type { Config, OfflineAction, ResultAction } from './types';
const complete = (
action: ResultAction,
success: boolean,
payload: {}
): ResultAction => ({
...action,
payload,
meta: { ...action.meta, success, comp... | import { busy, scheduleRetry } from './actions';
import { JS_ERROR } from './constants';
import type { Config, OfflineAction, ResultAction } from './types';
const complete = (
action: ResultAction,
success: boolean,
payload: {}
): ResultAction => ({
...action,
payload,
meta: { ...action.meta, success, comp... | Allow to use Promises on `discard` function | Allow to use Promises on `discard` function
| JavaScript | mit | jevakallio/redux-offline,redux-offline/redux-offline |
47464fc18d477b03059681ccab3378b915f96db9 | lib/carto/tree/layer.js | lib/carto/tree/layer.js | (function(tree) {
tree.LayerXML = function(obj, styles) {
var dsoptions = [];
for (var i in obj.Datasource) {
dsoptions.push('<Parameter name="' + i + '"><![CDATA[' +
obj.Datasource[i] + ']]></Parameter>');
}
var prop_string = '';
for (var prop in obj.properties) {
prop... | (function(tree) {
tree.LayerXML = function(obj, styles) {
var dsoptions = [];
for (var i in obj.Datasource) {
dsoptions.push('<Parameter name="' + i + '"><![CDATA[' +
obj.Datasource[i] + ']]></Parameter>');
}
var prop_string = '';
for (var prop in obj.properties) {
if (... | Convert minzoom/maxzoom parameters on Layer properties. | Convert minzoom/maxzoom parameters on Layer properties.
| JavaScript | apache-2.0 | CartoDB/carto,tomhughes/carto,mapbox/carto,gravitystorm/carto,stefanklug/carto,midnightcomm/carto,clhenrick/carto,CartoDB/carto,pnorman/carto,madeinqc/carto,whitelynx/carto,1ec5/carto |
1592f4b7eb94c76e60ef0b1e50da6455942d6725 | spec/renderer.spec.js | spec/renderer.spec.js | const path = require('path')
const { MarkdownRenderer } = require('../src/renderer')
describe ('Renderer', () => {
var renderer
var callback
beforeEach(() => {
callback = jasmine.createSpy('callback')
renderer = new MarkdownRenderer(callback)
})
it('converts a markdown file', (done) => {
const ... | const path = require('path')
const MarkdownRenderer = require('../src/renderer').MarkdownRenderer
describe ('Renderer', () => {
var renderer
var callback
beforeEach(() => {
callback = jasmine.createSpy('callback')
renderer = new MarkdownRenderer(callback)
})
it('converts a markdown file', (done) =>... | Change Jasmine import syntax to satisfy Travis | Change Jasmine import syntax to satisfy Travis
| JavaScript | unlicense | pfertyk/mauve,pfertyk/mauve |
c142c4b1abcfbf2f55133beb0edd78702464c164 | data/script.js | data/script.js | $(document).ready(function () {
$('.collapsible').click(function () {
$(this).parent().find('.collapse').collapse('toggle');
});
});
| $(document).ready(function () {
$('.collapsible').click(function () {
var $btn = $(this);
$btn.parent().find('.collapse').collapse('toggle');
$btn.find('span').toggleClass('glyphicon-folder-open glyphicon-folder-close');
});
});
| Switch to close folder icon when collapsing | Switch to close folder icon when collapsing
| JavaScript | mit | feuerbach/tasty-html |
d6ce1424c5d99ba80ad0f13532d20140ae195e60 | teknologr/members/static/js/applicant.js | teknologr/members/static/js/applicant.js | $(document).ready(function() {
$('#id_degree_programme_options').change(function() {
console.log('hello');
if (this.value === 'extra') {
$('#unknown_degree').show();
$('#unknown_degree input').val('');
} else {
$('#unknown_degree').hide();
$('... | $(document).ready(function() {
$('#id_degree_programme_options').change(function() {
console.log('hello');
if (this.value === 'extra') {
$('#unknown_degree').show();
$('#id_degree_programme').val('');
} else {
$('#unknown_degree').hide();
$('#... | Use existing id instead of selector in JS | Use existing id instead of selector in JS
| JavaScript | mit | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io |
32c7b198b8b6f1e50da1ecf3bac6b998ce395c36 | app/js/main.js | app/js/main.js | window.addEventListener('DOMContentLoaded', function() {
var linkedDataGraph = svgPanZoom('#linked-data-graph', {
zoomEnabled: true,
controlIconsEnabled: true
});
});
| window.addEventListener('load', function() {
var linkedDataGraph = svgPanZoom('#linked-data-graph', {
zoomEnabled: true,
controlIconsEnabled: true
});
});
| Load svgPanZoom at the right time | Load svgPanZoom at the right time
| JavaScript | isc | pentandra/steps-to-the-future,pentandra/steps-to-the-future |
7fdd7ef7976c5b69d24289c2ef4b6d4f22e1c3df | webextension/scripts/utils.js | webextension/scripts/utils.js | /**
* returns a localised string
* @param {String} str
* @param {String} locale (optional)
*/
function _t() {
var args = _t.arguments;
var str = args[0] ? args[0] : "";
var localestr = (args[1] && args[1].length > 0) ? args[1] : locale;
return (localeStrings[localestr] && localeStrings[localestr][str]) ? locale... | /**
* returns a localised string
* @param {String} str
* @param {String} locale (optional)
*/
function _t() {
const args = _t.arguments;
const str = args[0] || '';
const localestr = (args[1] && args[1].length > 0) ? args[1] : locale;
const defaultLocale = 'en';
return (localeStrings[localestr] && localeStrings... | Add fallback to English locale if translation not found | Add fallback to English locale if translation not found
| JavaScript | mit | ffoodd/a11y.css |
48b281de76170a63d046e21f9180fbae3a9c9eea | Libraries/Image/ImageStylePropTypes.js | Libraries/Image/ImageStylePropTypes.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... | /**
* 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... | Remove padding restriction on images | [ReactNative] Remove padding restriction on images
Summary:
@public
Padding actually works fine on images.
Test Plan: Nested text inside an image is properly positioned with padding on the image.
| JavaScript | bsd-3-clause | esauter5/react-native,gabrielbellamy/react-native,srounce/react-native,catalinmiron/react-native,PlexChat/react-native,dvcrn/react-native,ptomasroos/react-native,pandiaraj44/react-native,sudhirj/react-native,jibonpab/react-native,chenbk85/react-native,averted/react-native,zenlambda/react-native,misakuo/react-native,tay... |
c8241bec4fed33de1f234aaa800cfda5dc3cedf4 | test/functional/spec/smoketest/loadLoginPageSpec.js | test/functional/spec/smoketest/loadLoginPageSpec.js | /* eslint max-len: ["error", 100 ] */
/* global describe, beforeEach, afterEach, it, expect */
'use strict';
describe('Selenium Tutorial', function() {
var selenium = require('selenium-webdriver');
var timeoutMilliSec = 10 * 1000;
// Open the TECH.insight website in the browser before each test is run
... | /* eslint max-len: ["error", 100 ] */
/* global describe, beforeEach, afterEach, it, expect */
'use strict';
describe('Selenium Tutorial', function() {
var selenium = require('selenium-webdriver');
var timeoutMilliSec = 10 * 1000;
// Open the TECH.insight website in the browser before each test is run
... | Connect to local instance and look for signin button | Connect to local instance and look for signin button
| JavaScript | mit | jmchandonia/narrative,briehl/narrative,briehl/narrative,jmchandonia/narrative,briehl/narrative,jmchandonia/narrative,pranjan77/narrative,briehl/narrative,briehl/narrative,jmchandonia/narrative,kbase/narrative,kbase/narrative,pranjan77/narrative,psnovichkov/narrative,psnovichkov/narrative,psnovichkov/narrative,psnovichk... |
b4a1536787fe24a582965bf1e3851e9bb72f1024 | src/hearing-test.js | src/hearing-test.js | (function (window) {
'use strict';
var HearingTest = Object.create(null);
HearingTest.init = function init() {
this.context = new window.AudioContext();
this.sound = this.createSound(this.context);
return this;
}
HearingTest.createSound = function createSound(context) {
return context.createOscillator(... | (function (window) {
'use strict';
var HearingTest = Object.create(null);
var context = new window.AudioContext();
HearingTest.init = function init(frequency) {
frequency = frequency || 440;
return this;
}
HearingTest.createSound = function createSound(context) {
return context.createOscillator();
};
... | Change instantiate AudioContext timing, and add a argument frequency in init function | Change instantiate AudioContext timing, and add a argument frequency in init function
| JavaScript | mit | kubosho/hearing-test-app |
3a72fc8cd1e5bf3b647b5fa03c45f28266be7e21 | js/post_list.js | js/post_list.js | $(function() {
var api_uri = 'http://amateras.wsd.kutc.kansai-u.ac.jp/~otsuka/michishiki_api_server/select.py?order_by=created_at&order=descend';
$.getJSON(api_uri, function(json) {
for (var i = 0; i < json.length; i++) {
var $li = createListItem(json[i].title, json[i].comment, json[i].posted_by);
$(... | $(document).on('pageshow', '#post-list', function() {
initPostList();
});
function initPostList() {
var api_uri = 'http://amateras.wsd.kutc.kansai-u.ac.jp/~otsuka/michishiki_api_server/select.py?order_by=created_at&order=descend';
$.getJSON(api_uri, function(json) {
for (var i = 0; i < json.length; i++) {... | Initialize post list when showing post list page | Initialize post list when showing post list page
| JavaScript | mit | otknoy/michishiki |
70cb6b22db4693eb6e1bd8d4c65766a66a4e1426 | test/all.js | test/all.js | // internal config tests
require('./camera-resolution');
require('./camera-fps');
require('./camera-combo');
require('./camera-noaudio');
require('./camera-targets');
// constraints generation tests
require('./camera-resolution-constraints');
require('./camera-fps-constraints');
require('./camera-combo-constraints');
... | // internal config tests
require('./camera-resolution');
require('./camera-fps');
require('./camera-combo');
require('./camera-noaudio');
require('./camera-targets');
// constraints generation tests
require('./camera-resolution-constraints');
require('./camera-fps-constraints');
require('./camera-combo-constraints');
... | Include mandatory constraints generation test | Include mandatory constraints generation test
| JavaScript | apache-2.0 | rtc-io/rtc-captureconfig |
cc475e55c6e771918bf64b9ce611dd71dc3968ad | test/bin.js | test/bin.js | (function() {
'use strict';
var cli = require('casper').create().cli;
var parapsych = require(cli.raw.get('rootdir') + '/dist/parapsych').create(require);
parapsych.set('cli', cli)
.set('initUrl', '/')
.set('initSel', 'body');
describe('group 1', function() {
it('should pass --grep filter' , fu... | (function() {
'use strict';
var cli = require('casper').create().cli;
var parapsych = require(cli.raw.get('rootdir') + '/dist/parapsych').create(require);
parapsych.set('cli', cli).set('initUrl', '/').set('initSel', 'body');
describe('group 1', function() {
it('should pass --grep filter' , function() {
... | Update done() call to run(). | Update done() call to run().
| JavaScript | mit | codeactual/conjure,codeactual/conjure |
c47a3890433f083df23a54d71fca9795c12f8c18 | static/js/published.js | static/js/published.js | $(document).ready(function () {
var $id_type = $('[id$=type]');
$id_type.each(function() {
if($(this).val() == 'p'){
$('[id$=periodical]').parents('.row').show();
$('[id$=date]').parents('.row').show();
$('[id$=event]').parents('.row').hide();
} else if($(th... | $(document).ready(function () {
var $id_type = $('#id_type');
$id_type.each(function() {
if($(this).val() == 'p'){
$('[id^="publishedinperiodical"]').parents('._inline-group').show();
$('[id^="publishedinevent"]').parents('._inline-group').hide();
} else if($(this).val(... | Enable or disable an inline in accordance with the type of article | Enable or disable an inline in accordance with the type of article
| JavaScript | mpl-2.0 | neuromat/nira,neuromat/nira,neuromat/nira |
30d20a6b328b7efde919853107f4abb1e19e72ef | dev/dev-server.js | dev/dev-server.js | /*eslint-disable */
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var config = require('../webpack.dev.config')
var app = express()
var compiler = webpack(config)
// Development Middleware
app.use(require('webpack-dev-middleware')(compiler, {
noInfo: true,
publicPath:... | /*eslint-disable */
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var config = require('../webpack.dev.config')
var app = express()
var compiler = webpack(config)
// Development Middleware
app.use(require('webpack-dev-middleware')(compiler, {
noInfo: true,
publicPath:... | Move static asset middleware up a few notches | Move static asset middleware up a few notches | JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
827724243efbc397691d4261c8fccd74a1dd4830 | www/common/security/stateInterceptors.js | www/common/security/stateInterceptors.js | import accountsModule from '../resources/accounts';
/**
* 每次切换页面时判断是否需要登录,如果需要就跳转到登录页
* @param {Object} $rootScope
*/
function LoginInterceptor($rootScope, $location, Accounts) {
$rootScope.$on('$stateChangeStart', function(event, toState, toParams) {
if (toState.data && toState.data.requiresLogin && !isLogged... | import accountsModule from '../resources/accounts';
/**
* 每次切换页面时判断是否需要登录,如果需要就跳转到登录页
* @param {Object} $rootScope
*/
function LoginInterceptor($rootScope, $location, Accounts) {
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
if (toState.data && toState.data.req... | Fix a bug that cause redirection to login page failed at the second time | Fix a bug that cause redirection to login page failed at the second time
| JavaScript | bsd-3-clause | sodatea/cc98-ionic,sodatea/cc98-ionic |
185ad1f8387ead47fd22e33c65b64ca60351dfb8 | app/js/controllers/LocalRowListCtrl.js | app/js/controllers/LocalRowListCtrl.js | /* global angular */
'use strict';
angular.module('storm.controllers')
.controller('LocalRowListCtrl', ['$scope', '$state', '$stateParams', '$injector', 'Navigation', function($scope, $state, $stateParams, $injector, Navigation) {
$scope.items = [];
$scope.lastPage = true;
var oldest = $stateParams.view === 'ol... | /* global angular */
'use strict';
angular.module('storm.controllers')
.controller('LocalRowListCtrl', ['$scope', '$state', '$stateParams', '$injector', 'Navigation', function($scope, $state, $stateParams, $injector, Navigation) {
$scope.items = [];
$scope.lastPage = true;
var oldest = $stateParams.view === 'ol... | Fix delete confirmation in queue and history | Fix delete confirmation in queue and history
| JavaScript | mit | joemartingit/cuevana,TheNaoX/storm,Cuevana/storm,TheNaoX/storm,joemartingit/cuevana |
9c7022ea589490b0d1d63a6f27facdaf0fc623e3 | app/reducers/entityReducers/article.js | app/reducers/entityReducers/article.js | import {
REMEMBER_ARTICLE_SUCCESS,
UPDATE_ARTICLE_SUCCESS,
LOAD_ARTICLE_SUCCESS,
REMOVE_ARTICLE_SUCCESS,
} from './../../actions/article';
export default (state, action) => {
switch (action.type) {
case LOAD_ARTICLE_SUCCESS: {
const articles = action.payload.getIn(['entities', 'article']);
... | import {
REMEMBER_ARTICLE_SUCCESS,
UPDATE_ARTICLE_SUCCESS,
LOAD_ARTICLE_SUCCESS,
REMOVE_ARTICLE_SUCCESS,
} from './../../actions/article';
export default (state, action) => {
switch (action.type) {
case LOAD_ARTICLE_SUCCESS: {
const articles = action.payload.getIn(['entities', 'article']);
... | Fix popup updates when url changes | Fix popup updates when url changes
Problem: when the article changes url once (medium.com), popup is not
able to report article status immediately.
Cause: the issue was caused by entities reducer to update only one
article (in non-deterministic fashion).
Solution: this commit makes entities reducer update all entrie... | JavaScript | agpl-3.0 | heutagogy/heutagogy-chrome-extension,heutagogy/heutagogy-chrome-extension |
e6ac12efc4c859a38af6c35e902755167a7264a9 | app/templates/Gruntfile.js | app/templates/Gruntfile.js | 'use strict';
module.exports = function(grunt)
{
grunt.loadNpmTasks('grunt-contrib-less');
// load all grunt tasks
grunt.initConfig({
less: {
development: {
options: {
strictImports: true
},
files: {
"css/style.css": "less/style.less"
}
}
}... | 'use strict';
module.exports = function(grunt)
{
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
// load all grunt tasks
grunt.initConfig({
watch: {
styles: {
files: ['**/*.less'],
tasks: ['less'],
options: {
spawn: false,
... | Use watch to watch the directory for changes to the less files | Use watch to watch the directory for changes to the less files
| JavaScript | mit | Citrrus/Drupal-Chantilly,Citrrus/Drupal-Chantilly |
dc0ba645baf5c7cf2f5383fa35a05c689906471e | server.js | server.js | /**********
http://expressjs.com/en/api.html
************/
var express = require('express')
var app = express()
var PORT = 3000
var requestCount = 0
app.use(
"/", //the URL throught which you want to access to you static content
express.static(__dirname + '/public') //where your static content is located in... | /**********
http://expressjs.com/en/api.html
************/
var express = require('express')
var app = express()
var PORT = 3000
var requestCount = 0
app.use(
"/", //the URL throught which you want to access to you static content
express.static(__dirname + '/public') //where your static content is located in... | Use this to set PORT both locally and on Heroku: app.listen(process.env.PORT || PORT) | Use this to set PORT both locally and on Heroku: app.listen(process.env.PORT || PORT)
| JavaScript | mit | jxxcarlson/ns_angular,jxxcarlson/ns_angular |
5df84249d56b84968401b42271e402726066e16a | renderer/server-form.js | renderer/server-form.js | import bridge from '../common/bridge';
import React from 'react';
export default class ServerForm extends React.Component {
render() {
return (
<form onSubmit={this.connect.bind(this)}>
<p>server: <input type='text' name='server' defaultValue='irc.freenode.net' /></p>
<p>port: <input type='... | import bridge from '../common/bridge';
import React from 'react';
export default class ServerForm extends React.Component {
render() {
return (
<form onSubmit={this.connect.bind(this)}>
<p>server: <input type='text' name='server' defaultValue='irc.freenode.net' /></p>
<p>port: <input type='... | Fix typo in server form. | Fix typo in server form.
| JavaScript | mit | KokoIRC/koko,noraesae/koko,woss/koko,noraesae/koko,woss/koko,alienxp03/koko,hachibasu/koko,KokoIRC/koko,hachibasu/koko,alienxp03/koko,hachibasu/koko,KokoIRC/koko,noraesae/koko,woss/koko,alienxp03/koko |
564d4ba339b0c0877b5b8cca061235af55b024f2 | plugins/c9.analytics/mock_analytics.js | plugins/c9.analytics/mock_analytics.js | /**
* Dummy implementation of analytics.
*/
"use strict";
plugin.consumes = [];
plugin.provides = ["analytics"];
module.exports = plugin;
function plugin(options, imports, register) {
register(null, {
"analytics": {
log: function() {},
track: function() {},
ide... | /**
* Dummy implementation of analytics.
*/
"use strict";
plugin.consumes = [];
plugin.provides = ["analytics"];
module.exports = plugin;
function plugin(options, imports, register) {
register(null, {
"analytics": {
log: function() {},
track: function() {},
ide... | Revert "Revert "Fix broken funnel"" | Revert "Revert "Fix broken funnel""
| JavaScript | bsd-3-clause | humberto-garza/VideoJuegos,humberto-garza/VideoJuegos |
f8bc44a2ee0a8c951ee975ccad40e9e1c8c9ca4e | embeds/buffer-tpc-check.js | embeds/buffer-tpc-check.js | // buffer-tpc-check.js
// (c) 2013 Sunil Sadasivan
// Check if third party cookies are disabled
//
;(function () {
;(function check() {
//if the 3rd party cookies check is done, remove the iframe
if(self.port) {
bufferpm.bind("buffer_3pc_done", function(){
elem = do... | // buffer-tpc-check.js
// (c) 2013 Sunil Sadasivan
// Check if third party cookies are disabled
//
;(function () {
;(function check() {
//if the 3rd party cookies check is done, remove the iframe
if((self.port) || (xt && xt.options)) {
bufferpm.bind("buffer_3pc_done", function(){
... | Make TPC check work on chrome again | Make TPC check work on chrome again
| JavaScript | mit | vijayrawatsan/buffer-extension-shared,bufferapp/buffer-extension-shared,vijayrawatsan/buffer-extension-shared,bufferapp/buffer-extension-shared |
37fc5d719f07eb1ea14edf061be231ac2b83cf74 | src/main/component.js | src/main/component.js | /** @jsx React.DOM */
var NavigationBar = require('../navigation-bar/component');
var EditorAndRunner = require('../editor-and-runner/component');
var KeyboardShortcutOverlay = require('../keyboard-shortcut-overlay/component');
var React = require('react');
var View = React.createClass({
render: function() {
r... | /** @jsx React.DOM */
var NavigationBar = require('../navigation-bar/component');
var EditorAndRunner = require('../editor-and-runner/component');
var KeyboardShortcutOverlay = require('../keyboard-shortcut-overlay/component');
var React = require('react');
var View = React.createClass({
render: function() {
v... | Add isVisible to shortcuts overlay and extracted `props=this.props`. | Add isVisible to shortcuts overlay and extracted `props=this.props`. | JavaScript | mit | tddbin/tddbin-frontend,tddbin/tddbin-frontend,tddbin/tddbin-frontend |
f30a74c4f62c90999c3fdd2716653cbd2609041a | app/assets/javascripts/admin/models/version_check.js | app/assets/javascripts/admin/models/version_check.js | /**
Our data model for determining whether there's a new version of Discourse
@class VersionCheck
@extends Discourse.Model
@namespace Discourse
@module Discourse
**/
Discourse.VersionCheck = Discourse.Model.extend({
upToDate: function() {
return this.get('latest_version') === this.get('installed_versio... | /**
Our data model for determining whether there's a new version of Discourse
@class VersionCheck
@extends Discourse.Model
@namespace Discourse
@module Discourse
**/
Discourse.VersionCheck = Discourse.Model.extend({
upToDate: function() {
return this.get('missing_versions_count') === 0;
}.property('m... | Fix version check when your version is later than the one fetched by the last version check job | Fix version check when your version is later than the one fetched by the last version check job
| JavaScript | mit | tadp/learnswift,natefinch/discourse,tadp/learnswift,natefinch/discourse,tadp/learnswift |
fc35a635a4f61052db5b865022adf4e835555cd4 | templates/js/pages/shipment.js | templates/js/pages/shipment.js | $(function() {
var dt = {sPaginationType: 'full_numbers',
bAutoWidth:false ,
aaSorting: [[ 0, 'desc' ]],
fnDrawCallback: _iconify,
}
if ($(window).width() <= 600) dt = $.extend({
'bScrollCollapse': true,
'sScrollX': '100%',
}, dt)
$('.robot_actions').d... | $(function() {
var dt = {sPaginationType: 'full_numbers',
bAutoWidth: false,
aaSorting: [[ 0, 'desc' ]],
fnDrawCallback: _iconify,
}
/*if ($(window).width() <= 600) dt = $.extend({
'bScrollCollapse': true,
'sScrollX': '100%',
}, dt)*/
var dt = $('.robo... | Add responsive behaviour to table, add search box | Add responsive behaviour to table, add search box
| JavaScript | apache-2.0 | stufisher/ispyb-php,stufisher/ispyb-php,stufisher/ispyb-php,stufisher/ispyb-php,stufisher/ispyb-php |
84008455d24f8c9d54435bd297a45d22308bf332 | components/datepicker/NavigationBar.js | components/datepicker/NavigationBar.js | import React from 'react';
import PropTypes from 'prop-types';
import { Box } from '../box';
import { IconButton } from '../button';
import {
IconArrowLeftMediumOutline,
IconArrowRightMediumOutline,
IconArrowLeftSmallOutline,
IconArrowRightSmallOutline,
} from '@teamleader/ui-icons';
const NavigationBar = ({ n... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Box } from '../box';
import { IconButton } from '../button';
import {
IconArrowLeftMediumOutline,
IconArrowRightMediumOutline,
IconArrowLeftSmallOutline,
IconArrowRightSmallOutline,
} from '@teamleader/ui-icons';
class N... | Convert functional component to class extending PureComponent | Convert functional component to class extending PureComponent
| JavaScript | mit | teamleadercrm/teamleader-ui |
63f250a63f34def45defc4487c56ffb7e892a7a9 | app/helpers/svg-jar.js | app/helpers/svg-jar.js | import { htmlSafe } from 'ember-string';
import makeHelper from 'ember-svg-jar/utils/make-helper';
import makeSVG from 'ember-svg-jar/utils/make-svg';
import inlineAssets from '../inline-assets';
export default makeHelper((assetId, svgAttrs) => (
htmlSafe(makeSVG(assetId, svgAttrs, inlineAssets))
));
| import { htmlSafe } from 'ember-string';
import makeHelper from 'ember-svg-jar/utils/make-helper';
import makeSVG from 'ember-svg-jar/utils/make-svg';
import inlineAssets from '../inline-assets';
export function svgJar(assetId, svgAttrs) {
return htmlSafe(makeSVG(assetId, svgAttrs, inlineAssets));
}
export default ... | Make svgJar a callable method | Make svgJar a callable method | JavaScript | mit | ivanvotti/ember-svg-jar,ivanvotti/ember-svg-jar,ivanvotti/ember-svg-jar |
9f12ac537d22a0aa8b3dfc61b0586c5ada0701b1 | js/models/me.js | js/models/me.js | import log from 'logger';
import User from 'models/user';
import Raven from 'raven';
class Me extends User {
fetch() {
this.$api('me.get_me', {}, this.on_user_fetched);
return this;
}
update(data, on_success, on_error) {
this.$api('me.update_me', {payload: JSON.stringify(data)}, on... | import User from 'models/user';
import Raven from 'raven';
import config from 'config';
class Me extends User {
fetch() {
this.$api('me.get_me', {}, this.on_user_fetched);
return this;
}
update(data, on_success, on_error) {
this.$api('me.update_me', {payload: JSON.stringify(data)},... | Declare current user to Sentry only if enabled | Declare current user to Sentry only if enabled
| JavaScript | agpl-3.0 | opendatateam/udata,etalab/udata,opendatateam/udata,opendatateam/udata,etalab/udata,etalab/udata |
ba52def1940f72e0cf221138329dd48e0cb9b69b | gulpfile.babel.js | gulpfile.babel.js |
var gulp = require('gulp');
var execsyncs = require('gulp-execsyncs');
gulp.task('prepare-data', function(cb) {
execsyncs({
cmds : [
'./prepare.sh',
'src/scripts/prepare-asylum-data.rb'
]
});
cb();
});
var opts = {
pretasks: ['prepare-data'],
paths: ['node_modules/lucify-commons']
}
... |
var gulp = require('gulp');
var execsyncs = require('gulp-execsyncs');
gulp.task('prepare-data', function(cb) {
execsyncs({
cmds : [
'./prepare.sh',
'src/scripts/prepare-asylum-data.rb'
]
});
cb();
});
var opts = {
pretasks: ['prepare-data'],
paths: ['node_modules/lucify-commons'],
p... | Add parameters for publishing project (as embeddable) | Add parameters for publishing project (as embeddable)
| JavaScript | mit | lucified/lucify-refugees,lucified/lucify-refugees,lucified/lucify-refugees,lucified/lucify-refugees |
f15bc08b62cf9af4f6ccdb72769d78e1736a1891 | lib/nextTick.js | lib/nextTick.js | 'use strict';
exports.test = function () {
// Don't get fooled by e.g. browserify environments.
return process && !process.browser;
};
exports.install = function (func) {
return function () {
process.nextTick(func);
};
}; | 'use strict';
exports.test = function () {
// Don't get fooled by e.g. browserify environments.
return (typeof process !== 'undefined') && !process.browser;
};
exports.install = function (func) {
return function () {
process.nextTick(func);
};
};
| Check for process without potential to cause a ReferenceError. | Check for process without potential to cause a ReferenceError. | JavaScript | mit | calvinmetcalf/immediate |
2a0e1ed1ee8604a711181adb268ef7f6eb85095c | src/Icon.js | src/Icon.js | var React = require('react');
var Icon = React.createClass({
propTypes: {
id: React.PropTypes.string,
type: React.PropTypes.string,
className: React.PropTypes.string
},
getDefaultProps: function() {
return {
type: 'octicon'
};
},
render: funct... | const React = require('react');
const classNames = require('classnames');
const Icon = React.createClass({
propTypes: {
// Icon of the icon in the collection
id: React.PropTypes.string,
// Type of collection
type: React.PropTypes.string,
// Extra className
... | Add prop "spin" for icon | Add prop "spin" for icon
| JavaScript | apache-2.0 | GitbookIO/styleguide,rlugojr/styleguide,GitbookIO/styleguide,rlugojr/styleguide |
afa143c0e53bf4a5250b9aee4ec71751e525a7bd | src/form.js | src/form.js | import React, {PropTypes, Component} from 'react';
import {View} from 'react-native';
export default class Form extends Component {
_listeners = [];
static PropTypes = {
onSuccess: PropTypes.func,
onFail: PropTypes.func,
submitButton: PropTypes.element.isRequired
}
static childContextTypes = {
... | import React, {PropTypes, Component} from 'react';
import {View} from 'react-native';
export default class Form extends Component {
_listeners = [];
static PropTypes = {
onSuccess: PropTypes.func,
onFail: PropTypes.func,
submitButton: PropTypes.element.isRequired
}
static childContextTypes = {
... | Add prop to disable submit | Add prop to disable submit
| JavaScript | mit | EurekaLabs-Dev/eureka-rn-components,EurekaLabsCompany/eureka-rn-components |
3cd3339449e4ca49b1d76e4e9dea5f7faca256ec | src/save.js | src/save.js | import fs from 'fs';
import path from 'path';
import { Reader } from 'fstream';
import { Pack } from 'tar';
/** pose.save
* @desc Save a template.
* @param {Object} opts - Options.
*/
function save(opts = {}) {
const name = opts._[1] || opts.name;
const destPath = path.join(opts._templates, `${name}.tar`);
c... | import fs from 'fs';
import path from 'path';
import { Reader } from 'fstream';
import { Pack } from 'tar';
/** pose.save
* @desc Save a template.
* @param {Object} opts - Options.
*/
function save(opts = {}) {
const name = opts._[1] || opts.name;
const entry = opts._[2] || opts.entry;
const destPath = path.... | Change entry for CLI layout | Change entry for CLI layout
| JavaScript | mit | seanc/pose |
cf45e4c3f13908215979f76e535377c832a8a7b9 | routes/api_routes.js | routes/api_routes.js | var express = require('express');
var router = express.Router();
var app = express();
router.get('/sendSMS', function(req, res, next){
var number = req.query['number'];
var body_message = req.query['message'];
var client = require('twilio')('AC525c4929b17f0023e6067967a16232f0', '7a1cfcc80b4adc7634cf037b3d... | var express = require('express');
var router = express.Router();
var app = express();
router.get('/sendSMS', function(req, res, next){
var number = req.query['number'];
var body_message = req.query['message'];
var client = require('twilio')(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);
... | Create response for request and create env var for twilio account. | Create response for request and create env var for twilio account.
| JavaScript | mit | aleph-engineering/aleph_apps,aleph-engineering/aleph_apps |
6dd7fbdd4a3166f03bc00aa83f118f0d9a7e35a6 | lib/link-paths.js | lib/link-paths.js | 'use babel';
/* eslint-disable no-multi-str, prefer-const, func-names */
let linkPaths;
const regex = new RegExp('\
((?:\\w:)?/?\
(?:[-\\w.]+/)*[-\\w.]+)\
:(\\d+)\
(?::(\\d+))?\
', 'g');
const template = '<a class="-linked-path" data-path="$1" data-line="$2" data-column="$3">$&</a>';
export default linkPaths = lines ... | 'use babel';
/* eslint-disable no-multi-str, prefer-const, func-names */
let linkPaths;
const regex = new RegExp('((?:\\w:)?/?(?:[-\\w.]+/)*[-\\w.]+):(\\d+)(?::(\\d+))?', 'g');
// ((?:\w:)?/? # Prefix of the path either '/' or 'C:/' (optional)
// (?:[-\w.]+/)*[-\w.]+) # The path of the file some/file/path.... | Add comments lost by converting to JS | Add comments lost by converting to JS
| JavaScript | mit | fscherwi/atom-script,idleberg/atom-script,rgbkrk/atom-script |
0aae8d3591294f8e14c48f77907ca2c90a82ebec | routes/users.js | routes/users.js | var express = require('express');
var router = express.Router();
var User = require('./../app/models/user');
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});
router.post('/checkUser', function(req, res, done) {
console.log(req.body,'req..body');
var c... | var express = require('express');
var router = express.Router();
var User = require('./../app/models/user');
/* GET users listing. */
//router.get('/', function(req, res, next) {
// res.send('respond with a resource');
//});
router.post('/accountinfo', function(req, res, done) {
var currentUser = req.body.usernam... | Add two function for account panel | Add two function for account panel
add the ability to get/set user data in database
| JavaScript | mit | kyleshockey/headcount,arosenberg01/headcount,rockytang/headcount,Za1batsu/FinIt,rockytang/headcount,henrymollman/headcount,Illustrious-Dirigble/headcount,arosenberg01/headcount,henrymollman/headcount,kyleshockey/headcount,Za1batsu/FinIt,Illustrious-Dirigble/headcount |
982bb47d7089412124956c9a9a2625673ecbbc98 | server/index.js | server/index.js | var app = require('express')();
var bodyParser = require('body-parser');
var cors = require('cors');
var http = require('http').Server(app);
var io = require('socket.io')(http);
var state = {};
app.use(bodyParser.json());
app.use(cors());
app.get('/', function(req, res) {
res.send(JSON.stringify(state));
});
app.p... | var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var cors = require('cors');
var http = require('http').Server(app);
var io = require('socket.io')(http);
var state = {};
app.use(bodyParser.json());
app.use(cors());
var parentDir = __dirname.substring(0, __dirname.lastIn... | Set up client app files to be served by the server | Set up client app files to be served by the server
| JavaScript | mit | ethankaminski/dragons-table |
a77739df9eeb6946ae7c220897e2d30a49170d89 | src/static/js/editor.js | src/static/js/editor.js | console.log("Loaded editor.js");
function submitData(path){
var data = editor.getSession().getValue();
console.log("Got data: " + data);
$.ajax({
type: "POST",
url: path,
data: { code: data},
success: function(d){
console.log("Got reply from server: " + d);
// Take the reply and make it the new documen... | console.log("Loaded editor.js");
function submitData(path){
var data = editor.getSession().getValue();
console.log("Got data: " + data);
$.ajax({
type: "POST",
url: path,
data: { code: data},
success: function(d){
console.log("Got reply from server: " + d);
// Take the reply and make it the new documen... | Fix that displays the data sent back by the server | Fix that displays the data sent back by the server
| JavaScript | mit | mereckaj/CS4098-Group-E,mereckaj/CS4098-Group-E,mereckaj/PML-IDE,mereckaj/PML-IDE,mereckaj/PML-IDE,mereckaj/CS4098-Group-E,mereckaj/PML-IDE,mereckaj/CS4098-Group-E |
73d707ef52ff981a83a2288be27a4f047fcccd6f | jquery.equal-height.js | jquery.equal-height.js | if (typeof jQuery === 'undefined') {
throw new Error('The jQuery equal height extension requires jQuery!');
}
jQuery.fn.equalHeight = function() {
var $ = jQuery;
var that = this;
var setHeights = function() {
var elems = {};
var cont = $(that);
// Reset the elements heights
cont.each(function() {
$... | if (typeof jQuery === 'undefined') {
throw new Error('The jQuery equal height extension requires jQuery!');
}
jQuery.fn.equalHeight = function() {
var $ = jQuery;
var that = this;
var setHeights = function() {
var elems = {};
var cont = $(that);
// Reset the elements heights
cont.each(function() {
$... | Set heights after images have loaded | Set heights after images have loaded | JavaScript | mit | Nikker/jquery.equal-height,Nikker/jquery-equal-height |
40dd0e268172564ad09359f27e428e1d2e87e564 | src/GeoExt/tree/OverlayLayerContainer.js | src/GeoExt/tree/OverlayLayerContainer.js | /*
* Copyright (c) 2008-2013 The Open Source Geospatial Foundation
*
* Published under the BSD license.
* See https://github.com/geoext/geoext2/blob/master/license.txt for the full
* text of the license.
*/
/*
* @include GeoExt/tree/LayerContainer.js
*/
/**
* A layer node plugin that will collect all base la... | /*
* Copyright (c) 2008-2013 The Open Source Geospatial Foundation
*
* Published under the BSD license.
* See https://github.com/geoext/geoext2/blob/master/license.txt for the full
* text of the license.
*/
/*
* @include GeoExt/tree/LayerContainer.js
*/
/**
* A layer node plugin that will collect all base la... | Make the overlay fix more readable | Make the overlay fix more readable
| JavaScript | bsd-3-clause | annarieger/geoext2,m-click/geoext2,annarieger/geoext2,marcjansen/geoext2,Sundsvallskommun/geoext2,geographika/geoext2,m-click/geoext2,Sundsvallskommun/geoext2,chrismayer/geoext2,geographika/geoext2,chrismayer/geoext2,marcjansen/geoext2,geoext/geoext2,bentrm/geoext2,Sundsvallskommun/geoext2,geoext/geoext2,bentrm/geoext2 |
23c34e33e5f8c8242d5e407c80313e538c85fdaf | app/src/components/PageMarquee/index.js | app/src/components/PageMarquee/index.js | import React, { PropTypes } from 'react';
import Box from 'grommet/components/Box';
import Heading from 'grommet/components/Heading';
import defaultHero from '../../../images/bhamc-hero.jpg';
const PageMarquee = ({ image }) =>
<Box
full="horizontal"
colorIndex="grey-1"
texture={image || defaultHero}
... | import React, { PropTypes } from 'react';
import Box from 'grommet/components/Box';
import Heading from 'grommet/components/Heading';
import defaultHero from '../../../images/bhamc-hero.jpg';
const PageMarquee = ({ image }) =>
<Box
full="horizontal"
colorIndex="grey-1"
texture={image}
size={{ height:... | Add default props to PageMarquee. | Add default props to PageMarquee.
| JavaScript | apache-2.0 | karatechops/bhamc |
e32395dee473bf0e5287c73398e3782b14355fda | karma.conf.coverage.js | karma.conf.coverage.js | module.exports = function (config) {
require('./karma.conf.js')(config);
config.set({
coverageReporter: {
reporters: [{
type: 'text'
}, {
type: 'lcov'
}]
}
});
};
| module.exports = function (config) {
require('./karma.conf.js')(config);
config.set({
coverageReporter: {
reporters: [{
type: 'text'
}, {
type: 'lcovonly',
subdir: '.'
}]
}
});
};
| Update lcov reporter to put data in the same place Travis was expecting it before. | Update lcov reporter to put data in the same place Travis was expecting it before.
| JavaScript | mit | KenPowers/radium,Cottin/radium,rolandpoulter/radium,bencao/radium,haridusenadeera/radium,rolandpoulter/radium,andyhite/radium,almost/radium,KenPowers/radium,yetone/radium,basarat/radium,Cottin/radium,bencao/radium,WillJHaggard/radium,clessg/radium,FormidableLabs/radium,yetone/radium,haridusenadeera/radium,namuol/radium... |
8fa30beb33d8dbf71671e63df669244575e245b3 | src/Particle.js | src/Particle.js | 'use strict';
function Particle(config) {
this.position = config.position;
this.velocity = config.velocity;
this.acceleration = config.acceleration;
this.damping = config.damping || 1;
this.inverseMass = 1 / config.mass || Infinity;
Object.defineProperty(this, 'mass', {
get: function () {
return ... | /* global Vector3 */
'use strict';
function Particle(config) {
this.position = config.position;
this.velocity = config.velocity;
this.acceleration = config.acceleration;
this.damping = config.damping || 1;
this.inverseMass = 1 / config.mass || Infinity;
Object.defineProperty(this, 'mass', {
get: functi... | Add integrate method to the particle | Add integrate method to the particle
| JavaScript | mit | mgechev/physics-engine,mgechev/physics-engine |
3930735975de2887c6ca5b1ae4ad6a0ae5d5f82a | src/ShowMore.js | src/ShowMore.js | import React, { Component, PropTypes } from 'react';
import Truncate from 'react-truncate';
class ShowMore extends Component {
static defaultProps = {
lines: 3,
more: 'Show more',
less: 'Show less',
anchorClass: ''
}
static propTypes = {
children: PropTypes.node.isR... | import React, { Component, PropTypes } from 'react';
import Truncate from 'react-truncate';
class ShowMore extends Component {
static defaultProps = {
lines: 3,
more: 'Show more',
less: 'Show less',
anchorClass: ''
}
static propTypes = {
children: PropTypes.node,
... | Make "children" an optional prop | Make "children" an optional prop
Fixes #5
| JavaScript | isc | One-com/react-show-more |
6dcc00ea35ad12a2947e404857f19a936174032f | gulp/bundle.js | gulp/bundle.js | const gulp = require('gulp');
const del = require('del');
const paths = require('vinyl-paths');
const rev = require('gulp-rev');
const through = require('through2');
const concat = require('gulp-concat-util');
const concatCss = require('gulp-concat-css');
const rename = require('gulp-rename');
const cleanCSS = require(... | const gulp = require('gulp');
const del = require('del');
const paths = require('vinyl-paths');
const rev = require('gulp-rev');
const through = require('through2');
const concat = require('gulp-concat-util');
const concatCss = require('gulp-concat-css');
const rename = require('gulp-rename');
const cleanCSS = require(... | Remove bootstrap css from bundling | Remove bootstrap css from bundling
| JavaScript | mit | binary-com/binary-bot,aminmarashi/binary-bot,aminmarashi/binary-bot,binary-com/binary-bot |
da8ef999085c7f229da25673a2b4fbf908c7a3f0 | lib/browser.js | lib/browser.js | var q = require("q");
var mammoth = require("./");
exports.Converter = mammoth.Converter;
exports.fileInput = fileInput;
function fileInput(inputElement, callback) {
var converter = new mammoth.Converter(mammoth.standardOptions);
function handleFileSelect(event) {
var file = event.target.files[0];
... | var q = require("q");
var mammoth = require("./");
exports.Converter = mammoth.Converter;
exports.fileInput = fileInput;
function fileInput(inputElement, callback) {
var converter = new mammoth.Converter(mammoth.standardOptions);
function handleFileSelect(event) {
var file = event.target.files[0];
... | Handle exceptions when attempting to open zip file | Handle exceptions when attempting to open zip file
| JavaScript | bsd-2-clause | mwilliamson/mammoth.js,mwilliamson/mammoth.js |
a1d31390c4c2fcc6a04101051b274cdd7e1f2168 | webpack-es6.config.js | webpack-es6.config.js | import webpack from 'webpack';
import path from 'path';
const APP = __dirname;
export default {
context: APP,
entry: {
app: './public/app.js'
},
output: {
path: './dist',
filename: 'app.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader'
}
]
... | import webpack from 'webpack';
const APP = __dirname;
export default {
context: APP,
entry: {
app: './public/app.js'
},
output: {
path: './dist',
filename: 'app.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader'
}
]
}
};
| Remove unused path import in package.json | Remove unused path import in package.json | JavaScript | mit | antogyn/es6-angular-webpack-fullstack,antogyn/es6-angular-webpack-fullstack |
80d2bde97659caebc793dd654158ed1eaa017b39 | webpack.config.dev.js | webpack.config.dev.js | var path = require('path');
var webpack = require('webpack');
var config = {
devtool: 'cheap-module-eval-source-map',
entry: [
'./src/main.js',
'webpack-hot-middleware/client'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/d... | /* eslint-disable */
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer')
var config = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./src/main.js'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.... | Load SCSS and SVG files | Load SCSS and SVG files
| JavaScript | mit | albertoblaz/lord-commander,albertoblaz/lord-commander |
e967720656c544ce37c987747afeb8f31312c6fe | lib/slacker.js | lib/slacker.js | 'use strict';
var
bole = require('bole'),
restify = require('restify')
;
var slackClient;
var logger = bole('slack');
exports.createClient = function createClient(opts)
{
slackClient = restify.createJSONClient({ url: opts.slack });
logger.info('Slack client created')
};
exports.report = funct... | 'use strict';
var
bole = require('bole'),
restify = require('restify')
;
var slackClient;
var logger = bole('slack');
exports.createClient = function createClient(opts)
{
slackClient = restify.createJSONClient({ url: opts.slack });
logger.info('Slack client created')
};
exports.report = funct... | Work around slack message limits | Work around slack message limits | JavaScript | isc | ceejbot/jthoober,ceejbot/jthoober |
a59987cafc8cc83fded497dc6934688e8ffa73a9 | scripts/build-frontpage.js | scripts/build-frontpage.js | #!/usr/bin/env node
/* eslint-disable no-console */
const fetch = require('node-fetch');
const { execSync } = require('child_process');
const { FRONTPAGE_WEBHOOK } = process.env;
const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
console.log('build-frontpage');
if (branch === 'master') {
... | #!/usr/bin/env node
/* eslint-disable no-console */
const fetch = require('node-fetch');
const { execSync } = require('child_process');
const { FRONTPAGE_WEBHOOK, FRONTPAGE_WEBHOOK_NEXT } = process.env;
const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
const branchToHook = {
master: FR... | Deploy the `next` branch of frontpage too | Deploy the `next` branch of frontpage too
| JavaScript | mit | storybooks/storybook,kadirahq/react-storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,kadirahq/react-storybook |
189ff5abfc92fe93875bec220581e547e106b188 | postcss.config.js | postcss.config.js | module.exports = {
plugins: [
[
"@fullhuman/postcss-purgecss",
{
contentFunction: (src) => {
if (src.endsWith("src/popup/index.scss")) {
return ["src/popup/**/*.{html,ts,tsx}"];
}
if (src.endsWith("src/options/index.scss")) {
return ["src/o... | module.exports = {
plugins: [
[
"@fullhuman/postcss-purgecss",
{
contentFunction: (src) => {
if (src.endsWith("src/popup/index.scss")) {
return ["src/popup/**/*.{html,ts,tsx}"];
}
if (src.endsWith("src/options/index.scss")) {
return ["src/o... | Raise error for unexpected CSS entrypoints | Raise error for unexpected CSS entrypoints
| JavaScript | mit | bitcrowd/tickety-tick,bitcrowd/tickety-tick,bitcrowd/tickety-tick,bitcrowd/tickety-tick,bitcrowd/tickety-tick |
6e1bcd64c0ec4b0b27998abb1749e47b2dbc69bf | web/js/intern-portal.js | web/js/intern-portal.js | /**
* Created by nkmathew on 23/06/2016.
*/
// Spinjs options for a big spinner
var BIG_SPINNER = {
lines: 13,
length: 33,
width: 14,
radius: 42,
scale: 0.5,
color: '#000',
};
$(document).ready(function () {
// Initialize bootstrap tooltip plugin
$('[data-toggle="to... | /**
* Created by nkmathew on 23/06/2016.
*/
// Spinjs options for a big spinner
var BIG_SPINNER = {
lines: 13,
length: 33,
width: 14,
radius: 42,
scale: 0.5,
color: '#000',
};
// Display a success message
function alertSuccess(message) {
$('.alert-box .msg').html(message)... | Create function for displaying success messages | Create function for displaying success messages
| JavaScript | bsd-3-clause | nkmathew/intern-portal,nkmathew/intern-portal |
65398ffddacf851b1c0a43d239e94464c9044aa4 | BBVAnet/bbvanet.saldo.js | BBVAnet/bbvanet.saldo.js | /* configure jshint globals */
/* globals numeral */
(function ($) {
'use strict';
// Set langauge for Numeral library.
numeral.language('es');
var $center = $('center');
var first_table = $('center').prev().detach();
$center.after(first_table);
var dinero_ya = $('.containerDineroYa').de... | /* configure jshint globals */
/* globals numeral */
(function ($) {
'use strict';
// Set langauge for Numeral library.
numeral.language('es');
// Move main table to the beginning of the page.
var $main = $('body>div:eq(-1)');
$main.children('table:eq(-1)').detach().prependTo($main);
// A... | Update to new BBVA html | Update to new BBVA html
| JavaScript | unlicense | jmfederico/chrome-scripts |
4f3a3762d7284cd9b05cee202a4ccde9209c901f | test/utility.js | test/utility.js | 'use strict';
var _ = require('lodash');
var path = require('path');
// Build a path relative to `test/`
exports.buildPath = function() {
var args = _.slice(arguments, 0),
paths = [__dirname].concat(args);
return path.join.apply(this, paths);
};
exports.numberToString = _.method('toString');
| 'use strict';
var _ = require('lodash');
var path = require('path');
// Build a path relative to `test/`
exports.buildPath = function() {
var args = _.slice(arguments, 0),
paths = [__dirname].concat(args);
return path.join.apply(this, paths);
};
exports.numberToString = _.method('toString');
exports.... | Add asynchronous handler for common test tasks | Add asynchronous handler for common test tasks
| JavaScript | bsd-3-clause | dYale/highlight.js,jean/highlight.js,CausalityLtd/highlight.js,lead-auth/highlight.js,dbkaplun/highlight.js,taoger/highlight.js,dublebuble/highlight.js,tenbits/highlight.js,alex-zhang/highlight.js,palmin/highlight.js,adjohnson916/highlight.js,ponylang/highlight.js,zachaysan/highlight.js,Ankirama/highlight.js,Sannis/hig... |
cace4498de41782102efad3a8ee5700f6897dc05 | lib/components/SevenHour.js | lib/components/SevenHour.js | import React from 'react';
import icons from '../weather_icons/WeatherIcons';
const SevenHour = ({ hourlyForecast }) => {
if (!hourlyForecast) {
return null;
}
const sevenHourForecast = hourlyForecast.slice(0, 7);
const sevenHourDataLoop = sevenHourForecast.map((hour, i) => {
return (
<div key={... | import React from 'react';
import icons from '../weather_icons/WeatherIcons';
const SevenHour = ({ hourlyForecast }) => {
if (!hourlyForecast) {
return null;
}
const sevenHourForecast = hourlyForecast.slice(0, 7);
const sevenHourDataLoop = sevenHourForecast.map((hour, i) => {
return (
<div key={... | Create line break for icons. | Create line break for icons.
| JavaScript | mit | thatPamIAm/weathrly,thatPamIAm/weathrly |
632e64df6326713cd283a2f01aaf637538b1d0fd | src/lib/EnhancedError.js | src/lib/EnhancedError.js | /* @flow */
export default class EnhancedError extends Error {
code: string;
constructor(message: string, code: string) {
super(message);
this.name = this.constructor.name;
this.message = message;
this.code = code;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, thi... | /* @flow */
export default class EnhancedError extends Error {
code: string;
data: any;
constructor(message: string, code: string, data: any) {
super(message);
this.name = this.constructor.name;
this.message = message;
this.code = code;
this.data = data;
if (typeof Error.captureStackTrace === 'functi... | Support attaching data to an error object | Support attaching data to an error object
| JavaScript | agpl-3.0 | scrollback/pure,belng/pure,Anup-Allamsetty/pure,scrollback/pure,belng/pure,scrollback/pure,belng/pure,scrollback/pure,Anup-Allamsetty/pure,belng/pure,Anup-Allamsetty/pure,Anup-Allamsetty/pure |
8f11bfd932d9cfb6c8466ad9299f02c73066034f | src/pipeline-provider.js | src/pipeline-provider.js | import {Container} from 'aurelia-dependency-injection';
import {Pipeline} from './pipeline';
import {BuildNavigationPlanStep} from './navigation-plan';
import {ApplyModelBindersStep} from './model-binding';
import {LoadRouteStep} from './route-loading';
import {CommitChangesStep} from './navigation-context';
import {
... | import {Container} from 'aurelia-dependency-injection';
import {Pipeline} from './pipeline';
import {BuildNavigationPlanStep} from './navigation-plan';
import {ApplyModelBindersStep} from './model-binding';
import {LoadRouteStep} from './route-loading';
import {CommitChangesStep} from './navigation-context';
import {
... | Add a precommit extension point to the pipeline | feat(router): Add a precommit extension point to the pipeline | JavaScript | mit | alsoicode/router,Roustalski/router,jods4/router,aurelia/router,jdanyow/router,cmichaelgraham/router,aurelia/router,bryanrsmith/router,milunka/router,hitesh97/router,davismj/router,bfil/router,StrahilKazlachev/router,JeroenVinke/router |
323c92d02c8d5a3d201acc3a1ab1c8be626f22e7 | src/services/api/auth.js | src/services/api/auth.js | import axios from '@/services/axios'
import authUser from '@/services/api/authUser'
let KEY, updateToken, clearToken
if (CORDOVA) {
const { localStorage } = window
KEY = 'token'
clearToken = () => {
localStorage.removeItem(KEY)
clearHeader()
}
updateToken = token => {
localStorage.setItem(KEY... | import axios from '@/services/axios'
import authUser from '@/services/api/authUser'
let KEY, updateToken, clearToken
if (CORDOVA) {
const { localStorage } = window
KEY = 'token'
clearToken = () => {
localStorage.removeItem(KEY)
clearHeader()
}
updateToken = token => {
localStorage.setItem(KEY... | Throw error if using getToken() outside cordova | Throw error if using getToken() outside cordova
| JavaScript | mit | yunity/karrot-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/karrot-frontend |
74fe70d18f56b8f3cdf9576f79a022f5e2538695 | src/utils/get-scripts.js | src/utils/get-scripts.js | import fs from 'fs';
import path from 'path';
import yaml from 'js-yaml';
const travisCommands = [
// Reference: http://docs.travis-ci.com/user/customizing-the-build/#The-Build-Lifecycle
'before_install',
'install',
'before_script',
'script',
'after_success or after_failure',
'before_deploy',
'deploy',... | import fs from 'fs';
import path from 'path';
import yaml from 'js-yaml';
const scriptCache = {};
function getCacheOrFile(key, fn) {
if (scriptCache[key]) {
return scriptCache[key];
}
const value = fn();
scriptCache[key] = value;
return value;
}
const travisCommands = [
// Reference: http://docs.tr... | Add cache logic to get script utility. | Add cache logic to get script utility.
| JavaScript | mit | depcheck/depcheck,depcheck/depcheck |
afa811016080d53be1a5d92527aef3cfa728c55b | src/App/Header.js | src/App/Header.js | import React from 'react';
import Paper from 'material-ui/lib/paper';
import { sideMargin, pageWidth } from 'data/layout';
export default () => (
<div>
<Paper rounded={false} zDepth={1} style={barStyle} />
<div style={centerContainerStyle}>
<Paper rounded={false} zDepth={2} style={logoStyle}>
... | import React from 'react';
import Paper from 'material-ui/lib/paper';
import { sideMargin, pageWidth } from 'data/layout';
export default () => (
<Paper rounded={false} zDepth={1} style={barStyle}>
<div style={centerContainerStyle}>
<Paper rounded={false} zDepth={2} style={logoStyle}>
<img src="l... | Fix header alignment and silliness | Fix header alignment and silliness
| JavaScript | cc0-1.0 | ksmithbaylor/emc-license-summarizer,ksmithbaylor/emc-license-summarizer,ksmithbaylor/emc-license-summarizer |
0a407589c35467c0233b9652461b06c30c228138 | src/Collection.js | src/Collection.js | VIE.prototype.Collection = Backbone.Collection.extend({
model: VIE.prototype.Entity,
get: function(id) {
if (!this.models.length) {
return null;
}
if (!this.models[0].isReference(id)) {
id = this.models[0].toReference(id);
}
if (id == null) return... | VIE.prototype.Collection = Backbone.Collection.extend({
model: VIE.prototype.Entity,
get: function(id) {
if (id == null) return null;
id = this.toReference(id);
return this._byId[id.id != null ? id.id : id];
},
addOrUpdate: function(model) {
var collection = this;
... | Copy reference handling methods to collection as well | Copy reference handling methods to collection as well
| JavaScript | mit | bergie/VIE,bergie/VIE |
26398d1f67f40f6d87a14501b9e222e220b72323 | server/channels/__tests__/authAdmin.js | server/channels/__tests__/authAdmin.js | jest.mock('../../models/meeting');
jest.mock('../../utils');
const { emit, broadcast } = require('../../utils');
const { createGenfors } = require('../../models/meeting');
const { generateGenfors, generateSocket } = require('../../utils/generateTestData');
const { createGenfors: createGenforsListener } = require('../au... | jest.mock('../../models/meeting');
jest.mock('../../utils');
const { emit, broadcast } = require('../../utils');
const { createGenfors } = require('../../models/meeting');
const { generateGenfors, generateSocket } = require('../../utils/generateTestData');
const { createGenfors: createGenforsListener } = require('../au... | Reset genfors admin password in afterEach | Reset genfors admin password in afterEach
| JavaScript | mit | dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta |
d87343be45440b42c65b532ee90837c71a508d07 | Utils/computeProps.js | Utils/computeProps.js | var React = require('react');
import { ReactNativePropRegistry } from 'react-native';
var _ = require('lodash');
module.exports = function(incomingProps, defaultProps) {
// External props has a higher precedence
var computedProps = {};
incomingProps = _.clone(incomingProps);
delete incomingProps.chil... | var React = require('react');
import ReactNativePropRegistry from 'react-native/Libraries/Renderer/src/renderers/native/ReactNativePropRegistry';
var _ = require('lodash');
module.exports = function(incomingProps, defaultProps) {
// External props has a higher precedence
var computedProps = {};
incomingP... | Revert "Fixes failed to find module in react-native 0.36.0" | Revert "Fixes failed to find module in react-native 0.36.0"
| JavaScript | apache-2.0 | GeekyAnts/react-native-easy-grid |
c29268722a52e6d080bf9dcc112d9990a05fbf45 | test/helpers.js | test/helpers.js | /*global it, describe, before, beforeEach */
var util = require('util');
var assert = require('assert');
var generators = require('..');
var helpers = require('../').test;
describe('yeoman.generators.test', function () {
'use strict';
var Unicorn;
beforeEach(function () {
var self = this;
Unicorn = fun... | /*global it, describe, before, beforeEach */
var util = require('util');
var assert = require('assert');
var yeoman = require('..');
var helpers = yeoman.test;
describe('yeoman.test', function () {
'use strict';
beforeEach(function () {
var self = this;
this.StubGenerator = function (args, options) {
... | Refactor and complement yeoman.test.createGenerator tests | Refactor and complement yeoman.test.createGenerator tests
| JavaScript | bsd-2-clause | rutaihwa/generator,andrewstuart/generator,yeoman/environment,JulienCabanes/generator,yeoman/generator,yeoman/generator |
016bf7184caf7a62cbf4457a10e801396f970046 | test/episodeByAirDate.js | test/episodeByAirDate.js | 'use strict';
const TVDB = require('..');
const API_KEY = process.env.TVDB_KEY;
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const expect = chai.expect;
chai.use(chaiAsPromised);
describe('#episodeByAirDate', () => {
it('should return all episodes aired on "2011-10-03" from... | 'use strict';
const TVDB = require('..');
const API_KEY = process.env.TVDB_KEY;
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const expect = chai.expect;
chai.use(chaiAsPromised);
describe('#episodeByAirDate', () => {
it('should return all episodes aired on "2011-10-03" from... | Add test for invalid series in `episodesByAirDate` | Add test for invalid series in `episodesByAirDate`
| JavaScript | mit | edwellbrook/node-tvdb |
d268fe6501bc7c5162ad270c72ac75df2cafaaae | test/features/app/app.js | test/features/app/app.js | 'use strict';
// mocha defines to avoid JSHint breakage
/* global describe, it, before, beforeEach, after, afterEach */
var preq = require('preq');
var assert = require('../../utils/assert.js');
var server = require('../../utils/server.js');
describe('express app', function() {
this.timeout(20000);
be... | 'use strict';
// mocha defines to avoid JSHint breakage
/* global describe, it, before, beforeEach, after, afterEach */
var preq = require('preq');
var assert = require('../../utils/assert.js');
var server = require('../../utils/server.js');
describe('express app', function() {
this.timeout(20000);
be... | Add a test case for robots.txt | Add a test case for robots.txt
| JavaScript | apache-2.0 | wikimedia/mathoid,wikimedia/mathoid,wikimedia/mediawiki-services-mobileapps,nyurik/service-template-node,MonashAlexandria/mathoid,milimetric/service-template-node,d00rman/service-template-node,nyurik/service-template-node,wikimedia/mediawiki-services-mobileapps,wikimedia/restevent,brion/kartotherian,nyurik/service-temp... |
eceb398a6589f944799aa285bd58106b6e7a2b3b | test/helpers/auth.js | test/helpers/auth.js | // Helper functions used to test endpoints that are protected by authentication.
exports.APIKEY_ADMIN = process.env.ADMIN_APIKEY || '12345';
exports.AUTH_ADMIN = 'deconst apikey="' + exports.APIKEY_ADMIN + '"';
exports.APIKEY_USER = '54321';
exports.AUTH_USER = 'deconst apikey="' + exports.APIKEY_USER + '"';
/**
... | // Helper functions used to test endpoints that are protected by authentication.
exports.APIKEY_ADMIN = process.env.ADMIN_APIKEY || '12345';
exports.AUTH_ADMIN = 'deconst ' + exports.APIKEY_ADMIN;
exports.APIKEY_USER = '54321';
exports.AUTH_USER = 'deconst ' + exports.APIKEY_USER;
/**
* @description Test helper t... | Remove the apikey="" stuff from the unit tests. | Remove the apikey="" stuff from the unit tests.
| JavaScript | mit | deconst/content-service,deconst/content-service |
ce703ac914fdd7a8df9d73fbace43aabd36dbbd2 | test/src/lib/app.spec.js | test/src/lib/app.spec.js | /* global sinon, expect, describe, it, before */
import '../../setup'
import { app } from '../../../src/lib/app'
const request = require('supertest')
const url = 'http://localhost/api/'
describe('app', () => {
before(() => {
// Start app
app({
port: 7777,
lambdas: './test/lambdas'
})
})
... | /* global sinon, expect, describe, it, before */
import '../../setup'
import { app } from '../../../src/lib/app'
const request = require('supertest')
const url = 'http://localhost/api/'
describe('app', () => {
before(() => {
// Start app
app({
port: 7777,
lambdas: './test/lambdas'
})
})
... | Simplify tests to check request and request with payload | Simplify tests to check request and request with payload
| JavaScript | mit | TechnologyAdvice/glambda |
45c0d2104f8ce704a3c3df5b12462b37e3f3d6fc | tests/unit/initializers/store-test.js | tests/unit/initializers/store-test.js | import Ember from 'ember';
import { initialize } from '../../../initializers/store';
import { module, test } from 'qunit';
var container, application;
module('Unit | Initializer | store', {
beforeEach: function() {
Ember.run(function() {
application = Ember.Application.create();
container = applicat... | import Ember from 'ember';
import { initialize } from '../../../initializers/store';
import { module, test } from 'qunit';
var container, application;
module('Unit | Initializer | store', {
beforeEach: function() {
Ember.run(function() {
application = Ember.Application.create();
container = applicat... | Add unit test for store service initializer | Add unit test for store service initializer
| JavaScript | mit | kmkamruzzaman/ember-jsonapi-resources,Rahien/ember-jsonapi-resources,oliverbarnes/ember-jsonapi-resources,kmkamruzzaman/ember-jsonapi-resources,proteamer/ember-jsonapi-resources,greyhwndz/ember-jsonapi-resources,rwjblue/ember-jsonapi-resources,pixelhandler/ember-jsonapi-resources,greyhwndz/ember-jsonapi-resources,prote... |
a041c9414456bde319464226ecab158a838b8b98 | ui/js/component/chart/mixin/resize.js | ui/js/component/chart/mixin/resize.js | /* global window */
'use strict';
var dom = require('util/dom');
module.exports = {
paramAttributes: [
'data-aspect'
],
data: function () {
return {
aspect: 1
};
},
ready: function () {
window.addEventListener('resize', this.onResize);
},
computed: {
viewBox: function () {
return '0 0 ' + ... | /* global window */
'use strict';
var dom = require('util/dom');
module.exports = {
paramAttributes: [
'data-aspect'
],
data: function () {
return {
aspect: 1,
height: 0,
width : 0
};
},
ready: function () {
window.addEventListener('resize', this.onResize);
},
computed: {
viewBox: functi... | Set a default width and height | Set a default width and height
Set the default width and height for the resize mixin to be 0 so that we don't
get error resulting from undefined values in the SVG viewBox attribute.
| JavaScript | agpl-3.0 | unicef/polio,unicef/rhizome,SeedScientific/polio,SeedScientific/polio,unicef/polio,unicef/polio,SeedScientific/polio,SeedScientific/polio,unicef/rhizome,unicef/rhizome,SeedScientific/polio,unicef/rhizome,unicef/polio |
dff029d3cbd50b3f981b90c77c6c4e973ed37bee | browser-sync.config.js | browser-sync.config.js | module.exports = {
port: 3001,
files: [ 'build/*', "src/views/index.html" ]
};
| module.exports = {
port: 3001,
files: [ 'build/*', "src/views/index.html" ],
ghostMode: false,
notify: false
};
| Disable ghostMode (mirroring interactions in different browsers) and notifications (top right corner) | Disable ghostMode (mirroring interactions in different browsers) and
notifications (top right corner)
| JavaScript | mit | PathwayCommons/app-ui,PathwayCommons/app-ui,PathwayCommons/app-ui |
9447a73949e99dc5a58bf166942195561f442789 | src/sw-install.js | src/sw-install.js | if('serviceWorker' in navigator) {
navigator.serviceWorker.register('./sw.js').then(function(registration) {
// Registration was successful 😊
console.log('ServiceWorker registration successful with scope: ',
registration.scope);
}).catch(function(err) {
// registration failed :(
console.log('... | (function() {
if (location.hostname === 'localhost') {
console.log('service worker disabled on localhost');
return;
}
if(!('serviceWorker' in navigator)) {
console.log('service worker not supported');
return;
}
navigator.serviceWorker.register('./sw.js').then(function(registration) {
// Re... | Disable service worker on localhost | Disable service worker on localhost
| JavaScript | mit | billy-hardy/order-splitter,jonsmithers/order-splitter,billy-hardy/order-splitter,MergeMyPullRequest/order-splitter,MergeMyPullRequest/order-splitter,jonsmithers/order-splitter |
981fdb5dfdec7a6b3dab4550c471bc1394486d6a | test/employees.js | test/employees.js | import { expect } from 'chai';
import util from './util';
describe('Employees API', () => {
describe('fetch', () => {
it('should get employee list', (done) => {
const fsapi = util.getFullSlate();
fsapi.employees()
.then((employees) => {
expect(employees).to.be.an('array');
... | import { expect } from 'chai';
import util from './util';
describe('Employees API', () => {
describe('fetch', () => {
it('should get employee list', (done) => {
const fsapi = util.getFullSlate();
fsapi.employees()
.then((employees) => {
expect(employees).to.be.an('array');
... | Fix employee test to check for returned result keys | Fix employee test to check for returned result keys
| JavaScript | mit | kchung/fullslate |
f681d4e5c831a8811e4815135170929d0d074863 | server/main.js | server/main.js | 'use strict';
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.render('./../app/index.ejs');
});
app.use(express.static(__dirname + '/../tmp'));
app.listen(7777);
| 'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.get('/', (req, res) => {
res.render('./../app/index.ejs');
});
app.use(express.static(__dirname + '/../tmp'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: false
})... | Create End point for items list | Create End point for items list
| JavaScript | mit | Lazhari/react-grocery,Lazhari/react-grocery |
ecca3073586349c649a1554ad5f15f38f0889f1c | webpack.config.js | webpack.config.js | const path = require('path');
const webpack = require('webpack');
const BabiliPlugin = require('babili-webpack-plugin');
const pkg = require('./package.json');
let banner =
`OBS WebSocket Javascript API (${pkg.name}) v${pkg.version}\n` +
`Author: ${pkg.author}\n` +
`License: ${pkg.license}\n` +
`Repository: ${... | const path = require('path');
const webpack = require('webpack');
const BabiliPlugin = require('babili-webpack-plugin');
const pkg = require('./package.json');
let banner =
`OBS WebSocket Javascript API (${pkg.name}) v${pkg.version}\n` +
`Author: ${pkg.author}\n` +
`License: ${pkg.license}\n` +
`Repository: ${... | Remove comments from Babili Webpack Plugin | ci: Remove comments from Babili Webpack Plugin | JavaScript | mit | haganbmj/obs-websocket-js,haganbmj/obs-websocket-js,haganbmj/obs-websocket-js |
40428226bf0015b1b91d9fc8b9e22e6fbb5f81ad | assets/application.js | assets/application.js | /**
* POST to the query endpoint to get information on whether or not it is going to snow.
*/
function queryData() {
var zipCode = $("#zip-input").val();
var zipData = { zip: zipCode };
$.post("weather/query.php", zipData, function(data) {
try {
var parsedData = JSON.parse(data);
... | /**
* POST to the query endpoint to get information on whether or not it is going to snow.
*/
function queryData() {
var zipCode = $("#zip-input").val();
var zipData = { zip: zipCode };
$("#response").css("display", "block");
$("#text-response").html("<h5>Loading..</h5>");
$.post("weather/query.ph... | Add loading message while retrieving data, support enter key on zip field | Add loading message while retrieving data, support enter key on zip field
| JavaScript | mit | Chris-Bitler/isitgoingtosnow.today,Chris-Bitler/isitgoingtosnow.today |
3c460877f9ad60d48f32259606b4523c4d56c066 | src/js/main.js | src/js/main.js | /*
* This is the main PebbleJS file. You do not need to modify this file unless
* you want to change the way PebbleJS starts, the script it runs or the libraries
* it loads.
*
* By default, this will run app.js
*/
require('safe');
Pebble.addEventListener('ready', function(e) {
// Initialize the Pebble protoco... | /*
* This is the main PebbleJS file. You do not need to modify this file unless
* you want to change the way PebbleJS starts, the script it runs or the libraries
* it loads.
*
* By default, this will run app.js
*/
var safe = require('safe');
var util2 = require('util2');
Pebble.addEventListener('ready', functio... | Add moment global usage warning | Add moment global usage warning
| JavaScript | mit | effata/pebblejs,ento/pebblejs,jsfi/pebblejs,ishepard/TransmissionTorrent,fletchto99/pebblejs,demophoon/Trimet-Tracker,effata/pebblejs,gwijsman/OpenRemotePebble,fletchto99/pebblejs,effata/pebblejs,daduke/LMSController,pebble/pebblejs,ento/pebblejs,jiangege/pebblejs-project,ishepard/TransmissionTorrent,daduke/LMSControll... |
1abf50595d4893a904b04b8b5c03d5adf8e53743 | src/updates.js | src/updates.js | import Npm from 'silent-npm-registry-client';
import boxen from 'boxen';
import chalk from 'chalk';
import pkg from '../package.json';
export default function() {
return new Promise(function(resolve) {
const params = {
timeout: 1000,
package: pkg.name,
auth: {}
};
const npm = new Npm()... | import Npm from 'silent-npm-registry-client';
import boxen from 'boxen';
import chalk from 'chalk';
import pkg from '../package.json';
export default function() {
return new Promise(function(resolve) {
const params = {
timeout: 1000,
package: pkg.name,
auth: {}
};
const npm = new Npm()... | Add support for beta versions to update notifier | Add support for beta versions to update notifier
| JavaScript | mit | arunoda/meteor-up,zodern/meteor-up,zodern/meteor-up,arunoda/meteor-up |
b4ecb8a87ec4f30f19b98623ea54b9b4b67f78b8 | tasks/xcode.js | tasks/xcode.js | /*
* grunt-xcode
* https://github.com/matiassingers/grunt-xcode
*
* Copyright (c) 2014 Matias Singers
* Licensed under the MIT license.
*/
'use strict';
var Promise = require('bluebird');
var exec = Promise.promisify(require('child_process').exec);
String.prototype.format = function() {
var formatted = this... | /*
* grunt-xcode
* https://github.com/matiassingers/grunt-xcode
*
* Copyright (c) 2014 Matias Singers
* Licensed under the MIT license.
*/
'use strict';
var Promise = require('bluebird');
var exec = Promise.promisify(require('child_process').exec);
String.prototype.format = function() {
var formatted = this... | Add initial default plugin options | Add initial default plugin options
| JavaScript | mit | matiassingers/grunt-xcode |
f5a36ec8a763e3bdebf3559ec2d460258e234b20 | test/issues.js | test/issues.js | var test = require('tape');
var parseInts = require('../');
test.skip('#1 - require radix is an integer or undefined', function (t) {
var nonInts = ['1', [1], {}];
t.plan(nonInts.length);
nonInts.forEach(function (radix) {
t.throws(function () {
parseInts('1', radix);
});
});
});
| var test = require('tape');
var parseInts = require('../');
var ints;
test.skip('#1 - require radix is an integer or undefined', function (t) {
var nonInts = ['1', [1], {}];
t.plan(nonInts.length);
nonInts.forEach(function (radix) {
t.throws(function () {
parseInts('1', radix);
});
});
});
... | Add failing test for negative integers. | Add failing test for negative integers.
| JavaScript | mit | jackboberg/parse-ints |
471c3940a159f699670499365ba891f010808610 | src/main/resources/static/js/cameras.js | src/main/resources/static/js/cameras.js | var validateEditForm = function (formObject) {
var error = false;
// check room number
if (formObject['room-number'].length < 1) {
toastr.error("You did not enter a room number");
error = true;
}
return !error;
};
var validateCreateForm = function (formObject) {
var error = fa... | var validateEditForm = function (formObject) {
var error = false;
// check room number
if (formObject['room-number'].trim().length < 1) {
toastr.error("You did not enter a room number");
error = true;
}
return !error;
};
var validateCreateForm = function (formObject) {
var err... | Trim added to verifications done by Mark | Trim added to verifications done by Mark
| JavaScript | agpl-3.0 | musalbas/Nuclibook,musalbas/Nuclibook,musalbas/Nuclibook |
0bdaebe1673b085fdc94428e7cea34bb20736680 | tools/build.js | tools/build.js | 'use strict';
var commander = require('commander');
var path = require('path');
var Queue = require('gear').Queue;
var registry = require('./tasks');
var build, target;
commander
.usage('[options] [<languages ...>]')
.option('-n, --no-compress', 'Disable compression')
.option('-t, --target <name>', '... | 'use strict';
var commander = require('commander');
var path = require('path');
var Queue = require('gear').Queue;
var registry = require('./tasks');
var build, target;
commander
.usage('[options] [<languages ...>]')
.option('-n, --no-compress', 'Disable compression')
.option('-t, --target <name>', '... | Set the target to lowercase inside command object | Set the target to lowercase inside command object
This makes it simpler to manage state for things like th CDN build that
needs to check what build target is currently is.
| JavaScript | bsd-3-clause | teambition/highlight.js,palmin/highlight.js,robconery/highlight.js,J2TeaM/highlight.js,jean/highlight.js,martijnrusschen/highlight.js,0x7fffffff/highlight.js,isagalaev/highlight.js,StanislawSwierc/highlight.js,lead-auth/highlight.js,teambition/highlight.js,aurusov/highlight.js,zachaysan/highlight.js,ysbaddaden/highligh... |
16da1d0f92a05aa9520de57ca517ee8fd51aebd8 | commands/npm/index.js | commands/npm/index.js | 'use strict';
const spawn = require('child_process').spawn;
module.exports = function (rootDir, type) {
const args = Array.from(arguments).slice(2);
spawn('npm', ['run'].concat(getNpmCommand(type, args)), { stdio: 'inherit' });
};
const getNpmCommand = (command, args) => {
switch (command) {
cas... | 'use strict';
const spawn = require('child_process').spawn;
module.exports = function (rootDir, type) {
const args = Array.from(arguments).slice(2);
const cmd = /^win/.test(process.platform) ? 'npm.cmd' : 'npm';
spawn(cmd, ['run'].concat(getNpmCommand(type, args)), { stdio: 'inherit' });
};
const getNpm... | Correct support for ngl NPM commands | Correct support for ngl NPM commands
| JavaScript | mit | gonzofish/angular-library-set,gonzofish/angular-library-set,gonzofish/angular-librarian,gonzofish/angular-librarian,gonzofish/angular-library-set,gonzofish/angular-librarian |
5d193f997cf525a7aa494435f85ca49393c0a8db | karma/default.config.js | karma/default.config.js | // Default karma configuration
var _ = require('lodash');
var sharedConfig = require('./shared.config');
var webpackPreprocessorLibrary = 'webpack';
module.exports = function (karma, globalFiles, testFiles) {
globalFiles = arrayify(globalFiles);
testFiles = arrayify(testFiles);
var options = sharedConfig(karma)... | // Default karma configuration
var _ = require('lodash');
var sharedConfig = require('./shared.config');
var webpackPreprocessorLibrary = 'webpack';
module.exports = function (karma, testFiles, globalFiles, externals) {
globalFiles = arrayify(globalFiles);
testFiles = arrayify(testFiles);
var options = sharedCo... | Allow the external webpack bundles to be specified with the global file list. | Allow the external webpack bundles to be specified with the global file list.
| JavaScript | mit | RenovoSolutions/Gulp-Typescript-Utilities |
ab14ea6c5ceb43b6b9069db95c757a5c68c8d22e | tests/unit/fixtures/ignoreDelimiters.js | tests/unit/fixtures/ignoreDelimiters.js | (function foo() {
'use strict';
<%
if someCondition do
%>
someMethod('<?php foo('test') ?>')
<% end %>
return '<%= asset_path('foo.png') %>' + '<% some_method() %>';
})();
| (function foo() {
'use strict';
<%
if someCondition do
%>
someMethod('<?php foo('test') ?>')
<% end %>
return '<%= asset_path('foo.png') %>' + '<% some_method() %>';
})();
function return_jsx() {
//<%
return <span>
(somecondition ?
"a"
/* else */:
"b"
)
</span>;
//%>
}... | Add additional ignoreDelimiter code to fixture | Add additional ignoreDelimiter code to fixture
| JavaScript | mit | zynick/jshint,n8io/jshint,marian-r/jshint,thomas658/jshint,cnbin/jshint,n8io/jshint,lukeapage/jshint,behind2/jshint,yadimon/jshint,wisavalite/jshint,behind2/jshint,gtanner/jshint,scottsmeester/jshint,Jeremy017/jshint,crivas/jshint,mohsen1/jshint,ljharb/jshint,scottsmeester/jshint,jugglinmike/jshint,crivas/jshint,Bridge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.