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 |
|---|---|---|---|---|---|---|---|---|---|
002de77134c1a2a2ee4e7e966c106a7fde9a66a9 | articles/articleStore.js | articles/articleStore.js | var MongoClient = require("mongodb").MongoClient;
var config = require("./config.json");
var dbConnection = null;
function getDB() {
return new Promise(function(resolve, reject) {
if (!dbConnection) {
var mongoServerUri = 'mongodb://' +
config.mongodb.user + ':' + config.mongod... | var MongoClient = require("mongodb").MongoClient;
var config = require("./config.json");
var dbConnection = null;
function getDB() {
return new Promise(function(resolve, reject) {
if (!dbConnection) {
var mongoServerUri = 'mongodb://' +
config.mongodb.user + ':' + config.mongod... | Store timestamp also in articles | Store timestamp also in articles
| JavaScript | mit | nisargjhaveri/news-access,nisargjhaveri/news-access,nisargjhaveri/news-access,nisargjhaveri/news-access |
d5db04c823652f20f21c36609778807640375bc3 | tests/dummy/app/routes/application.js | tests/dummy/app/routes/application.js | import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin'
export default Ember.Route.extend( ApplicationRouteMixin, {
init() {
this._super();
},
sessionAuthenticated(){
alert('Got authenticated!');
},
sessionInvalidated(){
alert('Got invalidat... | import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin'
export default Ember.Route.extend( ApplicationRouteMixin, {
init() {
this._super();
},
sessionAuthenticated(){
alert('Got authenticated!');
this._super.call(this);
},
sessionInvalidated... | Call super-method from Mixin in sessionAuthenticated and sessionInvalidated | Call super-method from Mixin in sessionAuthenticated and sessionInvalidated
| JavaScript | mit | mu-semtech/ember-mu-login,mu-semtech/ember-mu-login |
4ba9ce952cd31c51301a27cdcda61f63428414eb | koans/AboutBase.js | koans/AboutBase.js | describe("About <SubjectName>", function () {
describe("<SubjectPart>", function () {
beforeEach(function () {});
afterEach(function () {});
before(function () {});
after(function () {});
it("should <explain what it does>", function () {
// expect().toBe();
});
});
});
| // describe("About <SubjectName>", function () {
//
// describe("<SubjectPart>", function () {
//
// beforeEach(function () {});
// afterEach(function () {});
// before(function () {});
// after(function () {});
//
// it("should <explain what it does>", function () {
// // expect().toBe();
/... | Comment out template koans to stop it showing in the test runner | chore: Comment out template koans to stop it showing in the test runner
| JavaScript | mit | tawashley/es6-javascript-koans,tawashley/es6-javascript-koans,tawashley/es6-javascript-koans |
101ae484f401543217bf2760f4c58b3e756ee494 | test/mocha/test-runner.js | test/mocha/test-runner.js | // Make async.
if (window.__karma__) {
window.__karma__.loaded = function() {};
}
// Set the application endpoint and load the configuration.
require.config({
paths: {
// Testing libraries.
"mocha": "../vendor/bower/mocha/mocha",
"chai": "../vendor/bower/chai/chai",
// Location of tests.
spec:... | // Make async.
if (window.__karma__) {
window.__karma__.loaded = function() {};
}
// Set the application endpoint and load the configuration.
require.config({
paths: {
// Testing libraries.
"mocha": "../vendor/bower/mocha/mocha",
"chai": "../vendor/bower/chai/chai",
// Location of tests.
spec:... | Fix Mocha to run in browser and node tests. This is most likely a bug with karma-mocha. | Fix Mocha to run in browser and node tests. This is most likely a bug with karma-mocha.
| JavaScript | mit | JrPribs/backbone-boilerplate,MandeepRangi/doStuffMediaTest,jSanchoDev/backbone-boilerplate,adrianha/backbone-boilerplate,Hless/backbone-phonegap-boilerplate,danielabalta/albaneagra,si-ro/backbone-boilerplate-ver1,element4git/wipro,si-ro/todo-app2,codeimpossible/backbone-boilerplate,backbone-boilerplate/backbone-boilerp... |
23d51c822aedb56e0257455475dad58e4541bee2 | assets/src/amp-blocks.js | assets/src/amp-blocks.js | /**
* WordPress dependencies
*/
import { registerBlockType } from '@wordpress/blocks';
const context = require.context( './blocks', true, /index\.js$/ );
context.keys().forEach( ( modulePath ) => {
const { name, settings } = context( modulePath );
if ( name.includes( 'story' ) ) {
return;
}
registerBlockTyp... | /**
* WordPress dependencies
*/
import { registerBlockType } from '@wordpress/blocks';
const context = require.context( './blocks', true, /((?<!story.*)\/index\.js)$/ );
context.keys().forEach( ( modulePath ) => {
const { name, settings } = context( modulePath );
registerBlockType( name, settings );
} );
| Fix regex for non-story blocks require.context | Fix regex for non-story blocks require.context
| JavaScript | apache-2.0 | ampproject/amp-toolbox-php,ampproject/amp-toolbox-php |
b8408aec2f1318b6b974ac53f06525424ecdfe0f | test/index.js | test/index.js | var chai = require('chai'),
expect = chai.expect,
sinon = require('sinon'),
sinonChai = require("sinon-chai");
chai.use(sinonChai);
var introject = require('../lib');
describe('injectDeps', function() {
it('should properly inject deps', function() {
var _add = function(a, b) {
return a + b;
};
... | var chai = require('chai'),
expect = chai.expect,
sinon = require('sinon'),
sinonChai = require("sinon-chai");
chai.use(sinonChai);
var introject = require('../lib');
describe('injectDeps', function() {
it('should properly inject deps', function() {
var _add = function(a, b) {
return a + b;
};
... | Add test for requiring undefined deps | Add test for requiring undefined deps
| JavaScript | mit | elvinyung/introject |
f9217630184ad848b0325b400d2813257d8463d7 | src/files/navigation.js | src/files/navigation.js | var sidebarOpen = false;
var menuText = ["Menu", "Close"];
var menuElement = document.querySelector(".menu-link");
var sidebarElement = document.querySelector(".sidebar");
var headerElement = document.querySelector("header");
menuElement.addEventListener( "click", toggleSidebar, false );
window.addEventListener( "hash... | var sidebarOpen = false;
var menuText = ["Menu", "Close"];
var menuElement = document.querySelector(".menu-link");
var sidebarElement = document.querySelector(".sidebar");
var headerElement = document.querySelector("header");
var rAF;
menuElement.addEventListener( "click", toggleSidebar, false );
window.addEventListen... | Add rAF to sidebar animation | Add rAF to sidebar animation
| JavaScript | mit | sveltejs/svelte.technology,sveltejs/svelte.technology |
8e2ef3532f1101ae7bcb26b8712ca7a9323ab831 | test/users.js | test/users.js | const test = require('tape')
const miniplug = require('./mocks/mp')
const nock = require('nock')('https://plug.dj')
test('Retrieving a user', async (t) => {
t.plan(1)
nock.get('/_/users/123456').reply(200, require('./mocks/users/123456.json'))
const user = await miniplug().getUser(123456)
t.equal(user.userna... | const test = require('tape')
const miniplug = require('./mocks/mp')
const nock = require('nock')('https://plug.dj')
test('Retrieving a user', async (t) => {
t.plan(1)
nock.get('/_/users/123456').reply(200, require('./mocks/users/123456.json'))
const user = await miniplug().getUser(123456)
t.equal(user.userna... | Add tests for `user()` method. | Add tests for `user()` method.
| JavaScript | mit | goto-bus-stop/miniplug |
32794a95b5641a7a6e19cdf67a426a7356a944a3 | app/directives/gdOnevarResults.js | app/directives/gdOnevarResults.js | inlist_module.directive('gdOnevarResults', function() { return {
require:'^ngController', //input_list_ctrl
templateUrl:'app/views/onevar_results_table.html',
link: function(scope,elem,attrs,ctrl) {
scope.$watch('inctrl.stats', function(stats) {
document.getElementById('onevar_results_ma... | inlist_module.directive('gdOnevarResults', function() { return {
require:'^ngController', //input_list_ctrl
templateUrl:'app/views/onevar_results_table.html',
link: function(scope,elem,attrs,ctrl) {
scope.$watch('inctrl.stats', function(stats) {
document.getElementById('onevar_results_ma... | Add undefined instead of nan if only one number | Add undefined instead of nan if only one number
| JavaScript | agpl-3.0 | gderecho/stats,gderecho/stats |
3cb139d8b5a4e25a98044828cff759a8c9f83879 | app/server/views/visualisation.js | app/server/views/visualisation.js | var requirejs = require('requirejs');
var View = requirejs('extensions/views/view');
module.exports = View.extend({
render: function () {
View.prototype.render.apply(this, arguments);
console.log(this.fallbackUrl);
this.$el.attr('data-src', this.fallbackUrl);
}
}); | var requirejs = require('requirejs');
var View = requirejs('extensions/views/view');
module.exports = View.extend({
render: function () {
View.prototype.render.apply(this, arguments);
this.$el.attr('data-src', this.fallbackUrl);
}
}); | Remove log left in by mistake | Remove log left in by mistake
| JavaScript | mit | keithiopia/spotlight,tijmenb/spotlight,alphagov/spotlight,keithiopia/spotlight,tijmenb/spotlight,tijmenb/spotlight,alphagov/spotlight,alphagov/spotlight,keithiopia/spotlight |
91621e205caa1a5d3ccaca59928dba76edd42f65 | appcomposer/templates/translator/lib.js | appcomposer/templates/translator/lib.js | // Application found and translatable!
$web_link = $(".field-name-field-app-web-link");
$("<div class=\"field field-type-link-field field-label-inline clearfix\"><div class=\"field-label\">Available languages: </div><div class=\"field-items\"><div class=\"field-item even\">{{ translations }} (<a href=\"{{ ... | // Application found and translatable!
$web_link = $(".field-name-field-app-web-link");
$("<div class=\"field field-type-link-field field-label-inline clearfix\"><div class=\"field-label\">Available languages: </div><div class=\"field-items\"><div class=\"field-item even\">{{ translations }} </div></div></d... | Remove the 'Translate this app' link | Remove the 'Translate this app' link
| JavaScript | bsd-2-clause | morelab/appcomposer,go-lab/appcomposer,morelab/appcomposer,go-lab/appcomposer,go-lab/appcomposer,porduna/appcomposer,morelab/appcomposer,porduna/appcomposer,morelab/appcomposer,porduna/appcomposer,go-lab/appcomposer,porduna/appcomposer |
e45f219a13b8d7c130fa64847026b81866e04535 | lib/Predictions.js | lib/Predictions.js | import React, { Component } from 'react';
import {
StyleSheet,
FlatList,
View
} from 'react-native';
import Prediction from './Prediction';
class Predictions extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View style={style.container}>
... | import React, { Component } from 'react';
import {
StyleSheet,
FlatList,
View
} from 'react-native';
import Prediction from './Prediction';
class Predictions extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View style={style.container}>
... | Use correct properties from predictions response | Use correct properties from predictions response
| JavaScript | mit | chrislam/react-native-google-place-autocomplete |
bd885efa7e38addd3d975bf388fe0bc9febd4cc8 | src/createPoll.js | src/createPoll.js | "use strict";
var utils = require("../utils");
var log = require("npmlog");
module.exports = function(defaultFuncs, api, ctx) {
return function createPoll(title, threadID, options, callback) {
if(!callback) {
if(utils.getType(options) == "Function") {
callback = options;
} else {
cal... | "use strict";
var utils = require("../utils");
var log = require("npmlog");
module.exports = function(defaultFuncs, api, ctx) {
return function createPoll(title, threadID, options, callback) {
if(!callback) {
if(utils.getType(options) == "Function") {
callback = options;
} else {
cal... | Fix unnecessary encoding in poll function | Fix unnecessary encoding in poll function
| JavaScript | mit | ravkr/facebook-chat-api,Schmavery/facebook-chat-api,GAMELASTER/facebook-chat-api |
548d7c5c653608c189b7d5d3143492a42e69c6c9 | imports/client/pages/AboutPage.js | imports/client/pages/AboutPage.js | import React from 'react';
import IntroBand from '../components/About/IntroBand';
import AboutBand from '../components/About/AboutBand';
import ProjectsBand from '../components/About/ProjectsBand';
class AboutPage extends React.Component {
shouldComponentUpdate() {
return false;
}
render() {
return (
... | import React from 'react';
import IntroBand from '../components/About/IntroBand';
import AboutBand from '../components/About/AboutBand';
import ProjectsBand from '../components/About/ProjectsBand';
import ContactForm from '../components/Contact/ContactForm';
class AboutPage extends React.Component {
shouldComponent... | Add contact form to about page | Add contact form to about page
| JavaScript | apache-2.0 | evancorl/portfolio,evancorl/skate-scenes,evancorl/skate-scenes,evancorl/portfolio,evancorl/skate-scenes,evancorl/portfolio |
8671ba83bd37b4e43a3288af2093d19fc611a759 | app/components/Hamburger/index.js | app/components/Hamburger/index.js | import React from 'react';
import styled from 'styled-components';
import theme from 'theme';
const StyledHamburger = styled.div`
position: relative;
width: 15px;
height: 13px;
`;
export const Bar = styled.div`
position: absolute;
height: 3px;
background: ${theme.black};
overflow: hidden;
... | import React from 'react';
import styled from 'styled-components';
import theme from 'theme';
const StyledHamburger = styled.div`
position: relative;
width: 15px;
height: 13px;
`;
export const Bar = styled.div`
position: absolute;
height: 3px;
background: ${theme.black};
overflow: hidden;
... | Convert Hamburger component to stateless function | Convert Hamburger component to stateless function
| JavaScript | mit | nathanhood/mmdb,nathanhood/mmdb |
390bf907e581c44804ac03becbf462fcee134ea7 | app/renderer/js/components/tab.js | app/renderer/js/components/tab.js | 'use strict';
const BaseComponent = require(__dirname + '/../components/base.js');
class Tab extends BaseComponent {
constructor(props) {
super();
this.props = props;
this.webview = this.props.webview;
this.init();
}
init() {
this.$el = this.generateNodeFromTemplate(this.template());
this.props.$roo... | 'use strict';
const BaseComponent = require(__dirname + '/../components/base.js');
class Tab extends BaseComponent {
constructor(props) {
super();
this.props = props;
this.webview = this.props.webview;
this.init();
}
init() {
this.$el = this.generateNodeFromTemplate(this.template());
this.props.$roo... | Remove unused isLoading function from Tab. | components: Remove unused isLoading function from Tab.
| JavaScript | apache-2.0 | zulip/zulip-desktop,zulip/zulip-desktop,zulip/zulip-desktop,zulip/zulip-desktop |
22ab2b03693a5a188a7675c984303f5be34052a9 | src/components/SimilarPlayersCard.js | src/components/SimilarPlayersCard.js | import React from 'react';
import PlayerAvatar from './PlayerAvatar.js'
import '../style/components/SimilarPlayersCard.css';
export default function SimilarPlayersCard(props) {
const similarPlayersList = [
{
'firstName': props.firstName0,
'lastName': props.lastName0,
'img': props.img0,
'... | import React from 'react';
import PlayerAvatar from './PlayerAvatar.js'
import '../style/components/SimilarPlayersCard.css';
export default function SimilarPlayersCard(props) {
const similarPlayersList = [
{
'firstName': props.firstName0,
'lastName': props.lastName0,
'img': props.img0,
'... | Use idx as key for similar player avatars | Use idx as key for similar player avatars
| JavaScript | mit | iNaesu/nba-player-dashboard,iNaesu/nba-player-dashboard |
4a505be39079d972c6506467891e6e4958789ed7 | src/lib/substituteTailwindAtRules.js | src/lib/substituteTailwindAtRules.js | import fs from 'fs'
import _ from 'lodash'
import postcss from 'postcss'
function updateSource(nodes, source) {
return _.tap(Array.isArray(nodes) ? postcss.root({ nodes }) : nodes, tree => {
tree.walk(node => (node.source = source))
})
}
export default function(config, { components: pluginComponents, utilitie... | import fs from 'fs'
import _ from 'lodash'
import postcss from 'postcss'
function updateSource(nodes, source) {
return _.tap(Array.isArray(nodes) ? postcss.root({ nodes }) : nodes, tree => {
tree.walk(node => (node.source = source))
})
}
export default function(
config,
{ base: pluginBase, components: plu... | Load plugin base styles at `@tailwind base` | Load plugin base styles at `@tailwind base`
| JavaScript | mit | tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindcss/tailwindcss |
ffcf591b1c59f3441206ce1c308a95d63f005766 | lib/web/middleware/basic_auth.js | lib/web/middleware/basic_auth.js | var settings = require('../../settings');
module.exports = function basic_auth(req, res, next){
var username, password, auth_token, index_of_colon, auth_header, i, user_tuple;
try{
auth_header = req.header('Authorization');
if (auth_header === undefined){
return unauthorized(res);
}
if (auth... | var settings = require('../../settings');
module.exports = function basic_auth(req, res, next){
var username, password, auth_token, index_of_colon, auth_header, i, user_tuple;
try{
auth_header = req.header('Authorization');
if (auth_header === undefined){
return unauthorized(res);
}
if (auth... | Send www-authenticate header so browsers ask for a password. | Send www-authenticate header so browsers ask for a password.
| JavaScript | apache-2.0 | racker/gutsy,racker/gutsy |
87b8b34f84f13c547de50533efd81345eb73570f | src/karma.conf.js | src/karma.conf.js | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... | Revert "Add custom launcher for karma" | Revert "Add custom launcher for karma"
This reverts commit dd80f254f407429aeaf5ca5c4fb414363836c267.
| JavaScript | mit | dzonatan/angular2-linky,dzonatan/angular2-linky |
c974512324fe20775db67626d15027a539ec27bb | packages/components/containers/app/createApi.js | packages/components/containers/app/createApi.js | import xhr from 'proton-shared/lib/fetch/fetch';
import configureApi from 'proton-shared/lib/api';
export default ({ CLIENT_ID, APP_VERSION, API_VERSION, API_URL }) => (UID) => {
return configureApi({
xhr,
UID,
API_URL,
CLIENT_ID,
API_VERSION,
APP_VERSION
});
};
| import xhr from 'proton-shared/lib/fetch/fetch';
import configureApi from 'proton-shared/lib/api';
export default ({ CLIENT_ID, CLIENT_SECRET, APP_VERSION, API_VERSION, API_URL }) => (UID) => {
return configureApi({
xhr,
UID,
API_URL,
CLIENT_ID,
CLIENT_SECRET,
API_VE... | Add support for sending client secret from the config | Add support for sending client secret from the config
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
d76e961f639a776c837f70f02fcb767de9f4287c | src/main/power.js | src/main/power.js | "use strict";
module.exports.charging = function() {
if ( process.platform === "darwin") {
var osxBattery = require("osx-battery");
return osxBattery().then(res => {
return res.isCharging || res.fullyCharged;
});
}
else if ( process.platform === "linux") {
var linuxBattery = require("... | "use strict";
module.exports.charging = function() {
if ( process.platform === "darwin") {
var osxBattery = require("osx-battery");
return osxBattery().then(res => {
return res.isCharging || res.fullyCharged;
}).catch(() => {
return false;
});
}
else if ( process.platform === "linux"... | Add error handling to battery check | Add error handling to battery check
| JavaScript | mit | muffinista/before-dawn,muffinista/before-dawn,muffinista/before-dawn |
87ecca5fb61b6ff202c317771c6ce7e6ebdcb979 | backend/server/model-loader.js | backend/server/model-loader.js | module.exports = function modelLoader(isParent) {
'use strict';
if (isParent || process.env.MCTEST) {
console.log('using mocks/model');
return require('./mocks/model');
}
let ropts = {
db: 'materialscommons',
port: 30815
};
let r = require('rethinkdbdash')(ropt... | module.exports = function modelLoader(isParent) {
'use strict';
if (isParent || process.env.MCTEST) {
return require('./mocks/model');
}
let ropts = {
db: process.env.MCDB || 'materialscommons',
port: process.env.MCPORT || 30815
};
let r = require('rethinkdbdash')(ropt... | Add environment variables for testing, database and database server port. | Add environment variables for testing, database and database server port.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
c99b485a0ec66a1a0c262a9dc74bbdebeab86083 | node/index.js | node/index.js | var path = require('path');
var moduleEntryPoint = require.resolve('incuna-sass');
var moduleDir = path.dirname(moduleEntryPoint);
function includePaths() {
return [moduleDir];
}
module.exports = {
includePaths: includePaths()
};
| // This index module is returned by default when this package is required
// Node module imports
var path = require('path');
// Function returns absolute system path to location that module is installed.
// This is useful for referencing the files within this package in grunt tasks
// Uses a technique copied from nod... | Make sure the node module path is reported correctly | Make sure the node module path is reported correctly | JavaScript | mit | incuna/incuna-sass |
8f375eaf4e3453fee3c41907ef0016de3c11d636 | server/main.js | server/main.js | makeThumbNail = function (fileBuffer, extenstion, callback) {
var gmImageRessource = gm(fileBuffer, 'image.' + extenstion)
, newImage = {
side: 400
}
, syncSize = function (gmRessource, callback) {
gmRessource.size(callback)
}
, imageSize = Meteor.wrapAsync(syncSize)(gmImageRessource)
, imageRatio = {
... | makeThumbNail = function (fileBuffer, extenstion, callback) {
var gmImageRessource = gm(fileBuffer, 'image.' + extenstion)
, newImage = {
side: 400
}
function syncSize (gmRessource, callback) {
gmRessource.size(callback)
}
var imageSize = Meteor.wrapAsync(syncSize)(gmImageRessource)
newGmImageRess... | Refactor makeThumbNail to produce images with min400 x min400 | Refactor makeThumbNail to produce images with min400 x min400
| JavaScript | mit | Kriegslustig/meteor-gallery |
d0ff2e82248998d018b07d7d018b9f9747afcbc6 | src/geo/ui/widgets/category/search_paginator_view.js | src/geo/ui/widgets/category/search_paginator_view.js | var $ = require('jquery');
var _ = require('underscore');
var View = require('cdb/core/view');
var Model = require('cdb/core/model');
var PaginatorView = require('./paginator_view');
var searchTemplate = require('./search_paginator_template.tpl');
module.exports = PaginatorView.extend({
_TEMPLATE: searchTemplate,
... | var $ = require('jquery');
var _ = require('underscore');
var View = require('cdb/core/view');
var Model = require('cdb/core/model');
var PaginatorView = require('./paginator_view');
var searchTemplate = require('./search_paginator_template.tpl');
module.exports = PaginatorView.extend({
_TEMPLATE: searchTemplate,
... | Clean search (input, data, ...) when search view is disabled | Clean search (input, data, ...) when search view is disabled | JavaScript | bsd-3-clause | splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js |
3bcf3b06bf13be57da0ef4c619da5e9c7beee4d1 | lib/extensions/error_reporting/mixin_base.js | lib/extensions/error_reporting/mixin_base.js | 'use strict';
var Mixin = require('../../utils/mixin'),
inherits = require('util').inherits;
var ErrorReportingMixinBase = module.exports = function (host, onParseError) {
Mixin.call(this, host);
this.posTracker = null;
this.onParseError = onParseError;
};
inherits(ErrorReportingMixinBase, Mixin);
... | 'use strict';
var Mixin = require('../../utils/mixin'),
inherits = require('util').inherits;
var ErrorReportingMixinBase = module.exports = function (host, onParseError) {
Mixin.call(this, host);
this.posTracker = null;
this.onParseError = onParseError;
};
inherits(ErrorReportingMixinBase, Mixin);
... | Add details field to error | Add details field to error
| JavaScript | mit | HTMLParseErrorWG/parse5,HTMLParseErrorWG/parse5 |
9c1882431b199501018c2be8cef6dd92ea7ad642 | server/auth/local/passport.js | server/auth/local/passport.js | let passport = require('passport');
let LocalStrategy = require('passport-local').Strategy;
const AUTH_ERROR = {message: 'Invalid email or password.'};
let localPassport = {
localAuthenticate,
setup
};
function localAuthenticate(userService, email, password, done) {
userService.getByEmail(email.toLowerCa... | 'use strict';
let passport = require('passport');
let LocalStrategy = require('passport-local').Strategy;
const AUTH_ERROR = {message: 'Invalid email or password.'};
let localPassport = {
localAuthenticate,
setup
};
function localAuthenticate(userService, email, password, done) {
userService.getByEmail(... | Build gc-orders-server from commit bd221fb on branch master | Build gc-orders-server from commit bd221fb on branch master
| JavaScript | apache-2.0 | rrgarciach/gc-orders-server |
168008d7087d2505af4183e1bb8783259fa677b8 | src/modules/cluster/cluster-detail/cluster-detail.js | src/modules/cluster/cluster-detail/cluster-detail.js | (function() {
"use strict";
var app = angular.module("TendrlModule");
app.controller("clusterDetailController", clusterDetailController);
/*@ngInject*/
function clusterDetailController($state, $stateParams, utils, $scope, $rootScope) {
var vm = this;
vm.tabList = { "Host": 1 };
... | (function() {
"use strict";
var app = angular.module("TendrlModule");
app.controller("clusterDetailController", clusterDetailController);
/*@ngInject*/
function clusterDetailController($state, $stateParams, utils, $scope, $rootScope) {
var vm = this;
vm.tabList = { "Host": 1 };
... | Fix for cluster detail page | Fix for cluster detail page
| JavaScript | apache-2.0 | Tendrl/dashboard,cloudbehl/tendrl_frontend,Tendrl/dashboard,cloudbehl/tendrl_frontend |
fe824c8f8412806bccfcdbc94f8d0810ef3f1441 | src/actions.js | src/actions.js | export const ADD: string = 'ADD'
export const SHOW: string = 'SHOW'
export const DISMISS: string = 'DISMISS'
export function add (item) {
return {
type: ADD,
payload: item
}
}
export function show (item) {
return {
type: SHOW,
payload: item
}
}
export function dismiss () {
return {
type... | export const ADD: string = 'SNACKBAR.ADD'
export const SHOW: string = 'SNACKBAR.SHOW'
export const DISMISS: string = 'SNACKBAR.DISMISS'
export function add (item) {
return {
type: ADD,
payload: item
}
}
export function show (item) {
return {
type: SHOW,
payload: item
}
}
export function dismi... | Add namespace for redux action for better scope | Add namespace for redux action for better scope
| JavaScript | mit | 9gag-open-source/react-native-snackbar-dialog |
3a9815f8c89af89d3ab92c96ec3a51acb4dd024d | client/components/App.js | client/components/App.js | import React, { Component } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { hot } from 'react-hot-loader';
import SignUpPage from './SignUp/SignUpPage';
import LoginPage from './Login/LoginPage';
import IndexPage from './Index';
class App extends Component {
render() {
return (
... | import React, { Component } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { hot } from 'react-hot-loader';
import SignUpPage from './SignUp/SignUpPage';
import LoginPage from './Login/LoginPage';
import IndexPage from './Index';
import Books from './Books';
class App extends Component ... | Add route for getting books | Add route for getting books
| JavaScript | mit | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books |
74480edd7007f19bc97deed0581d14b107bc2365 | client/middlewares/call-api.js | client/middlewares/call-api.js | import liqen from 'liqen'
export const CALL_API = Symbol('call api')
export default store => next => action => {
const callAPI = action[CALL_API]
if (typeof callAPI === 'undefined') {
return next(action)
}
const { ref, target, tag } = callAPI
// Send a pending
next({
type: 'CREATE_ANNOTATION_PEN... | import liqen from 'liqen'
import fakeLiqen from '../../server/local-liqen'
import cookies from 'cookies-js'
export const CALL_API = Symbol('call api')
export default store => next => action => {
const callAPI = action[CALL_API]
if (typeof callAPI === 'undefined') {
return next(action)
}
const token = co... | Set token and fake liqen in redux middleware | Set token and fake liqen in redux middleware
| JavaScript | mit | CommonActionForum/liqen-face,exacs/liqen-face,CommonActionForum/liqen-face,exacs/liqen-face |
ff52f6b8861b23e808b0853e88faf0532029eda4 | test/index.js | test/index.js | //query
import './query/ends_with';
import './query/includes';
import './query/is_alpha';
import './query/is_alpha_digit';
import './query/is_blank';
import './query/is_digit';
import './query/is_empty';
import './query/is_lower_case';
import './query/is_numeric';
import './query/is_string';
import './query/is_upper_ca... | //query
import './query/ends_with';
import './query/includes';
import './query/is_alpha';
import './query/is_alpha_digit';
import './query/is_blank';
import './query/is_digit';
import './query/is_empty';
import './query/is_lower_case';
import './query/is_numeric';
import './query/is_string';
import './query/is_upper_ca... | Include matches unit tests in main bundle | Include matches unit tests in main bundle
| JavaScript | mit | hyeonil/awesome-string,hyeonil/awesome-string,panzerdp/voca |
884c59717350496cdc6a373cb5e4e8118277c708 | packages/components/bolt-copy-to-clipboard/src/copy-to-clipboard.standalone.js | packages/components/bolt-copy-to-clipboard/src/copy-to-clipboard.standalone.js | import {
define,
props,
withComponent,
css,
hasNativeShadowDomSupport,
withPreact,
withHyperHTML,
sanitizeBoltClasses
} from '@bolt/core';
import ClipboardJS from 'clipboard';
@define
export class BoltCopyToClipboard extends withHyperHTML() {
static is = 'bolt-copy-to-clipboard';
constructor() {
... | import {
define,
props,
withComponent,
css,
hasNativeShadowDomSupport,
withPreact,
BoltComponent,
sanitizeBoltClasses
} from '@bolt/core';
import ClipboardJS from 'clipboard';
@define
export class BoltCopyToClipboard extends BoltComponent() {
static is = 'bolt-copy-to-clipboard';
constructor() {
... | Copy to Clipboard -- Swap out withHyperHTML in favor of BoltComponent to fix console / render errors | Copy to Clipboard -- Swap out withHyperHTML in favor of BoltComponent to fix console / render errors
| JavaScript | mit | bolt-design-system/bolt,bolt-design-system/bolt,bolt-design-system/bolt,bolt-design-system/bolt,bolt-design-system/bolt |
9fc75f0a12404f8dbe7938e796d6c5ddfeaec1c9 | test/fixtures/collections/searchResultFields.js | test/fixtures/collections/searchResultFields.js | (function () {
'use strict';
define(function () {
return [
{
key: 'first',
labelText: 'Field One'
},
{
key: 'second',
labelText: 'Field Two'
},
{
key: 'third',
... | (function () {
'use strict';
define(function () {
return [
{
key: 'first',
labelText: 'Field One',
sort: true
},
{
key: 'second',
labelText: 'Field Two',
sort: function (v... | Add sort settings to fixture config. | Add sort settings to fixture config.
| JavaScript | mit | rwahs/research-frontend,rwahs/research-frontend |
c95310d6ab447822e2ebdc1a7fe8bfe2d7c295e7 | mix-files/index.js | mix-files/index.js | var mix = require('mix');
var path = require('path');
var vfs = require('vinyl-fs');
module.exports = function (options) {
var base = path.resolve(options.base);
var globs;
if (typeof options.globs === 'string') {
globs = [options.globs];
} else {
globs = options.globs;
}
globs... | var mix = require('mix');
var path = require('path');
var vfs = require('vinyl-fs');
module.exports = function (options) {
var base = path.resolve(options.base);
var globs;
if (typeof options.globs === 'string') {
globs = [options.globs];
} else {
globs = options.globs;
}
globs... | Migrate the files plugin to use Watcher | Migrate the files plugin to use Watcher
| JavaScript | mit | byggjs/bygg,byggjs/bygg-plugins |
3949481100244425dfdc1d478ff94101812b3de6 | tests/nightwatch/specs/current/face-to-face-page.js | tests/nightwatch/specs/current/face-to-face-page.js | 'use strict';
var util = require('util');
var common = require('../../modules/common-functions');
module.exports = {
'Start page': common.startPage,
'Categories of law (Your problem)': function(client) {
client
.assert.urlContains('/problem')
.assert.containsText('h1', 'What do you need help with... | 'use strict';
var common = require('../../modules/common-functions');
module.exports = {
'Start page': common.startPage,
'Categories of law (Your problem)': function(client) {
client
.assert.urlContains('/problem')
.assert.containsText('h1', 'What do you need help with?')
.click('input[name... | Add simple 'Find legal adviser' search test | TEST: Add simple 'Find legal adviser' search test
| JavaScript | mit | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public |
7991b9480f2c975420f9786db509d32bc1e54110 | nuxt.config.js | nuxt.config.js | module.exports = {
/*
** Headers of the page
*/
head: {
title: 'CSS Frameworks',
titleTemplate: '%s - CSS Frameworks',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Compare CS... | const path = require('path')
const dataPath = path.join(__dirname, process.env.repoDataPath || 'data.json')
const frameworks = require(dataPath)
module.exports = {
/*
** Headers of the page
*/
head: {
title: 'CSS Frameworks',
titleTemplate: '%s - CSS Frameworks',
meta: [
{ charset: 'utf-8' }... | Change the way to load json | Change the way to load json
| JavaScript | mit | sunya9/css-frameworks,sunya9/css-frameworks |
23cff7eb77661c30c6449adc9a04bda5cf300e3f | karma.conf.js | karma.conf.js | var _ = require('lodash')
var webpackConfig = require('./webpack.config')
var config = {
frameworks: ['mocha', 'effroi'],
preprocessors: {
'tests/index.js': ['webpack', 'sourcemap']
},
files: [
'tests/index.js'
],
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters:... | var _ = require('lodash')
var webpackConfig = require('./webpack.config')
var config = {
frameworks: ['mocha', 'effroi'],
preprocessors: {
'tests/index.js': ['webpack', 'sourcemap']
},
files: [
'tests/index.js'
],
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters:... | Bring back source maps in tests | Bring back source maps in tests
| JavaScript | mit | QubitProducts/cherrytree,nathanboktae/cherrytree,nathanboktae/cherrytree,QubitProducts/cherrytree |
2cd672d73c2d232fe6431cefa846b330443c7a5e | web/src/js/components/General/FullScreenProgress.js | web/src/js/components/General/FullScreenProgress.js |
import React from 'react'
import PropTypes from 'prop-types'
import CircularProgress from 'material-ui/CircularProgress'
class FullScreenProgress extends React.Component {
render () {
const {containerStyle, progressStyle} = this.props
return (
<div
style={containerStyle}>
<CircularPro... |
import React from 'react'
import PropTypes from 'prop-types'
import CircularProgress from 'material-ui/CircularProgress'
class FullScreenProgress extends React.Component {
render () {
const {containerStyle, progressStyle} = this.props
return (
<div
style={containerStyle}>
<CircularPro... | Add a max width to 100vw component to avoid horizontal scroll. | Add a max width to 100vw component to avoid horizontal scroll.
| JavaScript | mpl-2.0 | gladly-team/tab,gladly-team/tab,gladly-team/tab |
1bb6e58b0e8a1e1f5ac48bdca2ab3ac0b3beaf0d | lib/control/v1/index.js | lib/control/v1/index.js | 'use strict';
const express = require('express');
const BodyParser = require('body-parser');
const Handlers = require('../util').Handlers;
const Err = require('../util').Err;
exports.attach = function (app, storage) {
app.get('/v1/health', require('./health'));
app.use('/v1/health', Handlers.allowed('GET'));
a... | 'use strict';
const express = require('express');
const BodyParser = require('body-parser');
const Handlers = require('../util').Handlers;
const Err = require('../util').Err;
exports.attach = function (app, storage) {
app.get('/v1/health', require('./health'));
app.get('/v1/token/default', require('./token')(sto... | Clean up route handling so it's more readable. | Clean up route handling so it's more readable.
| JavaScript | mit | rapid7/tokend,rapid7/tokend,rapid7/tokend |
cd3abcf0a72ab69da0c26a483cfddf35e35c0f03 | clientapp/models/call.js | clientapp/models/call.js | /*global app, me, client*/
"use strict";
var _ = require('underscore');
var HumanModel = require('human-model');
var logger = require('andlog');
module.exports = HumanModel.define({
type: 'call',
initialize: function (attrs) {
this.contact.onCall = true;
},
session: {
contact: 'object... | /*global app, me, client*/
"use strict";
var _ = require('underscore');
var HumanModel = require('human-model');
var logger = require('andlog');
module.exports = HumanModel.define({
type: 'call',
initialize: function (attrs) {
this.contact.onCall = true;
},
session: {
contact: 'object... | Fix excess reason condition wrapping | Fix excess reason condition wrapping
| JavaScript | mit | digicoop/kaiwa,lasombra/kaiwa,warcode/kaiwa,syci/kaiwa,nsg/kaiwa,rogervaas/otalk-im-client,syci/kaiwa,weiss/kaiwa,ForNeVeR/kaiwa,unam3/kaiwa,heyLu/kaiwa,ForNeVeR/kaiwa,digicoop/kaiwa,warcode/kaiwa,otalk/otalk-im-client,nsg/kaiwa,heyLu/kaiwa,ForNeVeR/kaiwa,weiss/kaiwa,lasombra/kaiwa,heyLu/kaiwa,di-stars/kaiwa,rogervaas/... |
c59942e85fd74b8794aca87ececfb8f15b368724 | helpers/helpers.js | helpers/helpers.js | module.exports = function (context) {
return {
$: function (expression) {
return expression
},
extend: {
extendables: {},
add: function (selector, cssString) {
this.extendables[selector] = {
css: cssString,
selectors: []
}
},
that: functio... | module.exports = function (context) {
return {
$: function (expression) {
return expression
},
extend: {
extendables: {},
add: function (selector, cssString) {
this.extendables[selector] = {
css: cssString,
selectors: []
}
},
that: functio... | Fix a bug in extend | Fix a bug in extend
| JavaScript | mit | Kriegslustig/jsheets |
3e2cf41793074bce2338a2e4f75d2940d1f0ea30 | rest/making-calls/example-4/example-4.2.x.js | rest/making-calls/example-4/example-4.2.x.js | // Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);
client.calls.create({
u... | // Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);
client.calls.create({
u... | Update based on feedback from @nash-md | Update based on feedback from @nash-md | JavaScript | mit | TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snip... |
4251b1b921f5e566eb571a320b64c77ca8adcc2b | src/components/Header/index.js | src/components/Header/index.js | import React, { Component } from 'react';
import { Link } from 'react-router';
import ChannelDropdown from '../../containers/ChannelDropdown/ChannelDropdown';
/* component styles */
import { styles } from './styles.scss';
export class Header extends Component {
render() {
return (
<header className={`${st... | import React, { Component } from 'react';
import { Link } from 'react-router';
import ChannelDropdown from '../../containers/ChannelDropdown/ChannelDropdown';
/* component styles */
import { styles } from './styles.scss';
export class Header extends Component {
render() {
return (
<header className={`${st... | Move logo link out of header component and into child, simplify markup | Move logo link out of header component and into child, simplify markup
| JavaScript | mit | dramich/Chatson,dramich/twitchBot,badT/twitchBot,TerryCapan/twitchBot,dramich/Chatson,TerryCapan/twitchBot,badT/Chatson,badT/twitchBot,badT/Chatson,dramich/twitchBot |
134cad0d006b00d073d029c7b4b9c687b3145c99 | src/lifecycle/attribute.js | src/lifecycle/attribute.js | import data from '../util/data';
export default function (opts) {
const { attribute } = opts;
return function (name, oldValue, newValue) {
const propertyName = data(this, 'attributeLinks')[name];
if (propertyName) {
const propertyData = data(this, `api/property/${propertyName}`);
if (!propert... | import data from '../util/data';
export default function (opts) {
const { attribute } = opts;
return function (name, oldValue, newValue) {
const propertyName = data(this, 'attributeLinks')[name];
if (propertyName) {
const propertyData = data(this, `api/property/${propertyName}`);
if (!propert... | Fix issue where value might be null in which case it's safe to just set directly on the property. | Fix issue where value might be null in which case it's safe to just set directly on the property.
| JavaScript | mit | skatejs/skatejs,chrisdarroch/skatejs,skatejs/skatejs,chrisdarroch/skatejs,skatejs/skatejs |
a8a6b901289de0b918df9b9ee66f52fc534dd55b | scripts/generate-entry-i10n.js | scripts/generate-entry-i10n.js | const promise = require("bluebird");
const options = {
// Initialization Options
promiseLib: promise, // use bluebird as promise library
capSQL: true, // when building SQL queries dynamically, capitalize SQL keywords
};
const pgp = require("pg-promise")(options);
const connectionString = process.env.DATABASE_URL;... | const promise = require("bluebird");
const { SUPPORTED_LANGUAGES } = require("./../constants.js");
const { find } = require("lodash");
const options = {
// Initialization Options
promiseLib: promise, // use bluebird as promise library
capSQL: true, // when building SQL queries dynamically, capitalize SQL keywords... | Prepare fetching of localization data | Prepare fetching of localization data
| JavaScript | mit | participedia/api,participedia/api,participedia/api,participedia/api |
488e3f56b59859258a6e89c359ffa0a2ca5199c2 | Apps/server.js | Apps/server.js | /*global require,__dirname*/
var connect = require('connect');
connect.createServer(
connect.static(__dirname)
).listen(8080); | /*global require,__dirname*/
/*jshint es3:false*/
var connect = require('connect');
connect.createServer(
connect.static(__dirname)
).listen(8080); | Fix warning with new JSHint version. | Fix warning with new JSHint version.
| JavaScript | apache-2.0 | jason-crow/cesium,kiselev-dv/cesium,geoscan/cesium,denverpierce/cesium,denverpierce/cesium,hodbauer/cesium,CesiumGS/cesium,kiselev-dv/cesium,CesiumGS/cesium,kaktus40/cesium,likangning93/cesium,esraerik/cesium,AnalyticalGraphicsInc/cesium,NaderCHASER/cesium,progsung/cesium,ggetz/cesium,emackey/cesium,YonatanKra/cesium,o... |
8ad089b866785e51763bb1e2749fd1c957ef9c1e | src/main/web/florence/js/functions/_viewLogIn.js | src/main/web/florence/js/functions/_viewLogIn.js | function viewLogIn() {
var login_form = templates.login;
$('.section').html(login_form);
$('.form-login').submit(function (e) {
e.preventDefault();
var email = $('.fl-user-and-access__email').val();
var password = $('.fl-user-and-access__password').val();
postLogin(email, password);
});
}
| function viewLogIn() {
var login_form = templates.login;
$('.section').html(login_form);
$('.form-login').submit(function (e) {
e.preventDefault();
loadingBtn($('#login'));
var email = $('.fl-user-and-access__email').val();
var password = $('.fl-user-and-access__password').... | Add loading icon to login screen | Add loading icon to login screen
Former-commit-id: 90d450bf4183942e81865a20f91780d27f208994 | JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence |
2f19d1c6b2d39958e59afaca72cc66a1e55daf58 | app/components/preheatPresets/index.js | app/components/preheatPresets/index.js | import React from 'react';
import { forEach } from 'lodash'
import ControllButton from '../controllButton';
import { getUniqueId } from '../../lib/utils';
const PreheatPresets = ({ presets, onClick }) => (
<div>
{Object.keys(presets).map(preset => {
return (<div>
<ControllButton onClick={() => { o... | import React from 'react';
import { forEach } from 'lodash'
import ControllButton from '../controllButton';
import { getUniqueId } from '../../lib/utils';
const PreheatPresets = ({ presets, onClick }) => (
<div>
{Object.keys(presets).map(preset => {
return (<div>
<ControllButton onClick={() => { o... | Fix wrong name being used at temperature preset component | Fix wrong name being used at temperature preset component
| JavaScript | agpl-3.0 | MakersLab/farm-client,MakersLab/farm-client |
b96c549fcdaa39ab03704fa064bd4c6852fb2249 | src/full-observation-widget.js | src/full-observation-widget.js | import createElement from 'virtual-dom/create-element'
import diff from 'virtual-dom/diff'
import patch from 'virtual-dom/patch'
import VText from 'virtual-dom/vnode/vtext'
import { getScheduler } from './scheduler-assignment'
export default class FullObservationWidget {
constructor (observation) {
this.type = '... | import createElement from 'virtual-dom/create-element'
import diff from 'virtual-dom/diff'
import patch from 'virtual-dom/patch'
import VText from 'virtual-dom/vnode/vtext'
import { getScheduler } from './scheduler-assignment'
export default class FullObservationWidget {
constructor (observation) {
this.type = '... | Convert strings to VText nodes | Convert strings to VText nodes | JavaScript | mit | lee-dohm/etch,atom/etch,nathansobo/etch,smashwilson/etch |
bfbf2dcdbd2e0a2eb56391a903204ec6b8b4e9c1 | src/in-view.js | src/in-view.js | import Registry from './registry';
const initInView = () => {
const getElements = (selector) =>
[].slice.call(document.querySelectorAll(selector));
const inViewport = (element, offset = 0) => {
let bounds = element.getBoundingClientRect();
return bounds.bottom > offset
&& ... | import Registry from './registry';
const inView = () => {
const getElements = (selector) =>
[].slice.call(document.querySelectorAll(selector));
const inViewport = (element, offset = 0) => {
let bounds = element.getBoundingClientRect();
return bounds.bottom > offset
&& boun... | Rename returned interface to control and init to inView | Rename returned interface to control and init to inView
| JavaScript | mit | kudago/in-view,camwiegert/in-view |
f25e3d3b233d81a65604266722378be813affd29 | src/app/includes/js/geolocation/geolocation.js | src/app/includes/js/geolocation/geolocation.js | (function($) {
$.fn.geoLocation = function(callback) {
if (callback && typeof(callback) === 'function') {
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0 //Always request the current location
};
function su... | (function($) {
$.fn.geoLocation = function(callback, data) {
if (callback && typeof(callback) === 'function') {
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0 //Always request the current location
}
function success(position) {
callback({
... | Add option to pass data back to callback | Add option to pass data back to callback
| JavaScript | unlicense | Vegosvar/Vegosvar,Vegosvar/Vegosvar,Vegosvar/Vegosvar |
478adc6cddce5001819006a2628aba7033da7990 | modules/map/services/measure/measure.factory.js | modules/map/services/measure/measure.factory.js | (function () {
'use strict';
angular
.module('dpMap')
.factory('measure', measureFactory);
measureFactory.$inject = ['$document', 'L', 'MEASURE_CONFIG'];
function measureFactory ($document, L, MEASURE_CONFIG) {
return {
initialize: initialize
};
fu... | (function () {
'use strict';
angular
.module('dpMap')
.factory('measure', measureFactory);
measureFactory.$inject = ['$document', '$rootScope', 'L', 'MEASURE_CONFIG', 'store', 'ACTIONS'];
function measureFactory ($document, $rootScope, L, MEASURE_CONFIG, store, ACTIONS) {
retu... | Hide the active overlays on 'measurestart'. | Hide the active overlays on 'measurestart'.
| JavaScript | mpl-2.0 | DatapuntAmsterdam/atlas,Amsterdam/atlas,DatapuntAmsterdam/atlas,DatapuntAmsterdam/atlas,DatapuntAmsterdam/atlas_prototype,Amsterdam/atlas,Amsterdam/atlas,Amsterdam/atlas,DatapuntAmsterdam/atlas_prototype |
9dc3dc91ee48137f7f72cae93fd770ba2b12ac33 | website/static/js/pages/home-page.js | website/static/js/pages/home-page.js | /**
* Initialization code for the home page.
*/
'use strict';
var $ = require('jquery');
var $osf = require('js/osfHelpers');
var quickSearchProject = require('js/quickProjectSearchPlugin');
var newAndNoteworthy = require('js/newAndNoteworthyPlugin');
var meetingsAndConferences = require('js/meetingsAndConferencesP... | /**
* Initialization code for the home page.
*/
'use strict';
var $ = require('jquery');
var $osf = require('js/osfHelpers');
var quickSearchProject = require('js/quickProjectSearchPlugin');
var newAndNoteworthy = require('js/newAndNoteworthyPlugin');
var meetingsAndConferences = require('js/meetingsAndConferencesP... | Reorder mounted elements. QuickSearch needs to load last. | Reorder mounted elements. QuickSearch needs to load last.
| JavaScript | apache-2.0 | abought/osf.io,TomBaxter/osf.io,CenterForOpenScience/osf.io,brianjgeiger/osf.io,TomBaxter/osf.io,zamattiac/osf.io,caneruguz/osf.io,binoculars/osf.io,monikagrabowska/osf.io,HalcyonChimera/osf.io,monikagrabowska/osf.io,RomanZWang/osf.io,mfraezz/osf.io,HalcyonChimera/osf.io,TomHeatwole/osf.io,mattclark/osf.io,mfraezz/osf.... |
e0eec4f09fd0bf6eb73f8ba2803ef25c5f61e007 | src/clients/appinsights/AppInsightsClient.js | src/clients/appinsights/AppInsightsClient.js | const appInsightsKey = process.env.FORTIS_SERVICES_APPINSIGHTS_KEY;
let client;
function setup() {
if (appInsightsKey) {
const appInsights = require('applicationinsights');
appInsights.setup(appInsightsKey);
appInsights.start();
client = appInsights.getClient(appInsightsKey);
}
}
function trackDe... | const appInsightsKey = process.env.FORTIS_SERVICES_APPINSIGHTS_KEY;
let client;
let consoleLog = console.log;
let consoleError = console.error;
let consoleWarn = console.warn;
function setup() {
if (appInsightsKey) {
const appInsights = require('applicationinsights');
appInsights.setup(appInsightsKey);
... | Send all console calls to app insights as traces | Send all console calls to app insights as traces
| JavaScript | mit | CatalystCode/project-fortis-services,CatalystCode/project-fortis-services |
51f6d5ff9122f6752fae62f1d2a070b837920178 | app/src/controllers/plugins/uiExtensions/selectors.js | app/src/controllers/plugins/uiExtensions/selectors.js | import { createSelector } from 'reselect';
import { enabledPluginNamesSelector } from '../selectors';
import { EXTENSION_TYPE_SETTINGS_TAB } from './constants';
import { uiExtensionMap } from './uiExtensionStorage';
export const createUiExtensionSelectorByType = (type) =>
createSelector(enabledPluginNamesSelector, (... | import { createSelector } from 'reselect';
import { EXTENSION_TYPE_SETTINGS_TAB } from './constants';
import { enabledPluginNamesSelector } from '../selectors';
import { uiExtensionMap } from './uiExtensionStorage';
export const createUiExtensionSelectorByType = (type) =>
createSelector(enabledPluginNamesSelector, (... | Allow plugins to add own tabs to project settings | EPMRPP-47707: Allow plugins to add own tabs to project settings
| JavaScript | apache-2.0 | reportportal/service-ui,reportportal/service-ui,reportportal/service-ui |
717199f14ccbd4bedf15568e935c4d9c7da2e5df | src/mui/layout/Notification.js | src/mui/layout/Notification.js | import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import Snackbar from 'material-ui/Snackbar';
import { hideNotification as hideNotificationAction } from '../../actions/notificationActions' ;
class Notification extends React.Component {
handleRequestClose = () => {
this.props... | import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import Snackbar from 'material-ui/Snackbar';
import { hideNotification as hideNotificationAction } from '../../actions/notificationActions' ;
function getStyles(context) {
if (!context) return { primary1Color: '#00bcd4', accent1Color:... | Use theme colors in notifications | Use theme colors in notifications
Closes #177
| JavaScript | mit | marmelab/admin-on-rest,matteolc/admin-on-rest,marmelab/admin-on-rest,matteolc/admin-on-rest |
42cca2bd3411e45f38c0419faed5ccd9e5b01dcf | src/release/make-bower.json.js | src/release/make-bower.json.js | #!/usr/bin/env node
// Renders the bower.json template and prints it to stdout
var template = {
name: "graphlib",
version: require("../../package.json").version,
main: [ "dist/graphlib.core.js", "dist/graphlib.core.min.js" ],
ignore: [
".*",
"README.md",
"CHANGELOG.md",
"Makefile",
"browse... | #!/usr/bin/env node
// Renders the bower.json template and prints it to stdout
var packageJson = require("../../package.json");
var template = {
name: packageJson.name,
version: packageJson.version,
main: ["dist/" + packageJson.name + ".core.js", "dist/" + packageJson.name + ".core.min.js"],
ignore: [
".... | Check in improved bower generation script | Check in improved bower generation script
| JavaScript | mit | cpettitt/graphlib,dagrejs/graphlib,dagrejs/graphlib,kdawes/graphlib,cpettitt/graphlib,kdawes/graphlib,dagrejs/graphlib,gardner/graphlib,gardner/graphlib,leMaik/graphlib,leMaik/graphlib |
05aa4e055ff496566b5ea8301851bfb312a5aea9 | src/prepare.js | src/prepare.js | /**
* Prepare request configuration, deeply merging some specific keys
*/
var assign = require('./assign')
var toArray = require('./toArray')
var DEFAULTS = {
baseURL : '/',
basePath : '',
body : undefined,
params : undefined,
headers : {
'Accept': 'application/json'
},
method... | /**
* Prepare request configuration, deeply merging some specific keys
*/
var assign = require('./assign')
var toArray = require('./toArray')
var DEFAULTS = {
baseURL : '/',
basePath : '',
params : undefined,
headers : {
'Accept': 'application/json'
},
method : 'GET',
path ... | Remove body from configuration options | Remove body from configuration options
Merging `body` with defaults was problematic since `body`
is not always an object. For example, it might be `FormData`.
| JavaScript | mit | vigetlabs/gangway |
b678b02650046b6fbd8a74485158bec0e43ca851 | src/sandbox.js | src/sandbox.js | /* eslint-env mocha */
import Chai from 'chai';
import ChaiString from 'chai-string';
import Sinon from 'sinon';
import SinonChai from 'sinon-chai';
Chai.use(ChaiString);
Chai.use(SinonChai);
beforeEach(function() {
this.sandbox = Sinon.sandbox.create({
injectInto: this,
properties: ['spy', 'stub', 'mock'],... | /* eslint-env mocha */
import Chai from 'chai';
import ChaiString from 'chai-string';
import Sinon from 'sinon';
import SinonChai from 'sinon-chai';
Chai.use(ChaiString);
Chai.use(SinonChai);
beforeEach(function() {
this.sandbox = Sinon.sandbox.create({
injectInto: this,
properties: ['spy', 'stub', 'mock'],... | Throw unhandled rejections in mocha tests | Throw unhandled rejections in mocha tests
Only works under >= 3.x, but will still help us potentially catch issues in test. | JavaScript | mit | kpdecker/linoleum-node,kpdecker/linoleum-electron,kpdecker/linoleum,kpdecker/linoleum-webpack,kpdecker/linoleum-electron |
0014d16e589aecb8cbaeb5832fa73bc70cf86485 | lib/control/v1/index.js | lib/control/v1/index.js | 'use strict';
const AWS = require('aws-sdk');
const Err = require('./error');
const upload = require('multer')();
const rp = require('request-promise');
// Hit the Vault health check endpoint to see if we're actually working with a Vault server
/**
* Checks whether there is an actual Vault server running at the Va... | 'use strict';
const AWS = require('aws-sdk');
const Err = require('./error');
const upload = require('multer')();
const rp = require('request-promise');
// Hit the Vault health check endpoint to see if we're actually working with a Vault server
/**
* Checks whether there is an actual Vault server running at the Va... | Move KMS key retrieval to its own function. | Move KMS key retrieval to its own function.
| JavaScript | mit | rapid7/acs,rapid7/acs,rapid7/acs |
96bc5c0b0bddf63d729116a55288621b00b1401c | test/helpers/fixtures/index.js | test/helpers/fixtures/index.js | var fixtures = require('node-require-directory')(__dirname);
exports.load = function *(specificFixtures) {
if (typeof specificFixtures === 'string') {
specificFixtures = [specificFixtures];
}
try {
yield exports.unload();
var keys = Object.keys(fixtures).filter(function(key) {
if (specificFix... | var fixtures = require('node-require-directory')(__dirname);
exports.load = function *(specificFixtures) {
if (typeof specificFixtures === 'string') {
specificFixtures = [specificFixtures];
}
var prevSetting = sequelize.options.logging;
sequelize.options.logging = false;
try {
yield exports.unload()... | Disable logging sql when creating tables | Disable logging sql when creating tables
| JavaScript | mit | wikilab/wikilab-api |
9a024fcf6cf762ae7a335daf642171a12f4e05f5 | src/state/markerReducer.js | src/state/markerReducer.js | import { Map } from 'immutable';
import {
SIZE_3,
BLACK
} from './markerConstants';
export const initialMarker = Map({
size: SIZE_3,
color: BLACK
});
import { CHANGE_COLOR, CHANGE_SIZE } from './../../src/client/app/toolbar/toolbarActions';
const markerReducer = (state = initialMarker, action) => {
switch... | import { Map } from 'immutable';
import {
BLACK,
SIZE_3,
DRAW
} from './markerConstants';
export const initialMarker = Map({
color: BLACK,
size: SIZE_3,
mode: DRAW
});
import {
CHANGE_COLOR,
CHANGE_SIZE,
CHANGE_MODE
} from './../../src/client/app/toolbar/toolbarActions';
const markerReducer = (sta... | Add mode field to marker state, add reducer case for CHANGE_MODE | Add mode field to marker state, add reducer case for CHANGE_MODE
| JavaScript | bsd-3-clause | jackrzhang/boardsession,jackrzhang/boardsession |
96d5a31937f2cbcef7c62d5551a5c633743a677f | lib/elements/helpers.js | lib/elements/helpers.js | 'use babel'
/* @flow */
import type { Message } from '../types'
export function visitMessage(message: Message) {
const messageFile = message.version === 1 ? message.filePath : message.location.file
const messageRange = message.version === 1 ? message.range : message.location.position
atom.workspace.open(messag... | 'use babel'
/* @flow */
import type { Message } from '../types'
const nbsp = String.fromCodePoint(160)
export function visitMessage(message: Message) {
const messageFile = message.version === 1 ? message.filePath : message.location.file
const messageRange = message.version === 1 ? message.range : message.locati... | Use a non-hacky way to replace nbsp | :art: Use a non-hacky way to replace nbsp
| JavaScript | mit | AtomLinter/linter-ui-default,steelbrain/linter-ui-default,steelbrain/linter-ui-default |
14c5bfeee4b331919ebf34379ebb52b834cc8f36 | lib/helpers/retrieve.js | lib/helpers/retrieve.js | 'use strict';
/**
* @file Retrieve files for the account
*/
/**
* Download all files from the specified Google Account.
*
* @param {String} refreshToken Refresh_token to identify the account
* @param {Date} since Retrieve contacts updated since this date
* @param {Function} cb Callback. First parameter is the e... | 'use strict';
/**
* @file Retrieve files for the account
*/
/**
* Download all files from the specified Google Account.
*
* @param {String} refreshToken Refresh_token to identify the account
* @param {Date} since Retrieve contacts updated since this date
* @param {Function} cb Callback. First parameter is the e... | Fix a little bug with cursor | Fix a little bug with cursor
| JavaScript | mit | AnyFetch/gdrive-provider.anyfetch.com |
df5d7d39519382440574e9f210895089e75b0d6a | src/elements/CustomHTMLAnchorElement-impl.js | src/elements/CustomHTMLAnchorElement-impl.js | import { setTheInput } from './URLUtils-impl.js';
import { setAll as setPrivateMethods } from './private-methods.js';
export default class CustomHTMLAnchorElementImpl {
createdCallback() {
doSetTheInput(this);
}
attributeChangedCallback(name) {
if (name === 'href') {
doSetTheInput(this);
}
}... | import { setTheInput } from './URLUtils-impl.js';
import { setAll as setPrivateMethods } from './private-methods.js';
export default class CustomHTMLAnchorElementImpl {
createdCallback() {
doSetTheInput(this);
addDefaultEventListener(this, 'click', () => window.location.href = this.href);
}
attributeCh... | Add behavior to navigate to the new URL! | Add behavior to navigate to the new URL!
| JavaScript | apache-2.0 | zenorocha/html-as-custom-elements,zenorocha/html-as-custom-elements,valmzetvn/html-as-custom-elements,domenic/html-as-custom-elements,valmzetvn/html-as-custom-elements,domenic/html-as-custom-elements,domenic/html-as-custom-elements,valmzetvn/html-as-custom-elements |
c04f1d42eee5fb1ad6aa397059a9a647a5da057b | tasks/index.js | tasks/index.js | import gulp from 'gulp'
import { fonts } from './fonts'
import { images } from './images'
import { scripts } from './webpack'
import { styles } from './styles'
export function watch() {
gulp.watch('./resources/assets/sass/**/*.scss', styles);
gulp.watch('./resources/js/**/*.js', scripts);
gulp.watch('./re... | import gulp from 'gulp'
import { fonts } from './fonts'
import { images } from './images'
import { scripts } from './webpack'
import { styles } from './styles'
function watch_task() {
gulp.watch('./resources/assets/sass/**/*.scss', styles);
gulp.watch('./resources/js/**/*.js', scripts);
gulp.watch('./reso... | Make watch task compile everything first | Make watch task compile everything first
| JavaScript | mit | OParl/dev-website,OParl/dev-website,OParl/dev-website |
769f69a05366f37150e5b94240eb60586f162f19 | imports/api/database-controller/graduation-requirement/graduationRequirement.js | imports/api/database-controller/graduation-requirement/graduationRequirement.js | import { mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
class GraduationRequirementCollection extends Mongo.Collection {}
const GraduationRequirements = new GraduationRequirementCollection('gradiationRequirement');
const gradRequirementSchema = {
requirementName: {
typ... | import { mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
/// This Component handles the initialization of the graduation requirement collection
/// requirementModule should be in he following format :
/// module code: boolean true/false
/// e.g : CS1231: false
/// the boolean i... | ADD collection description to the graduation Requirement database | ADD collection description to the graduation Requirement database
| JavaScript | mit | nus-mtp/nus-oracle,nus-mtp/nus-oracle |
47ff4ef345faf3fcf2dc2ab2c57f460df3719b96 | week-7/game.js | week-7/game.js | // Design Basic Game Solo Challenge
// This is a solo challenge
// Your mission description:
// Overall mission: Create madlibs game!
// Goals: Prompt user for input for various nouns, adjectives, and names. Set up alert that shows small bits of storyline with user input inserted.
// Characters: N/A
// Objects: Story... | // Design Basic Game Solo Challenge
// This is a solo challenge
// Your mission description:
// Overall mission: Create madlibs game!
// Goals: Prompt user for input for various nouns, adjectives, and names. Insert selected keywords into story-line, and print completed script.
// Characters: NA
// Objects: Field boxe... | Add reflection to solo challenge | Add reflection to solo challenge
| JavaScript | mit | sharonjean/phase-0,sharonjean/phase-0,sharonjean/phase-0 |
568418926c9ce41e85afaa9ed57b1f8c670d297c | test/build.js | test/build.js | const test = require('ava')
const { tmpdir } = require('os')
const { join } = require('path')
const rollup = require('rollup')
const config = require('../rollup.config')
test('build: creates a valid bundle', async assert => {
const bundle = await rollup.rollup(config)
const file = join(tmpdir(), 'bundle.js')
awa... | const test = require('ava')
const { tmpdir } = require('os')
const { join } = require('path')
const rollup = require('rollup')
const config = require('../rollup.config')
test.skip('build: creates a valid bundle', async assert => {
const bundle = await rollup.rollup(config)
const file = join(tmpdir(), 'bundle.js')
... | Add a failing test case | Add a failing test case
| JavaScript | mit | buxlabs/ast |
573e68252c868d450fee7764fbf1d49143b4e4c5 | test.js | test.js | var set = require('./index.js');
var assert = require('assert');
describe('mocha-let', function() {
var object = {};
set('object', () => object);
it("allows accessing the return value of the given function as the specified property on `this`", function() {
assert.equal(this.object, object);
});
});
| var set = require('./index.js');
var assert = require('assert');
describe('mocha-let', function() {
var object = {};
set('object', () => object);
context("in a sub-context", function() {
var aDifferentObject = {};
set('object', () => aDifferentObject);
it("allows overriding the value of an existing... | Allow overriding previously set values | Allow overriding previously set values
| JavaScript | mit | Ajedi32/mocha-let |
f5d0ab8fed19b9f61f089c1cd7ff01d457e33e93 | springfox-swagger-ui/src/web/js/springfox.js | springfox-swagger-ui/src/web/js/springfox.js | $(function() {
var springfox = {
"baseUrl": function() {
var urlMatches = /(.*)\/swagger-ui.html.*/.exec(window.location.href);
return urlMatches[1];
},
"securityConfig": function(cb) {
$.getJSON(this.baseUrl() + "/configuration/security", function(data) {... | $(function() {
var springfox = {
"baseUrl": function() {
var urlMatches = /(.*)\/swagger-ui.html.*/.exec(window.location.href);
return urlMatches[1];
},
"securityConfig": function(cb) {
$.getJSON(this.baseUrl() + "/configuration/security", function(data) {... | Allow loading of external urls specified in the swagger resource location | Allow loading of external urls specified in the swagger resource location
resolves #843
| JavaScript | apache-2.0 | erikthered/springfox,springfox/springfox,RobWin/springfox,maksimu/springfox,RobWin/springfox,vmarusic/springfox,vmarusic/springfox,thomsonreuters/springfox,acourtneybrown/springfox,thomasdarimont/springfox,thomsonreuters/springfox,zorosteven/springfox,zorosteven/springfox,choiapril6/springfox,vmarusic/springfox,RobWin/... |
c2618f02b207a1c9a93638d2209532fd60d5805a | karma.conf.ci.js | karma.conf.ci.js | module.exports = function(config) {
require("./karma.conf")(config);
config.set({
customLaunchers: {
SL_Chrome: {
base: 'SauceLabs',
browserName: 'chrome',
version: '35'
},
SL_Firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: '30'
... | module.exports = function(config) {
require("./karma.conf")(config);
config.set({
customLaunchers: {
SL_Chrome: {
base: 'SauceLabs',
browserName: 'chrome',
version: '35'
},
SL_Firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: '30'
... | Set startConnect: false and tunnelIdentifier | Set startConnect: false and tunnelIdentifier
Reference: https://github.com/karma-runner/karma-sauce-launcher/issues/73
| JavaScript | mit | exogen/script-atomic-onload |
a87dfa91ebfe7816cfdd2770903a09719b7710d6 | biz/webui/cgi-bin/lookup-tunnel-dns.js | biz/webui/cgi-bin/lookup-tunnel-dns.js | var url = require('url');
var properties = require('../lib/properties');
var rules = require('../lib/proxy').rules;
var util = require('../lib/util');
module.exports = function(req, res) {
var tunnelUrl = properties.get('showHostIpInResHeaders') ? req.query.url : null;
if (typeof tunnelUrl != 'string') {
tunne... | var url = require('url');
var properties = require('../lib/properties');
var rules = require('../lib/proxy').rules;
var util = require('../lib/util');
module.exports = function(req, res) {
var tunnelUrl = properties.get('showHostIpInResHeaders') ? req.query.url : null;
if (typeof tunnelUrl != 'string') {
tunne... | Use resolveRule instead of resolveRules | refactor: Use resolveRule instead of resolveRules
| JavaScript | mit | avwo/whistle,avwo/whistle |
daa89751125bd9d00502f80fbae96fcd032092e2 | webpack.config.js | webpack.config.js | var version = require('./package.json').version;
module.exports = {
entry: './lib',
output: {
filename: './dist/index.js',
library: ['jupyter', 'services'],
libraryTarget: 'umd',
publicPath: 'https://npmcdn.com/jupyter-js-services@' + version + '/dist/'
},
devtool: 'sour... | var version = require('./package.json').version;
module.exports = {
entry: './lib',
output: {
filename: './dist/index.js',
library: 'jupyter-js-services',
libraryTarget: 'umd',
umdNamedDefine: true,
publicPath: 'https://npmcdn.com/jupyter-js-services@' + version + '/dist... | Unify the library name and export the amd name | Unify the library name and export the amd name
| JavaScript | bsd-3-clause | jupyterlab/services,blink1073/jupyter-js-services,blink1073/services,jupyterlab/services,jupyter/jupyter-js-services,blink1073/services,blink1073/jupyter-js-services,blink1073/jupyter-js-services,blink1073/services,jupyter/jupyter-js-services,blink1073/services,jupyter/jupyter-js-services,jupyterlab/services,jupyter/ju... |
106d0c0f3d824631fc6decd139dd9d6e7d3aca88 | tools/fake-database-service.js | tools/fake-database-service.js | 'use strict';
function FakeDatabaseService() {
}
module.exports = FakeDatabaseService;
FakeDatabaseService.prototype = {
run: function(query, callback) {
return callback(null, {});
},
createTable: function(targetTableName, query, callback) {
return callback(null, {});
},
getCol... | 'use strict';
function FakeDatabaseService() {
}
module.exports = FakeDatabaseService;
FakeDatabaseService.prototype = {
run: function(query, callback) {
return callback(null, {});
},
createTable: function(targetTableName, query, callback) {
return callback(null, {});
},
create... | Complete fake database service with missing stubs | Complete fake database service with missing stubs
| JavaScript | bsd-3-clause | CartoDB/camshaft |
814947e84a55a47a076be389579e458c556ec259 | test/services/helpers/services/testSystem.js | test/services/helpers/services/testSystem.js | let createdSystemIds = [];
const createTestSystem = app => ({ url, type = 'moodle' }) => app.service('systems').create({ url, type })
.then((system) => {
createdSystemIds.push(system._id.toString());
return system;
});
const cleanup = app => () => {
const ids = createdSystemIds;
createdSystemIds = [];
retur... | let createdSystemIds = [];
const createTestSystem = app => async (options = { url: '', type: 'moodle' }) => {
const system = await app.service('systems').create(options);
createdSystemIds.push(system._id.toString());
return system;
};
const cleanup = app => () => {
const ids = createdSystemIds;
createdSystemIds ... | Refactor and improve test systems | Refactor and improve test systems
| JavaScript | agpl-3.0 | schul-cloud/schulcloud-server,schul-cloud/schulcloud-server,schul-cloud/schulcloud-server |
a2f85d74c83803ed4b6155f7c1f54b2fe0a1e276 | index.js | index.js | 'use strict';
var assert = require('assert');
var WM = require('es6-weak-map');
var hasNativeWeakmap = require('es6-weak-map/is-native-implemented');
var defaultResolution = require('default-resolution');
var runtimes = new WM();
function isFunction(fn){
return (typeof fn === 'function');
}
function isExtensible... | 'use strict';
var assert = require('assert');
var WM = require('es6-weak-map');
var hasWeakMap = require('es6-weak-map/is-implemented');
var defaultResolution = require('default-resolution');
var runtimes = new WM();
function isFunction(fn){
return (typeof fn === 'function');
}
function isExtensible(fn){
if(ha... | Improve native WeakMap check for newer node versions | Fix: Improve native WeakMap check for newer node versions
| JavaScript | mit | gulpjs/last-run,phated/last-run |
c90aeb8628b2a6a7c4d58954786c011f17ee743b | Tools/buildTasks/createGalleryList.js | Tools/buildTasks/createGalleryList.js | /*global importClass,project,attributes,elements,java,Packages*/
importClass(Packages.org.mozilla.javascript.tools.shell.Main); /*global Main*/
Main.exec(['-e', '{}']);
var load = Main.global.load;
load(project.getProperty('tasksDirectory') + '/shared.js'); /*global forEachFile,readFileContents,writeFileContents,File,... | /*global importClass,project,attributes,elements,java,Packages*/
importClass(Packages.org.mozilla.javascript.tools.shell.Main); /*global Main*/
Main.exec(['-e', '{}']);
var load = Main.global.load;
load(project.getProperty('tasksDirectory') + '/shared.js'); /*global forEachFile,readFileContents,writeFileContents,File,... | Fix gallery images for dev-only Sandcastle demos. | Fix gallery images for dev-only Sandcastle demos.
| JavaScript | apache-2.0 | kiselev-dv/cesium,soceur/cesium,AnimatedRNG/cesium,esraerik/cesium,CesiumGS/cesium,omh1280/cesium,kiselev-dv/cesium,kaktus40/cesium,NaderCHASER/cesium,jason-crow/cesium,omh1280/cesium,denverpierce/cesium,likangning93/cesium,emackey/cesium,NaderCHASER/cesium,geoscan/cesium,kaktus40/cesium,kiselev-dv/cesium,jason-crow/ce... |
e0ada96ceab737926231ef0bc8cb40c4ee753fd4 | examples/navigation/reducers/reposByUser.js | examples/navigation/reducers/reposByUser.js | import * as ActionTypes from '../ActionTypes';
export default function reposByUser(state = {}, action) {
switch (action.type) {
case ActionTypes.REQUESTED_USER_REPOS:
return {
...state,
[action.payload.user]: undefined
};
case ActionTypes.RECEIVED_USER_REPOS:
return {
... | import * as ActionTypes from '../ActionTypes';
export default function reposByUser(state = {}, action) {
switch (action.type) {
case ActionTypes.REQUESTED_USER_REPOS:
return Object.assign({}, state, {
[action.payload.user]: undefined
});
case ActionTypes.RECEIVED_USER_REPOS:
return ... | Use Object.assign instead of object spread | chore(examples): Use Object.assign instead of object spread
| JavaScript | mit | jesinity/redux-observable,jesinity/redux-observable,redux-observable/redux-observable,blesh/redux-observable,jesinity/redux-observable,redux-observable/redux-observable,blesh/redux-observable,redux-observable/redux-observable |
7af36c6a2875aeb49609149eaaed25b3c69ace03 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... | Use event delegation for reveal button | Use event delegation for reveal button
| JavaScript | mit | njarin/earp,njarin/earp,njarin/earp |
859ce78bbc41f14c233b700dd1836ac6fa5a553c | api/src/routes/data/cashflow/updateBalance.js | api/src/routes/data/cashflow/updateBalance.js | /**
* Update cash flow data
*/
const { DateTime } = require('luxon');
const joi = require('joi');
const { balanceSchema } = require('../../../schema');
function updateQuery(db, user, value) {
const { year, month, balance } = value;
const date = DateTime.fromObject({ year, month })
.endOf('month')
... | /**
* Update cash flow data
*/
const { DateTime } = require('luxon');
const joi = require('joi');
const { balanceSchema } = require('../../../schema');
function updateQuery(db, user, value) {
const { year, month, balance } = value;
const date = DateTime.fromObject({ year, month })
.endOf('month')
... | Fix replacement of balance items based on month | Fix replacement of balance items based on month
| JavaScript | mit | felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget |
d3d6e597f017e3b31529dffa14810c4d5e1e8584 | app/js/arethusa.sg/directives/sg_ancestors.js | app/js/arethusa.sg/directives/sg_ancestors.js | "use strict";
angular.module('arethusa.sg').directive('sgAncestors', [
'sg',
function(sg) {
return {
restrict: 'A',
scope: {
obj: '=sgAncestors'
},
link: function(scope, element, attrs) {
scope.requestGrammar = function(el) {
if (el.sections) {
sg.r... | "use strict";
angular.module('arethusa.sg').directive('sgAncestors', [
'sg',
function(sg) {
return {
restrict: 'A',
scope: {
obj: '=sgAncestors'
},
link: function(scope, element, attrs) {
scope.requestGrammar = function(el) {
if (el.sections) {
if (... | Make sg label clicking act like a toggle | Make sg label clicking act like a toggle
| JavaScript | mit | Masoumeh/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,Masoumeh/arethusa,fbaumgardt/arethusa,PonteIneptique/arethusa |
36c1441fc5fb4e4beb6130d4c1567c8e484f7517 | webpack.generate.umd.config.js | webpack.generate.umd.config.js | 'use strict';
var webpack = require('webpack');
var kitchensinkExternals = {
root: 'Kitchensink',
commonjs2: 'kitchensink',
commonjs: 'kitchensink',
amd: 'kitchensink'
};
module.exports = {
externals: {
'kitchensink': kitchensinkExternals
},
module: {
loaders: [
{ test: /\.js$/, loaders: ... | 'use strict';
var webpack = require('webpack');
var kitchensinkExternals = {
root: 'Kitchensink',
commonjs2: 'kitchensink',
commonjs: 'kitchensink',
amd: 'kitchensink'
};
module.exports = {
externals: {
'kitchensink': kitchensinkExternals
},
module: {
loaders: [
{ test: /\.js$/, loaders: ... | Update umd bundle to use css loader for css files | Update umd bundle to use css loader for css files
| JavaScript | mit | DispatchMe/kitchen |
e307faf42079076b9f4be177e21fb73214a25866 | lib/fiber-utils.js | lib/fiber-utils.js | var Fiber = require('fibers');
var Future = require('fibers/future');
var _ = require('underscore');
var assert = require('assert');
// Makes a function that returns a promise or takes a callback synchronous
exports.wrapAsync = function (fn, context) {
return function (/* arguments */) {
var self = context || th... | var Fiber = require('fibers');
var Future = require('fibers/future');
var _ = require('underscore');
var assert = require('assert');
// Makes a function that returns a promise or takes a callback synchronous
exports.wrapAsync = function (fn, context) {
return function (/* arguments */) {
var self = context || th... | Make wrapAsync support wrapping async functions that return a promise | Make wrapAsync support wrapping async functions that return a promise
| JavaScript | mit | boom-fantasy/chimp,intron/chimp,boom-fantasy/chimp,intron/chimp |
92cdfc7c3656c760488c2f79fe6621b7da8f5e9c | examples/play_soundfile/sketch.js | examples/play_soundfile/sketch.js | // ====================
// DEMO: play a sound at a random speed/pitch when the ball hits the edge
// ====================
// create a variable for the sound file
var soundFile;
function setup() {
createCanvas(400, 400);
background(0);
// create a SoundFile
soundFile = loadSound( ['../_files/beatbox.ogg', '..... | // ====================
// DEMO: play a sound when the user presses a key
// ====================
// create a variable for the sound file
var soundFile;
function setup() {
createCanvas(400, 400);
background(0);
// create a SoundFile
soundFile = loadSound( ['../_files/beatbox.ogg', '../_files/beatbox.mp3'] );... | Fix top description. Probably copied from another file. | Fix top description. Probably copied from another file. | JavaScript | mit | polyrhythmatic/p5.js-sound,therewasaguy/p5.js-sound,chelliah/p5.js-sound,processing/p5.js-sound,chelliah/p5.js-sound,therewasaguy/p5.js-sound,polyrhythmatic/p5.js-sound,processing/p5.js-sound |
d54a0ab97ee7c4cbe5952d4a0d4edd9cd5464a72 | panthrMath/polynomial.js | panthrMath/polynomial.js | (function(define) {'use strict';
define(function(require) {
// creates a polynomial function from the array of coefficients
// for example, if the function is ax^3 + bx^2 + cx + d
// the array is [a, b, c, d], that is, the array indexing is
// the reverse of the usual coefficient indexing
function Polyn... | (function(define) {'use strict';
define(function(require) {
// creates a polynomial function from the array of coefficients
// for example, if the function is ax^3 + bx^2 + cx + d
// the array is [a, b, c, d], that is, the array indexing is
// the reverse of the usual coefficient indexing
function Polyn... | Add "new" constructor wrapper to Polynomial. | Add "new" constructor wrapper to Polynomial.
| JavaScript | mit | PanthR/panthrMath,PanthR/panthrMath |
b51782f687e45449841d310c5727481dab31853e | src/about/about.js | src/about/about.js | // about.js
"use strict";
import { welcome } from "../welcome/welcome";
if (NODE_ENV == DEV_ENV) {
welcome("about");
console.log(NODE_ENV);
}
export { welcome };
| // about.js
"use strict";
import { welcome } from "../welcome/welcome";
if (NODE_ENV == DEV_ENV) {
welcome("about");
console.log(NODE_ENV);
}
$.when( $.ready ).then(function() {
let $jqButton = $("#testJQuery");
function testJQueryHandler(e) {
e.preventDefault();
let $listItems = $("ul > li");
... | Add code for jquery test | Add code for jquery test
| JavaScript | mit | var-bin/webpack-training,var-bin/webpack-training,var-bin/webpack-training,var-bin/webpack-training |
d2770b64828741f5cb6234e838238cd1fa8cc7d4 | extensions/php/build/update-grammar.js | extensions/php/build/update-grammar.js | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | Fix all string throw statements | Fix all string throw statements
| JavaScript | mit | eamodio/vscode,DustinCampbell/vscode,cleidigh/vscode,gagangupt16/vscode,rishii7/vscode,microsoft/vscode,KattMingMing/vscode,gagangupt16/vscode,0xmohit/vscode,gagangupt16/vscode,mjbvz/vscode,Microsoft/vscode,hoovercj/vscode,mjbvz/vscode,KattMingMing/vscode,the-ress/vscode,the-ress/vscode,hoovercj/vscode,microsoft/vscode... |
801f00141ccd1f1a2314566a6778ce45fc2cf83f | src/stores/GeoObjectsStore.js | src/stores/GeoObjectsStore.js | 'use strict';
var AbstractStore = require('stores/AbstractStore');
var assign = require('object-assign');
var GeoAppDispatcher = require('../dispatcher/GeoAppDispatcher');
var GeoAppActionsConstants = require('constants/GeoAppActions');
var LocalStoreDataProvider = require('stores/LocalStorageDataProvider');
var GeoO... | 'use strict';
var AbstractStore = require('stores/AbstractStore');
var assign = require('object-assign');
var GeoAppDispatcher = require('../dispatcher/GeoAppDispatcher');
var GeoAppActionsConstants = require('constants/GeoAppActions');
var LocalStoreDataProvider = require('stores/LocalStorageDataProvider');
var GeoO... | Remove object from local storage hook | Remove object from local storage hook
| JavaScript | apache-2.0 | NVBespalov/Geo,NVBespalov/Geo |
74ea5c4200e3fd8fde5a8ccb310f526a08591baf | routes.js | routes.js | var Backbone = require('backbone');
var $ = require('jquey');
Backbone.$ = $;
module.exports = function(app) {
// app.get('/', function(req, res) {
// res.send('Hello, world!');
// });
};
| 'use strict';
var YelpAPI = require('./lib/yelp-api');
var yelpAPI = new YelpAPI({
// To do: un-hard-code keys for Heroku
consumerKey: 'LF09pfePJ5IAB7MYcnRkaQ',
consumerSecret: '8QABPQRA-VZpVtCk6gXmPc-rojg',
token: 'dPrd7L96SseVYeQGvoyVtf1Dy9n3mmrT',
tokenSecret: 'W9Br5z5nKGHkScKBik9XljJEAoE',
});
module.exports... | Add API endpoint for Yelp queries | Add API endpoint for Yelp queries
| JavaScript | mit | Localhost3000/along-the-way |
54bc8ccb16e3f9578ccbbf937d2b6097504bd7ca | src/web/helpers/serveBuild.js | src/web/helpers/serveBuild.js | const path = require('path');
const mime = require('mime');
function serveBuild(registry) {
return async function(req, res, next) {
const username = req.user && req.user.username;
const branchId = await registry.models.user.getBranch(username);
const {bucketId, overlays} = await registry.models.branch.ge... | const path = require('path');
const mime = require('mime');
function serveBuild(registry) {
return async function(req, res, next) {
const username = req.user && req.user.username;
const branchId = await registry.models.user.getBranch(username);
const {bucketId, overlays} = await registry.models.branch.ge... | Make sure that we normalize paths. | Make sure that we normalize paths.
| JavaScript | mpl-2.0 | hellojwilde/gossamer-server |
60758057ddffc61b4cf215581f7cbb94ff1bba77 | client/js/controllers/photo-stream-controller.js | client/js/controllers/photo-stream-controller.js | "use strict";
var PhotoStreamController = function($scope, $http, $log, $timeout, analytics, resourceCache) {
$http({method: "GET", url: "/api/v1/hikes?fields=distance,locality,name,photo_facts,photo_preview,string_id", cache: resourceCache}).
success(function(data, status, headers, config) {
var hikes = jQuery.... | "use strict";
var PhotoStreamController = function($scope, $http, $log, $timeout, analytics, resourceCache) {
$http({method: "GET", url: "/api/v1/hikes?fields=distance,locality,name,photo_facts,photo_preview,string_id", cache: resourceCache}).
success(function(data, status, headers, config) {
// Only show the hi... | Undo changes to /discover page. | Undo changes to /discover page.
| JavaScript | mit | zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io |
cb5eed88e490fe90881be7310caaf0593f99aa8f | server.js | server.js | var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
var port = process.env.PORT || 3000;
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true
}).listen(port, 'localhost', fun... | var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
var port = process.env.PORT || 3000;
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true
}).listen(port, function (err, r... | Allow to bind to any port | Allow to bind to any port
| JavaScript | mit | macilry/technozaure-graphql,jjbohn/graphql-blog-schema,abdulhannanali/graphql-sandbox,kadirahq/graphql-blog-schema,macilry/technozaure-graphql,kadirahq/graphql-blog-schema,jjbohn/graphql-blog-schema,kadirahq/graphql-blog-schema,macilry/technozaure-graphql,jjbohn/graphql-blog-schema,abdulhannanali/graphql-sandbox,abdulh... |
b267607732ba521ec771152a5a07ec73f7174dfc | weighthub/actionhandlers/calibrateHandler.js | weighthub/actionhandlers/calibrateHandler.js | const quantize = require('../quantizer');
const TARGETS = ['zero', 'full', 'empty'];
function calibrate(weightsRef, sensorsRef, action) {
const {id, target} = action;
let valRef = sensorsRef.child(id + '/value');
let weightRef = weightsRef.child(id);
if(TARGETS.includes(target)) {
weightRef.once('value', ... | const quantize = require('../quantizer');
const TARGETS = ['zero', 'full', 'empty'];
function calibrate(weightsRef, sensorsRef, action) {
const {id, target} = action;
let valRef = sensorsRef.child(id + '/value');
let weightRef = weightsRef.child(id);
if(TARGETS.includes(target)) {
weightRef.once('value', ... | Fix calibration to not crash on undefined | Fix calibration to not crash on undefined
| JavaScript | mit | mapster/WeightyBeer,mapster/WeightyBeer,mapster/WeightyBeer,mapster/WeightyBeer |
c01eebd47c87151477bd21845efeb9578eab8e45 | tasks/task-style-compile.js | tasks/task-style-compile.js | var gulp = require("gulp");
var CFG = require("./utils/config.js");
var $ = require("gulp-load-plugins")();
var path = require("path");
var pkg = require(path.join("..", CFG.FILE.config.pkg));
var argv = require("yargs").argv;
var notify = require("./utils/notify-style-compile");
/**
* style:compile
... | var gulp = require("gulp");
var CFG = require("./utils/config.js");
var $ = require("gulp-load-plugins")();
var path = require("path");
var pkg = require(path.join("..", CFG.FILE.config.pkg));
var exec = require("child_process").exec;
var argv = require("yargs").argv;
var notify = require("./utils/no... | Remove dependency on blacklisted gem, gulp-compass. | Remove dependency on blacklisted gem, gulp-compass.
| JavaScript | mit | rishabhsrao/voxel,rishabhsrao/voxel,rishabhsrao/voxel |
71fd14452b4e6f584e937c17666f4e669ac8bd25 | src/js/tabs/usd.js | src/js/tabs/usd.js | var util = require('util'),
Tab = require('../client/tab').Tab;
var UsdTab = function ()
{
Tab.call(this);
};
util.inherits(UsdTab, Tab);
UsdTab.prototype.tabName = 'usd';
UsdTab.prototype.mainMenu = 'fund';
UsdTab.prototype.angularDeps = Tab.prototype.angularDeps.concat(['qr']);
UsdTab.prototype.generateHtm... | var util = require('util'),
Tab = require('../client/tab').Tab;
var UsdTab = function ()
{
Tab.call(this);
};
util.inherits(UsdTab, Tab);
UsdTab.prototype.tabName = 'usd';
UsdTab.prototype.mainMenu = 'fund';
UsdTab.prototype.angularDeps = Tab.prototype.angularDeps.concat(['qr']);
UsdTab.prototype.generateHtm... | Fix total when the entered amount is blank | [FIX] Fix total when the entered amount is blank
| JavaScript | isc | wangbibo/ripple-client,yongsoo/ripple-client,ripple/ripple-client,Madsn/ripple-client,yxxyun/ripple-client-desktop,bankonme/ripple-client-desktop,bsteinlo/ripple-client,MatthewPhinney/ripple-client-desktop,Madsn/ripple-client,wangbibo/ripple-client,yongsoo/ripple-client,yongsoo/ripple-client-desktop,vhpoet/ripple-clien... |
ff1168a2e59b269486ef587018d4705dd80c75f7 | src/v3.js | src/v3.js | import {reactive} from 'vue';
import Auth from './auth.js';
// NOTE: Create pseudo Vue object for Vue 2 backwards compatibility.
function Vue (obj) {
var data = obj.data();
this.state = reactive(data.state);
}
Auth.prototype.install = function (app) {
app.auth = this;
app.config.globalPropertie... | import {inject } from 'vue'
import {reactive} from 'vue';
import Auth from './auth.js';
const authKey = 'auth';
// NOTE: Create pseudo Vue object for Vue 2 backwards compatibility.
function Vue (obj) {
var data = obj.data();
this.state = reactive(data.state);
}
Auth.prototype.install = function (app... | Update install / use to follow provide/inject key model. | Update install / use to follow provide/inject key model.
| JavaScript | mit | websanova/vue-auth |
95b10d1dbf19973c00253468ee175561347a1cd0 | live/tests/unit/models/snapshot-test.js | live/tests/unit/models/snapshot-test.js | import {expect} from 'chai';
import {describe, it} from 'mocha';
import {setupModelTest} from 'ember-mocha';
describe('Snapshot', function() {
setupModelTest('snapshot', {
// Specify the other units that are required for this test.
needs: []
});
// Replace this with your real tests.
it('exists', funct... | import {expect} from 'chai';
import {describe, it} from 'mocha';
import {setupModelTest} from 'ember-mocha';
describe('Snapshot', function() {
setupModelTest('snapshot', {
needs: []
});
it('exists', function() {
const model = this.subject();
expect(model).to.be.ok;
});
});
| Remove unused test in snapshot model | Remove unused test in snapshot model
| JavaScript | agpl-3.0 | sgmap/pix,sgmap/pix,sgmap/pix,sgmap/pix |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.