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 |
|---|---|---|---|---|---|---|---|---|---|
c77addad3e26ad040945acccf603d2937d66a0b1 | src/marbles/dispatcher.js | src/marbles/dispatcher.js | //= require ./core
(function () {
"use strict";
var __callbacks = [];
Marbles.Dispatcher = {
register: function (callback) {
__callbacks.push(callback);
var dispatchIndex = __callbacks.length - 1;
return dispatchIndex;
},
dispatch: function (event) {
var promises = __callbacks.map(function (callback) {
... | //= require ./core
(function () {
"use strict";
var __callbacks = [];
Marbles.Dispatcher = {
register: function (callback) {
__callbacks.push(callback);
var dispatchIndex = __callbacks.length - 1;
return dispatchIndex;
},
dispatch: function (event) {
var promises = __callbacks.map(function (callback) {
... | Update Dispatcher: dispatch resolves with results of callbacks | Update Dispatcher: dispatch resolves with results of callbacks
| JavaScript | bsd-3-clause | jvatic/marbles-js,jvatic/marbles-js |
f3bce3e7938f28c0dd6471ea8bbca5cecab44052 | duo-comment-links.user.js | duo-comment-links.user.js | // ==UserScript==
// @name Duolingo Comment Links
// @description Turn comment timestamps into direct links
// @match *://www.duolingo.com/*
// @author HodofHod
// @namespace HodofHod
// @version 0.0.3
// ==/UserScript==
function inject(f) {
var script = document.createElement('scrip... | // ==UserScript==
// @name Duolingo Comment Links
// @description Turn comment timestamps into direct links
// @match *://www.duolingo.com/*
// @author HodofHod
// @namespace HodofHod
// @version 0.0.3
// ==/UserScript==
/*
Copyright (c) 2013-2014 HodofHod (https://github.com/HodofHod)
L... | Add Copyright and link to MIT License | Add Copyright and link to MIT License | JavaScript | mit | HodofHod/Userscripts |
cb49dac428723756d2529810a2614b9ceab67ad3 | web/src/stores/coords.js | web/src/stores/coords.js | import { observable, action } from 'mobx';
export default new class StoreCoords {
@observable
lat = 0
@observable
lng = 0
@observable
accuracy = 9999
@action
_update(...values) {
[ this.lat, this.lng, this.accuracy ] = values;
}
constructor() {
navigator.geolocation.watchPosition((e) => {
... | import { observable, action } from 'mobx';
export default new class StoreCoords {
@observable
lat = 0
@observable
lng = 0
@observable
accuracy = 9999
@action
_update(...values) {
[ this.lat, this.lng, this.accuracy ] = values;
}
constructor() {
if (navigator.geolocation) navigator.geolocatio... | Add Geolocation API compatibility check (web) | Add Geolocation API compatibility check (web)
| JavaScript | agpl-3.0 | karlkoorna/Bussiaeg,karlkoorna/Bussiaeg |
ca99ce59c3f7a40972470eb2194d116f33cccd45 | web/src/stores/coords.js | web/src/stores/coords.js | import { decorate, observable, action } from 'mobx';
class StoreCoords {
lat = 0
lng = 0
accuracy = 9999
// Update coordinates and accuracy in store.
update(coords) {
[ this.lat, this.lng, this.accuracy ] = [ coords.latitude || coords.lat, coords.longitude || coords.lng, coords.accuracy ];
}
constructor... | import { decorate, observable, action } from 'mobx';
import { opts as mapOpts } from 'views/Map/Map.jsx';
class StoreCoords {
lat = mapOpts.startLat
lng = mapOpts.startLng
accuracy = 9999
// Update coordinates and accuracy in store.
update(coords) {
[ this.lat, this.lng, this.accuracy ] = [ coords.latitude... | Fix map flashing outside country (web) | Fix map flashing outside country (web)
| JavaScript | agpl-3.0 | karlkoorna/Bussiaeg,karlkoorna/Bussiaeg |
596a5affa2f9411c6a4b0a1c28f3b0d917b5feee | Gruntfile.js | Gruntfile.js | /*
* grunt-liquibase
* https://github.com/chrisgreening/grunt-liquibase
*
* Copyright (c) 2014 Chris Greening
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Configuration to be run (and then tested).
liquibase: {... | /*
* grunt-liquibase
* https://github.com/chrisgreening/grunt-liquibase
*
* Copyright (c) 2014 Chris Greening
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Configuration to be run (and then tested).
liquibase: {... | Create test task to match package.json | Create test task to match package.json
| JavaScript | mit | cgreening/grunt-liquibase,MRN-Code/grunt-liquibase,idefy/grunt-liquibase,sameetn/grunt-liquibase |
f7ea307e8c3e21e53801f1327c5beeddcaf6fb4a | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
options: {
ieCompat: true,
strictImports: false,
syncImport: false,
report: 'min'
},
css: {
options: {
compress: false,
yuicompress: false
}... | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
options: {
ieCompat: true,
strictImports: false,
syncImport: false,
report: 'min'
},
css: {
options: {
compress: false,
yuicompress: false
}... | Add version to head of minified version | Add version to head of minified version
| JavaScript | mit | albertchau/Green,albertchau/Green |
36522ada53a64a129cb3519b4183da8084dced1c | app/assets/javascripts/services/dialog_editor_http_service.js | app/assets/javascripts/services/dialog_editor_http_service.js | ManageIQ.angular.app.service('DialogEditorHttp', ['$http', 'API', function($http, API) {
this.loadDialog = function(id) {
return API.get('/api/service_dialogs/' + id + '?attributes=content,buttons,label');
};
this.saveDialog = function(id, action, data) {
return API.post('/api/service_dialogs' + id, {
... | ManageIQ.angular.app.service('DialogEditorHttp', ['$http', 'API', function($http, API) {
this.loadDialog = function(id) {
return API.get('/api/service_dialogs/' + id + '?attributes=content,buttons,label');
};
this.saveDialog = function(id, action, data) {
return API.post('/api/service_dialogs' + id, {
... | Rename fqdn to fqname in DialogEditorHttpService | Rename fqdn to fqname in DialogEditorHttpService
https://bugzilla.redhat.com/show_bug.cgi?id=1553846
| JavaScript | apache-2.0 | ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic |
b3b78ff3a18bdfcc533e9f76e4d9ed251c4e6245 | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
jshint: {
grunt: {
src: ['Gruntfile.js']
},
main: {
src: ['tock.js'],
options: {
'browser': true,
'camelcase': true,
'curly': true,
'e... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
jshint: {
grunt: {
src: ['Gruntfile.js']
},
main: {
src: ['tock.js'],
options: {
'browser': true,
'camelcase': true,
'curly': true,
'd... | Add missing "devel" and "undef". Remove "indent" since it was moved to jscs. | Add missing "devel" and "undef". Remove "indent" since it was moved to jscs.
| JavaScript | mit | Falc/Tock.js |
4b2c8b781b824ebbc56376cd897a26d79bdfca4b | app/src/home/intro-animation/intro-anim.js | app/src/home/intro-animation/intro-anim.js | require('./intro-anim.sass');
const isTouchDevice = 'ontouchstart' in document.documentElement;
const ev = isTouchDevice ? 'touchend' : 'click';
const delay = isTouchDevice ? 1050 : 550;
document.getElementById('corners').addEventListener(ev, () => setTimeout(() => {
console.log('Animation finished');
}, delay));
| require('./intro-anim.sass');
const isTouchDevice = 'ontouchstart' in document.documentElement;
const ev = isTouchDevice ? 'touchend' : 'click';
const delay = isTouchDevice ? 1050 : 550;
document.getElementById('corners').addEventListener(ev, () => setTimeout(() => {
alert('You\'re in!');
}, delay));
| Implement user-visible alert after interaction | Implement user-visible alert after interaction
| JavaScript | mit | arkis/arkis.io,arkis/arkis.io |
71c798ac47b0e1c8ad4e10fd4e5a01a429a273bc | app/assets/javascripts/core/pixelator.js | app/assets/javascripts/core/pixelator.js | var Pixelator = function(data, partner) {
this.data = data;
this.partner = partner;
};
Pixelator.prototype = {
defaults: function() {
var default_context = this.data.context || {};
default_context.timestamp = new Date().getTime();
return default_context;
},
picker: function(key, options) {
va... | var Pixelator = function(data, partner) {
this.data = data;
this.partner = partner;
};
Pixelator.prototype = {
defaults: function() {
var default_context = this.data.context || {};
default_context.timestamp = new Date().getTime();
return default_context;
},
picker: function(key, options) {
va... | Return out of Pixelator.picker if no keys are provided | Return out of Pixelator.picker if no keys are provided
| JavaScript | mit | howaboutwe/pixelator,howaboutwe/pixelator |
d7327f575048b5735bf65fa0e0fc666601e26e25 | script/lib/lint-java-script-paths.js | script/lib/lint-java-script-paths.js | 'use strict'
const path = require('path')
const {spawn} = require('child_process')
const CONFIG = require('../config')
module.exports = async function () {
return new Promise((resolve, reject) => {
const eslint = spawn(
path.join('script', 'node_modules', '.bin', 'eslint'),
['--cache', '--format', ... | 'use strict'
const path = require('path')
const {spawn} = require('child_process')
const process = require('process')
const CONFIG = require('../config')
module.exports = async function () {
return new Promise((resolve, reject) => {
const eslintArgs = ['--cache', '--format', 'json']
if (process.argv.inclu... | Add script/lint --fix which fixes some code formatting issues via eslint | Add script/lint --fix which fixes some code formatting issues via eslint
| JavaScript | mit | brettle/atom,PKRoma/atom,PKRoma/atom,brettle/atom,atom/atom,Mokolea/atom,atom/atom,PKRoma/atom,Mokolea/atom,Mokolea/atom,brettle/atom,atom/atom |
78fa674d525f1165a26932c3b1dcb65da6f5f8e2 | scripts/get-latest-platform-tests.js | scripts/get-latest-platform-tests.js | "use strict";
if (process.env.NO_UPDATE) {
process.exit(0);
}
const path = require("path");
const fs = require("fs");
const request = require("request");
// Pin to specific version, reflecting the spec version in the readme.
// At the moment we are pinned to a branch.
//
// To get the latest commit:
// 1. Go to ht... | "use strict";
if (process.env.NO_UPDATE) {
process.exit(0);
}
const path = require("path");
const fs = require("fs");
const request = require("request");
// Pin to specific version, reflecting the spec version in the readme.
// At the moment we are pinned to a branch.
//
// To get the latest commit:
// 1. Go to ht... | Update to the latest web platform tests | Update to the latest web platform tests
These just add additional coverage.
| JavaScript | mit | jsdom/whatwg-url,jsdom/whatwg-url,jsdom/whatwg-url |
9fc4be566d1d4f7f68eafc35c4659cb246654936 | test/setup.js | test/setup.js | require('babel-register');
require('coffee-script/register');
| require('coffee-script/register');
require('babel-register');
require('source-map-support').install({ handleUncaughtExceptions: false, hookRequire: true });
| Fix stack traces for errors happening inside coffee-script tests. | fix: Fix stack traces for errors happening inside coffee-script tests.
Both `coffee-script` as well as `source-map-support` (loaded through `babel-register`) patch `Error.prepareStackTrace` to modify stack traces to point to correct error locations for transpiled code. Unfortunately, these two patches don't play well ... | JavaScript | mit | tediousjs/tedious,tediousjs/tedious,pekim/tedious |
1142e1ddb10699a59790b1a144ca3570a307cc8a | examples/official-storybook/stories/core/rendering.stories.js | examples/official-storybook/stories/core/rendering.stories.js | import React, { useRef } from 'react';
export default {
title: 'Core/Rendering',
};
// NOTE: in our example apps each component is mounted twice as we render in strict mode
let timesMounted = 0;
export const Counter = () => {
const countRef = useRef();
if (!countRef.current) timesMounted += 1;
countRef.curre... | import React, { useEffect, useRef } from 'react';
import { useArgs } from '@storybook/client-api';
export default {
title: 'Core/Rendering',
};
// NOTE: in our example apps each component is mounted twice as we render in strict mode
let timesCounterMounted = 0;
export const Counter = () => {
const countRef = useR... | Add an example to highlight if a story renders too many times | Add an example to highlight if a story renders too many times
| JavaScript | mit | storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook |
4f1c5dd238b101a57207708e84da229364572eb9 | app/index.js | app/index.js | 'use strict';
var generators = require('yeoman-generator'),
_ = require('lodash');
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);
this.argument('appname', { type: String, required: true });
// And you can then access it later on this way... | 'use strict';
var generators = require('yeoman-generator'),
_ = require('lodash');
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);
this.argument('appname', { type: String, required: true });
this.viewName = _.startCase(this.appname);
... | Copy entire src directory not file by file | Copy entire src directory not file by file
| JavaScript | isc | rudijs/generator-ngpack,rudijs/generator-ngpack,rudijs/generator-ngpack |
2601075b3380a6488e8fe6adc45fcbf840d5897f | packages/accounts-google/google_client.js | packages/accounts-google/google_client.js | Meteor.loginWithGoogle = function (options, callback) {
// support both (options, callback) and (callback).
if (!callback && typeof options === 'function') {
callback = options;
options = {};
}
var config = Accounts.loginServiceConfiguration.findOne({service: 'google'});
if (!config) {
callback &... | Meteor.loginWithGoogle = function (options, callback) {
// support both (options, callback) and (callback).
if (!callback && typeof options === 'function') {
callback = options;
options = {};
} else if (!options) {
options = {};
}
var config = Accounts.loginServiceConfiguration.findOne({service: ... | Fix error on Meteor.loginWithGoogle() with no args | Fix error on Meteor.loginWithGoogle() with no args | JavaScript | mit | papimomi/meteor,aramk/meteor,dev-bobsong/meteor,yiliaofan/meteor,brdtrpp/meteor,zdd910/meteor,AlexR1712/meteor,lieuwex/meteor,juansgaitan/meteor,codingang/meteor,cog-64/meteor,yiliaofan/meteor,4commerce-technologies-AG/meteor,nuvipannu/meteor,Hansoft/meteor,jenalgit/meteor,cog-64/meteor,planet-training/meteor,Jeremy017... |
f5ef0965335933ef9c0cf694f7340fca60b1fd49 | baseError.js | baseError.js | function BaseError(data){
var oldLimit = Error.stackTraceLimit,
error;
Error.stackTraceLimit = 20;
error = Error.apply(this, arguments);
Error.stackTraceLimit = oldLimit;
if(Error.captureStackTrace){
Error.captureStackTrace(this, BaseError);
}
this.__genericError = true;... | var captureStackTrace = require('capture-stack-trace');
function BaseError(data){
var oldLimit = Error.stackTraceLimit,
error;
Error.stackTraceLimit = 20;
error = Error.apply(this, arguments);
Error.stackTraceLimit = oldLimit;
captureStackTrace(this, BaseError);
this.__genericError... | Use ponyfil for base error | Use ponyfil for base error
| JavaScript | mit | MauriceButler/generic-errors |
5323addedf2cfd1e42218d471b2ef96b70a64276 | example/tests/ntfjs.org.js | example/tests/ntfjs.org.js | var ntf = require('ntf')
, test = ntf.http('http://ntfjs.org')
exports.ntf = test.get('/', function(test) {
test.statusCode(200)
test.body('ntf')
test.done()
})
| var ntf = require('ntf')
, test = ntf.http('http://ntfjs.org')
exports.frontpage = test.get('/', function(test) {
test.statusCode(200)
test.body('ntf')
test.done()
})
exports.fail = test.get('/fail', function(test) {
test.statusCode(200)
test.done()
})
| Add failing test to example | Add failing test to example
| JavaScript | mit | shutterstock/ntfd |
16c50fd316a43c2b934ee2d4d0434166101ad849 | src/indicator-parameter/ParameterSearchController.js | src/indicator-parameter/ParameterSearchController.js | 'use strict';
// @ngInject
var ParameterSearchController = function($scope, $location, $controller, npdcAppConfig, Parameter) {
// Extend NpolarApiBaseController
$controller("NpolarBaseController", {
$scope: $scope
});
$scope.resource = Parameter;
npdcAppConfig.cardTitle = 'Environmental monitoring para... | 'use strict';
// @ngInject
var ParameterSearchController = function($scope, $location, $controller, npdcAppConfig, Parameter) {
// Extend NpolarApiBaseController
$controller("NpolarBaseController", {
$scope: $scope
});
$scope.resource = Parameter;
npdcAppConfig.cardTitle = 'Environmental monitoring para... | Sort on last updated first | Sort on last updated first
| JavaScript | mit | npolar/npdc-indicator,npolar/npdc-indicator |
2de4a243971aab231adbcab0e67e21570cdbd971 | index.js | index.js | /**
* Run the first test with "focus" tag.
*
* @param {Object} hydro
* @api public
*/
module.exports = function(hydro) {
if (!hydro.get('focus')) return;
var focus = false;
hydro.on('pre:test', function(test) {
if (focus) return test.skip();
if (test.meta.indexOf('focus') != -1) focus = true;
});
... | /**
* Run the first test with "focus" tag.
*
* @param {Object} hydro
* @api public
*/
module.exports = function(hydro) {
if (!hydro.get('focus')) return;
var focus = false;
hydro.on('pre:test', function(test) {
if (focus || test.meta.indexOf('focus') == -1) return test.skip();
focus = true;
});
};... | Fix bug where it will run more tests than desired | Fix bug where it will run more tests than desired
| JavaScript | mit | hydrojs/focus |
6a30ee8c3487069be065e1b82df578bbc8cd806b | src/router/index.js | src/router/index.js | import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
import Home from './Home';
// import Counter from './Counter'
const Counter = resolve => require.ensure([], () => resolve(require('./Counter').default), 'counter');
const GeographicalIp = resolve => require.ensure([], () => resolve(requir... | import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
import Home from './Home';
// import Counter from './Counter'
const Counter = resolve => require.ensure([], () => resolve(require('./Counter').default), 'counter');
const GeographicalIp = resolve => require.ensure([], () => resolve(requir... | Add title for every router | feat: Add title for every router
use router.afterEach to set document title.
| JavaScript | mit | scopewu/vue-vuex-starter-kit,scopewu/vue-vuex-starter-kit |
77030bd69fdba772e4632443ea0328ffc4f3370b | src/components/GroupRolesView.js | src/components/GroupRolesView.js | import React from 'react'
const GroupRolesView = () => (
<div/>
)
export default GroupRolesView
| import React from 'react'
import {connect} from 'react-redux'
import {compose, withHandlers, withProps, withState} from 'recompose'
import {addMemberToRole, addRoleToGroup} from '../actions/groups'
const mapStateToProps = ({groups}) => ({
groups
})
const enhance = compose(
connect(mapStateToProps),
withProps((... | Add form for role view | Add form for role view
| JavaScript | mit | mg4tv/mg4tv-web,mg4tv/mg4tv-web |
124a16c6fee95c52f0a20a6bba3d948b2d8724c5 | index.js | index.js | /* eslint-env node */
'use strict';
const fastbootTransform = require('fastboot-transform');
const filesToImport = [
'dependencyLibs/inputmask.dependencyLib.js',
'inputmask.js',
'inputmask.extensions.js',
'inputmask.date.extensions.js',
'inputmask.numeric.extensions.js',
'inputmask.phone.extensions.js'
];... | /* eslint-env node */
'use strict';
const fastbootTransform = require('fastboot-transform');
const filesToImport = [
'dependencyLibs/inputmask.dependencyLib.js',
'inputmask.js',
'inputmask.extensions.js',
'inputmask.date.extensions.js',
'inputmask.numeric.extensions.js',
'inputmask.phone.extensions.js'
];... | Make fastboot transform actually work | Make fastboot transform actually work
| JavaScript | mit | pzuraq/ember-inputmask,blimmer/ember-inputmask,pzuraq/ember-inputmask,blimmer/ember-inputmask |
f73eb6af5d1b32dcaf53ca26fa2c99c7edd89514 | src/main.js | src/main.js | 'use babel'
import {transform} from 'babel-core'
import Path from 'path'
export const compiler = true
export const minifier = false
export function process(contents, {rootDirectory, filePath, config}) {
const beginning = contents.substr(0, 11)
if (beginning !== '"use babel"' && beginning !== "'use babel'") {
... | 'use babel'
import {transform} from 'babel-core'
import Path from 'path'
export const compiler = true
export const minifier = false
export function process(contents, {rootDirectory, filePath, config}) {
const fileName = Path.dirname(filePath)
const relativePath = Path.relative(rootDirectory, filePath)
const tra... | Remove beginning check for 'use babel' | :fire: Remove beginning check for 'use babel'
| JavaScript | mit | steelbrain/ucompiler-plugin-babel |
d29101b0e12007ecc4ffc0b515c3f5896702feb6 | index.js | index.js | #!/usr/bin/env node
'use strict';
var program = require('commander')
, gulp = require('gulp')
, chalk = require('chalk')
, exec = require('exec')
, pjson = require('./package.json')
var strings = {
create: 'Creating new project',
install: 'Installing dependencies',
complete: 'Done!'
}
var pa... | #!/usr/bin/env node
'use strict';
var program = require('commander')
, gulp = require('gulp')
, chalk = require('chalk')
, exec = require('exec')
, pjson = require('./package.json')
var strings = {
create: 'Creating new project',
install: 'Installing dependencies',
complete: 'Done!'
}
var pa... | Fix bug where .gitignore was not being generated | Fix bug where .gitignore was not being generated
| JavaScript | mit | jinn-tool/jinn |
12ab81512d58c257decb5a4997a74bb662934098 | index.js | index.js | 'use strict';
const seneca = require('seneca')()
const senecaContet = require('seneca-context')
seneca.add({role:'api', cmd:'post'}, (args, done) => {
seneca.make('blog/posts').save$(args.post, done)
})
seneca.act({role:'web', use:{
prefix: '/api/',
pin: {role:'api', cmd:'*'},
map: {
'post': {GET: true}
... | 'use strict'
const seneca = require('seneca')()
const senecaContext = require('seneca-context')
seneca.use(require('seneca-context/plugins/setContext'), {createContext: (req, res, context, done) => {
const tenant = req.hostname.match(/([^\.]+)/)[1]
setImmediate(() => done(null, {tenant}))
}})
seneca.add({role:'ap... | Add tenant context based on subdomain | Add tenant context based on subdomain
| JavaScript | mit | eoinsha/seneca-mt-demo |
58f2b85604c59880d50dff79011022ed4f2bc248 | index.js | index.js | const React = require('react');
var { NativeModules, Platform } = require('react-native');
if (Platform.OS === 'android') {
module.exports = {
get(dim) {
try {
if(!NativeModules.ExtraDimensions) {
throw "ExtraDimensions not defined. Try rebuilding your project. e.g. react-native run-andro... | const React = require('react');
var { NativeModules, Platform } = require('react-native');
if (Platform.OS === 'android') {
module.exports = {
get(dim) {
try {
if(!NativeModules.ExtraDimensions) {
throw "ExtraDimensions not defined. Try rebuilding your project. e.g. react-native run-andro... | Make constants accessible through funcs | Make constants accessible through funcs
Each constant is not accessible through a function. This should make autocomplete within IDE's much easier
| JavaScript | isc | jaysoo/react-native-extra-dimensions-android,Sunhat/react-native-extra-dimensions-android,Sunhat/react-native-extra-dimensions-android,jaysoo/react-native-extra-dimensions-android |
5561f959ae4a33bd47ccc76ebbef01807e3e8a9c | index.js | index.js | "use strict";
global.use = function (path) {
if(path === 'config'){
return require.main.require('./' + path);
}else{
return require('./' + path);
}
};
const Server = use('core/server');
const Message = use('core/messages');
Message.request.addIntercept... | global.use = function (path) {
if (path === "config") {
return require.main.require("./" + path);
} else {
return require("./" + path);
}
};
const Config = use("config");
const Server = use("core/server");
const Message = use("core/mes... | Add console interceptors only in dev env | Add console interceptors only in dev env
| JavaScript | mit | yura-chaikovsky/dominion |
6613a524deee98784f9b3a282ebfbe08c38dc539 | index.js | index.js | /* jshint node: true */
'use strict';
var path = require('path');
module.exports = {
name: 'ember-cli-octicons',
blueprintsPath: function() {
return path.join(__dirname, 'blueprints');
}
};
| /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-cli-octicons',
included: function(app) {
this._super.included(app);
app.import(app.bowerDirectory + '/octicons/octicons/octicons.css');
app.import(app.bowerDirectory + '/octicons/octicons/octicons.eot', { destDir: 'assets' });
... | Add app.import statements for octicons css and font files | Add app.import statements for octicons css and font files
| JavaScript | mit | kpfefferle/ember-cli-octicons,kpfefferle/ember-octicons,kpfefferle/ember-cli-octicons,kpfefferle/ember-octicons |
2f2663e7010837ee11a51aaf9a837d15ded56840 | src/Components/EditableTable/EditableTableHeader/index.js | src/Components/EditableTable/EditableTableHeader/index.js | import React from 'react'
import PropTypes from 'prop-types'
const EditableTableHeader = ({columnNames}) => {
return(
<div>
{columnNames.map( columnName => {return <div>columnName</div>})}
</div>
)
}
export default EditableTableHeader | import React from 'react'
import PropTypes from 'prop-types'
const EditableTableHeader = ({columnNames}) => {
return(
<div>
{columnNames.map( columnName => {return <div>columnName</div>})}
</div>
)
}
EditableTableHeader.propTypes = {
columnNames: PropTypes.arrayOf(PropTypes.string).isRequired
}
... | Add propTypes check to editableTableHeader | Add propTypes check to editableTableHeader
| JavaScript | mit | severnsc/brewing-app,severnsc/brewing-app |
681976d249137b65a62ecf282b7fd965abe9590f | index.js | index.js | /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-devtools',
isEnabled: function() {
var addonConfig = this.app.project.config(this.app.env)['ember-devtools'];
return addonConfig.enabled;
}
};
| /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-devtools',
isEnabled: function() {
var options = (this.app && this.app.options && this.app.options['ember-devtools']) || {}
return options.enabled;
}
};
| Update loading of options hash to be compatible with modern ember-cli | Update loading of options hash to be compatible with modern ember-cli
| JavaScript | mit | aexmachina/ember-devtools,aexmachina/ember-devtools |
de0e9f7326601b810153c6e63a2e5c189c1858c7 | index.js | index.js | var fs = require('fs');
module.exports = function requireAll(options) {
if (typeof options === 'string') {
options = {
dirname: options,
filter: /(.+)\.js(on)?$/,
excludeDirs: /^\.(git|svn)$/,
params: params
};
}
var files = fs.readdirSync(options.dirname);
var modules = {};
... | var fs = require('fs');
module.exports = function requireAll(options) {
if (typeof options === 'string') {
options = {
dirname: options,
filter: /(.+)\.js(on)?$/,
excludeDirs: /^\.(git|svn)$/,
params: params
};
}
var files = fs.readdirSync(options.dirname);
var modules = {};
... | Fix merge conflict & add 3rd paramater for map function; false for directory, true for file | Fix merge conflict & add 3rd paramater for map function; false for directory, true for file
| JavaScript | mit | SteveKanter/node-require-all |
c380459c90a70a345b07ef963534d76fbac42f5d | index.js | index.js | var restify = require('restify');
var messenger = require('./lib/messenger');
var server = restify.createServer();
server.use(restify.queryParser());
server.use(restify.bodyParser());
server.use(restify.authorizationParser());
server.get('/', function (req, res, next) {
res.send(200, {status: 'ok'});
});
server.p... | var restify = require('restify');
var messenger = require('./lib/messenger');
var server = restify.createServer();
var users = {};
server.use(restify.queryParser());
server.use(restify.bodyParser());
server.use(restify.authorizationParser());
server.get('/', function (req, res, next) {
res.send(200, {status: 'ok'... | Store phone numbers in memory and respond differently | Store phone numbers in memory and respond differently
| JavaScript | mpl-2.0 | rockawayhelp/emergencybadges,rockawayhelp/emergencybadges |
854f618c63fa254fef9810963d816cff0a296216 | index.js | index.js |
var EventEmitter = require('events').EventEmitter;
var inherits = require('inherits');
module.exports = function(fn) {
inherits(fn, EventEmitter);
var self = new fn();
fn.prototype.addEventListener = function(ev, cb) {
self.on(ev,cb);
//console.log('addEventListener',ev,cb);
};
global.postMessag... |
var EventEmitter = require('events').EventEmitter;
var inherits = require('inherits');
module.exports = function(fn) {
inherits(fn, EventEmitter);
var self = new fn();
self.addEventListener = function(ev, cb) {
self.on(ev,cb);
};
global.postMessage = // unfortunately global for worker (no namespaces... | Augment instance instead of prototype | Augment instance instead of prototype
| JavaScript | mit | deathcap/unworkify |
5589ab5cf11d02a6ba5dd888e18fbccef7787d56 | index.js | index.js | "use strict";
module.exports.Receiver = require( './lib/receiver' );
module.exports.transports = {
receivers: {
Express: require( './lib/transport.receiver.express' ),
Local: require( './lib/transport.receiver.local' )
},
senders: {
Http: require( './lib/transport.sender.http' )
}
};
// convenience met... | "use strict";
module.exports.Receiver = require( './lib/receiver' );
module.exports.transports = {
receivers: {
Express: require( './lib/transport.receiver.express' ),
Local: require( './lib/transport.receiver.local' )
},
senders: {
Http: require( './lib/transport.sender.http' )
}
};
// convenience met... | Add authorize to createReceiver() convenience method | Add authorize to createReceiver() convenience method
| JavaScript | mit | BlueRival/json-fling |
f9bd33dafe554ddb2ff82a4f956b4fd0a4db72ac | src/Umbraco.Infrastructure/WebAssets/PreviewInitialize.js | src/Umbraco.Infrastructure/WebAssets/PreviewInitialize.js | [
'lib/jquery/jquery.min.js',
'lib/angular/angular.js',
'lib/underscore/underscore-min.js',
'lib/umbraco/Extensions.js',
'js/app.js',
'js/umbraco.resources.js',
'js/umbraco.services.js',
'js/umbraco.interceptors.js',
'ServerVariables',
'lib/signalr/jquery.signalR.js',
'BackO... | [
'lib/jquery/jquery.min.js',
'lib/angular/angular.js',
'lib/underscore/underscore-min.js',
'lib/umbraco/Extensions.js',
'js/app.js',
'js/umbraco.resources.js',
'js/umbraco.services.js',
'js/umbraco.interceptors.js',
'ServerVariables',
'lib/signalr/signalr.min.js',
'js/umbra... | Include new SignalR in preview view | Include new SignalR in preview view
| JavaScript | mit | umbraco/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,umbraco/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,abryukhov/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,... |
149635f3119a64373b38fae4e56fc93c2db54afc | packages/lesswrong/lib/collections/subscriptions/callbacks.js | packages/lesswrong/lib/collections/subscriptions/callbacks.js | import { addCallback } from 'meteor/vulcan:core';
import { Subscriptions } from './collection'
async function deleteOldSubscriptions(subscription) {
const { userId, documentId, collectionName, type } = subscription
Subscriptions.update({userId, documentId, collectionName, type}, {$set: {deleted: true}}, {multi: tr... | import { addCallback } from 'meteor/vulcan:core';
import { Subscriptions } from './collection'
async function deleteOldSubscriptions(subscription) {
const { userId, documentId, collectionName, type } = subscription
Subscriptions.update({userId, documentId, collectionName, type}, {$set: {deleted: true}}, {multi: tr... | Fix run-order issue where callback that was supposed to delete old sub, deleted new sub too | deleteOldSubscriptions: Fix run-order issue where callback that was supposed to delete old sub, deleted new sub too
| JavaScript | mit | Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope |
a5b314aa1c9a36f1311871b32ee6d94ec161cd29 | config/views.js | config/views.js | module.exports= {
views: [{
"name": "Raw Match Data",
"view": "matches"
}],
matches: function (mongoCollection, callback) {
mongoCollection.find().toArray(function (err, matches) {
callback([
{
name: "Matches",
headers: [
{
text: "Team",
value: "team"
},
... | module.exports= {
views: [{
"name": "Raw Match Data",
"view": "matches"
}],
matches: function (mongoCollection, callback) {
mongoCollection
.find()
.sort({"_id": -1})
.toArray(function (err, matches) {
callback([
{
name: "Matches",
headers: [
{
text: "Team",
... | Return Raw Match Data in Inverse Order | Return Raw Match Data in Inverse Order
| JavaScript | bsd-2-clause | FRCteam4909/FRC-Scouting,FRCteam4909/FRC-Scouting,FRCteam4909/FRC-Scouting |
8b17519bcd20f691f94019be636eb474f6a1f706 | server/options-handler.js | server/options-handler.js | var fs = require('fs');
var path = require('path');
var argv = require('optimist').argv;
// Load options into JS object.
exports.options = JSON.parse(fs.readFileSync(path.resolve(__dirname,'../'+argv.optionsFile)));
| var fs = require('fs');
var path = require('path');
var argv = require('optimist').argv;
// Load options into JS object.
exports.options = JSON.parse(fs.readFileSync(argv.optionsFile));
| Change options handler to use filepath instead of filename. | Change options handler to use filepath instead of filename.
| JavaScript | mit | MisterTea/TidalWave,MisterTea/TidalWave,MisterTea/TidalWave,MisterTea/TidalWave,MisterTea/TidalWave,MisterTea/TidalWave |
4abc3604fbe0d44e4a4a6222558613c906ca95ef | src/formatters/text_formatter.js | src/formatters/text_formatter.js | import columnify from 'columnify';
import figures from 'figures';
import chalk from 'chalk';
export default function TextFormatter(errorsGroupedByFile) {
const files = Object.keys(errorsGroupedByFile);
const errorsText = files
.map(file => {
return generateErrorsForFile(file, errorsGroupedByFile[file]);... | import columnify from 'columnify';
import figures from 'figures';
import chalk from 'chalk';
export default function TextFormatter(errorsGroupedByFile) {
const files = Object.keys(errorsGroupedByFile);
const errorsText = files
.map(file => {
return generateErrorsForFile(file, errorsGroupedByFile[file]);... | Include name of `rule` that caused error in text formatter | Include name of `rule` that caused error in text formatter
| JavaScript | mit | cjoudrey/graphql-schema-linter |
458b683a66b98ae454eac27e87a0d3951ffa9a44 | src/redux/action-types.js | src/redux/action-types.js | export const RUNNING = 'RUNNING';
export const START_LOAD_RUNTIME = 'START_LOAD_RUNTIME';
export const FINISH_LOAD_RUNTIME = 'FINISH_LOAD_RUNTIME';
export const FAIL_LOAD_RUNTIME = 'FAIL_LOAD_RUNTIME';
| export const START_LOAD_RUNTIME = 'START_LOAD_RUNTIME';
export const FINISH_LOAD_RUNTIME = 'FINISH_LOAD_RUNTIME';
export const FAIL_LOAD_RUNTIME = 'FAIL_LOAD_RUNTIME';
export const START_PARSE = 'START_PARSE';
export const FINISH_PARSE = 'FINISH_PARSE';
export const FAIL_PARSE = 'FAIL_PARSE';
export const START_COMPI... | Add action types for running code | Add action types for running code
| JavaScript | apache-2.0 | pcardune/pyret-ide,pcardune/pyret-ide |
69bdc2ba08689ea7065ca0f23eda0a3c840b4d89 | src/js/components/TabPanel/Measurement.js | src/js/components/TabPanel/Measurement.js | import Measurement from 'esri/dijit/Measurement';
import React, {
Component,
PropTypes
} from 'react';
export default class InfoWindow extends Component {
static contextTypes = {
map: PropTypes.object.isRequired
}
initialized = false
componentWillUpdate(prevProps) {
if (
this.context.map.lo... | import Measurement from 'esri/dijit/Measurement';
import React, {
Component,
PropTypes
} from 'react';
export default class InfoWindow extends Component {
static contextTypes = {
map: PropTypes.object.isRequired
}
initialized = false
componentWillUpdate(prevProps) {
if (
this.context.map.lo... | Remove measurement on-end event listener that was preventing the measurement result from being displayed | Remove measurement on-end event listener that was preventing the measurement result from being displayed
| JavaScript | mit | wri/gfw-mapbuilder,wri/gfw-mapbuilder,wri/gfw-mapbuilder |
0080f81ee471972876be9fe847f60da2c6f37fc0 | app/index.js | app/index.js | 'use strict';
var express = require('express'),
index = require('./routes/index.js');
var app = express();
app.get('/', index.get);
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Listening at http://%s:%s', host, port);
}); | 'use strict';
var express = require('express'),
index = require('./routes/index.js');
var app = express();
app.get('/', index.get);
var server = app.listen(process.env.PORT || 3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Listening at http://%s:%s', ... | Fix port to be compatible with heroku | Fix port to be compatible with heroku
| JavaScript | mit | Zeikko/beating-forehead-vein-backend |
bf36d46f618163f7ee269bc8c7722513f5a9640c | src/edit/global_events.js | src/edit/global_events.js | import { onBlur } from "../display/focus.js"
import { on } from "../util/event.js"
// These must be handled carefully, because naively registering a
// handler for each editor will cause the editors to never be
// garbage collected.
function forEachCodeMirror(f) {
if (!document.getElementsByClassName) return
let ... | import { onBlur } from "../display/focus.js"
import { on } from "../util/event.js"
// These must be handled carefully, because naively registering a
// handler for each editor will cause the editors to never be
// garbage collected.
function forEachCodeMirror(f) {
if (!document.getElementsByClassName) return
let ... | Remove fast path in resize handler | Remove fast path in resize handler
It can't reliably determine whether the scrollbar still needs to
be clipped
Closes #5445
| JavaScript | mit | wingify/CodeMirror,mtaran-google/CodeMirror,nightwing/CodeMirror,namin/CodeMirror,dperetti/CodeMirror,codio/CodeMirror,namin/CodeMirror,pabloferz/CodeMirror,notepadqq/CodeMirror,codio/CodeMirror,SidPresse/CodeMirror,hackmdio/CodeMirror,codio/CodeMirror,hackmdio/CodeMirror,thomasjm/CodeMirror,notepadqq/CodeMirror,nightw... |
8d4a96b8cff3e4ed82aeeb1679326da265b6d42b | src/eeh-flot-directive.js | src/eeh-flot-directive.js | (function (angular) {
'use strict';
function FlotDirective(eehFlot, $interval) {
return {
restrict: 'AE',
template: '<div class="eeh-flot"></div>',
scope: {
dataset: '=',
options: '@',
updateCallback: '&',
... | (function (angular) {
'use strict';
function FlotDirective(eehFlot, $interval) {
return {
restrict: 'AE',
template: '<div class="eeh-flot"></div>',
scope: {
dataset: '=',
options: '@',
updateCallback: '=',
... | Fix issues with callback function | Fix issues with callback function
| JavaScript | mit | ethanhann/eeh-flot |
9c7befc18f142f1eed895257a099d3095f4f2f3e | src/fmi-radar-images.js | src/fmi-radar-images.js | const axios = require('axios')
const sharp = require('sharp')
async function fetchPostProcessedRadarFrame(url) {
const data = await fetchRadarImage(url)
return processImage(data)
}
async function fetchRadarImage(url) {
const response = await axios({url, method: 'get', responseType: 'arraybuffer'})
return Buff... | const axios = require('axios')
const sharp = require('sharp')
sharp.cache(false)
async function fetchPostProcessedRadarFrame(url) {
const data = await fetchRadarImage(url)
return processImage(data)
}
async function fetchRadarImage(url) {
const response = await axios({url, method: 'get', responseType: 'arraybuf... | Disable sharp cache (helps with Heroku) | Disable sharp cache (helps with Heroku) | JavaScript | mit | heikkipora/sataako-fi,heikkipora/sataako-fi,heikkipora/sataako-fi,heikkipora/sataako-fi |
8ecca249abcc8f6ff4760ef3a3ee57486a6bdffe | modules/blueprint.js | modules/blueprint.js | var BlueprintClient = require('xively-blueprint-client-js');
var client = new BlueprintClient({
authorization: process.env.BLUEPRINT_AUTHORIZATION
});
console.log('Client initialized with authorization >', process.env.BLUEPRINT_AUTHORIZATION);
module.exports = client;
| var BlueprintClient = require('xively-blueprint-client-js');
var client = new BlueprintClient({
authorization: 'Basic ' + process.env.BLUEPRINT_AUTHORIZATION
});
module.exports = client;
| Remove log and Prefix Authorization token with 'Basic ' | Remove log and Prefix Authorization token with 'Basic '
Update your env vars
| JavaScript | mit | Altoros/refill-them-api |
3ac6057a28b2f3d2e9cee0e663b10ac0d225d99f | test/unit/specs/avfs/partials/members.js | test/unit/specs/avfs/partials/members.js | 'use strict';
var chai = require('chai');
var expect = chai.expect;
var Stats = require('lib/common/components/stats');
var ReadStream = require('lib/common/streams/read-stream');
var WriteStream = require('lib/common/streams/write-stream');
var SyncWriteStream = require('lib/common/streams/sync-write-stream');
... | 'use strict';
var chai = require('chai');
var expect = chai.expect;
var Stats = require('lib/common/components/stats');
var ReadStream = require('lib/common/streams/read-stream');
var WriteStream = require('lib/common/streams/write-stream');
var SyncWriteStream = require('lib/common/streams/sync-write-stream');
... | Add unit test for access flags | Add unit test for access flags
| JavaScript | mit | fldubois/avfs |
a90e6f1f92888e0904bd50d67993ab23ccec1a38 | src/services/config/config.service.js | src/services/config/config.service.js | 'use strict';
// Service for the spec config.
// We keep this separate so that changes are kept even if the spec changes.
angular.module('vlui')
.factory('Config', function() {
var Config = {};
Config.data = {};
Config.config = {};
Config.getConfig = function() {
return {};
};
Config... | 'use strict';
// Service for the spec config.
// We keep this separate so that changes are kept even if the spec changes.
angular.module('vlui')
.factory('Config', function() {
var Config = {};
Config.data = {};
Config.config = {};
Config.getConfig = function() {
return {};
};
Config... | Make tick thicker to facilitate hovering | Make tick thicker to facilitate hovering
cc: da39a3ee5e6b4b0d3255bfef95601890afd80709@zeningqu
| JavaScript | bsd-3-clause | vega/vega-lite-ui,uwdata/vega-lite-ui,uwdata/vega-lite-ui,vega/vega-lite-ui,uwdata/vega-lite-ui,vega/vega-lite-ui |
29ed8407f945a36d0c2ad41eebd48d4ac7ef29db | server/discord/utils/dmail/index.js | server/discord/utils/dmail/index.js | const r = require('./../../../db');
const config = require('config');
const check = id =>
new Promise((resolve, reject) => {
r.table('registrations')
.get(id)
.run(r.conn, (err1, res) => {
if (err1) {
reject('Could not search RethonkDB');
} else if (!res) {
reject(`You or the guild are not r... | const r = require('./../../../db');
const config = require('config');
const check = id =>
new Promise((resolve, reject) => {
r.table('registrations')
.get(id)
.run(r.conn, (err1, res) => {
if (err1) {
reject('Could not search RethonkDB');
} else if (!res) {
reject(`You or the guild are not r... | Support most ASCII characters and all Unicode above U+007F | Support most ASCII characters and all Unicode above U+007F
| JavaScript | mit | moustacheminer/discordmail,moustacheminer/discordmail |
f6cebdad9813026b2909fadc4e43adcdc4d78b10 | src/node/hooks/express/padurlsanitize.js | src/node/hooks/express/padurlsanitize.js | var padManager = require('../../db/PadManager');
var url = require('url');
exports.expressCreateServer = function (hook_name, args, cb) {
//redirects browser to the pad's sanitized url if needed. otherwise, renders the html
args.app.param('pad', function (req, res, next, padId) {
//ensure the padname is valid ... | var padManager = require('../../db/PadManager');
var url = require('url');
exports.expressCreateServer = function (hook_name, args, cb) {
//redirects browser to the pad's sanitized url if needed. otherwise, renders the html
args.app.param('pad', function (req, res, next, padId) {
//ensure the padname is valid ... | Fix decode error if pad name contains special characters and is sanitized | Fix decode error if pad name contains special characters and is sanitized
| JavaScript | apache-2.0 | University-of-Potsdam-MM/etherpad-lite,ether/etherpad-lite,2-B/etherpad-lite,joequant/etherpad-lite,tiblu/etherpad-lite,xavidotron/etherpad-lite,asac/etherpad-lite,aptivate/etherpad-lite,joequant/etherpad-lite,KonradMil/etherpad-lite,joequant/etherpad-lite,aptivate/etherpad-lite,webzwo0i/etherpad-lite,ether/etherpad-li... |
12c4395a7939f3b435060ce701fd9002c6be2d8f | src/sampleActivities.js | src/sampleActivities.js | const activitiesByTimestamp = {
// activityTimestamps: [1488058736421, 1488058788421, 1488058446421, 1488051326421, 1488051326555]
1488058736421: {
text: "hang at Golden Gate park 🍺",
},
1488078736421: {
text: "soak up some 🌞 at Dolores park",
},
1488058788421: {
text: "climb at Planet Granite... | const activitiesByTimestamp = {
1488058736421: {
text: "hang at Golden Gate park 🍺",
},
1488078736421: {
text: "soak up some 🌞 at Dolores park",
},
1487558788421: {
text: "climb at Planet Granite -- 3 hours",
},
1488058446421: {
text: "run 4.5 miles 🏃",
},
1486959646421: {
text:... | Add some other dates into sample activities | Add some other dates into sample activities
| JavaScript | mit | mknudsen01/today,mknudsen01/today |
f17b368d6b462bcde11948b3241fcffcba167df2 | src/index.js | src/index.js | const notify = (events) => ({ dispatch }) => next => action => {
const returnValue = next(action);
events.forEach( event => {
if (event.catch.indexOf(action.type) !== -1) {
dispatch(event.dispatch());
}
});
return returnValue;
};
export default notify;
| const notify = (events) => ({ dispatch }) => next => action => {
const returnValue = next(action);
events.forEach( event => {
if (event.catch.indexOf(action.type) !== -1) {
if (event.dispatch instanceof Function) dispatch(event.dispatch());
else if (event.dispatch instanceof Array) {
event.d... | Allow to dispatch an array of actions in parallel. | Allow to dispatch an array of actions in parallel.
| JavaScript | mit | zalmoxisus/redux-notify |
cdf3136cde02d459d1c7e670afcb7217cb357f97 | src/index.js | src/index.js | const path = require('path');
let version;
module.exports = {
Client: require('./client/Client'),
Shard: require('./sharding/Shard'),
ShardingManager: require('./sharding/ShardingManager'),
Collection: require('./util/Collection'),
get version() {
if (!version) version = require(path.join(__dirname, '.... | const path = require('path');
module.exports = {
Client: require('./client/Client'),
Shard: require('./sharding/Shard'),
ShardingManager: require('./sharding/ShardingManager'),
Collection: require('./util/Collection'),
version: require(path.join(__dirname, '..', 'package.json')).version,
};
| Make version a regular property instead of getter | Make version a regular property instead of getter
| JavaScript | apache-2.0 | robflop/discord.js,devsnek/discord.js,zajrik/discord.js,robflop/discord.js,aemino/discord.js,Lewdcario/discord.js,zajrik/discord.js,SpaceEEC/discord.js,appellation/discord.js,hydrabolt/discord.js,meew0/discord.js,aemino/discord.js,robflop/discord.js,hydrabolt/discord.js,Drahcirius/discord.js,Drahcirius/discord.js,CodeM... |
2af1f21d2496cb192973c27bff321527534e2c7c | lib/publications.js | lib/publications.js | privacyOptions = { // true means exposed
_id: true,
commentCount: true,
createdAt: true,
email_hash: true,
isInvited: true,
karma: true,
postCount: true,
slug: true,
username: true,
'profile.name': true,
'profile.notifications': true,
'profile.bio': true,
'profile.github': true,
'profile.sit... | privacyOptions = { // true means exposed
_id: true,
commentCount: true,
createdAt: true,
email_hash: true,
isInvited: true,
karma: true,
postCount: true,
slug: true,
username: true,
'profile.name': true,
'profile.notifications': true,
'profile.bio': true,
'profile.github': true,
'profile.sit... | Fix broken twitter avatars - services.twitter.profile_image_url_https field wasn't being published | Fix broken twitter avatars
- services.twitter.profile_image_url_https field wasn't being published
| JavaScript | mit | Discordius/Telescope,simbird/Test,ahmadassaf/Telescope,zires/Telescope,rtluu/immersive,sharakarasic/telescope-coderdojola,Leeibrah/telescope,georules/iwishcitiescould,acidsound/Telescope,tepk/Telescope,simbird/Test,veerjainATgmail/Telescope,TribeMedia/Telescope,STANAPO/Telescope,Daz2345/Telescope,queso/Telescope,sophea... |
4de767d8c6bd350dcba2f36339ad52f465b6c629 | src/utils/renderDate.js | src/utils/renderDate.js | import moment from 'moment';
const DefaultDateFormat = 'YYYY-MM-DD';
const DefaultTimeFormat = 'HH:mm:ss';
const DefaultDateTimeFormat = 'YYYY-MM-DD HH:mm:ss';
export default function renderDate(date, formFormat, displayFormat) {
let format;
if (displayFormat) format = displayFormat;
else if (formFormat === 'time'... | import moment from 'moment';
const DefaultDateFormat = 'YYYY-MM-DD';
const DefaultTimeFormat = 'HH:mm:ss';
const DefaultDateTimeFormat = 'YYYY-MM-DD HH:mm:ss';
export default function renderDate(date, formFormat, displayFormat) {
if (!date) return '';
let format;
if (displayFormat) format = displayFormat;
else if... | Fix "Invalid date" bug in date related components | fix: Fix "Invalid date" bug in date related components
| JavaScript | mit | cantonjs/re-admin,cantonjs/re-admin |
e24e3c50970cabb78acb6375fa8dceabb74fc06c | src/agcScriptTagHelper.js | src/agcScriptTagHelper.js | /* global angular */
(function() {
angular.module("googlechart")
.factory("agcScriptTagHelper", agcScriptTagHelperFactory);
agcScriptTagHelperFactory.$inject = ["$q"];
function agcScriptTagHelperFactory($q)
{
/** Add a script tag to the document's head section and return an angular
... | /* global angular */
(function() {
angular.module("googlechart")
.factory("agcScriptTagHelper", agcScriptTagHelperFactory);
agcScriptTagHelperFactory.$inject = ["$q", "$document"];
function agcScriptTagHelperFactory($q, $document)
{
/** Add a script tag to the document's head section an... | Use $document for unit test suppport. | [refactor] Use $document for unit test suppport.
| JavaScript | mit | angular-google-chart/angular-google-chart,nbering/angular-google-chart,nbering/angular-google-chart,angular-google-chart/angular-google-chart |
6c28462ee6b375b005e4ed4b183f1c395bee55c6 | src/js/client/util/index.js | src/js/client/util/index.js | import scripts from './scripts';
import shortcut from './shortcut';
import setUserRequire from './require';
module.exports = {
scripts,
setUserRequire,
shortcut
} | import scripts from './scripts';
import shortcut from './shortcut';
import setUserRequire from './require';
import log from './log';
module.exports = {
scripts,
setUserRequire,
shortcut,
log
} | Add log to module exports | Add log to module exports
| JavaScript | mit | simonlovesyou/AutoRobot |
dabbed7a84a8b40fefb8503234de2b2fdb58a338 | lib/api/socket-adapter.js | lib/api/socket-adapter.js | const uuidV4 = require('uuid/v4');
class SocketAdapter {
constructor(uuid) {
this.uuid = uuid;
this.conn = {
remoteAddress: `socket-adapter: ${this.uuid}`,
};
this.pair = null;
this.callbacks = {};
}
trigger(name, data) {
this.callbacks[name](data);
}
emit(name, data) {
if... | const uuidV4 = require('uuid/v4');
class SocketAdapter {
constructor(uuid) {
this.uuid = uuid;
this.conn = {
remoteAddress: `socket-adapter: ${this.uuid}`,
};
this.pair = null;
this.callbacks = {};
}
trigger(name, data) {
if (this.callbacks[name]) {
this.callbacks[name](data)... | Fix unregistered socket adapter triggers | Fix unregistered socket adapter triggers
| JavaScript | mit | frostburn/panel-league,frostburn/panel-league |
c990c04bf6307c1fc36f30772574c7280d10398c | lib/notification-badge.js | lib/notification-badge.js | Template.notificationBadge.helpers({
count: function () {
// TODO: find a better way ?
this._count = this._count || this.count;
if (this.count !== this._count) {
$('.notification-count')
.css({ opacity: 0 })
.css({ top: '-3px' })
.animate({ top: '5px', opacity: 1 });
}... | Template.notificationBadge.helpers({
count: function () {
// access template instance instead of 'this',
// which only returns the data context
var self = Template.instance();
self._count = self._count || this.count;
if (this.count !== self._count) {
Meteor.defer(function () {
$('... | Fix animation and count checking | Fix animation and count checking
| JavaScript | mit | erasaur/notification-badge |
4374c40aac4674a7e163c994a114f9a9cbf97d27 | routes/api/github.js | routes/api/github.js | var GitHub = require( '../../lib/Webmaker.js' ).github;
module.exports = {
tags: function( req, res ) {
GitHub.tags( req.params.repo, function( err, tags ) {
if ( err ) {
res.json( 500, { error: 'Unable to get tags for repo ' + repo + '.' } );
return;
}
res.json( tags );
});... | var GitHub = require( '../../lib/Webmaker.js' ).github;
module.exports = {
tags: function( req, res ) {
GitHub.tags( req.params.repo, function( err, tags ) {
if ( err ) {
res.json( 500, { error: 'Unable to get tags for repo ' + req.params.repo + '.' } );
return;
}
res.json( tags... | Fix typo in tags error message. | Fix typo in tags error message.
| JavaScript | mpl-2.0 | alicoding/dashboard.webmaker.org,alicoding/dashboard.webmaker.org |
7c92d068c2cb19663f3058b6d5f45b0fbd8a64bf | tests/spec/utilities.js | tests/spec/utilities.js | describe("Utilities", function() {
it("should get the domain", function() {
expect(getDomain('http://www.google.com')).toMatch('www.google.com');
expect(getDomain('http://www.google.com/')).toMatch('www.google.com');
expect(getDomain('http://www.google.com/kitty')).toMatch('www.google.com');
expect(getDomain(... | describe("Utilities", function() {
it("should get the domain", function() {
expect(getDomain('http://www.google.com')).toMatch('www.google.com');
expect(getDomain('http://www.google.com/')).toMatch('www.google.com');
expect(getDomain('http://www.google.com/kitty')).toMatch('www.google.com');
expect(getDomain(... | Add test for reordering elements in an Array. | Add test for reordering elements in an Array.
| JavaScript | mit | AntarcticApps/Tiles,AntarcticApps/Tiles |
627a61ab32ac65ee0955c64f7f01209468c41cdd | lib/index.js | lib/index.js | import MemoryFileSystem from 'memory-fs'
import tty from 'tty'
import path from 'path'
import webpack from 'webpack'
export default function plugin (config) {
const compiler = webpack(config)
compiler.outputFileSystem = new MemoryFileSystem()
return function (files, metalsmith, done) {
compiler.run((err, sta... | import MemoryFileSystem from 'memory-fs'
import tty from 'tty'
import path from 'path'
import webpack from 'webpack'
export default function plugin (config) {
const compiler = webpack(config)
compiler.outputFileSystem = new MemoryFileSystem()
return function (files, metalsmith, done) {
compiler.run((err, sta... | Add comment to describe the output files | Add comment to describe the output files
| JavaScript | mit | elliottsj/metalsmith-plugin-webpack |
bca29aa0ce8043b1918688dd2a1dcfa0d2c9bae9 | test/api/highlightAuto.js | test/api/highlightAuto.js | 'use strict';
var bluebird = require('bluebird');
var fs = bluebird.promisifyAll(require('fs'));
var hljs = require('../../build');
var path = require('path');
var utility = require('../utility');
function testAutoDetection(language) {
var languagePath = utility.buildPath('detect', language);
it('... | 'use strict';
var bluebird = require('bluebird');
var fs = bluebird.promisifyAll(require('fs'));
var hljs = require('../../build');
var path = require('path');
var utility = require('../utility');
function testAutoDetection(language) {
var languagePath = utility.buildPath('detect', language);
it('... | Fix detection tests silent fails | Fix detection tests silent fails
CC @sourrust
| JavaScript | bsd-3-clause | CausalityLtd/highlight.js,lizhil/highlight.js,Sannis/highlight.js,StanislawSwierc/highlight.js,ehornbostel/highlight.js,krig/highlight.js,axter/highlight.js,weiyibin/highlight.js,robconery/highlight.js,kayyyy/highlight.js,0x7fffffff/highlight.js,adam-lynch/highlight.js,devmario/highlight.js,highlightjs/highlight.js,eho... |
d915a20733462e619234116bed5bc51ee121f60c | test/spec/test_captcha.js | test/spec/test_captcha.js | describe("The constructor is supposed a proper Captcha object", function() {
it('Constructor Captcha exists', function(){
expect(Captcha).toBeDefined();
});
});
| describe("The constructor is supposed a proper Captcha object", function() {
it('Constructor Captcha exists', function(){
expect(Captcha).toBeDefined();
});
it("Captcha object is not null", function(){
expect(captcha).not.toBeNull();
});
});
| Add test to chekc if captcha object is null. The test fails | Add test to chekc if captcha object is null. The test fails
| JavaScript | mit | sonjahohlfeld/Captcha-Generator,sonjahohlfeld/Captcha-Generator |
d516cc28ca767dda67179798711494d26ba1c197 | lib/setup.js | lib/setup.js | var $ = require('jquery');
module.exports = function(namespace) {
var toggleSelector = '[data-' + namespace + '-toggle]';
var openClass = namespace + '--open';
var body = $(document.body).addClass(namespace);
$(document)
.on('click.' + namespace, toggleSelector, function(e) {
e.pr... | var $ = require('jquery');
module.exports = function(namespace) {
var toggleSelector = '[data-' + namespace + '-toggle]';
var openClass = namespace + '--open';
var root = $('html').addClass(namespace);
$(document)
.on('click.' + namespace, toggleSelector, function(e) {
e.preventDe... | Fix adding root class to html, not body | Fix adding root class to html, not body
| JavaScript | mit | dotsunited/off-canvas-navigation,dotsunited/off-canvas-navigation |
e44d438f960df6931a547a83b9b6388ecf5a0ab6 | warp/static/js/project.js | warp/static/js/project.js | /* global document, $ */
/* Project specific Javascript goes here. */
/*
Formatting hack to get around crispy-forms unfortunate hardcoding
in helpers.FormHelper:
if template_pack == 'bootstrap4':
grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*')
using_grid_layout = (grid_colum_matc... | /* global document, $ */
/* Project specific Javascript goes here. */
/*
Formatting hack to get around crispy-forms unfortunate hardcoding
in helpers.FormHelper:
if template_pack == 'bootstrap4':
grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*')
using_grid_layout = (grid_colum_matc... | Add defensive logic to csrf-ajax-filter | Add defensive logic to csrf-ajax-filter
| JavaScript | mit | SaturDJang/warp,SaturDJang/warp,SaturDJang/warp,SaturDJang/warp |
36c13c4d4e7ffd312cbb1efa9ba881b3258a01a2 | specs/integration.js | specs/integration.js | var chai = require('chai');
var expect = chai.expect;
var models = require('../server/db/models');
var request = require('request');
var localServerUri = 'http://127.0.0.1:3000/';
var GETUri = localServerUri + '?x=100.123456&y=-50.323&z=14.4244';
var testData = {x: 100.123456, y: -50.323, z: 14.4244, message: 'hello da... | var chai = require('chai');
var expect = chai.expect;
var models = require('../server/db/models');
var request = require('request');
var localServerUri = 'http://127.0.0.1:3000/';
var GETUri = localServerUri + '?x=100.123456&y=-50.323&z=14.4244';
var testData = {x: 100.123456, y: -50.323, z: 14.4244, message: 'hello da... | Remove test data from database after tests are run | Remove test data from database after tests are run
| JavaScript | mit | scottdixon/uncovery,team-oath/uncovery,team-oath/uncovery,team-oath/uncovery,scottdixon/uncovery,scottdixon/uncovery,scottdixon/uncovery,team-oath/uncovery |
71e4557ac4e36f717b5e8d3da394ca6b18ca4f37 | webpack/webpack.config.js | webpack/webpack.config.js | const path = require('path');
const webpack = require('webpack');
const banner = require('./banner');
module.exports = {
entry: './src/api/v4/index.js',
output: {
path: path.resolve(__dirname, '../dist/public'),
filename: 'carto.js',
library: 'carto',
libraryTarget: 'umd'
},
plugins: [
// I... | const path = require('path');
const webpack = require('webpack');
const banner = require('./banner');
module.exports = {
entry: './src/api/v4/index.js',
output: {
path: path.resolve(__dirname, '../dist/public'),
filename: 'carto.js',
library: 'carto',
libraryTarget: 'umd'
},
devtool: 'sourcemap... | Add sourcemap generation to build script | Add sourcemap generation to build script
| JavaScript | bsd-3-clause | splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js |
dbb8974ac01d634eac952f5e927b98505bc76fff | src/server/pullRequest.js | src/server/pullRequest.js | 'use strict';
var R = require('ramda');
function onPrClose() {
}
function writeSuccess(res, result) {
res.send(':)');
}
function writeFailure(res, err) {
res.send(':(');
}
function pullRequestRouteHandler(req, res) {
var body = req.body;
var onSucess = R.curry(writeSuccess)(res);
var onFail = R.curr... | 'use strict';
var R = require('ramda');
function onPrClose() {
return q.resolve();
}
function writeSuccess(res, result) {
res.send(':)');
}
function writeFailure(res, err) {
res.send(':(');
}
function pullRequestRouteHandler(req, res) {
var body = req.body;
var onSucess = R.curry(writeSuccess)(res);
... | Resolve promise in PR handler | Resolve promise in PR handler
| JavaScript | mit | rafkhan/the-clusternator,alanthai/the-clusternator,rafkhan/the-clusternator,rangle/the-clusternator,bennett000/the-clusternator,rangle/the-clusternator,alanthai/the-clusternator,rangle/the-clusternator,bennett000/the-clusternator,bennett000/the-clusternator |
cca37003d0931d4f446eb8c80e18a31fa35fd4e0 | src/stringify/anything.js | src/stringify/anything.js | import _ from '../wrap/lodash'
import isMatcher from '../matchers/is-matcher'
import * as stringifyObject from 'stringify-object-es5'
export default (anything) => {
if (_.isString(anything)) {
return stringifyString(anything)
} else if (isMatcher(anything)) {
return anything.__name
} else {
return st... | import _ from '../wrap/lodash'
import isMatcher from '../matchers/is-matcher'
import * as stringifyObject from 'stringify-object-es5'
export default (anything) => {
if (_.isString(anything)) {
return stringifyString(anything)
} else if (isMatcher(anything)) {
return anything.__name
} else if (anything &&... | Use toString when printing proxy description | Use toString when printing proxy description
| JavaScript | mit | testdouble/testdouble.js,testdouble/testdouble.js,testdouble/testdouble.js |
a3f1459bbfd7edaad9eefc4c64306a85c85b2f3d | src/script/components/dashcaseFilter.js | src/script/components/dashcaseFilter.js | app.filter('dashcase', function () {
return function (input) {
input = input.replace(/\s+/g, '-')
.toLowerCase()
.replace('ä', 'ae')
.replace('ö', 'oe')
.replace('ü', 'ue')
.replace('ß', 'ss')
.replace(/[^a-z0-9-]/g, '');
return input;
};
});
| app.filter('dashcase', function () {
return function (input) {
return input.toLowerCase()
.replace(/\s+/g, '-')
.replace(/ä/g, 'ae')
.replace(/ö/g, 'oe')
.replace(/ü/g, 'ue')
.replace(/\u00df/g, 'ss')
.replace(/[^a-z0-9-]/g, '');
};
});
| Fix bug with German umlauts in dashcase filter | Fix bug with German umlauts in dashcase filter
| JavaScript | mit | stekhn/portfolio,stekhn/portfolio,stekhn/portfolio |
248c21e5d391ef985b7aab2992f3237234b8054f | frontend/components/modals/promoteModal.js | frontend/components/modals/promoteModal.js | import React, { Component } from 'react';
import Dialog from 'material-ui/lib/dialog';
import FlatButton from 'material-ui/lib/flat-button';
import RaisedButton from 'material-ui/lib/raised-button';
// NOTE: For emit `onTouchTap` event.
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();... | import React, { Component } from 'react';
import Dialog from 'material-ui/lib/dialog';
import FlatButton from 'material-ui/lib/flat-button';
import RaisedButton from 'material-ui/lib/raised-button';
// NOTE: For emit `onTouchTap` event.
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();... | Remove handleOpen function. because it is unnecessary. | Remove handleOpen function. because it is unnecessary.
| JavaScript | mit | mgi166/usi-front,mgi166/usi-front |
80e7eebae4772ee6659330e36f515f70430133a9 | test/reducers/example-reducer.test.js | test/reducers/example-reducer.test.js | import * as actionTypes from "../../src/actions/types";
import exampleReducer from "../../src/reducers/example-reducer";
describe("exampleReducer", () => {
test("initial state", () => {
expect(exampleReducer(undefined, {})).toEqual({example: ""});
});
test ("when action type is EXAMPLE_ACTION", () => {
... | import * as actionTypes from "../../src/actions/types";
import exampleReducer from "../../src/reducers/example-reducer";
describe("exampleReducer", () => {
test("initial state", () => {
expect(exampleReducer(undefined, {})).toEqual({example: ""});
});
test ("when action type is EXAMPLE_ACTION", () => {
... | Test exampleReducer with prior state | Test exampleReducer with prior state
| JavaScript | mit | tiere/react-starter,tiere/react-starter |
ffabc205276183238c8d6dc1676724508a035c8d | app/common/views/visualisations/volumetrics/number.js | app/common/views/visualisations/volumetrics/number.js | define([
'extensions/views/single_stat'
],
function (SingleStatView) {
var NumberView = SingleStatView.extend({
changeOnSelected: true,
labelPrefix: '',
formatValue: function(value) {
return this.formatNumericLabel(value);
},
getValue: function () {
return this.formatValue(this.co... | define([
'extensions/views/single_stat'
],
function (SingleStatView) {
var NumberView = SingleStatView.extend({
changeOnSelected: true,
labelPrefix: '',
formatValue: function(value) {
return this.formatNumericLabel(value);
},
getValue: function () {
return this.formatValue(this.co... | Add temporary fix for problem where selected model on hover does not exist | Add temporary fix for problem where selected model on hover does not exist
| JavaScript | mit | tijmenb/spotlight,alphagov/spotlight,alphagov/spotlight,keithiopia/spotlight,keithiopia/spotlight,alphagov/spotlight,tijmenb/spotlight,tijmenb/spotlight,keithiopia/spotlight |
d9e6d766e7326f0cf96ad172864caa795cc02fdf | app/modules/deliberation/directives/showDiscussion.js | app/modules/deliberation/directives/showDiscussion.js | angular.module('pcApp.deliberation.directives.showDiscussion', [
'pcApp.adhocracyEmbedder.services.adhocracy',
])
.directive('showDiscussion', ['Adhocracy', function (Adhocracy) {
return {
restrict: 'E',
scope: {
path: '@'
},
link: function(scope, element, attrs) {
... | angular.module('pcApp.deliberation.directives.showDiscussion', [
'pcApp.adhocracyEmbedder.services.adhocracy',
])
.directive('showDiscussion', ['API_CONF', 'Adhocracy', function (API_CONF, Adhocracy) {
return {
restrict: 'E',
scope: {
key: '@'
},
link: function(scope... | Adjust show-discussion directive to actual functionality | Adjust show-discussion directive to actual functionality
This now embeds the adhocracy create-or-show-comment-listing widget,
which creates new commentables on the fly.
This can be used as the following:
<show-discussion ng-if="metric.id" data-key="metric_{{ metric.id
}}"></show-discussion>
| JavaScript | agpl-3.0 | bullz/policycompass-frontend,cbotsikas/policycompass-frontend,policycompass/policycompass-frontend,almey/policycompass-frontend,FabiApfelkern/policycompass-frontend,mmilaprat/policycompass-frontend,policycompass/policycompass-frontend,policycompass/policycompass-frontend,almey/policycompass-frontend,bullz/policycompass... |
c2cecbfa182b27d93a4c40a602d97ee77ef5949d | fullcalendar-rightclick.js | fullcalendar-rightclick.js | /*!
* fullcalendar-rightclick v1.1
* Docs & License: https://github.com/mherrmann/fullcalendar-rightclick
* (c) 2015 Michael Herrmann
*/
(function($) {
var fc = $.fullCalendar;
var AgendaView = fc.views.agenda;
var originalRender = AgendaView.prototype.render;
AgendaView.prototype.render = function() {
origi... | /*!
* fullcalendar-rightclick v1.2
* Docs & License: https://github.com/mherrmann/fullcalendar-rightclick
* (c) 2015 Michael Herrmann
*/
(function($) {
function monkeyPatchViewClass(View, dayCssClass) {
var originalRender = View.prototype.render;
View.prototype.render = function() {
originalRender.call(thi... | Add support for FullCalendar's month view. | Add support for FullCalendar's month view.
| JavaScript | mit | mherrmann/fullcalendar-rightclick,mherrmann/fullcalendar-rightclick |
15df3d995d8177651d0806e26f000b85bebd1ce4 | client/js/src/security/authentication.js | client/js/src/security/authentication.js | (function() {
'use strict';
angular.module('pub.security.authentication', [])
.factory('authentication', [
'$q',
'$http',
'securityContext',
function($q, $http, securityContext) {
var authentication = {
requestSecurityContext: function() {
debugger;
... | (function() {
'use strict';
angular.module('pub.security.authentication', [])
.factory('authentication', [
'$q',
'$http',
'securityContext',
function($q, $http, securityContext) {
var authentication = {
requestSecurityContext: function() {
if (securityCon... | Remove dubugger; statement from auth controller. | Remove dubugger; statement from auth controller.
| JavaScript | mit | carlospaelinck/publications-js,carlospaelinck/publications-js |
968ef346f21ebe8048feb1c725c0c31fd77879c1 | src/routers/group_router.js | src/routers/group_router.js | import {validate_request} from '../utils/errors'
import express from 'express'
function validate_request_body(request, response, next_handler) {
request.checkBody({
'screen_name': {
notEmpty: {
errorMessage: 'parameter is required',
},
},
})
validate_request(request, next_handler)
}
... | import {check_authentication, validate_request} from '../utils/errors'
import express from 'express'
function validate_request_body(request, response, next_handler) {
request.checkBody({
'screen_name': {
notEmpty: {
errorMessage: 'parameter is required',
},
},
})
validate_request(req... | Check an authentication in the group router | Check an authentication in the group router
| JavaScript | mit | thewizardplusplus/vk-group-stats,thewizardplusplus/vk-group-stats |
625ba111d23a074c638df40b95c21fa9c36a5868 | src/recursion/pascalsTriangle.js | src/recursion/pascalsTriangle.js | /**
* Pascal's triangle is defined as the rth column of the nth row is n! / ( r! x (n - r)!)
*
* @param {Integer} n
* @return {Array} int array where each value represents a level in the triangle.
*/
function pascalsTriangle(n) {
// Check if n is 0.
if (!n) return [];
// Start with the first level already m... | /**
* Pascal's triangle is defined as the rth column of the nth row is n! / ( r! x (n - r)!)
*
* @param {Integer} n
* @return {Array} int array where each value represents a level in the triangle.
*/
function pascalsTriangle(n) {
// Check if the triangle is empty.
if (!n) return [];
return pascalsTriangleRe... | Add recursive solution for pascals triangle | Add recursive solution for pascals triangle
| JavaScript | mit | vinnyoodles/algorithms,vinnyoodles/algorithms,vinnyoodles/algorithms |
a5164cf372f181da57ce972a5de8e3a91e2f4a5d | src/redux/reducer.js | src/redux/reducer.js | import * as actType from './action-types';
const initialState = {
loadingApi: undefined,
runtimeApi: undefined,
};
function loadApi(state = initialState, action) {
switch (action.type) {
case actType.START_LOAD_RUNTIME:
return Object.assign({}, state, {loadingApi: 'started'});
case actType.FINISH_... | import * as actType from './action-types';
const initialState = {
loadingApi: undefined,
runtimeApi: undefined,
error: undefined
};
function loadApi(state = initialState, action) {
switch (action.type) {
case actType.START_LOAD_RUNTIME:
return Object.assign({}, state, {loadingApi: 'started'});
c... | Add error state and fail payload | Add error state and fail payload
| JavaScript | apache-2.0 | pcardune/pyret-ide,pcardune/pyret-ide |
66d004e2b1f4fb5a269587519bb4a47b25935648 | test/specs/issues.spec.js | test/specs/issues.spec.js | 'use strict'
const vuedoc = require('../..')
/* global describe it expect */
describe('issues', () => {
describe('#21 - undefined default value is rendering as a non string', () => {
it('undefined default value is rendering as a non string', () => {
const filecontent = `
<script>
export... | 'use strict'
const vuedoc = require('../..')
/* global describe it expect */
describe('issues', () => {
describe('#21 - undefined default value is rendering as a non string', () => {
it('undefined default value is rendering as a non string', () => {
const filecontent = `
<script>
export... | Add a test for Spread Operator | Add a test for Spread Operator
This closes #7
| JavaScript | mit | vuedoc/md,vuedoc/md |
14db900ae0d48c8b80f9089bcc6192f229a2ec91 | src/engines/json/validationError.js | src/engines/json/validationError.js | /**
* Error
*
* @constructor
*/
var ValidationError = function() {
this.length = 0;
};
ValidationError.prototype.push = function(item) {
this[this.length] = item;
this.length += 1;
};
/**
* GetProperties
*/
ValidationError.prototype.getProperties = function() {
return pluck(this, 'property');
};
Valida... | /**
* Error
*
* @constructor
*/
var ValidationError = function() {
this.length = 0;
};
ValidationError.prototype.push = function(error) {
this[this.length] = {
property: error.property,
propertyValue: error.propertyValue,
attributeName: error.attributeName,
attributeValue: error.attributeValu... | Add a compatibility layer to the ‘Error’ object | Add a compatibility layer to the ‘Error’ object
| JavaScript | mit | Baggz/Amanda,apiaryio/Amanda,apiaryio/Amanda |
7e6b7463cb3c6a81d32f8bbb3d4a5af0dad57737 | test/apk_test_v24.js | test/apk_test_v24.js | var assert = require("assert");
var parseApk = require("..");
describe("APK V24", function () {
var output = null;
before(function (done) {
parseApk(__dirname + "/samples/test_v24.apk", function (err, out) {
if (err) {
return done(err);
}
output = ou... | var assert = require("assert");
var parseApk = require("..");
describe("APK V24", function () {
var output = null;
before(function (done) {
parseApk(__dirname + "/samples/test_v24.apk", function (err, out) {
if (err) {
return done(err);
}
output = ou... | Change test_v24 to the correct item. | Change test_v24 to the correct item.
| JavaScript | mit | rubenv/node-apk-parser |
ac87ce6e6055531f6e33a8def6014be7ad53f44b | test/notSupported.js | test/notSupported.js | /*global describe, it */
/*exported should */
/*jshint -W030 */
var should = require('should'),
supertest = require('supertest'),
app = require('../app');
describe('notSupported', function() {
it('should not support anything', function(done) {
supertest(app).
get('/api/v1/').
expect(500, fu... | /*global describe, it */
/*exported should */
/*jshint -W030 */
var should = require('should'),
supertest = require('supertest'),
app = require('../app');
describe('notSupported', function() {
it('should not support any resources', function(done) {
supertest(app).
get('/api/v1/questions').
... | Test AEP and non-API 404s | Test AEP and non-API 404s
Signed-off-by: shaisachs <47bd79f9420edf5d0991d1e2710179d4e040d480@ngpvan.com>
| JavaScript | apache-2.0 | joshco/osdi-service,NGPVAN/osdi-service |
bfe5961922d3b73e1f3dfef126bab4c0064a8afd | client/js/directives/give-focus-directive.js | client/js/directives/give-focus-directive.js | "use strict";
angular.module("hikeio").
directive("giveFocus", ["$timeout", function($timeout) {
return {
link: function(scope, element, attributes) {
scope.$watch(attributes.giveFocus, function(value) {
if (value) {
$timeout(function() {
element.focus();
});
}
});
}
};
}]); | "use strict";
angular.module("hikeio").
directive("giveFocus", ["$timeout", function($timeout) {
return {
link: function(scope, element, attributes) {
scope.$watch(attributes.giveFocus, function(value) {
if (value) {
$timeout(function() {
element.focus();
// Set focus to the end of the inp... | Set focus to the end of the input when giving focus, matters on the preopulated add dialog. | Set focus to the end of the input when giving focus, matters on the preopulated add dialog.
| JavaScript | mit | zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io |
57c67f110ddbfcc17ae6ab83170018bd778c0062 | web_client/views/layout/HeaderView.js | web_client/views/layout/HeaderView.js | import View from '../View';
import HeaderAnalysesView from './HeaderAnalysesView';
import HeaderUserView from './HeaderUserView';
import HeaderImageView from './HeaderImageView';
import router from '../../router';
import events from '../../events';
import headerTemplate from '../../templates/layout/header.pug';
import... | import View from '../View';
import HeaderAnalysesView from './HeaderAnalysesView';
import HeaderUserView from './HeaderUserView';
import HeaderImageView from './HeaderImageView';
import router from '../../router';
import headerTemplate from '../../templates/layout/header.pug';
import '../../stylesheets/layout/header.s... | Remove _setImageText in image header | Remove _setImageText in image header
| JavaScript | apache-2.0 | DigitalSlideArchive/HistomicsTK,DigitalSlideArchive/HistomicsTK |
adb12ea094d1e4b82d45489ff3bccf84b5a7791f | src/styles/PrinterStyles.js | src/styles/PrinterStyles.js | export const printStyles =
`<style>
div {
border-radius: 0px !important;
box-shadow: none !important; }
@media print {
@page { margin: 0; }
body { margin: 0 0; }
img {visibility: hidden; }
}
</style>`;
| export const printStyles =
`<style>
div {
border-width: 0px ! important;
border-radius: 0px !important;
box-shadow: none !important;}
img {
visibility: hidden; }
@media print {
@page { margin: 0; }
body { margin: 0 0; }
}
</style>`;
| Fix pdf image appearing and borders appering | [styling]: Fix pdf image appearing and borders appering
| JavaScript | mit | AndrewTHuang/fear-the-repo,sujaypatel16/fear-the-repo,dont-fear-the-repo/fear-the-repo,dont-fear-the-repo/fear-the-repo,AndrewTHuang/fear-the-repo,sujaypatel16/fear-the-repo |
514a9f2a5b58adefd596d6551373c48397f12076 | chromeapi.js | chromeapi.js | (function() {
// Find the parent window, which has its parent set to itself.
var parentWindow = window;
while (parentWindow.parent !== parentWindow) {
parentWindow = parentWindow.parent;
}
function failFunc(msg) {
parentWindow.alert('fail: ' + msg);
}
var onLaunchedListeners = [];
chrome = {};... | (function() {
// Find the parent window, which has its parent set to itself.
var parentWindow = window;
while (parentWindow.parent !== parentWindow) {
parentWindow = parentWindow.parent;
}
var onLaunchedListeners = [];
chrome = {};
chrome.app = {};
chrome.app.runtime = {};
chrome.app.runtime.onLa... | Fix XHR failed alerts firing incorrectly. | Fix XHR failed alerts firing incorrectly.
| JavaScript | bsd-3-clause | hgl888/mobile-chrome-apps,hgl888/mobile-chrome-apps,xiaoyanit/mobile-chrome-apps,guozanhua/mobile-chrome-apps,liqingzhu/mobile-chrome-apps,MobileChromeApps/mobile-chrome-apps,chirilo/mobile-chrome-apps,hgl888/mobile-chrome-apps,wudkj/mobile-chrome-apps,chirilo/mobile-chrome-apps,xiaoyanit/mobile-chrome-apps,xiaoyanit/m... |
217ad8ea81bc57b3bc9830d83b6798bdd11a03e5 | packages/components/containers/domains/AddressesSection.js | packages/components/containers/domains/AddressesSection.js | import React from 'react';
import { c } from 'ttag';
import PropTypes from 'prop-types';
import { Alert, Button, PrimaryButton, Block } from 'react-components';
const AddressesSection = ({ onRedirect }) => {
return (
<>
<Alert>{c('Info for domain modal')
.t`Addresses must be con... | import React from 'react';
import { c } from 'ttag';
import PropTypes from 'prop-types';
import { Alert, PrimaryButton, Block } from 'react-components';
const AddressesSection = ({ onRedirect }) => {
return (
<>
<Alert>{c('Info for domain modal')
.t`If you have a subscription pl... | Update text for addresses section | Update text for addresses section
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
a12ef315f9f8996b7b0a9036f4c82ba168e09c51 | test/javascript/public/test/settings.js | test/javascript/public/test/settings.js | QUnit.config.urlConfig.push({
id: "jquery",
label: "jQuery version",
value: ["3.2.1", "3.2.0", "3.1.1", "3.0.0", "2.2.4", "2.1.4", "2.0.3", "1.12.4", "1.11.3"],
tooltip: "What jQuery Core version to test against"
});
/* Hijacks normal form submit; lets it submit to an iframe to prevent
* navigating away from ... | QUnit.config.urlConfig.push({
id: "jquery",
label: "jQuery version",
value: ["3.2.1", "3.2.1.slim", "3.1.1", "3.1.1.slim", "3.0.0", "3.0.0.slim", "2.2.4", "2.1.4", "2.0.3", "1.12.4", "1.11.3"],
tooltip: "What jQuery Core version to test against"
});
/* Hijacks normal form submit; lets it submit to an iframe to... | Test against jQuery slim 3.x | Test against jQuery slim 3.x | JavaScript | mit | DavyJonesLocker/client_side_validations,DavyJonesLocker/client_side_validations,DavyJonesLocker/client_side_validations |
70ca3912f97118b3f583eca4299114c8ecc67e52 | minivents.js | minivents.js | function Events(target){
var events = {}, i, list, args, A = Array;
target = target || this
/**
* On: listen to events
*/
target.on = function(type, func, ctx){
events[type] || (events[type] = [])
events[type].push({f:func, c:ctx})
}
/**
* Off: stop listening to event / ... | function Events(target){
var events = {}, i, list, args, A = Array;
target = target || this
/**
* On: listen to events
*/
target.on = function(type, func, ctx){
events[type] || (events[type] = [])
events[type].push({f:func, c:ctx})
}
/**
* Off: stop listening to event / ... | Remove \!, switch ternary outs | Remove \!, switch ternary outs
| JavaScript | mit | allouis/minivents,Aestek/minivents,remy/minivents,callpage/minivents,samlin08/minivents,objectliteral/multivents |
29c079971ecd241a69ccde5bee41f3a0170ab753 | game/Wall.js | game/Wall.js | try {
window;
} catch(e) {
var utility = require('./../game/utility');
}
function Wall(start_x, start_y, end_x, end_y) {
this.start_x = start_x;
this.start_y = start_y;
this.end_x = end_x;
this.end_y = end_y
}
Wall.prototype.init = function(){
}
Wall.prototype.update = function() {
}
Wall.prototype.rend... | try {
window;
} catch(e) {
var utility = require('./../game/utility');
}
function Wall(start_x, start_y, end_x, end_y) {
this.start_x = start_x;
this.start_y = start_y;
this.end_x = end_x;
this.end_y = end_y
}
Wall.prototype.init = function(){
}
Wall.prototype.update = function() {
}
Wall.prototype.rend... | Add render function to wall.js | Add render function to wall.js
| JavaScript | apache-2.0 | ninjadev/globalgamejam2016,ninjadev/globalgamejam2016 |
b0948a2a74242a7b37cbf08880e5fb979d8e85c3 | packages/lesswrong/lib/modules/indexes.js | packages/lesswrong/lib/modules/indexes.js | import { Comments, Posts } from 'meteor/example-forum';
// Recent Comments query index\
Comments._ensureIndex({'postedAt': -1, '_id': -1});
// Top Posts query index
Posts._ensureIndex({'status': -1, 'draft': -1, 'isFuture': -1, 'sticky': -1, 'score': -1, '_id': -1});
| import { Comments, Posts } from 'meteor/example-forum';
import { Votes } from "meteor/vulcan:voting";
// Recent Comments query index\
Comments._ensureIndex({'postedAt': -1, '_id': -1});
// Top Posts query index
Posts._ensureIndex({'status': -1, 'draft': -1, 'isFuture': -1, 'sticky': -1, 'score': -1, '_id': -1});
//... | Add a missing index (votes by document) | Add a missing index (votes by document)
| JavaScript | mit | Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2 |
f72ab3d284c2b751263de3847c0b908e86d156bc | javascript/userswitcher.js | javascript/userswitcher.js | (function($){
$.entwine('userswitcher', function($){
$('form.userswitcher select').entwine({
onchange : function(){
this.parents('form:first').submit();
}
});
$('form.userswitcher .Actions').entwine({
onmatch : function(){
this.hide();
}
});
$('body').entwine({
onmatch : function(){... | (function($){
$.entwine('userswitcher', function($){
$('form.userswitcher select').entwine({
onchange : function(){
this.parents('form:first').submit();
this._super();
}
});
$('form.userswitcher .Actions').entwine({
onmatch : function(){
this.hide();
this._super();
}
});
$('bod... | Add this._super calls to avoid weird JS breaking behaviour | fix(this._super): Add this._super calls to avoid weird JS breaking behaviour
| JavaScript | bsd-3-clause | sheadawson/silverstripe-userswitcher,sheadawson/silverstripe-userswitcher |
1bd478df6fe6a2a43871d6914a9cc197353a6a06 | any-db-postgres/index.js | any-db-postgres/index.js | var pg = require('pg')
, Transaction = require('any-db').Transaction
, pgNative = null
try { pgNative = pg.native } catch (__e) {}
exports.forceJS = false
exports.createConnection = function (opts, callback) {
var backend = chooseBackend()
, conn = new backend.Client(opts)
conn.begin = Transaction.createBeg... | var pg = require('pg')
, Transaction = require('any-db').Transaction
, pgNative = null
try { pgNative = pg.native } catch (__e) {}
exports.forceJS = false
exports.createConnection = function (opts, callback) {
var backend = chooseBackend()
, conn = new backend.Client(opts)
conn.begin = begin
if (callback)... | Use a single shared 'begin' function in postgres adapter | Use a single shared 'begin' function in postgres adapter
| JavaScript | mit | grncdr/node-any-db,MignonCornet/node-any-db |
bbf74b2599b124849c59019e181f22e1801293f6 | tests/test-01-instantiation.js | tests/test-01-instantiation.js | describe('Syrup Instantiation', function() {
it('should instantiate without throwing an error', function() {
require('../index.js');
});
});
| describe('Syrup Instantiation', function() {
it('should instantiate without throwing an error', function() {
require('../index.js');
});
it('should instantiate with a faker object as a property', function() {
let assert = require('assert');
assert(typeof require('../index.js').faker ... | Check for instantiation of faker on the Syrup class | Check for instantiation of faker on the Syrup class
| JavaScript | mpl-2.0 | thejsninja/syrup |
686f957171786496adae8426e2112b8e7201acc8 | app/components/routes.js | app/components/routes.js | import React from 'react'
import { Router, Route, hashHistory, IndexRoute } from 'react-router'
import App from './App'
import Home from './Home'
import NewGameContainer from './containers/NewGameContainer'
import Games from './Games'
export default (
<Router history={hashHistory}>
<Route path='/' component={Ap... | import React from 'react'
import { Router, Route, hashHistory, IndexRoute } from 'react-router'
import App from './App'
import Home from './Home'
import NewGameContainer from './containers/NewGameContainer'
import GamesContainer from './containers/GamesContainer'
export default (
<Router history={hashHistory}>
... | Correct Games route component to GamesContainer | Correct Games route component to GamesContainer
| JavaScript | mit | georgeF105/handball-scoring,georgeF105/handball-scoring |
e73c97463f71717a42ed2f13d02e2ef42c071267 | wagtail/wagtailadmin/static_src/wagtailadmin/js/submenu.js | wagtail/wagtailadmin/static_src/wagtailadmin/js/submenu.js | $(function() {
var $explorer = $('#explorer');
$('.nav-main .submenu-trigger').on('click', function() {
if ($(this).closest('li').find('.nav-submenu').length) {
// Close other active submenus first, if any
if ($('.nav-wrapper.submenu-active').length && !$(this).closest('li').ha... | $(function() {
$('.nav-main .submenu-trigger').on('click', function() {
if ($(this).closest('li').find('.nav-submenu').length) {
// Close other active submenus first, if any
if ($('.nav-wrapper.submenu-active').length && !$(this).closest('li').hasClass('submenu-active')) {
... | Remove useless JS referencing explorer | Remove useless JS referencing explorer
| JavaScript | bsd-3-clause | rsalmaso/wagtail,rsalmaso/wagtail,FlipperPA/wagtail,mixxorz/wagtail,takeflight/wagtail,FlipperPA/wagtail,nimasmi/wagtail,jnns/wagtail,FlipperPA/wagtail,gasman/wagtail,takeflight/wagtail,mikedingjan/wagtail,nimasmi/wagtail,zerolab/wagtail,wagtail/wagtail,kaedroho/wagtail,zerolab/wagtail,takeflight/wagtail,kaedroho/wagta... |
7f1f44bd33cb95a5b891abec74682c75c7b9c37e | examples/counter/store/configureStore.js | examples/counter/store/configureStore.js | import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import invariant from 'redux-immutable-state-invariant';
import devTools from 'remote-redux-devtools';
import reducer from '../reducers';
export default function configureStore(initialState) {
const store = createStore(r... | import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import invariant from 'redux-immutable-state-invariant';
import { composeWithDevTools } from 'remote-redux-devtools';
import reducer from '../reducers';
export default function configureStore(initialState) {
const store ... | Update counter example to use `composeWithDevTools` | Update counter example to use `composeWithDevTools`
| JavaScript | mit | zalmoxisus/redux-remote-monitor,zalmoxisus/remote-redux-devtools |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.