commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
2a27f0e7d82ba6a410d7183a15457719d4d5df15 | js/settings.js | js/settings.js | $(document).ready(function(){
$("#backbtn-settings").click({
param: 'route_view'
}, showView);
// first button in settings is to reset favoritelist
// an empty list gets assigned to the favoritelist in localforage
$("#clearbtn").click(function(){
localforage.setItem("favList",[],function(err){});
... | $(document).ready(function(){
$("#backbtn-settings").click({
param: 'route_view'
}, showView);
// first button in settings is to reset favoritelist
// an empty list gets assigned to the favoritelist in localforage
$("#clearbtn").click(function(){
localforage.setItem("favList",[],function(err){});
... | Fix reload after FavList clear to show changes immediately. | Fix reload after FavList clear to show changes immediately.
| JavaScript | apache-2.0 | jonny-en/KoblenzBus,jonny-en/KoblenzBus | ---
+++
@@ -8,6 +8,6 @@
// an empty list gets assigned to the favoritelist in localforage
$("#clearbtn").click(function(){
localforage.setItem("favList",[],function(err){});
- $("#route_view").load("../route.html");
+ location.reload();
});
}); |
6a4c8185b053d82b4f3eef707a038262247102bd | bs-config.js | bs-config.js | module.exports = {
// browser: 'google chrome',
reloadDelay: 250,
open: false,
files: ['build/*.css', 'build/*.js', 'build/*.html'],
server: {
baseDir: './build',
},
notify: false,
}
| module.exports = {
// browser: 'google chrome',
open: false,
files: ['build/*.css', 'build/*.js', 'build/*.html'],
server: {
baseDir: './build',
},
notify: false,
}
| Remove the browser-sync reload delay | Remove the browser-sync reload delay
| JavaScript | agpl-3.0 | hawkrives/gobbldygook,hawkrives/gobbldygook,hawkrives/gobbldygook | ---
+++
@@ -1,6 +1,5 @@
module.exports = {
// browser: 'google chrome',
- reloadDelay: 250,
open: false,
files: ['build/*.css', 'build/*.js', 'build/*.html'],
server: { |
abb61893261347174fd6055ab2013f2113ed2472 | test/rules/bodySelectors.js | test/rules/bodySelectors.js | exports.tests = [
{
css: '.foo body > h2 {}',
metrics: {
redundantBodySelectors: 1
}
},
{
css: 'body ul li a {}',
metrics: {
redundantBodySelectors: 1
}
},
{
css: 'body#foo ul li a {}',
metrics: {
redundantBodySelectors: 1
}
},
{
css: 'body > h1 {}',
metrics: {
redundantBodySele... | exports.tests = [
{
css: '.foo body > h2 {}',
metrics: {
redundantBodySelectors: 1
}
},
{
css: 'body ul li a {}',
metrics: {
redundantBodySelectors: 1
}
},
{
css: 'body#foo ul li a {}',
metrics: {
redundantBodySelectors: 1
}
},
{
css: 'body > h1 {}',
metrics: {
redundantBodySele... | Add a unit test case | Add a unit test case
| JavaScript | bsd-2-clause | macbre/analyze-css,gmetais/analyze-css,macbre/analyze-css | ---
+++
@@ -46,5 +46,11 @@
metrics: {
redundantBodySelectors: 0
}
+ },
+ {
+ css: 'html.modal-popup-mode body {}',
+ metrics: {
+ redundantBodySelectors: 0
+ }
}
]; |
5165725d3230135f16cf7cdd178d93be88c8dc7a | webpack.config.production.js | webpack.config.production.js | var Clean = require('clean-webpack-plugin'),
ExtractTextPlugin = require('extract-text-webpack-plugin'),
webpack = require('webpack'),
webpackConfig = require('webpack-config');
var config = webpackConfig.fromCwd().merge({
output: {
filename: 'videojs.chapter-thumbnail... | var Clean = require('clean-webpack-plugin'),
ExtractTextPlugin = require('extract-text-webpack-plugin'),
webpack = require('webpack'),
webpackConfig = require('webpack-config');
var config = webpackConfig.fromCwd().merge({
output: {
filename: 'videojs.chapter-thumbnail... | Remove comments from minified version. | chore(webpack): Remove comments from minified version.
| JavaScript | mit | chemoish/videojs-chapter-thumbnails,chemoish/videojs-chapter-thumbnails | ---
+++
@@ -17,7 +17,9 @@
new ExtractTextPlugin('videojs.chapter-thumbnails.min.css'),
new webpack.optimize.DedupePlugin(),
- new webpack.optimize.UglifyJsPlugin()
+ new webpack.optimize.UglifyJsPlugin({
+ comments: false
+ })
];
module.exports = config; |
e80f8d4096642746c44bfb80540e65901360493b | options.js | options.js | "use strict";
if (typeof localStorage !== "undefined"){
for(var key in localStorage){
if (localStorage.hasOwnProperty(key) && key != "debug") exports[key] = localStorage[key];
}
}
exports.register = function(opt, ele, nopersist){
var field = ele.type == "checkbox" ? "checked" : "value";
if (exports[opt]) ele[fiel... | "use strict";
if (typeof localStorage !== "undefined"){
for(var key in localStorage){
if (localStorage.hasOwnProperty(key) && key != "debug") exports[key] = localStorage[key];
}
}
exports.register = function(opt, ele, nopersist){
var field = ele.type == "checkbox" ? "checked" : "value";
if (exports[opt]) ele[fiel... | Revert using input event, change seems good enough | Revert using input event, change seems good enough
| JavaScript | mit | serprex/openEtG,serprex/openEtG | ---
+++
@@ -8,7 +8,7 @@
var field = ele.type == "checkbox" ? "checked" : "value";
if (exports[opt]) ele[field] = exports[opt];
if (!nopersist && typeof localStorage !== "undefined"){
- ele.addEventListener("input", function() {
+ ele.addEventListener("change", function() {
if (this[field]){
exports[o... |
5ba467a94ebbb66c18786ed81604612956bdb615 | packages/engine/src/markers/style.js | packages/engine/src/markers/style.js | import { camelToDash } from '@hybrids/core/src/utils';
import { error } from '../debug';
export default function style({ node, expr }, ...propertyNames) {
if (!propertyNames.length) {
return (list, { type: globalType, oldValue, changelog }) => {
switch (globalType) {
case 'modify':
Object... | import { error } from '../debug';
function camelToDash(str) {
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}
export default function style({ node, expr }, ...propertyNames) {
if (!propertyNames.length) {
return (list, { type: globalType, oldValue, changelog }) => {
switch (globalType) {... | Fix remove core source dependency | Fix remove core source dependency
| JavaScript | mit | hybridsjs/hybrids | ---
+++
@@ -1,5 +1,8 @@
-import { camelToDash } from '@hybrids/core/src/utils';
import { error } from '../debug';
+
+function camelToDash(str) {
+ return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
+}
export default function style({ node, expr }, ...propertyNames) {
if (!propertyNames.length) { |
8b3d516638836e7a824b7ebbf03a5efe7564792f | test/unit/testDownload_2.js | test/unit/testDownload_2.js | 'use strict';
var jf = require('../../'),
expect = require('chai').expect,
http = require('http');
var count = 0;
function testValue(){
count ++;
return { num: count }
}
let server = http.createServer(
(request, response) => {
response.writeHead(200, {'Content-Type': 'application/json'});
re... | 'use strict';
var jf = require('../../'),
expect = require('chai').expect,
http = require('http');
var count = 0;
function testValue(){
count ++;
return { num: count }
}
let server = http.createServer(
(request, response) => {
response.writeHead(200, {'Content-Type': 'application/json'});
re... | Fix bug of test code | Fix bug of test code
| JavaScript | bsd-3-clause | 7k8m/json.filed,7k8m/json.filed | ---
+++
@@ -26,21 +26,23 @@
function * (){ yield './' + Math.random() + '.json'; } );
downloadedJson
- .io( ( json ) => { expect( json.num ).to.equal( 1 ) }).exec();
+ .io( ( json ) => { expect( json.num ).to.equal( 1 ) })
+ .pass( () => {
+ downloadedJson
+ .io( ( json ) => { expec... |
7e6b130061ea2d778ce6ac954329f7c0e63d7bec | client/4minitz.js | client/4minitz.js | import { Meteor } from 'meteor/meteor'
Meteor.startup(function () {
$.material.init();
});
Meteor.call("gitVersionInfoUpdate");
| import { Meteor } from 'meteor/meteor'
Meteor.call("gitVersionInfoUpdate");
| Remove startup code because $.material is undefined | Remove startup code because $.material is undefined
There is no material design yet and on the material design branch this is also deleted
| JavaScript | mit | RobNeXX/4minitz,Huggle77/4minitz,4minitz/4minitz,4minitz/4minitz,4minitz/4minitz,Huggle77/4minitz,Huggle77/4minitz,RobNeXX/4minitz,RobNeXX/4minitz | ---
+++
@@ -1,7 +1,3 @@
import { Meteor } from 'meteor/meteor'
-Meteor.startup(function () {
- $.material.init();
-});
-
Meteor.call("gitVersionInfoUpdate"); |
a9a8631584407a0c67cd24c6f0a7a83be3d71585 | app/assets/javascripts/components/verify-button.js | app/assets/javascripts/components/verify-button.js | ManageIQ.angular.app.component('verifyButton', {
bindings: {
validate: '<',
enabled: '<',
validateUrl: '@',
restful: '<',
valtype: '<',
buttonLabels: '<',
},
controllerAs: 'vm',
controller: ['$scope', function($scope) {
$scope.__ = __;
var vm = this;
vm.findScope = function(... | ManageIQ.angular.app.component('verifyButton', {
bindings: {
validate: '<',
enabled: '<',
validateUrl: '@',
restful: '<',
valtype: '<',
buttonLabels: '<',
},
controllerAs: 'vm',
controller: ['$scope', function($scope) {
$scope.__ = __;
var vm = this;
vm.findScope = function(... | Remove trailing comma syntax error | Remove trailing comma syntax error
| JavaScript | apache-2.0 | ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic | ---
+++
@@ -27,7 +27,7 @@
vm.valtype,
true,
vm.findScope,
- vm.validateUrl,
+ vm.validateUrl
);
} else {
vm.validate(vm.validateUrl); |
58adf61de75b551d72601eef7f2179897bf99732 | src/game/GameScene.js | src/game/GameScene.js | var GameLayer = cc.Layer.extend({
ctor:function () {
//
this._super();
var gameLayer = ccs.load(res.GameScene_json);
this.addChild(gameLayer.node)
}
});
var GameScene = cc.Scene.extend({
onEnter:function() {
this._super();
var layer = new GameLayer();
this.addChild(layer);
}
});
| var GameLayer = cc.Layer.extend({
ctor:function () {
//
this._super();
var bkg = new cc.LayerColor(cc.color.WHITE);
this.addChild(bkg);
var gameLayer = ccs.load(res.GameScene_json);
this.addChild(gameLayer.node);
}
});
var GameScene = cc.Scene.extend({
onEnter:function() {
this._super();
var laye... | Add background for game scene | Add background for game scene
| JavaScript | mit | darkdukey/PeriodicQuest,darkdukey/PeriodicQuest | ---
+++
@@ -3,9 +3,12 @@
ctor:function () {
//
this._super();
-
+
+ var bkg = new cc.LayerColor(cc.color.WHITE);
+ this.addChild(bkg);
+
var gameLayer = ccs.load(res.GameScene_json);
- this.addChild(gameLayer.node)
+ this.addChild(gameLayer.node);
}
});
|
c8081bb7f8c20e59fe91b53191fb72e71df354ef | src/client/app/controllers/SearchController.js | src/client/app/controllers/SearchController.js | /*globals angular, console*/
/**
* @author lattmann / https://github.com/lattmann
*/
angular.module('RequirementsApp').controller('SearchController', function (SearchService, $scope) {
'use strict';
var self = this;
console.log('SearchController');
$scope.model = {
data: {}
};
$sc... | /*globals angular, console*/
/**
* @author lattmann / https://github.com/lattmann
*/
angular.module('RequirementsApp').controller('SearchController', function (SearchService, $scope, $location) {
'use strict';
var self = this;
console.log('SearchController');
$scope.model = {
data: {}
... | Update search query in the url. | Update search query in the url.
| JavaScript | mit | dynamics-team/requirements-editor,dynamics-team/requirements-editor,dynamics-team/requirements-editor,dynamics-team/requirements-editor | ---
+++
@@ -3,7 +3,7 @@
* @author lattmann / https://github.com/lattmann
*/
-angular.module('RequirementsApp').controller('SearchController', function (SearchService, $scope) {
+angular.module('RequirementsApp').controller('SearchController', function (SearchService, $scope, $location) {
'use strict';
... |
b2d9b294026e2d7d2cb1652fcf9f6e90a531f600 | config-example.js | config-example.js | /**
* Ripple Client Configuration
*
* Copy this file to config.js and edit to suit your preferences.
*/
var Options = {
server: {
"trusted" : true,
"websocket_ip" : "127.0.0.1",
"websocket_port" : 5006,
"websocket_ssl" : false
},
blobvault : "54.243.129.146:80",
// If set, login will persis... | /**
* Ripple Client Configuration
*
* Copy this file to config.js and edit to suit your preferences.
*/
var Options = {
server: {
"trusted" : true,
"websocket_ip" : "s1.ripple.com",
"websocket_port" : 51233,
"websocket_ssl" : true
// "websocket_ip" : "127.0.0.1",
// "websocket_port" : 5006,
... | Add s1 as the default server in the example config. | Add s1 as the default server in the example config.
| JavaScript | isc | xdv/ripple-client-desktop,thics/ripple-client-desktop,vhpoet/ripple-client,resilience-me/DEPRICATED_ripple-client,h0vhannes/ripple-client,MatthewPhinney/ripple-client,h0vhannes/ripple-client,arturomc/ripple-client,ripple/ripple-client,h0vhannes/ripple-client,darkdarkdragon/ripple-client,ripple/ripple-client-desktop,res... | ---
+++
@@ -6,9 +6,12 @@
var Options = {
server: {
"trusted" : true,
- "websocket_ip" : "127.0.0.1",
- "websocket_port" : 5006,
- "websocket_ssl" : false
+ "websocket_ip" : "s1.ripple.com",
+ "websocket_port" : 51233,
+ "websocket_ssl" : true
+// "websocket_ip" : "127.0.0.1",
+// "web... |
46c62aa4945b646742815d42857cc6c661b246e3 | .eslintrc.js | .eslintrc.js | module.exports = {
parser: 'babel-eslint',
extends: ['airbnb-base', 'prettier'],
plugins: ['prettier'],
globals: {
Promise: true
},
env: {
node: true
},
rules: {
'comma-dangle': 'off',
'import/prefer-default-export': ['warn'],
'function-paren-newline': ['error', 'consistent'],
'p... | module.exports = {
parser: 'babel-eslint',
extends: ['airbnb-base', 'prettier'],
plugins: ['prettier'],
globals: {
Promise: true
},
env: {
jest: true, // https://stackoverflow.com/a/40265356/586382
node: true
},
rules: {
'comma-dangle': 'off',
'import/prefer-default-export': ['warn'... | Remove linting errors due to `jest` globals | Remove linting errors due to `jest` globals
| JavaScript | mit | jevakallio/redux-offline,redux-offline/redux-offline | ---
+++
@@ -6,6 +6,7 @@
Promise: true
},
env: {
+ jest: true, // https://stackoverflow.com/a/40265356/586382
node: true
},
rules: { |
2a66c8aff08e9638c31c94e64ef96151db56596b | client/reducers/index.js | client/reducers/index.js | import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
const rootReducer = combineReducers({
routing: routerReducer
});
export default rootReducer; | import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import { reducer as formReducer } from 'redux-form';
const rootReducer = combineReducers({
form: formReducer,
routing: routerReducer
});
export default rootReducer; | Create root reducer for the application | Create root reducer for the application
| JavaScript | mit | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books | ---
+++
@@ -1,7 +1,9 @@
import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
+import { reducer as formReducer } from 'redux-form';
const rootReducer = combineReducers({
+ form: formReducer,
routing: routerReducer
});
|
d2ef89c404a03d1823d3aec4237509ba46e40cc5 | .eslintrc.js | .eslintrc.js | module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
'rule... | module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
'rule... | Remove no-multi-spaces rule from eslint | Remove no-multi-spaces rule from eslint
| JavaScript | mit | melonmanchan/reaktor-chat-client,melonmanchan/reaktor-chat-client | ---
+++
@@ -15,6 +15,7 @@
// allow paren-less arrow functions
'arrow-parens': 0,
'key-spacing': 0,
+ 'no-multi-spaces': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development |
26cf0aef62fdadac3ea9697adc1242f4a2dc49ff | Kwc/Advanced/IntegratorTemplate/Embed/Component.js | Kwc/Advanced/IntegratorTemplate/Embed/Component.js | 'use strict';
var $ = require('jQuery');
var onReady = require('kwf/on-ready');
var BaseUrl = require('kwf/base-url');
onReady.onRender('.kwcClass', function(el) {
//if embed template is used turn all xhr into cross domain xhr
$.ajaxPrefilter(function(options) {
if (options.url.substr(0, 1) == '/') {
... | 'use strict';
var $ = require('jQuery');
var onReady = require('kwf/on-ready');
var BaseUrl = require('kwf/base-url');
onReady.onRender('.kwcClass', function(el) {
//if embed template is used turn all xhr into cross domain xhr
$.ajaxPrefilter(function(options) {
if (options.url.substr(0, 1) == '/') {
... | Fix getting baseUrl from component-div | Fix getting baseUrl from component-div
| JavaScript | bsd-2-clause | koala-framework/koala-framework,koala-framework/koala-framework | ---
+++
@@ -7,9 +7,9 @@
//if embed template is used turn all xhr into cross domain xhr
$.ajaxPrefilter(function(options) {
if (options.url.substr(0, 1) == '/') {
- options.url = el.data('kwfUp-base-url')+options.url;
+ options.url = el.data('base-url')+options.url;
... |
c87d8ba8845e686e9323c99445bdd6ddf2627c74 | .eslintrc.js | .eslintrc.js | module.exports = {
extends: 'fyndiq',
rules: {
// This rules causes issues because of nested packages.json, disabling
'import/no-extraneous-dependencies': 0,
'jsx-a11y/label-has-for': ['error', {
required: {
every: ['nesting'],
},
}],
},
}
| module.exports = {
extends: 'fyndiq',
rules: {
// These rules causes issues because of nested packages.json, disabling
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': [2, { ignore: ['@storybook/react'] }],
'import/extensions': [2, { ignorePackages: true }],
'jsx-a11y/label-has-f... | Tweak eslint config to ignore problematic packages | :see_no_evil: Tweak eslint config to ignore problematic packages
| JavaScript | mit | fyndiq/fyndiq-ui,fyndiq/fyndiq-ui | ---
+++
@@ -1,8 +1,11 @@
module.exports = {
extends: 'fyndiq',
rules: {
- // This rules causes issues because of nested packages.json, disabling
+ // These rules causes issues because of nested packages.json, disabling
'import/no-extraneous-dependencies': 0,
+ 'import/no-unresolved': [2, { ignore... |
e6a577658d1d06abfc8b3efa753575188b39812f | promise.js | promise.js |
module.exports = global.Promise
if (!module.exports) {
try {
module.exports = require('bluebird')
} catch (_) {}
}
|
try {
module.exports = require('bluebird')
} catch (_) {
module.exports = global.Promise
}
| Add attempt to require bluebird first | Add attempt to require bluebird first
| JavaScript | mit | rstacruz/native-or-bluebird,normalize/native-or-bluebird | ---
+++
@@ -1,8 +1,6 @@
-module.exports = global.Promise
-
-if (!module.exports) {
- try {
- module.exports = require('bluebird')
- } catch (_) {}
+try {
+ module.exports = require('bluebird')
+} catch (_) {
+ module.exports = global.Promise
} |
078673dfa568f7ddf9c1dec8b19d91995da91b35 | proxy_server.js | proxy_server.js | var Proxy = require('./proxy');
var RouterClient = require('./router_client');
var ServiceRegistryClient = require('./service_registry_client');
var VersionClient = require('./version_client');
var port = process.env.PORT || 4001;
var opts = {
host: process.env.COREOS_PRIVATE_IPV4
};
var serviceRegistryClient = ne... | var Proxy = require('./proxy');
var RouterClient = require('./router_client');
var ServiceRegistryClient = require('./service_registry_client');
var VersionClient = require('./version_client');
var port = process.env.PORT || 4001;
var opts = {
host: process.env.COREOS_PRIVATE_IPV4
};
// allow a list of peers to be... | Allow env option to pass in a list of etcd peers | Allow env option to pass in a list of etcd peers
| JavaScript | apache-2.0 | zettajs/link-router,zettajs/link-router | ---
+++
@@ -8,6 +8,11 @@
var opts = {
host: process.env.COREOS_PRIVATE_IPV4
};
+
+// allow a list of peers to be passed, overides COREOS_PRIVATE_IPV4
+if (process.env.ETCD_PEER_HOSTS) {
+ opts.host = process.env.ETCD_PEER_HOSTS.split(',');
+}
var serviceRegistryClient = new ServiceRegistryClient(opts);
|
bc0cb8e9849b4f8f1866065436934203ef0ecc91 | js/setListHeight.js | js/setListHeight.js | //Source: http://stackoverflow.com/questions/3837037/div-with-scrollbar-inside-div-with-positionfixed
(function($) {
$.fn.getPotentialHeight = function() {
var $element = this;
//heightOfParent is the height of parents content (inside the padding)
var heightOfParent = $element.parent().height(... | //Source: http://stackoverflow.com/questions/3837037/div-with-scrollbar-inside-div-with-positionfixed
(function($) {
$.fn.getPotentialHeight = function() {
var $element = this;
//heightOfParent is the height of parents content (inside the padding)
var heightOfParent = $element.parent().height(... | Set height info wrapper to 100% | Set height info wrapper to 100%
| JavaScript | mit | sjbuysse/sessions-map,sjbuysse/sessions-map | ---
+++
@@ -22,6 +22,6 @@
$infoWrapper = $('#info-wrapper');
var phInfoWrapper = $infoWrapper.getPotentialHeight();
- $infoWrapper.css('height', phInfoWrapper);
+ //$infoWrapper.css('height', phInfoWrapper);
}
); |
dbfca4cb557ebe45e1b81ddbe37785e35b9513a8 | webpack/webpack.build.js | webpack/webpack.build.js | var path = require("path");
var webpack = require("webpack");
var DtsBundlePlugin = require("./webpack.dts.plugin");
module.exports = {
entry: {
main: "./src/index",
},
resolve: {
extensions: [".ts"],
},
output: {
filename: "trapezium.js",
},
module: {
ru... | var path = require("path");
var webpack = require("webpack");
var DtsBundlePlugin = require("./webpack.dts.plugin");
module.exports = {
entry: {
main: "./src/index",
},
resolve: {
extensions: [".ts"],
},
output: {
filename: "trapezium.js",
libraryTarget: "commonjs... | Add libraryTarget to make module exportable | Add libraryTarget to make module exportable
| JavaScript | mit | Josh-ES/trapezium,Josh-ES/trapezium,Josh-ES/trapezium | ---
+++
@@ -14,6 +14,7 @@
output: {
filename: "trapezium.js",
+ libraryTarget: "commonjs",
},
module: { |
1319e5d2f7010d68db5df3c090474aba190edaaf | queries.js | queries.js | const promise = require('bluebird');
const options = {
promiseLib: promise
};
const pgp = require('pg-promise')(options);
const connectionString = 'postgres://localhost:5432/todos';
const db = pgp(connectionString);
let getAllTodos = (req, res, next) => {
db.any('SELECT * FROM todos')
.then(data => {
r... | Add function to get all todos | Add function to get all todos
| JavaScript | mit | spencerdezartsmith/to-do-list-app,spencerdezartsmith/to-do-list-app | ---
+++
@@ -0,0 +1,28 @@
+const promise = require('bluebird');
+
+const options = {
+ promiseLib: promise
+};
+
+const pgp = require('pg-promise')(options);
+const connectionString = 'postgres://localhost:5432/todos';
+const db = pgp(connectionString);
+
+let getAllTodos = (req, res, next) => {
+ db.any('SELECT * F... | |
2f1a460b80e30451e3bb502079c9477889e271d9 | src/knockout-hint.js | src/knockout-hint.js | (function(win, doc, $, ko){
var options = {
hiddenClass: 'hidden'
};
ko.bindingHandlers.hint = {
init:function (element, valueAccessor, allBindingsAccessor) {
var observable = valueAccessor(),
hintOptions = allBindingsAccessor().hintOptions,
cssCl... | (function(win, doc, $, ko){
var options = {
hiddenClass: 'hidden'
};
ko.bindingHandlers.hint = {
init:function (element, valueAccessor, allBindingsAccessor) {
var observable = valueAccessor(),
hintOptions = allBindingsAccessor().hintOptions,
cssCl... | Clean hint logic from copy/paste | Clean hint logic from copy/paste
| JavaScript | mit | s-stude/knockout-hint | ---
+++
@@ -17,11 +17,7 @@
insertCustomCss();
}
- if (observable()) {
- $(element).removeClass(cssClass);
- } else {
- $(element).addClass(cssClass);
- }
+ applyHint(observable, element, cssClass);
},
... |
169ae6727f388814d211a4ac029d66560df2d6bb | src/ui-preferences/ContainerPreferenceGroup.js | src/ui-preferences/ContainerPreferenceGroup.js | import ContextualIdentities from '../ContextualIdentity';
import PreferenceGroup from './PreferenceGroup';
import ContainerPreference from './ContainerPreference';
/**
* Contains a @see{ContainerPreference} for each existing container
*/
export default class ContainerPreferenceGroup extends PreferenceGroup {
cons... | import ContextualIdentities from '../ContextualIdentity';
import PreferenceGroup from './PreferenceGroup';
import ContainerPreference from './ContainerPreference';
/**
* Contains a @see{ContainerPreference} for each existing container
*/
export default class ContainerPreferenceGroup extends PreferenceGroup {
cons... | Use the correct variable for ContainerPreference names | Use the correct variable for ContainerPreference names
| JavaScript | mit | kintesh/containerise,kintesh/containerise | ---
+++
@@ -16,7 +16,7 @@
this._preferences = (await ContextualIdentities.get())
.map((container) => {
return new ContainerPreference({
- name: container.cookieStoreId,
+ name: `${this.name}.${container.cookieStoreId}`,
label: container.name,
});
... |
7002a6583915ad000faf0edb7f2943e768199d43 | Identity/MonadIdentity.js | Identity/MonadIdentity.js | var Identity = require('./Identity');
module.exports = {
pure : function(x){ return new Identity(x); },
copure : function(idx){ return idx.val; }
} | var Identity = require('./Identity');
module.exports = {
pure : function(x){ return new Identity(x); },
copure : function(idx){
if(!(idx instanceof Identity && idx.type === 'Identity')){
throw new Error('Expected type Identity in first argument of MonadIdentity.copure, but got ' + typeof idx);
}
... | Add error detection in Identity.cobind | Add error detection in Identity.cobind
| JavaScript | mit | 5outh/famine | ---
+++
@@ -2,5 +2,10 @@
module.exports = {
pure : function(x){ return new Identity(x); },
- copure : function(idx){ return idx.val; }
+ copure : function(idx){
+ if(!(idx instanceof Identity && idx.type === 'Identity')){
+ throw new Error('Expected type Identity in first argument of MonadIdentity.co... |
342a1a88d2cc9494ba9889465074ab45167b4cd2 | lib/open-tests.js | lib/open-tests.js | 'use babel';
import { CompositeDisposable } from 'atom';
import fs from 'fs';
export default {
modalPanel: null,
subscriptions: null,
config: {
shouldCreateFile: {
type: 'boolean',
default: true,
},
testExtension: {
type: 'string',
default: '.spec',
},
},
activate(s... | 'use babel';
import { CompositeDisposable } from 'atom';
import fs from 'fs';
export default {
modalPanel: null,
subscriptions: null,
config: {
shouldCreateFile: {
type: 'boolean',
default: true,
},
testExtension: {
type: 'string',
default: '.spec',
},
},
activate(s... | Split code in separate function | refactor: Split code in separate function
| JavaScript | mit | guilhermelimak/open-tests | ---
+++
@@ -29,17 +29,21 @@
this.subscriptions.dispose();
},
- open() {
+ getTestPath() {
const testExtension = atom.config.get('open-tests.testExtension')
- const shouldCreate = atom.config.get('open-tests.shouldCreateFile')
-
const filePath = atom.workspace.getActivePaneItem().buffer.file.p... |
c4c8f60870627a8790039073562b45c61d0f1b09 | src/components/icons/Resume.js | src/components/icons/Resume.js | import React from 'react'
export const ResumeIcon = ({ className, ...props }) => (
<svg
{...props}
className={`text-resume ${className}`}
role="img"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<title>Resume</title>
<path
stro... | import React from 'react'
export const ResumeIcon = ({ className, ...props }) => (
<svg
{...props}
className={`text-resume ${className}`}
role="img"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<title>Resume PDF</title>
<path
... | Change PDF to icon title | Change PDF to icon title
| JavaScript | mit | dtjv/dtjv.github.io | ---
+++
@@ -10,7 +10,7 @@
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
- <title>Resume</title>
+ <title>Resume PDF</title>
<path
strokeLinecap="round" |
ab91ec6c0a3a56c6741ea4ff872528d2062dcd14 | tests/helpers/start-app.js | tests/helpers/start-app.js | import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
// use defaults, but you can override
let attributes = Ember.assign({}, config.APP, attrs);
Ember.run(() => {
application = Application... | import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
Ember.run... | Fix Ember 2.4 test failures | Fix Ember 2.4 test failures
| JavaScript | mit | IvyApp/ivy-tabs,IvyApp/ivy-tabs | ---
+++
@@ -5,8 +5,8 @@
export default function startApp(attrs) {
let application;
- // use defaults, but you can override
- let attributes = Ember.assign({}, config.APP, attrs);
+ let attributes = Ember.merge({}, config.APP);
+ attributes = Ember.merge(attributes, attrs); // use defaults, but you can overr... |
8734bf9d679646e4c01758698fce66dac62e4ca3 | lib/xmlbuilder.js | lib/xmlbuilder.js | module.exports = require('xmlbuilder');
module.exports.XMLFragment = require('xmlbuilder/lib/XMLFragment');
module.exports.XMLFragment.prototype.addFragment = function(fragment) {
fragment.parent = this;
this.children.push(fragment);
return this;
};
// This is a workaround for the problem that text() does not w... | module.exports = require('xmlbuilder');
module.exports.XMLFragment = require('xmlbuilder/lib/XMLFragment');
module.exports.XMLFragment.prototype.addFragment = function(fragments) {
if (fragments) {
if (!Array.isArray(fragments))
fragments = [fragments];
fragments.forEach(function(fragment) {
frag... | Support null and array for addFragment() | Support null and array for addFragment()
| JavaScript | mit | groonga/gcs,groonga/gcs | ---
+++
@@ -1,9 +1,15 @@
module.exports = require('xmlbuilder');
module.exports.XMLFragment = require('xmlbuilder/lib/XMLFragment');
-module.exports.XMLFragment.prototype.addFragment = function(fragment) {
- fragment.parent = this;
- this.children.push(fragment);
+module.exports.XMLFragment.prototype.addFragmen... |
70a62f0eda926daec87632849836c1b70fdcc554 | tests/server/roles.spec.js | tests/server/roles.spec.js | // Write a test that validates that a new role created has a unique title.
// Write a test that validates that all roles are returned when Roles.all is called.
'use strict';
const expect = require('chai').expect;
const supertest = require('supertest');
const server = require('./../../index');
const api = ... | Implement basic tests for roles | Implement basic tests for roles
| JavaScript | mit | andela-oolutola/document-management-system-api | ---
+++
@@ -0,0 +1,19 @@
+// Write a test that validates that a new role created has a unique title.
+// Write a test that validates that all roles are returned when Roles.all is called.
+
+'use strict';
+
+const expect = require('chai').expect;
+const supertest = require('supertest');
+const server = require('... | |
2c5ddda8d285c33f45e63e487eb3086169a9b1d0 | src/js/controllers/channels.js | src/js/controllers/channels.js | (function() {
'use strict';
angular.module('app.controllers.channels', []).
controller('Channels', Channels);
Channels.$inject = ['$rootScope', 'chat'];
function Channels($rootScope, chat) {
var vm = this;
$rootScope.selected = '#roomtest';
vm.select = function(cha... | (function() {
'use strict';
angular.module('app.controllers.channels', []).
controller('Channels', Channels);
Channels.$inject = ['$rootScope', 'chat'];
function Channels($rootScope, chat) {
var vm = this;
$rootScope.selected = '#roomtest';
vm.select = function(cha... | Fix vex dialog being off topic | Fix vex dialog being off topic
| JavaScript | mit | BigRoom/mystique,BigRoom/mystique | ---
+++
@@ -18,8 +18,8 @@
vm.add = function() {
vex.dialog.prompt({
- message: 'What planet did the aliens come from?',
- placeholder: 'Planet name',
+ message: 'What channel do you want to join?',
+ placeholder: 'Channel name #...',
... |
a0a7b64abff749d6abc61529300a7d6416cc797b | src/plugins/index.js | src/plugins/index.js | module.exports = function(app) {
require('./storage/url')(app);
};
| module.exports = function(app) {
require('./storage/url')(app);
require('./storage/s3')(app);
require('./storage/dropbox')(app);
};
| Add links to storage providers. | Add links to storage providers.
| JavaScript | mit | Kelsus/ngFormio,Kelsus/ngFormio,formio/ngFormio | ---
+++
@@ -1,3 +1,5 @@
module.exports = function(app) {
require('./storage/url')(app);
+ require('./storage/s3')(app);
+ require('./storage/dropbox')(app);
}; |
cbc488e92500dbb534dde3f2535fd684c5b99016 | src/server/router.js | src/server/router.js | 'use strict';
const api = require('api');
const router = require('koa-router')();
router.get('/search/em', function*() {
const value = +this.query.value;
if (!value) {
return error(this, 'missing value');
}
const options = {};
if (this.query.limit) options.limit = +this.query.limit;
i... | 'use strict';
const api = require('api');
const router = require('koa-router')();
router.get('/search/em', function*() {
const value = +this.query.value;
if (!value) {
return error(this, 'missing value');
}
const options = {};
if (this.query.limit) options.limit = +this.query.limit;
i... | Add route for molecule mf | Add route for molecule mf
| JavaScript | mit | cheminfo/node-pubchem | ---
+++
@@ -28,7 +28,7 @@
});
router.get('/molecules/mf', function*() {
- const value = +this.query.value;
+ const value = this.query.value;
if (!value) {
return error(this, 'missing value');
} |
6677136c15c7e81b8e295de68f6d3e1b551987c6 | server/index.js | server/index.js | var express = require('express')
, app = express()
, http = require('http').Server(app)
, Q = require('q');
var ROOT = GLOBAL.proj_root
, SENDFILE_OPTS = { root: ROOT }
, PORT = 55221
, START_TIMEOUT = 5;
// Static content
app.use('/components', express.static(ROOT + '/components'));
app.use('/dist', express.st... | var express = require('express')
, app = express()
, http = require('http').Server(app)
, Q = require('q');
var ROOT = GLOBAL.proj_root
, SENDFILE_OPTS = { root: ROOT }
, PORT = 55221
, START_TIMEOUT = 5;
// Static content
app.use('/components', express.static(ROOT + '/components'));
app.use('/dist', express.st... | Make http server listen only on localhost | Make http server listen only on localhost
| JavaScript | mit | cobalamin/dripdownode | ---
+++
@@ -26,7 +26,8 @@
reject('Server did not start within ' + START_TIMEOUT + ' seconds');
}, START_TIMEOUT * 1000);
- http.listen(PORT, function() {
+ http.listen(PORT, 'localhost');
+ http.on('listening', function() {
clearTimeout(timeout);
console.log('Server listening on port %s', P... |
a9a521aa44cd8e683b913df75d1b27123e0a66d0 | timepiece/static/timepiece/js/chart/productivity_chart.js | timepiece/static/timepiece/js/chart/productivity_chart.js | var scripts = document.getElementsByTagName('script'),
script = scripts[scripts.length - 1],
report = JSON.parse(script.getAttribute('data-report')),
type = script.getAttribute('data-type');
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
function draw... | var scripts = document.getElementsByTagName('script'),
script = scripts[scripts.length - 1],
report = JSON.parse(script.getAttribute('data-report')),
type = script.getAttribute('data-type');
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
function draw... | Use default text when no data exists for query | Use default text when no data exists for query
| JavaScript | mit | BocuStudio/django-timepiece,caktus/django-timepiece,dannybrowne86/django-timepiece,dannybrowne86/django-timepiece,josesanch/django-timepiece,arbitrahj/django-timepiece,caktus/django-timepiece,caktus/django-timepiece,arbitrahj/django-timepiece,gaga3966/django-timepiece,dannybrowne86/django-timepiece,gaga3966/django-time... | ---
+++
@@ -32,8 +32,9 @@
containerId: 'chart'
});
wrapper.draw();
- } else {
- container = $('#chart');
- container.text('');
+ } else if (report.length === 1) {
+ var container = $('#chart'),
+ text = $('<p>No data to display.</p>');
+ cont... |
e7d43b2bc3acaf3d890bd37eca48bcc2bc728988 | server.js | server.js | const express = require('express')
const app = express()
const path = require('path')
const nunjucks = require('nunjucks')
module.exports = app
// Set up App
const appViews = [
path.join(__dirname, '/app/views/'),
path.join(__dirname, '/app/templates/')
]
nunjucks.configure(appViews, {
autoescape: true,
expr... | const express = require('express')
const app = express()
const path = require('path')
const nunjucks = require('nunjucks')
module.exports = app
// Set up App
const appViews = [
path.join(__dirname, '/app/views/'),
path.join(__dirname, '/app/templates/'),
path.join(__dirname, '/app/components/')
]
nunjucks.conf... | Configure app to include a components folder | Configure app to include a components folder
| JavaScript | mit | alphagov/govuk_frontend_alpha,alphagov/govuk_frontend_alpha,alphagov/govuk_frontend_alpha | ---
+++
@@ -8,7 +8,8 @@
// Set up App
const appViews = [
path.join(__dirname, '/app/views/'),
- path.join(__dirname, '/app/templates/')
+ path.join(__dirname, '/app/templates/'),
+ path.join(__dirname, '/app/components/')
]
nunjucks.configure(appViews, { |
dc44b411fb78ac2b761e82b7f81011ec61d065c4 | src/webui/src/main/webapp/js/loading.js | src/webui/src/main/webapp/js/loading.js | /**
*
*/
$(document).ready(function() {
var processCheckerUrl = 'AlignmentChecker?id=' + getUrlParameter('id');
(function poll() {
$.ajax({
url : processCheckerUrl,
type: "GET",
success : function(responseText) {
// TODO - redirect to correct page
var redirectUrl = 'AligmentResultServ... | /**
*
*/
$(document).ready(function() {
var processCheckerUrl = 'AlignmentChecker?id=' + getUrlParameter('id');
(function poll() {
$.ajax({
url : processCheckerUrl,
type: "GET",
statusCode: {
200: function (responseText) {
// TODO - redirect to correct page
var redire... | Manage only 200 success answer for show results | [FIX] Manage only 200 success answer for show results | JavaScript | apache-2.0 | SALSA-W/M-SALSA,SALSA-W/M-SALSA,SALSA-W/M-SALSA,SALSA-W/M-SALSA,SALSA-W/M-SALSA | ---
+++
@@ -8,12 +8,14 @@
(function poll() {
$.ajax({
url : processCheckerUrl,
- type: "GET",
- success : function(responseText) {
- // TODO - redirect to correct page
- var redirectUrl = 'AligmentResultServlet?id=' + getUrlParameter('id');
- window.location.href = redirectUrl;
- },
+ ... |
5426209388cd10500151cbd7136d8437fd36e483 | src/bootstrap/createStore.js | src/bootstrap/createStore.js | import {applyMiddleware, compose, createStore as rawCreateStore} from 'redux';
import {persistStore, autoRehydrate} from 'redux-persist';
import createSagaMiddleware from 'redux-saga';
import createRootReducer from './createRootReducer';
import rootSaga from './rootSaga';
import {APP_NAME} from '../modules/common/const... | import {applyMiddleware, compose, createStore as rawCreateStore} from 'redux';
import {persistStore, autoRehydrate} from 'redux-persist';
import createSagaMiddleware from 'redux-saga';
import createRootReducer from './createRootReducer';
import rootSaga from './rootSaga';
import {APP_NAME} from '../modules/common/const... | Add persist language in local storage | Add persist language in local storage
| JavaScript | mit | nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map | ---
+++
@@ -26,7 +26,7 @@
// The promise returned by "createStore" will be resolved once we have re-hydrated the state.
persistStore(store, {
- whitelist: [],
+ whitelist: ['language'],
blacklist: [],
keyPrefix: `${APP_NAME}:`
}, () => resolve(store)); |
f963425d95973d726705835ec463003673f7c2a3 | src/components/video_list.js | src/components/video_list.js | import React from 'react';
import VideoListItem from './video_list_item';
const VideoList = (props) => {
const videoItems = props.videos.map((video) => {
return <VideoListItem video = {video} />
});
return (
<ul className="col-md-4 list-group">
{videoItems}
</ul>
);
}
export default VideoLi... | import React from 'react';
import VideoListItem from './video_list_item';
const VideoList = (props) => {
const videoItems = props.videos.map((video) => {
return <VideoListItem key={video.etag} video={video} />
});
return (
<ul className="col-md-4 list-group">
{videoItems}
</ul>
);
}
export ... | Add keys to each video item | Add keys to each video item
| JavaScript | mit | izabelka/redux-simple-starter,izabelka/redux-simple-starter | ---
+++
@@ -3,7 +3,7 @@
const VideoList = (props) => {
const videoItems = props.videos.map((video) => {
- return <VideoListItem video = {video} />
+ return <VideoListItem key={video.etag} video={video} />
});
return ( |
44128c849cdeb74ac658fb40cdad7259f4ebbf77 | src/config.js | src/config.js | const env = process.env;
export const nodeEnv = env.NODE_ENV || 'development';
export default {
port: env.PORT || 3001,
host: env.HOST || '0.0.0.0',
get serverUrl() {
return `http://${this.host}:${this.port}`;
}
};
| const env = process.env;
export const nodeEnv = env.NODE_ENV || 'development';
export default {
port: env.API_PORT || 3001,
host: env.API_HOST || '0.0.0.0',
get serverUrl() {
return (typeof window === 'undefined') ? `http://${this.host}:${this.port}` : '';
}
};
| Update server: split api & app | Update server: split api & app
| JavaScript | mit | hrasoa/react-pwa,hrasoa/react-pwa,hrasoa/react-pwa | ---
+++
@@ -3,9 +3,9 @@
export const nodeEnv = env.NODE_ENV || 'development';
export default {
- port: env.PORT || 3001,
- host: env.HOST || '0.0.0.0',
+ port: env.API_PORT || 3001,
+ host: env.API_HOST || '0.0.0.0',
get serverUrl() {
- return `http://${this.host}:${this.port}`;
+ return (typeof wind... |
96f8fc68343389c15dc6cc02409485ce5fb60e81 | src/components/PageRouter/index.js | src/components/PageRouter/index.js | import React from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import { NavigationBar } from '../NavigationBar';
import { PageHome } from '../PageHome';
import { PageLogin } from '../PageLogin';
import { NoRouteMatch } from '../NoRouteMatch';
const PageRouter = () => (
... | import React from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import firebase from 'firebase';
import { NavigationBar } from '../NavigationBar';
import { PageHome } from '../PageHome';
import { PageLogin } from '../PageLogin';
import { NoRouteMatch } from '../NoRouteMatch';... | Add firebase auth event listener | Add firebase auth event listener
| JavaScript | apache-2.0 | nahody/biografia,nahody/biografia | ---
+++
@@ -4,23 +4,37 @@
Route,
Switch
} from 'react-router-dom';
+import firebase from 'firebase';
import { NavigationBar } from '../NavigationBar';
import { PageHome } from '../PageHome';
import { PageLogin } from '../PageLogin';
import { NoRouteMatch } from '../NoRouteMatch';
-const PageRouter = () =... |
b04bb087adc8914391d5bdebc1471d833c5e3c00 | src/foam/swift/refines/Requires.js | src/foam/swift/refines/Requires.js | /**
* @license
* Copyright 2017 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
refines: 'foam.core.Requires',
flags: ['swift'],
requires: [
'foam.swift.Argument',
'foam.swift.Method',
],
properties: [
{
name: 'swiftReturns',
exp... | /**
* @license
* Copyright 2017 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
refines: 'foam.core.Requires',
flags: ['swift'],
requires: [
'foam.swift.Argument',
'foam.swift.Method',
],
properties: [
{
name: 'swiftReturns',
exp... | Add 2nd parameter to create that's generated for requires that allows you to overwrite context. | Add 2nd parameter to create that's generated for requires that allows you to overwrite context.
| JavaScript | apache-2.0 | foam-framework/foam2,jacksonic/vjlofvhjfgm,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2 | ---
+++
@@ -37,6 +37,11 @@
defaultValue: '[:]',
type: '[String:Any?]',
}),
+ this.Argument.create({
+ localName: 'x',
+ defaultValue: 'nil',
+ type: 'Context?',
+ }),
],
}));
},
@@ -46,7 +51,7 @@
name: ... |
8b1071b55c32343dc4c427924959361a127d970e | test/algorithms/math/testGCD.js | test/algorithms/math/testGCD.js | /* eslint-env mocha */
const gcd = require('../../../src').algorithms.math.gcd;
const assert = require('assert');
describe('GCD', () => {
it('should return 0 for either or both numbers as 0', () => {
assert.equal(gcd(0, 10), 0);
assert.equal(gcd(10, 0), 0);
assert.equal(gcd(0, 0), 0);
});
it('shoul... | /* eslint-env mocha */
const gcd = require('../../../src').algorithms.math.gcd;
const assert = require('assert');
describe('GCD', () => {
it('should return 0 for either or both numbers as 0', () => {
assert.equal(gcd(0, 10), 0);
assert.equal(gcd(10, 0), 0);
assert.equal(gcd(0, 0), 0);
});
it('shoul... | Test GCD: Tests handling of negative numbers | Test GCD: Tests handling of negative numbers
| JavaScript | mit | ManrajGrover/algorithms-js | ---
+++
@@ -21,4 +21,10 @@
assert.equal(gcd(65, 10), 5);
assert.equal(gcd(3, 2), 1);
});
+
+ it('should return gcd of negative numbers', () => {
+ assert.equal(gcd(-60, -10), 10);
+ assert.equal(gcd(65, -10), 5);
+ assert.equal(gcd(-3, 2), 1);
+ });
}); |
124541264f788091dfc754696df8448769c7a0a7 | tasks/build.js | tasks/build.js | // imports
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var uglify = require('gulp-uglify');
var buffer = require('vinyl-buffer');
// build src
gulp.task('browserify', function(cb){
return browserify('./src/app.js', {
debug: ... | // imports
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var uglify = require('gulp-uglify');
var buffer = require('vinyl-buffer');
// build src
gulp.task('browserify', function(cb){
return browserify('./src/app.js', {
debug: ... | Update path fonts gulp task | Update path fonts gulp task | JavaScript | mit | microscope-mobile/ionic-firebase,microscope-mobile/ionic-firebase,microscope-mobile/ionic-firebase,microscope-mobile/ionic-firebase,microscope-mobile/ionic-firebase | ---
+++
@@ -32,7 +32,7 @@
// copy fonts
gulp.task('fonts', function(cb){
- return gulp.src('node_modules/ionic-framework/release/fonts/**')
+ return gulp.src('node_modules/ionic-npm/fonts/**')
.pipe(gulp.dest('./www/fonts/'));
cb();
}); |
aeb7aeeb4e335b885e71eec5da68819983d3402d | app/assets/javascripts/reducers/wikidata_labels.js | app/assets/javascripts/reducers/wikidata_labels.js | import { forEach } from 'lodash-es';
import { RECEIVE_WIKIDATA_LABELS } from '../constants';
const initialState = {
labels: {}
};
export default function wikidataLabels(state = initialState, action) {
switch (action.type) {
case RECEIVE_WIKIDATA_LABELS: {
const newLabels = { ...state.labels };
for... | import { forEach } from 'lodash-es';
import { RECEIVE_WIKIDATA_LABELS } from '../constants';
const initialState = {
labels: {}
};
export default function wikidataLabels(state = initialState, action) {
switch (action.type) {
case RECEIVE_WIKIDATA_LABELS: {
const newLabels = { ...state.labels };
for... | Fix error caused by a deleted Wikidata item | Fix error caused by a deleted Wikidata item
If an edited item was deleted, the request for labels for that item will not include a `labels` property for it.
| JavaScript | mit | WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard | ---
+++
@@ -10,6 +10,7 @@
case RECEIVE_WIKIDATA_LABELS: {
const newLabels = { ...state.labels };
forEach(action.data.entities, (entity) => {
+ if (!entity.labels) { return; }
const label = entity.labels[action.language] || entity.labels.en;
if (!label) { return; }
... |
38d94b51f8446e61a7adceac410ce0bff28de6fc | packages/sproutcore-handlebars/lib/controls/checkbox.js | packages/sproutcore-handlebars/lib/controls/checkbox.js | // ==========================================================================
// Project: SproutCore Handlebar Views
// Copyright: ©2011 Strobe Inc. and contributors.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
require("sprou... | // ==========================================================================
// Project: SproutCore Handlebar Views
// Copyright: ©2011 Strobe Inc. and contributors.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
require("sprou... | Fix SC.Checkbox bug in IE | Fix SC.Checkbox bug in IE
| JavaScript | mit | code0100fun/ember.js,wecc/ember.js,JacobNinja/es6,xtian/ember.js,workmanw/ember.js,mfeckie/ember.js,Serabe/ember.js,jherdman/ember.js,paddyobrien/ember.js,Zagorakiss/ember.js,cbou/ember.js,kellyselden/ember.js,johanneswuerbach/ember.js,johnnyshields/ember.js,mrjavascript/ember.js,gfvcastro/ember.js,marcioj/ember.js,pix... | ---
+++
@@ -23,14 +23,7 @@
defaultTemplate: SC.Handlebars.compile('<label><input type="checkbox" {{bindAttr checked="value"}}>{{title}}</label>'),
click: function() {
- if (jQuery.browser.msie) {
- this.change();
- }
- },
-
- change: function() {
SC.run.once(this, this._updateElementValue);
... |
79e07cd02beb910d16c6f80210f1da1f905f1487 | src/providers/domestika.org.js | src/providers/domestika.org.js | import JobProvider from './jobProvider'
export default class extends JobProvider {
constructor() {
super({
id: 'dmtk',
name: 'domestika.org',
logo: 'http://4.bp.blogspot.com/-_ntAal9lU2I/T3XBljnauCI/AAAAAAAAAWo/kS3eJcZZQvs/s490/domestika-logo.gif',
scope: 'ul.jobs-list li.job-item',
... | import JobProvider from './jobProvider'
export default class extends JobProvider {
constructor() {
super({
id: 'dmtk',
name: 'domestika.org',
logo: 'http://4.bp.blogspot.com/-_ntAal9lU2I/T3XBljnauCI/AAAAAAAAAWo/kS3eJcZZQvs/s490/domestika-logo.gif',
scope: 'ul.jobs-list li.job-item',
... | Fix on scrap link for domestika provider | Fix on scrap link for domestika provider
| JavaScript | mit | xcafebabe/jobsify,xcafebabe/jobsify,xcafebabe/jobsify | ---
+++
@@ -9,7 +9,7 @@
scope: 'ul.jobs-list li.job-item',
selectors: {
title: 'h2.job-item__title a',
- url: '.h2.job-item__title a@href',
+ url: 'h2.job-item__title a@href',
date: 'div.job-item__date',
company: 'h3.job-item__company',
location: 'div.jo... |
66cee3efb8e1c9e4dfab6ca33f4534023909fbf6 | react-native/react/constants/platform.native.desktop.js | react-native/react/constants/platform.native.desktop.js | import {OS_DESKTOP} from './platform.shared'
import path from 'path'
export const isDev = process.env.NODE_ENV === 'development'
export const OS = OS_DESKTOP
export const isMobile = false
const runMode = process.env.KEYBASE_RUN_MODE || 'devel'
const envedPathOSX = {
staging: 'KeybaseStaging',
devel: 'KeybaseDevel... | import {OS_DESKTOP} from './platform.shared'
import path from 'path'
export const isDev = process.env.NODE_ENV === 'development'
export const OS = OS_DESKTOP
export const isMobile = false
const runMode = process.env.KEYBASE_RUN_MODE || 'devel'
const envedPathOSX = {
staging: 'KeybaseStaging',
devel: 'KeybaseDevel... | Support prod runmode on Linux | Support prod runmode on Linux
(On Linux the service doesn't append .prod if it's prod, for some reason.)
| JavaScript | bsd-3-clause | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client | ---
+++
@@ -18,6 +18,10 @@
'linux': `${process.env.XDG_RUNTIME_DIR}/keybase.${runMode}/`
}
+ if (runMode === 'prod') {
+ paths['linux'] = `${process.env.XDG_RUNTIME_DIR}/keybase/`
+ }
+
return paths[process.platform]
}
|
e9d96c7a4af0c8a973dfed0a009da39cd30d06a9 | resources/frontend/app/pods/tournament/matches/route.js | resources/frontend/app/pods/tournament/matches/route.js | import Ember from 'ember';
import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';
export default Ember.Route.extend(ApplicationRouteMixin, {
model() {
const tournamentId = this.modelFor('tournament').get('id');
return this.store.query('match', {tournamentId});
},
setupControlle... | import Ember from 'ember';
import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';
const { Route, RSVP } = Ember;
export default Route.extend(ApplicationRouteMixin, {
model() {
const tournamentId = this.modelFor('tournament').get('id');
let rsvpHash = {
matches: this.get('stor... | Load teams on the first load of the tournament matches page | Load teams on the first load of the tournament matches page
| JavaScript | mit | nixsolutions/ggf,nixsolutions/ggf,nixsolutions/ggf,nixsolutions/ggf | ---
+++
@@ -1,11 +1,20 @@
import Ember from 'ember';
import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';
-export default Ember.Route.extend(ApplicationRouteMixin, {
+const { Route, RSVP } = Ember;
+
+export default Route.extend(ApplicationRouteMixin, {
model() {
const tournamen... |
1113d8d922fca15167d897decb5383569dff5c73 | js/participantFilter/datasetView.directive.js | js/participantFilter/datasetView.directive.js | 'use strict';
module.exports = DatasetView;
/** @ngInject **/
function DatasetView() {
return {
scope: {
participant: '=',
dataset: '=',
onEdit: '&'
},
template: require('./datasetView.directive.html'),
controllerAs: 'vm',
bindToController: true,
/** @ngInject **/
cont... | 'use strict';
module.exports = DatasetView;
/** @ngInject **/
function DatasetView() {
return {
scope: {
participant: '=',
dataset: '=',
onEdit: '&'
},
template: require('./datasetView.directive.html'),
controllerAs: 'vm',
bindToController: true,
/** @ngInject **/
cont... | Fix labels using lookups (introduced in 0.0.4) | Fix labels using lookups (introduced in 0.0.4)
| JavaScript | mit | spikeheap/labking,spikeheap/labking | ---
+++
@@ -15,18 +15,35 @@
controllerAs: 'vm',
bindToController: true,
/** @ngInject **/
- controller: function($filter) {
+ controller: function($filter, $scope, DatasetMetadataService) {
var self = this;
+ var _ = require('lodash');
+ self.lookups = {};
self.getValue ... |
a64fccdeb92494b9d500571c242969c2dada93bb | src/dataviews/category-dataview/category-model-range.js | src/dataviews/category-dataview/category-model-range.js | var _ = require('underscore');
var Model = require('../../core/model');
/**
* This model is used for getting the total amount of values
* from the category.
*
*/
module.exports = Model.extend({
defaults: {
url: '',
totalCount: 0,
categoriesCount: 0
},
url: function () {
var url = this.get... | var _ = require('underscore');
var Model = require('../../core/model');
/**
* This model is used for getting the total amount of values
* from the category.
*
*/
module.exports = Model.extend({
defaults: {
url: '',
totalCount: 0,
categoriesCount: 0
},
url: function () {
var url = this.get... | Fix widget url generation when missing apikey and authtoken | Fix widget url generation when missing apikey and authtoken
| JavaScript | bsd-3-clause | splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js | ---
+++
@@ -18,7 +18,7 @@
var url = this.get('url');
var queryOptions = [];
if (this.get('apiKey')) {
- queryOptions.push('api_key=' + this.get('apiKey'));
+ url += '?api_key=' + this.get('apiKey');
} else if (this.get('authToken')) {
var authToken = this.get('authToken');
... |
8921a630e7b036cc6be4fa048ed493c98f44a776 | extend.js | extend.js | /*
Example usage:
var A = Class(function() {
var defaults = {
foo: 'cat',
bar: 'dum'
}
this.init = function(opts) {
opts = std.extend(opts, defaults)
this._foo = opts.foo
this._bar = opts.bar
}
this.getFoo = function() {
return this._foo
}
this.getBar = function() {
return th... | /*
Example usage:
var A = Class(function() {
var defaults = {
foo: 'cat',
bar: 'dum'
}
this.init = function(opts) {
opts = std.extend(opts, defaults)
this._foo = opts.foo
this._bar = opts.bar
}
this.getFoo = function() {
return this._foo
}
this.getBar = function() {
return th... | Use copy instead of create for easier debugging | Use copy instead of create for easier debugging
| JavaScript | mit | ASAPPinc/std.js,marcuswestin/std.js | ---
+++
@@ -28,10 +28,10 @@
a.getBar() == 'sim'
*/
-var create = require('./create')
+var copy = require('./copy')
module.exports = function extend(target, extendWith) {
- target = target ? create(target) : {}
+ target = copy(target)
for (var key in extendWith) {
if (typeof target[key] != 'undefined') { ... |
f53acc88c6a492c4c50c779157f66882df8440f8 | src/routes.js | src/routes.js | 'use strict';
let Games = require('./games.js');
let uuid = require('node-uuid');
let games = new Games(uuid.v4);
exports.registerRoutes = app => {
app.get('/api/stats', (request, response) => {
response.send(games.getAllPlayerStats());
});
app.post('/api/player', (request, response) => {
... | 'use strict';
let Games = require('./games.js');
let uuid = require('node-uuid');
let games = new Games(uuid.v4);
exports.registerRoutes = app => {
app.get('/api', (request, response) => {
response.send({
name: "REST Mastermind server",
endpoints: [
{ endpoint: '/api/stats', met... | Create base api endpoint and adjust player stats path | Create base api endpoint and adjust player stats path
| JavaScript | mit | allan-stewart/rest-mastermind,allan-stewart/rest-mastermind | ---
+++
@@ -6,12 +6,29 @@
let games = new Games(uuid.v4);
exports.registerRoutes = app => {
+ app.get('/api', (request, response) => {
+ response.send({
+ name: "REST Mastermind server",
+ endpoints: [
+ { endpoint: '/api/stats', method: 'GET', purpose: 'Get the stats for all current players.... |
0b23fe3209f1f2fbdbfff533b512729902b58561 | modules/utils/EnterLeaveCounter.js | modules/utils/EnterLeaveCounter.js | import union from 'lodash/array/union';
import without from 'lodash/array/without';
export default class EnterLeaveCounter {
constructor() {
this.entered = [];
}
enter(enteringNode) {
this.entered = union(
this.entered.filter(node =>
document.body.contains(node) &&
(!node.contains ... | import union from 'lodash/array/union';
import without from 'lodash/array/without';
export default class EnterLeaveCounter {
constructor() {
this.entered = [];
}
enter(enteringNode) {
this.entered = union(
this.entered.filter(node =>
document.documentElement.contains(node) &&
(!nod... | Fix an edge case when a file is dropped outside <body> | Fix an edge case when a file is dropped outside <body>
| JavaScript | mit | cesarandreu/react-dnd,zetkin/react-dnd,jgable/react-dnd,konce/react-dnd,randrianov/react-dnd,ntdb/react-dnd,hiddentao/react-dnd,craigklem/react-dnd,globexdesigns/react-dnd,nagaozen/react-dnd,Reggino/react-dnd,zetkin/react-dnd,srajko/react-dnd,jowcy/react-dnd,colbyr/react-dnd,tylercollier/react-dnd-demo,pairyo/react-dnd... | ---
+++
@@ -9,7 +9,7 @@
enter(enteringNode) {
this.entered = union(
this.entered.filter(node =>
- document.body.contains(node) &&
+ document.documentElement.contains(node) &&
(!node.contains || node.contains(enteringNode))
),
[enteringNode]
@@ -21,7 +21,7 @@
leav... |
00e5aed30567bdea05c21938dd28b1a534ab3c36 | src/global/modules.js | src/global/modules.js | import logger from '../logger'
const openedModules = {}
const hotModules = {}
const createHotModule = () => ({ instances: [], updateTimeout: 0 })
export const hotModule = moduleId => {
if (!hotModules[moduleId]) {
hotModules[moduleId] = createHotModule()
}
return hotModules[moduleId]
}
export const isOpe... | import logger from '../logger'
const openedModules = {}
const hotModules = {}
const createHotModule = () => ({ instances: [], updateTimeout: 0 })
export const hotModule = moduleId => {
if (!hotModules[moduleId]) {
hotModules[moduleId] = createHotModule()
}
return hotModules[moduleId]
}
export const isOpe... | Fix grammar mistake in commment | Fix grammar mistake in commment
| JavaScript | mit | gaearon/react-hot-loader,gaearon/react-hot-loader | ---
+++
@@ -21,7 +21,7 @@
openedModules[sourceModule.id] = true
} else {
logger.warn(
- 'React-hot-loader: no `module` variable found. Do you shadow system variable?',
+ 'React-hot-loader: no `module` variable found. Did you shadow a system variable?',
)
}
} |
a76f3e4211a34579e7e74a98643f39b2eba53196 | entity.js | entity.js | const createTransform = require('./transform')
const assert = require('assert')
let entityId = 0
function Entity (components, tags, renderer) {
assert(!tags || Array.isArray(tags), 'Entity tags must be an array or null')
this.id = entityId++
this.tags = tags || []
this.renderer = renderer
this.components =... | const createTransform = require('./transform')
const assert = require('assert')
let entityId = 0
function Entity (components, tags, renderer) {
assert(!tags || Array.isArray(tags), 'Entity tags must be an array or null')
this.id = entityId++
this.tags = tags || []
this.renderer = renderer
this.components =... | Add hashmap for fast components lookups | Add hashmap for fast components lookups | JavaScript | mit | pex-gl/pex-renderer,pex-gl/pex-renderer | ---
+++
@@ -10,6 +10,11 @@
this.renderer = renderer
this.components = components ? components.slice(0) : []
+
+ this.componentsMap = new Map()
+ this.components.forEach((component) => {
+ this.componentsMap.set(component.type, component)
+ })
this.transform = this.getComponent('Transform')
if (!... |
110063b2d89c89317f6a11ae045627ddaa58391e | backend/server/db/model/processes.spec.js | backend/server/db/model/processes.spec.js | describe('Processes', function() {
'use strict';
let atf = require('../../specs/atf');
let ropts = {
db: 'mctest',
port: 30815
};
let r = require('rethinkdbdash')(ropts);
let p = require('./processes')(r);
describe('#create', function() {
it('should do something', f... | describe('Processes', function() {
'use strict';
let atf = require('../../specs/atf');
let ropts = {
db: 'mctest',
port: 30815
};
let r = require('rethinkdbdash')(ropts);
let p = require('./processes')(r);
describe('#create', function() {
it('should create a process... | Set up a valid process to begin testing against. | Set up a valid process to begin testing against.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | ---
+++
@@ -10,13 +10,22 @@
let p = require('./processes')(r);
describe('#create', function() {
- it('should do something', function(done) {
+ it('should create a process', function(done) {
function validate(err) {
console.log("err", err);
done(... |
f7f2386be131d66cbfe4e8ae6588171a1c511042 | blueprints/ember-cli-tooltipster/index.js | blueprints/ember-cli-tooltipster/index.js | /*jshint node:true*/
module.exports = {
description: 'ember-cli-tooltipster',
normalizeEntityName: function() {
// this prevents an error when the entityName is not specified
},
afterInstall: function( /*options*/ ) {
return this.addPackageToProject([{
name: 'tooltipster',
target: '4.2.2'
... | /*jshint node:true*/
module.exports = {
description: 'ember-cli-tooltipster',
normalizeEntityName: function() {
// this prevents an error when the entityName is not specified
},
afterInstall: function( /*options*/ ) {
return this.addPackagesToProject([{
name: 'tooltipster',
target: '4.2.2'
... | Fix addPackagesToProject in blueprint afterInstall | Fix addPackagesToProject in blueprint afterInstall
| JavaScript | mit | altrim/ember-cli-tooltipster,altrim/ember-cli-tooltipster | ---
+++
@@ -6,7 +6,7 @@
},
afterInstall: function( /*options*/ ) {
- return this.addPackageToProject([{
+ return this.addPackagesToProject([{
name: 'tooltipster',
target: '4.2.2'
}]); |
788d1d26a052fdbf2a6d5be5653c0cf0e2e7b2c1 | server.js | server.js | // Copyright (c) Martin Costello, 2017. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
var AlexaAppServer = require("alexa-app-server");
var env = require("node-env-file");
env(__dirname + "/.env");
console.log("TfL App Id :", pro... | // Copyright (c) Martin Costello, 2017. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
var AlexaAppServer = require("alexa-app-server");
var env = require("node-env-file");
var path = require("path");
env(path.join(__dirname, ".env... | Use path instead of concatenation | Use path instead of concatenation
Use path.join() instead of string concatenation.
| JavaScript | apache-2.0 | martincostello/alexa-london-travel | ---
+++
@@ -3,8 +3,9 @@
var AlexaAppServer = require("alexa-app-server");
var env = require("node-env-file");
+var path = require("path");
-env(__dirname + "/.env");
+env(path.join(__dirname, ".env"));
console.log("TfL App Id :", process.env.TFL_APP_ID);
console.log("TfL App Key:", process.env.TFL_APP_KEY); |
479582c83b164ef8802401b3bb1cde1beb75b44e | src/lib/lint.js | src/lib/lint.js | "use strict"
import Context from "./context"
import ShadowTree from "./shadowtree"
class Lint {
constructor(tree, filename = null, namespace = []) {
Object.assign(
this,
{
filename: filename,
namespace: namespace,
tree: tree,
... | "use strict"
import Context from "./context"
import ShadowTree from "./shadowtree"
import PHPStrictError from "./phpstricterror"
class Lint {
static get PHPStrictError() {
return PHPStrictError
}
static get ShadowTree() {
return ShadowTree
}
constructor(tree, filename = null, names... | Use static properties for the sub-items | Use static properties for the sub-items
| JavaScript | bsd-2-clause | jj101k/php-lint,jj101k/php-lint | ---
+++
@@ -2,8 +2,15 @@
import Context from "./context"
import ShadowTree from "./shadowtree"
+import PHPStrictError from "./phpstricterror"
class Lint {
+ static get PHPStrictError() {
+ return PHPStrictError
+ }
+ static get ShadowTree() {
+ return ShadowTree
+ }
constructor(t... |
4a07b40ee7010a4cff5d1d1a092cd657dfa0efa1 | src/App.js | src/App.js | import React from 'react';
import axios from 'axios';
class App extends React.Component {
render() {
return (
<Abc/>
)
}
}
class Abc extends React.Component {
render() {
return (
<div>
<button onClick={this.getList}>get List</button>
</div>
)
}
getList() {
axio... | import React from 'react';
import axios from 'axios';
class App extends React.Component {
render() {
return (
<SiteList/>
)
}
}
class SiteInfo extends React.Component {
render() {
return(
<li>{this.props.rId} - {this.props.url}, {this.props.count}, {this.props.creation}, {th... | Add get list ui and feature | Add get list ui and feature
| JavaScript | mit | junorouse/valid-xss-checker,junorouse/valid-xss-checker | ---
+++
@@ -5,23 +5,68 @@
render() {
return (
- <Abc/>
+ <SiteList/>
)
}
}
-class Abc extends React.Component {
+class SiteInfo extends React.Component {
+ render() {
+ return(
+ <li>{this.props.rId} - {this.props.url}, {this.props.count}, {this.props.creation}, {th... |
ad7fe2e1971062b92355463655e4032df4f5590d | shared/docs.js | shared/docs.js | // Scans your stylesheet for pseudo classes and adds a class with the same name.
// Thanks to Knyle Style Sheets for the idea.
(function () {
'use strict';
var toArray = function(arr) {
return Array.prototype.slice.call(arr, 0);
};
var add = function(a, b) { return a + b; };
// Compile regular expression.
var pse... | // Scans your stylesheet for pseudo classes and adds a class with the same name.
// Thanks to Knyle Style Sheets for the idea.
(function () {
'use strict';
var toArray = function(arr) { return Array.prototype.slice.call(arr, 0); };
var add = function(a, b) { return a + b; };
// Compile regular expression.
var pseudo... | Remove bonzo and qwery dependencies | Remove bonzo and qwery dependencies
| JavaScript | mit | trungnghia112/styledocco,paulwellnerbou/styledocco,paulwellnerbou/styledocco,jacobrask/styledocco,ooooooo-q/styledocco,ooooooo-q/styledocco,trungnghia112/styledocco | ---
+++
@@ -4,14 +4,12 @@
'use strict';
-var toArray = function(arr) {
- return Array.prototype.slice.call(arr, 0);
-};
-
+var toArray = function(arr) { return Array.prototype.slice.call(arr, 0); };
var add = function(a, b) { return a + b; };
// Compile regular expression.
-var pseudos = ['link', 'visited',... |
a8374d7bc31e55ca865952e96087860ba7c08cf3 | test/spec/spec-smoothScroll.js | test/spec/spec-smoothScroll.js | describe('Smooth Scroll', function () {
describe('init', function () {
it('should include the smoothScroll module', function () {
expect(!!smoothScroll).toBe(true);
});
});
});
| describe('Smooth Scroll', function () {
describe('API', function () {
it('should export the smoothScroll module', function () {
expect(smoothScroll).toBeDefined();
});
it('should expose public functions', function () {
expect(smoothScroll.init).toEqual(jasmine.any(F... | Add simple public API tests | Add simple public API tests
| JavaScript | mit | iksi/smooth-scroll,krrg/smooth-scroll,outsourceage/smooth-scroll,fussinatto/smooth-scroll,cferdinandi/smooth-scroll,krrg/smooth-scroll,iksi/smooth-scroll,hadrienl/smooth-scroll,SevInf/smooth-scroll,zonayedpca/smooth-scroll,mig1098/smooth-scroll,fussinatto/smooth-scroll,SevInf/smooth-scroll,outsourceage/smooth-scroll,cf... | ---
+++
@@ -1,9 +1,14 @@
describe('Smooth Scroll', function () {
- describe('init', function () {
- it('should include the smoothScroll module', function () {
- expect(!!smoothScroll).toBe(true);
+ describe('API', function () {
+ it('should export the smoothScroll module', function () {
+ ... |
81b3bb412604f6d372389a02c09b0e23cb924b7a | Packages/ohif-measurements/client/lib/toggleLabelButton.js | Packages/ohif-measurements/client/lib/toggleLabelButton.js | import { Template } from 'meteor/templating';
import { Blaze } from 'meteor/blaze';
import { OHIF } from 'meteor/ohif:core';
const toolMap = {
bidirectional: 'targets'
};
OHIF.measurements.toggleLabelButton = options => {
const removeButtonView = () => {
if (!options.instance.buttonView) {
... | import { Template } from 'meteor/templating';
import { Blaze } from 'meteor/blaze';
import { OHIF } from 'meteor/ohif:core';
const toolMap = {
bidirectional: 'targets'
};
OHIF.measurements.toggleLabelButton = options => {
const removeButtonView = () => {
if (!options.instance.buttonView) {
... | Fix bug with loading measurement flow | LT-275: Fix bug with loading measurement flow
| JavaScript | mit | OHIF/Viewers,OHIF/Viewers,OHIF/Viewers | ---
+++
@@ -22,7 +22,7 @@
const tool = toolMap[options.toolData.toolType];
const toolCollection = options.measurementApi[tool];
- const measurement = toolCollection.findOne(options.toolData.id);
+ const measurement = toolCollection.findOne(options.toolData._id);
const data = {
measur... |
0a9a3389c33e82b39c5ac19b132eef8fcbe1aee7 | Gulpfile.js | Gulpfile.js | const gulp = require('gulp');
const config = require('config');
const runner = require('punchcard-runner');
const options = runner.config({
application: {
library: {
src: [
'lib',
'config',
'content-types',
'input-plugins'
],
}
},
tasks: {
nodemon: {
... | const gulp = require('gulp');
const config = require('config');
const runner = require('punchcard-runner');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const imagemin = require('gulp-imagemin');
const path = require('path');
const options = runner.config({
application: {
library... | Fix Punchcard JS and images compilation | :bug: Fix Punchcard JS and images compilation
| JavaScript | apache-2.0 | punchcard-cms/demo,punchcard-cms/demo | ---
+++
@@ -1,6 +1,10 @@
const gulp = require('gulp');
const config = require('config');
const runner = require('punchcard-runner');
+const concat = require('gulp-concat');
+const uglify = require('gulp-uglify');
+const imagemin = require('gulp-imagemin');
+const path = require('path');
const options = runner.c... |
00123a872cc25c1b697811346ff1ec864d02cf73 | Gulpfile.js | Gulpfile.js | var gulp = require('gulp'),
less = require('gulp-less'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
notify = require('gulp-notify'),
rename = require('gulp-rename');
gulp.task('less', function() {
return gulp.src('less/caffeine.less')
.pipe(less())
.pipe(autoprefixer... | var gulp = require('gulp'),
less = require('gulp-less'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
notify = require('gulp-notify'),
rename = require('gulp-rename');
gulp.task('less', function() {
return gulp.src('less/caffeine.less')
.pipe(less())
.pipe(autoprefixer... | Set gulp autoprefixer cascade to true | Set gulp autoprefixer cascade to true
| JavaScript | mit | olumby/caffeine,olumby/caffeine | ---
+++
@@ -8,7 +8,9 @@
gulp.task('less', function() {
return gulp.src('less/caffeine.less')
.pipe(less())
- .pipe(autoprefixer())
+ .pipe(autoprefixer({
+ cascade: true
+ }))
.pipe(gulp.dest(''))
.pipe(rename({
suffix: '.min' |
96ed95da89b7dca4669e0f837a55baa362d064ae | frontend/src/plugins/vuetify.js | frontend/src/plugins/vuetify.js | // You still need to register Vuetify itself
// src/plugins/vuetify.js
import Vuetify from 'vuetify/lib'
import PbsLogo from '@/assets/PbsLogo.svg'
import GoogleLogo from '@/assets/GoogleLogo.svg'
import eCampLogo from '@/assets/eCampLogo.svg'
import i18n from '@/plugins/i18n'
class VuetifyLoaderPlugin {
install (V... | // You still need to register Vuetify itself
// src/plugins/vuetify.js
import Vuetify from 'vuetify/lib'
import PbsLogo from '@/assets/PbsLogo.svg'
import GoogleLogo from '@/assets/GoogleLogo.svg'
import eCampLogo from '@/assets/eCampLogo.svg'
import i18n from '@/plugins/i18n'
import colors from 'vuetify/lib/util/colo... | Adjust error color to be darker | Adjust error color to be darker
| JavaScript | agpl-3.0 | usu/ecamp3,pmattmann/ecamp3,pmattmann/ecamp3,ecamp/ecamp3,usu/ecamp3,pmattmann/ecamp3,usu/ecamp3,ecamp/ecamp3,pmattmann/ecamp3,ecamp/ecamp3,ecamp/ecamp3,usu/ecamp3 | ---
+++
@@ -6,6 +6,7 @@
import GoogleLogo from '@/assets/GoogleLogo.svg'
import eCampLogo from '@/assets/eCampLogo.svg'
import i18n from '@/plugins/i18n'
+import colors from 'vuetify/lib/util/colors'
class VuetifyLoaderPlugin {
install (Vue, options) {
@@ -21,6 +22,13 @@
google: { component: Googl... |
cdad548abcbc49e10001febaa08b17300035413a | app/adapters/node.js | app/adapters/node.js | import Ember from 'ember';
import DS from 'ember-data';
import ENV from '../config/environment';
function getToken() {
var token;
var session = window.localStorage['ember_simple_auth:session'];
if (session) {
token = JSON.parse(session)['authenticated'];
if ('attributes' in token) {
... | import Ember from 'ember';
import DS from 'ember-data';
import ENV from '../config/environment';
function getToken() {
var token;
var session = window.localStorage['ember_simple_auth-session'];
if (session) {
token = JSON.parse(session)['authenticated'];
if ('attributes' in token) {
... | Fix property name for ember-simple-auth | Fix property name for ember-simple-auth
| JavaScript | apache-2.0 | caneruguz/osfpages,caneruguz/osfpages,Rytiggy/osfpages,Rytiggy/osfpages | ---
+++
@@ -5,7 +5,7 @@
function getToken() {
var token;
- var session = window.localStorage['ember_simple_auth:session'];
+ var session = window.localStorage['ember_simple_auth-session'];
if (session) {
token = JSON.parse(session)['authenticated'];
if ('attributes' in token) { |
ea51980646b7f719f0717fb6fcc24273b78642dc | backend/timestamp-microservice/src/dateChecker.js | backend/timestamp-microservice/src/dateChecker.js | const checkDate = () => {
return;
}
module.exports = checkDate;
| const checkDate = (dateString) => {
if (isNaN(Date.parse(dateString))) {
return false;
}
return true;
}
module.exports = checkDate;
| Implement checkDate function for date string arguments | Implement checkDate function for date string arguments
| JavaScript | mit | mkermani144/freecodecamp-projects,mkermani144/freecodecamp-projects | ---
+++
@@ -1,4 +1,7 @@
-const checkDate = () => {
- return;
+const checkDate = (dateString) => {
+ if (isNaN(Date.parse(dateString))) {
+ return false;
+ }
+ return true;
}
module.exports = checkDate; |
f07bb14d90525ed304d072ea8e8017ece05f94ef | dripBot-css.js | dripBot-css.js | $('#dripbot-title').css({
"display": "inline-block",
"margin-right": "20px"
});
$('#dripbot').css({
"text-align": "left"
});
$('#dripbot-toggle.stop').css({
"background-color": "#e9656d",
"color": "white",
"margin-top": "-10px"
});
$('#dripbot ul li p').css({
"margin-bottom":"5px",
"margin-right": "... | $('#dripbot-title').css({
"display": "inline-block",
"margin-right": "20px"
});
$('#dripbot').css({
"text-align": "left"
});
$('#dripbot-toggle.stop').css({
"background-color": "#e9656d",
"color": "white",
"margin-top": "-10px"
});
$('#dripbot ul li p').css({
"margin-bottom":"5px",
"margin-right": "... | Remove css to apply each time. | Remove css to apply each time.
| JavaScript | mit | catofclysm/testing,catofclysm/testing,kyotie/bot,kyotie/bot,apottere/DripBot,apottere/DripBot | ---
+++
@@ -39,6 +39,3 @@
"margin-left": "20px"
});
-$('div#leaderBoard table tbody tr td.leader-diff').css({
- "color": "#47a447"
-}); |
7406b87053003b9a23f8e12dbbc65735d7c079ce | agar-mass-ejector.user.js | agar-mass-ejector.user.js | // ==UserScript==
// @name agar-mass-ejector
// @namespace http://github.com/dimotsai/
// @version 0.02
// @description A faster, continuous mass ejector for agar.
// @author dimotsai
// @license MIT
// @match http://agar.io/
// @grant none
// @run-at document-end
// ==/U... | // ==UserScript==
// @name agar-mass-ejector
// @namespace http://github.com/dimotsai/
// @version 0.03
// @description A faster, continuous mass ejector for agar.
// @author dimotsai
// @license MIT
// @match http://agar.io/*
// @grant none
// @run-at document-end
// ==/... | Increase compatibility with other plugins | Increase compatibility with other plugins
Plugins such as viptool+ or 大虫
| JavaScript | mit | dimotsai/agar-mass-ejector | ---
+++
@@ -1,39 +1,29 @@
// ==UserScript==
// @name agar-mass-ejector
// @namespace http://github.com/dimotsai/
-// @version 0.02
+// @version 0.03
// @description A faster, continuous mass ejector for agar.
// @author dimotsai
// @license MIT
-// @match http://agar.io/
... |
132ed270e82dac02cc555b6e78ef959487f85182 | scholar.js | scholar.js | window.onload = initialize;
var DATAFILE = "research.json";
var DONE_READYSTATE = 4;
var DONE_STATUS = 200;
var OFFICIAL_URL = "http://www.ecst.csuchico.edu/~kbuffardi/";
var OFFICIAL_HOST = "www.ecst.csuchico.edu"
var references = {};
function initialize()
{
validateHost();
//loadExternalData();
}
function val... | window.onload = initialize;
var DATAFILE = "research.json";
var DONE_READYSTATE = 4;
var DONE_STATUS = 200;
var OFFICIAL_URL = "https://kbuffardi.github.io/ScholarWebsite/";
var OFFICIAL_HOST = "kbuffardi.github.io"
var references = {};
function initialize()
{
validateHost();
//loadExternalData();
}
function va... | Switch to GitHub Pages as Host | Switch to GitHub Pages as Host
| JavaScript | mit | kbuffardi/ScholarWebsite,kbuffardi/ScholarWebsite | ---
+++
@@ -3,8 +3,8 @@
var DATAFILE = "research.json";
var DONE_READYSTATE = 4;
var DONE_STATUS = 200;
-var OFFICIAL_URL = "http://www.ecst.csuchico.edu/~kbuffardi/";
-var OFFICIAL_HOST = "www.ecst.csuchico.edu"
+var OFFICIAL_URL = "https://kbuffardi.github.io/ScholarWebsite/";
+var OFFICIAL_HOST = "kbuffardi.git... |
460be4e2357ee15ab2a08fa078015d9989a07c5f | server/handlers.js | server/handlers.js | 'use strict';
var request = require('request');
var randomstring = require('randomstring');
var db = require('./database');
var handlers = {
showIntro: function(req, res) {
res.render('intro');
},
createGame: function(req, res) {
var gameKey = randomstring.generate(5);
db.getOrCr... | 'use strict';
var request = require('request');
var randomstring = require('randomstring');
var db = require('./database');
var handlers = {
showIntro: function(req, res) {
res.render('intro');
},
createGame: function(req, res) {
var gameKey = randomstring.generate(5);
db.getOrCr... | Determine protocol when generating game links | Determine protocol when generating game links
| JavaScript | mit | njmcode/ggj-2016,njmcode/ggj-2016 | ---
+++
@@ -18,7 +18,7 @@
},
observeGame: function(req, res) {
- var joinURL = 'http://' + req.headers.host + '/c/' + req.params.game;
+ var joinURL = req.protocol + '://' + req.headers.host + '/c/' + req.params.game;
res.render('master', {
joinURL: joinURL,
@@ -31,7 ... |
4ecc2a2db9476648cb4dc34ee31d00a0109340ff | chrome/browser/resources/chromeos/login/demo_user_login.js | chrome/browser/resources/chromeos/login/demo_user_login.js | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Demo login UI.
*/
/**
* Handles a user clicking anywhere on the screen. This will log the demo user
* in. Yes, this actually ... | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Demo login UI.
*/
/**
* Handles a user clicking anywhere on the screen. This will log the demo user
* in. Yes, this actually ... | Fix possible issue with multiple clicks on demo login screen. Though this doesn't currently repro, there is a possibility that if the demo login flow takes too long, a user clicking really fast on the login screen may see unexpected behavior due to multiple login attempts being kicked off. This CL will ensure that that... | Fix possible issue with multiple clicks on demo login screen.
Though this doesn't currently repro, there is a possibility that if the demo login flow takes too long, a user clicking really fast on the login screen may see unexpected behavior due to multiple login attempts being kicked off.
This CL will ensure that that... | JavaScript | bsd-3-clause | crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,markYoungH/chromium.src,chuan9/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,jaruba/chromium.src,hujiajie... | ---
+++
@@ -10,7 +10,9 @@
* Handles a user clicking anywhere on the screen. This will log the demo user
* in. Yes, this actually _is the intention.
*/
-onClick = function() {
+onClick = function(e) {
+ document.removeEventListener('click', onClick);
+ e.stopPropagation();
chrome.send('launchDemoUser');
};... |
76feb621911c334ec424f56f9fce2d1630c1c1f6 | client/templates/registerWizard/wizard.js | client/templates/registerWizard/wizard.js | Template.registerWizard.helpers({
'steps': function () {
return [
{
id: 'registrant',
title: 'Registrant',
schema: WizardSchemas.registrant
},
{
id: 'contact',
title: 'Contact',
schema: WizardSchemas.contact
}
]
}
});
| Template.registerWizard.helpers({
'steps': function () {
return [
{
id: 'registrant',
title: 'Registrant',
schema: WizardSchemas.registrant,
template: "wizardRegistrant",
formId: "wizard-registrant"
},
{
id: 'contact',
title: 'Contact',
... | Use custom template for registrant step | Use custom template for registrant step
| JavaScript | agpl-3.0 | quaker-io/pym-online-registration,quaker-io/pym-online-registration,quaker-io/pym-2015,quaker-io/pym-2015 | ---
+++
@@ -4,7 +4,9 @@
{
id: 'registrant',
title: 'Registrant',
- schema: WizardSchemas.registrant
+ schema: WizardSchemas.registrant,
+ template: "wizardRegistrant",
+ formId: "wizard-registrant"
},
{
id: 'contact', |
3d742285efddba5b71e6d59af1dd8d4a5ca90fe4 | webpack/base.js | webpack/base.js | const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: [path.resolve(__dirname, '../client/index.js')],
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['bab... | const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: [path.resolve(__dirname, '../client/index.js')],
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['bab... | Configure bundling for images and fonts | Configure bundling for images and fonts
| JavaScript | mit | CodingZeal/react-boilerplate,CodingZeal/react-boilerplate | ---
+++
@@ -13,6 +13,9 @@
}, {
test: /\.css/,
loader: ExtractTextPlugin.extract('css')
+ }, {
+ test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
+ loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
}
],
preLoaders: [{ |
1de51f5756c91effc7054f879acc7cd239796659 | entry_points/harmonic.js | entry_points/harmonic.js | 'use strict';
require('./lib/polyfill');
module.exports = require('../dist/bin/cli/harmonic');
| #!/usr/bin/env node
'use strict';
require('./lib/polyfill');
module.exports = require('../dist/bin/cli/harmonic');
| Fix bin entry point for Unix-based OS's | Fix bin entry point for Unix-based OS's
| JavaScript | mit | thotty/harmonic,JSRocksHQ/harmonic,joaopauloti/harmonic,robsongajunior/harmonic,viniciusdacal/harmonic,mauricionr/harmonic | ---
+++
@@ -1,3 +1,4 @@
+#!/usr/bin/env node
'use strict';
require('./lib/polyfill'); |
925c4b35ebacea747c490c0b3ed054b0b4739bf8 | js/InventoryController.js | js/InventoryController.js | myApp.controller('InventoryController', function($scope, $window, $location, $routeParams, inventoryService) {
inventoryService.loadInventories()
.then(function(inventories) {
console.log("Loaded stored inventories: ", inventories);
$scope.inventories = inventories;
});
$... | myApp.controller('InventoryController', function($scope, $window, $location, $routeParams, inventoryService) {
inventoryService.loadInventories()
.then(function(inventories) {
console.log("Loaded stored inventories: ", inventories);
$scope.inventories = inventories;
$scop... | Add .apply() to inventory loading to refresh ng-repeat | Add .apply() to inventory loading to refresh ng-repeat
| JavaScript | cc0-1.0 | zcdunn/inventory,zcdunn/inventory | ---
+++
@@ -3,6 +3,7 @@
.then(function(inventories) {
console.log("Loaded stored inventories: ", inventories);
$scope.inventories = inventories;
+ $scope.apply();
});
$scope.inventory = inventoryService.getInventory($routeParams.id);
|
28c4434b7ceb86492f1e5448e47b6672889e33e6 | app/scripts/timetable_builder/views/ExamView.js | app/scripts/timetable_builder/views/ExamView.js | define(['backbone.marionette', 'app', 'hbs!../templates/exam'],
function (Marionette, App, template) {
'use strict';
return Marionette.ItemView.extend({
tagName: 'tr',
template: template,
events: {
'click .remove': function () {
App.execute('removeModule', this.model.id);... | define(['backbone.marionette', 'app', 'hbs!../templates/exam'],
function (Marionette, App, template) {
'use strict';
return Marionette.ItemView.extend({
tagName: 'tr',
template: template,
events: {
'click .remove': function () {
App.request('removeModule', this.model.id);... | Fix removing module from exam timetable | Fix removing module from exam timetable
| JavaScript | mit | mauris/nusmods,Yunheng/nusmods,chunqi/nusmods,Yunheng/nusmods,Yunheng/nusmods,zhouyichen/nusmods,Yunheng/nusmods,Yunheng/nusmods,nusmodifications/nusmods,zhouyichen/nusmods,nathanajah/nusmods,chunqi/nusmods,mauris/nusmods,nusmodifications/nusmods,zhouyichen/nusmods,mauris/nusmods,mauris/nusmods,nusmodifications/nusmods... | ---
+++
@@ -8,7 +8,7 @@
events: {
'click .remove': function () {
- App.execute('removeModule', this.model.id);
+ App.request('removeModule', this.model.id);
}
},
|
4d1dbddf920975ea1dd6e652c78f4cbe78284240 | routes/users.js | routes/users.js | var express = require('express');
var router = express.Router();
var usersController = require('../controllers/users');
/**
* Get all
*/
router.get('/', usersController.all);
/**
* Get by id
*/
router.get('/:userId', usersController.user);
/**
* Create
*/
router.post('/', usersController.create);
/**
* Updat... | var express = require('express');
var router = express.Router();
var usersController = require('../controllers/users');
/**
* Get all
*/
router.get('/', usersController.all);
/**
* Get by id
*/
router.get('/:userId', usersController.user);
/**
* Create
*/
router.post('/', usersController.create);
/**
* Updat... | Add login and logout route | Add login and logout route
| JavaScript | mit | 99999989/sample-manager-server,99999989/sample-manager-server,99999989/sample-manager-server | ---
+++
@@ -27,4 +27,14 @@
*/
router.delete('/:userId', usersController.destroy);
+/**
+ * Login
+ */
+router.post('/login', usersController.login);
+
+/**
+ * Logout
+ */
+router.get('/logout', usersController.logout);
+
module.exports = router; |
909fa7e69ed9cd01d08c65a2ba04b0499f4c454c | bin/etcd-dump.js | bin/etcd-dump.js | #!/usr/bin/env node
// Requires
var _ = require('underscore');
var fs = require('fs');
// Comannder
var prog = require('commander');
// etcd-dump's package.json file
var pkg = require('../package.json');
// Dumper class
var dumper = require('../')();
// General options
prog
.version(pkg.version)
.option('-f, --fi... | #!/usr/bin/env node
// Requires
var _ = require('underscore');
var fs = require('fs');
// Comannder
var prog = require('commander');
// etcd-dump's package.json file
var pkg = require('../package.json');
// Dumper class
var dumper = require('../')();
// General options
prog
.version(pkg.version)
.option('-f, --fi... | Fix typo "dump" => "dumper" | Fix typo "dump" => "dumper"
| JavaScript | apache-2.0 | AaronO/etcd-dump | ---
+++
@@ -36,7 +36,7 @@
.action(function() {
var entries = JSON.parse(fs.readFileSync(prog.file));
- return dump.restore(entries)
+ return dumper.restore(entries)
.then(function() {
console.log('Restore succeeded');
}) |
e920daf053c68538c3103e7d4b8bad1e7bb4678f | app/views/language-switch.js | app/views/language-switch.js | import Ember from "ember";
import translations from "croodle/lang/translations";
/* global Croodle */
export default Ember.View.extend({
templateName: 'language-switch',
languages: function() {
var languages = [];
for(var lang in translations) {
languages.push(lang);
}
return languages;
... | import Ember from "ember";
import translations from "croodle/lang/translations";
/* global Croodle */
export default Ember.View.extend({
templateName: 'language-switch',
languages: function() {
var languages = [];
for(var lang in translations) {
languages.push(lang);
}
return languages;
... | Fix not working language switch in production environment | Fix not working language switch in production environment
Fixes #64
| JavaScript | mit | jelhan/croodle,jelhan/croodle,jelhan/croodle | ---
+++
@@ -23,6 +23,6 @@
"max-age=" + 60*60*24*356 + ";";
// rerender page
- Croodle.reset();
+ window.location.reload();
}.observes('controller.language.selected')
}); |
296fe1c24a982ffe1d7fa6f8b056f5f0a0d2a908 | connected_components/javascript/adjacency_list.js | connected_components/javascript/adjacency_list.js | export class AdjacencyList {
constructor(graph) {
this.a = constructAdjacencyList(graph);
}
depthFirstSearch(start, earlyCallback) {
depthFirstSearch(this.a, start, earlyCallback);
}
}
function constructAdjacencyList(graph) {
// new Array(vertexCount).fill([]) does not work because ... | export class AdjacencyList {
constructor(graph) {
this.a = constructAdjacencyList(graph);
}
depthFirstSearch(start, earlyCallback) {
depthFirstSearch(this.a, start, earlyCallback);
}
}
function constructAdjacencyList(graph) {
// new Array(vertexCount).fill([]) does not work because ... | Replace fat arrow by traditional function for clarity | [connected_components/javascript] Replace fat arrow by traditional function for clarity
| JavaScript | mit | peferron/algo,peferron/algo,peferron/algo,peferron/algo,peferron/algo,peferron/algo | ---
+++
@@ -29,14 +29,14 @@
function depthFirstSearch(a, start, earlyCallback) {
let processed = new Array(a.length);
- let dfs = x => {
+ function dfs(x) {
if (processed[x]) {
return;
}
processed[x] = true;
earlyCallback(x);
a[x].forEach(dfs);
-... |
d3890708919d4c6a7f403a104ea5774f7130eb77 | src/components/MediaList/LoadingRow.js | src/components/MediaList/LoadingRow.js | import cx from 'clsx';
import React from 'react';
import PropTypes from 'prop-types';
import MediaLoadingIndicator from './MediaLoadingIndicator';
const LoadingRow = ({
className,
selected = false,
...attrs
}) => (
<div
className={cx('MediaListRow', 'is-loading', className, selected && 'is-selected')}
... | import cx from 'clsx';
import React from 'react';
import PropTypes from 'prop-types';
import MediaLoadingIndicator from './MediaLoadingIndicator';
const LoadingRow = ({
className,
selected = false,
...attrs
}) => (
<div
className={cx('MediaListRow', 'is-loading', className, selected && 'is-selected')}
... | Fix loading media list row layout | Fix loading media list row layout
| JavaScript | mit | u-wave/web,u-wave/web | ---
+++
@@ -13,15 +13,18 @@
{...attrs}
>
<MediaLoadingIndicator className="MediaListRow-loader" />
- <div className="MediaListRow-artist">
- {' … '}
- </div>
- <div className="MediaListRow-title">
- {' … '}
+ <div className="MediaListRow-data">
+ <div className="MediaListRow-ar... |
903c8677deeb379cf8f3881fe1e46c43f0d2dc17 | example/app.js | example/app.js | 'use strict'
const sitemap = require('./../index')
const express = require('express')
const app = express()
const core = new express.Router()
const other = new express.Router()
app.use('/core', core)
app.use(other)
// express routing
core.get('/', function(req, res) {
res.send('hello /')
}).get('/admin', functio... | 'use strict'
const sitemap = require('./../index')
const express = require('express')
const app = express()
const core = new express.Router()
const other = new express.Router()
app.use(express.urlencoded({extended: false}))
app.use(express.json())
app.use('/core', core)
app.use(other)
// express routing
core.get('/'... | Update example to check for query and body parameters. | Update example to check for query and body parameters.
| JavaScript | mit | fmcarvalho/express-sitemap-html | ---
+++
@@ -6,6 +6,8 @@
const app = express()
const core = new express.Router()
const other = new express.Router()
+app.use(express.urlencoded({extended: false}))
+app.use(express.json())
app.use('/core', core)
app.use(other)
@@ -17,12 +19,15 @@
}).post('/admin', function(req, res) {
res.send('hello /adm... |
596b298eb0e18bc3a8ce4cd90656e21f77e962b9 | app/geocoders/mapquest.js | app/geocoders/mapquest.js | var request = require('request');
var {processAddress, prefetchAddress} = require('./utils');
const GEOCODE_BASE_URL = 'http://open.mapquestapi.com/geocoding/v1/address';
function MapQuest(apiKey) {
this.key = apiKey;
return this;
}
MapQuest.prototype.geocode = function (address, location) {
return new Promis... | var request = require('request');
var {processAddress, prefetchAddress} = require('./utils');
const GEOCODE_BASE_URL = 'http://open.mapquestapi.com/geocoding/v1/address';
function MapQuest(apiKey) {
this.key = apiKey;
return this;
}
MapQuest.prototype.geocode = function (address, location) {
return new Promis... | Fix bug that was crashing worker. | Fix bug that was crashing worker.
| JavaScript | mit | keokilee/hitraffic-worker,hitraffic/worker | ---
+++
@@ -21,7 +21,7 @@
request({uri, json: true}, (err, _, response) => {
// There should be a location at the county level.
- if (response.results[0].locations.length > 0) {
+ if (response.results && response.results[0].locations.length > 0) {
let location = response.results[0].lo... |
922f03384944e0c3e6664ffae4ed476efbfccc67 | web/src/components/ConfigEditor.js | web/src/components/ConfigEditor.js | import React from 'react'
import AceEditor from 'react-ace'
import 'brace/mode/yaml'
import 'brace/theme/github'
import './ConfigEditor.scss'
export default function ConfigEditor(props) {
return (
<AceEditor mode="yaml" theme="github" name="config-editor" {...props} />
)
}
| import React from 'react'
import AceEditor from 'react-ace'
import 'brace/mode/yaml'
import 'brace/theme/dawn'
import './ConfigEditor.scss'
export default function ConfigEditor(props) {
return <AceEditor mode="yaml" theme="dawn" name="config-editor" {...props} />
}
| Change config editor theme to dawn | Change config editor theme to dawn
| JavaScript | mit | slice/dogbot,sliceofcode/dogbot,slice/dogbot,slice/dogbot,sliceofcode/dogbot | ---
+++
@@ -1,12 +1,10 @@
import React from 'react'
import AceEditor from 'react-ace'
import 'brace/mode/yaml'
-import 'brace/theme/github'
+import 'brace/theme/dawn'
import './ConfigEditor.scss'
export default function ConfigEditor(props) {
- return (
- <AceEditor mode="yaml" theme="github" name="config... |
9d10a9713b0adb5c93d7e1eacc6c67230ab9fbac | app/transforms/isodate.js | app/transforms/isodate.js | import DS from 'ember-data';
export default DS.Transform.extend({
deserialize(serialized) {
const date = moment(serialized).format('DD MMMM YYYY');
return date;
},
serialize(deserialized) {
const date = moment(deserialized).format('YYYY/MM/DD');
return date;
}
});
| import DS from 'ember-data';
export default DS.Transform.extend({
deserialize(serialized) {
const date = moment(serialized).format('DD MMMM');
return date;
},
serialize(deserialized) {
const date = moment(deserialized).format('YYYY/MM/DD');
return date;
}
});
| Hide year of birth in notification component | Hide year of birth in notification component
| JavaScript | mit | msm-app-devs/intranet-app,msm-app-devs/intranet-app | ---
+++
@@ -2,7 +2,7 @@
export default DS.Transform.extend({
deserialize(serialized) {
- const date = moment(serialized).format('DD MMMM YYYY');
+ const date = moment(serialized).format('DD MMMM');
return date;
}, |
0714797f65ce689f5bad2066e82ebd162dc598a7 | app/public/sa-tracking.js | app/public/sa-tracking.js | 'use strict';
var events = [];
var requestInterval = 5000;
window.addEventListener('click', function(e) {
e = event || window.event;
events.push(processEvent(e));
});
var processEvent = function(e) {
// Event attributes
var eventProps = ['type', 'timeStamp'];
// Event target attributes
var targetP... | 'use strict';
var events = [];
var requestInterval = 5000;
window.addEventListener('click', function(e) {
e = event || window.event;
events.push(processEvent(e));
});
var processEvent = function(e) {
// Event attributes
var eventProps = ['type', 'timeStamp'];
// Event target attributes
var targetP... | Refactor xhr functionality into ajax object | Refactor xhr functionality into ajax object
| JavaScript | mit | Sextant-WDB/sextant-ng | ---
+++
@@ -34,29 +34,31 @@
return result;
};
-var PostRequest = function() {
- var xhr;
+var ajax = {};
+ajax.postUrl ='http://sextant-ng-b.herokuapp.com/api/0_0_1/data';
+
+ajax.createXHR = function() {
try {
- xhr = new XMLHttpRequest();
+ return new XMLHttpRequest();
} catch(e) {
- throw n... |
ab4c92508eefce6ed440c18a0cbaebd5aa29b731 | app/routes/raids/index.js | app/routes/raids/index.js | import Ember from 'ember';
/* global moment */
export default Ember.Route.extend({
model: function() {
return this.store.filter('raid', { 'current': true }, function(raid) {
return moment(raid.get('date')).subtract(6, 'hours').isAfter();
});
},
setupController: function (controller, model) {
c... | import Ember from 'ember';
/* global moment */
export default Ember.Route.extend({
model: function() {
return this.store.filter('raid', {}, function(raid) {
return moment(raid.get('date')).subtract(6, 'hours').isAfter();
});
},
setupController: function (controller, model) {
controller.set('mo... | Use an empty query when grabbing filtered raids | Use an empty query when grabbing filtered raids
| JavaScript | mit | kelsin/coretheloothound,kelsin/coretheloothound | ---
+++
@@ -3,7 +3,7 @@
/* global moment */
export default Ember.Route.extend({
model: function() {
- return this.store.filter('raid', { 'current': true }, function(raid) {
+ return this.store.filter('raid', {}, function(raid) {
return moment(raid.get('date')).subtract(6, 'hours').isAfter();
})... |
49f1853be6835fd0a4ec8d8689141723b608c21c | src/article/converter/util/createEmptyJATS.js | src/article/converter/util/createEmptyJATS.js | import { DefaultDOMElement } from 'substance'
const EMPTY_JATS = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving DTD v1.0 20120330//EN" "JATS-journalarchiving.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ali="http://www.niso.org/schemas/a... | import { DefaultDOMElement } from 'substance'
import { DEFAULT_JATS_SCHEMA_ID, DEFAULT_JATS_DTD } from '../../ArticleConstants'
// TODO: we need a way to specify which namespaces should be declared
const EMPTY_JATS = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "${DEFAULT_JATS_SCHEMA_ID}" "${DEFAU... | Use default schema id for empty articles. | Use default schema id for empty articles.
| JavaScript | mit | substance/texture,substance/texture | ---
+++
@@ -1,7 +1,10 @@
import { DefaultDOMElement } from 'substance'
+import { DEFAULT_JATS_SCHEMA_ID, DEFAULT_JATS_DTD } from '../../ArticleConstants'
+
+// TODO: we need a way to specify which namespaces should be declared
const EMPTY_JATS = `<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-... |
d84f0a56b4c0827e1fc296b400e5170b98518496 | www/autotest/tests/bridge.tests.js | www/autotest/tests/bridge.tests.js | /*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); y... | /*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); y... | Fix bridge test failure due to "" vs null | android: Fix bridge test failure due to "" vs null
| JavaScript | apache-2.0 | corimf/cordova-mobile-spec,ollie314/cordova-mobile-spec,apache/cordova-mobile-spec,apache/cordova-mobile-spec,apache/cordova-mobile-spec,ollie314/cordova-mobile-spec,ollie314/cordova-mobile-spec,corimf/cordova-mobile-spec,ollie314/cordova-mobile-spec,apache/cordova-mobile-spec,corimf/cordova-mobile-spec,ollie314/cordov... | ---
+++
@@ -28,7 +28,7 @@
ifr.onload = function() {
var stolenSecret = ifr.contentWindow.prompt('', 'gap_init:');
done = true;
- expect(stolenSecret).toBe(null);
+ expect(!!stolenSecret).toBe(false);
};
document.bod... |
0724d01d034a3eb3ea8e0158058d366d87b1fbc7 | test/index.js | test/index.js | var chai = require('chai');
chai.should();
// var expect = chai.expect;
// var should = chai.should();
var jetconfig = require('../index.js');
describe('#get()', function (){
it("should return a default value", function () {
jetconfig.get('foo', true).should.equal(true);
});
});
| var chai = require('chai');
chai.should();
// var expect = chai.expect;
// var should = chai.should();
var jetconfig = require('../index.js');
before(function (done) {
console.dir(process.env);
done(new Error("Does this work?"));
});
describe('#get()', function (){
it("should return a default value", f... | Create a failing before-all hook. | Create a failing before-all hook.
| JavaScript | apache-2.0 | shakefu/jetconfig | ---
+++
@@ -6,6 +6,12 @@
var jetconfig = require('../index.js');
+before(function (done) {
+ console.dir(process.env);
+ done(new Error("Does this work?"));
+});
+
+
describe('#get()', function (){
it("should return a default value", function () {
jetconfig.get('foo', true).should.equal(true... |
5a5973935137f7b666f87b56d45922a20f5b9915 | test/index.js | test/index.js | import test from 'ava';
import { search, searchContinuously } from '..';
test('it makes a request', t =>
search()
.then(items => {
t.true(Array.isArray(items));
})
);
test('it subscribes to a stream', t =>
searchContinuously()
.take(1)
.toPromise()
.then(items => {
t.true(Array.isA... | import test from 'ava';
import { search, searchContinuously } from '..';
test('it makes a request', t =>
search()
.then(items => {
t.true(Array.isArray(items));
}),
);
test('it subscribes to a stream', t =>
searchContinuously()
.take(1)
.toPromise()
.then(items => {
t.true(Array.is... | Add trailing commas where appropriate | Add trailing commas where appropriate
| JavaScript | mit | maxdavidson/apartmentor | ---
+++
@@ -5,7 +5,7 @@
search()
.then(items => {
t.true(Array.isArray(items));
- })
+ }),
);
test('it subscribes to a stream', t =>
@@ -14,5 +14,5 @@
.toPromise()
.then(items => {
t.true(Array.isArray(items));
- })
+ }),
); |
ec512a22188219c4538b39b46def0eb1e14fcbb9 | src/app.js | src/app.js | import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Board } from './containers';
import './styles/app.scss';
class App extends Component {
render() {
return <Board />;
}
}
ReactDOM.render(<App />, document.getElementById('app'));
| import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import ReactDOM from 'react-dom';
import { Board } from './containers';
import './styles/app.scss';
const store = createStore(() => { return {}; });
class App extends Component {
render() {
re... | Add basic Redux Provider with store | Add basic Redux Provider with store
| JavaScript | mit | inooid/react-redux-card-game,inooid/react-redux-card-game | ---
+++
@@ -1,8 +1,12 @@
import React, { Component } from 'react';
+import { Provider } from 'react-redux';
+import { createStore } from 'redux';
import ReactDOM from 'react-dom';
import { Board } from './containers';
import './styles/app.scss';
+
+const store = createStore(() => { return {}; });
class App e... |
5f5ebcfc868e1c3690890a11cc16be94c41e9919 | test/setup.js | test/setup.js | // Copyright (c) Rotorz Limited. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root.
import given from "mocha-testdata";
import should from "should";
import webreed from "../src";
describe("#setup(options)", function () {
it("is a function", function () {
webreed
... | // Copyright (c) Rotorz Limited. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root.
// Packages
import given from "mocha-testdata";
import should from "should";
// Project
import webreed from "../src";
describe("#setup(options)", function () {
it("is a function", funct... | Add header comments to keep system, package and project imports separate. | Add header comments to keep system, package and project imports separate.
| JavaScript | mit | webreed/webreed,webreed/webreed | ---
+++
@@ -1,10 +1,14 @@
// Copyright (c) Rotorz Limited. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root.
+
+// Packages
import given from "mocha-testdata";
import should from "should";
+// Project
import webreed from "../src";
+
describe("#setup(options)", f... |
9811418bc7619f10522342b8eb0c7b360f1cb7c2 | src/cli.js | src/cli.js | import {dest} from 'vinyl-fs';
import drFrankenstyle from './dr-frankenstyle';
const argv = require('yargs')
.usage('Usage: dr-frankenstyle <output-dir>')
.example('dr-frankenstyle my_assets_dir')
.demand(1, 'Please provide an output directory')
.boolean('rails')
.argv;
const output = argv._[0];
let stream... | import {dest} from 'vinyl-fs';
import drFrankenstyle from './dr-frankenstyle';
const argv = require('yargs')
.usage('Usage: dr-frankenstyle [options] <output-dir>')
.example('dr-frankenstyle my_assets_dir')
.demand(1, 'Please provide an output directory')
.boolean('rails')
.describe('rails', "Use Rails' asse... | Document rails option in CLI tool | Document rails option in CLI tool
Signed-off-by: Vinson Chuong <6df075c17c17de53656cfe2eb11616735a18bb18@pivotal.io>
| JavaScript | mit | bartvde/dr-frankenstyle,pivotal-cf/dr-frankenstyle | ---
+++
@@ -2,10 +2,11 @@
import drFrankenstyle from './dr-frankenstyle';
const argv = require('yargs')
- .usage('Usage: dr-frankenstyle <output-dir>')
+ .usage('Usage: dr-frankenstyle [options] <output-dir>')
.example('dr-frankenstyle my_assets_dir')
.demand(1, 'Please provide an output directory')
.b... |
db269537a14f6c3be00d681d9e8c5666cf5806af | src/reducers/index.js | src/reducers/index.js | export function stub(state = {}, action) {
return state;
}
| // Tentative schema for the overall app store:
//
//
// interface Media {
// id: string;
// kind: 'audio' | 'video';
// owner: string;
// stream: Object;
// audioState: 'active' | 'muted' | 'not-available' | 'error';
// videoState: 'active' | 'muted' | 'not-available' | 'error';
/... | Add the tentative schema for the redux store | Add the tentative schema for the redux store
| JavaScript | apache-2.0 | jitsi/jitsi-meet-react,jitsi/jitsi-meet-react,jitsi/jitsi-meet-react,jitsi/jitsi-meet-react | ---
+++
@@ -1,3 +1,58 @@
+// Tentative schema for the overall app store:
+//
+//
+// interface Media {
+// id: string;
+// kind: 'audio' | 'video';
+// owner: string;
+// stream: Object;
+// audioState: 'active' | 'muted' | 'not-available' | 'error';
+// videoState: 'active' | '... |
87a28a1e8466e46129a746691763a2e2642e3fa8 | src/routing/router.js | src/routing/router.js | import url from "url";
import mixin from "merge-descriptors";
import wildcard from "wildcard-named";
export default {
callbacks : {},
when( uri ) {
return new Promise( resolve => {
this.callbacks[ url.resolve( this.base, uri ) ] = resolve;
} );
},
check( uri, req, ... | import url from "url";
import request from "retry-request";
import mixin from "merge-descriptors";
import wildcard from "wildcard-named";
export default {
callbacks : {},
when( uri ) {
return new Promise( resolve => {
this.callbacks[ url.resolve( this.base, uri ) ] = resolve;
... | Add get method to request a single resource | Add get method to request a single resource
| JavaScript | mit | Bartozzz/crawlerr | ---
+++
@@ -1,4 +1,5 @@
import url from "url";
+import request from "retry-request";
import mixin from "merge-descriptors";
import wildcard from "wildcard-named";
@@ -11,6 +12,32 @@
} );
},
+ get( uri ) {
+ if ( !uri.startsWith( this.base ) ) {
+ uri = url.resolve( t... |
f6b99704f6a48eabc2622cf020813023413a7fa3 | autocompleteme.js | autocompleteme.js | /**
* autocompleteme.js
* Chrome extension to remove autocomplete=off attributes from all elements on the page.
*
* https://github.com/martone/autocompleteme
* Andy Martone (amartone@gmail.com)
*/
(function() {
var elements = document.querySelectorAll('input[autocomplete=off]');
if (elements.length) {
con... | /**
* autocompleteme.js
* Chrome extension to remove autocomplete=off attributes from all elements on the page.
*
* https://github.com/martone/autocompleteme
* Andy Martone (amartone@gmail.com)
*/
(function() {
var elements = document.querySelectorAll('[autocomplete=off]');
if (elements.length) {
console.... | Apply to all elements, not just input. | Apply to all elements, not just input.
| JavaScript | mit | martone/autocompleteme | ---
+++
@@ -6,7 +6,7 @@
* Andy Martone (amartone@gmail.com)
*/
(function() {
- var elements = document.querySelectorAll('input[autocomplete=off]');
+ var elements = document.querySelectorAll('[autocomplete=off]');
if (elements.length) {
console.groupCollapsed(
'Removing autocomplete=off from t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.