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 |
|---|---|---|---|---|---|---|---|---|---|---|
8ea3fe598997e04b102d50bc31c6c579b5591679 | src/js/main.js | src/js/main.js | require('../css/style.css');
(function(window, document, requirejs, define){
'use strict';
// config
try {
var config = JSON.parse(
document.getElementById('data-config').getAttribute('data-config')
);
var versions = config.versions;
} catch (error) {
// console.log(error);
}
/**
* Require.js config.
*/
requirejs.config({
paths: {
'react': [
'//cdnjs.cloudflare.com/ajax/libs/react/' + versions['react'] + '/react.min'
],
'react-dom': [
'//cdnjs.cloudflare.com/ajax/libs/react/' + versions['react-dom'] + '/react-dom.min'
],
'react-router': [
'//cdnjs.cloudflare.com/ajax/libs/react-router/' + versions['react-router'] + '/ReactRouter.min'
]
}
});
/**
* Client-side mounting.
*/
document.addEventListener('DOMContentLoaded', function() {
var client = require('react-engine/lib/client');
client.boot({
routes: require('../../routes/Routes'),
viewResolver: function(viewName) {
return require('../../views/' + viewName);
}
});
});
})(window, document, window.requirejs, window.define);
| require('../css/style.css');
(function(window, document, requirejs, define){
'use strict';
// config
try {
var config = JSON.parse(
document.getElementById('data-config').getAttribute('data-config')
);
var versions = config.versions;
} catch (error) {
// console.log(error);
}
/**
* Require.js config.
*/
requirejs.config({
paths: {
'react': [
'//cdnjs.cloudflare.com/ajax/libs/react/' + versions['react'] + '/react.min'
],
'react-dom': [
'//cdnjs.cloudflare.com/ajax/libs/react/' + versions['react-dom'] + '/react-dom.min'
],
'react-router': [
'//cdnjs.cloudflare.com/ajax/libs/react-router/' + versions['react-router'] + '/ReactRouter.min'
]
}
});
/**
* Mount on client-side.
*/
requirejs(['react', 'react-dom'], function(React, ReactDOM) {
window.React = React;
window.ReactDOM = ReactDOM;
requirejs(['react-router'], function(ReactRouter) {
window.ReactRouter = ReactRouter;
var client = require('react-engine/lib/client');
client.boot({
routes: require('../../routes/Routes'),
viewResolver: function(viewName) {
return require('../../views/' + viewName);
}
});
});
});
})(window, document, window.requirejs, window.define);
| Refactor `react-engine` client-side mounting to use Require.js | Refactor `react-engine` client-side mounting to use Require.js
Replace event listener `DOMContentLoaded` with `requirejs` now
that the scripts will run after they are loaded.
Make sure to load `react` and `react-dom` before `react-router`.
Also, attach the modules to `window` for it to work in production.
| JavaScript | mit | remarkablemark/react-engine-template,remarkablemark/react-engine-template | ---
+++
@@ -31,16 +31,22 @@
});
/**
- * Client-side mounting.
+ * Mount on client-side.
*/
- document.addEventListener('DOMContentLoaded', function() {
- var client = require('react-engine/lib/client');
+ requirejs(['react', 'react-dom'], function(React, ReactDOM) {
+ window.React = React;
+ window.ReactDOM = ReactDOM;
- client.boot({
- routes: require('../../routes/Routes'),
- viewResolver: function(viewName) {
- return require('../../views/' + viewName);
- }
+ requirejs(['react-router'], function(ReactRouter) {
+ window.ReactRouter = ReactRouter;
+
+ var client = require('react-engine/lib/client');
+ client.boot({
+ routes: require('../../routes/Routes'),
+ viewResolver: function(viewName) {
+ return require('../../views/' + viewName);
+ }
+ });
});
});
|
9c90a3a6e2f4e5e6e8028e63936daa28ef51f294 | build/configs/replace.js | build/configs/replace.js | module.exports = function (grunt) {
var semver = require('semver');
var version = grunt.option('version');
function bump () {
//console.log(arguments[0][0]);
}
function file (path) {
return {
dest: path,
src: path
};
}
function pattern (find) {
return {
match: find,
replacement: bump
};
}
return {
release: {
options: {
patterns: [
pattern(/version: '([^\']+)';/),
pattern(/"version": "([^\']+)"/)
]
},
files: [
file('src/version.js'),
file('bower.json'),
file('package.json')
]
}
};
};
| module.exports = function (grunt) {
var curver = require('../../package.json').version;
var semver = require('semver');
var version = grunt.option('version');
function bump () {
return version ? version : semver.inc(curver);
}
function file (path) {
return {
dest: path,
src: path
};
}
return {
release: {
options: {
patterns: [
{
match: new RegExp(curver),
replacement: bump
}
]
},
files: [
file('src/version.js'),
file('bower.json'),
file('package.json')
]
}
};
};
| Use specified version or increment current version. | Use specified version or increment current version.
| JavaScript | mit | skatejs/skatejs,chrisdarroch/skatejs,skatejs/skatejs,antitoxic/skatejs,chrisdarroch/skatejs,skatejs/skatejs | ---
+++
@@ -1,9 +1,10 @@
module.exports = function (grunt) {
+ var curver = require('../../package.json').version;
var semver = require('semver');
var version = grunt.option('version');
function bump () {
- //console.log(arguments[0][0]);
+ return version ? version : semver.inc(curver);
}
function file (path) {
@@ -13,19 +14,14 @@
};
}
- function pattern (find) {
- return {
- match: find,
- replacement: bump
- };
- }
-
return {
release: {
options: {
patterns: [
- pattern(/version: '([^\']+)';/),
- pattern(/"version": "([^\']+)"/)
+ {
+ match: new RegExp(curver),
+ replacement: bump
+ }
]
},
files: [ |
5ae3053a5eee1c0e2f8b214fc4174d7dacaf91f6 | src/server.js | src/server.js | import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
import bodyParser from "body-parser"
import mongoose, { Schema } from "mongoose"
import schema from "./graphql"
import Item from "./db/item"
// Constants
const HTTP_PORT = 7700
let currentApp = null
const app = express()
mongoose.Promise = global.Promise
mongoose.connect("mongodb://localhost:27017/runescape", {
useMongoClient: true
})
app.use(
"/graphql",
bodyParser.json({
limit: "15mb"
}),
graphqlExpress(() => ({
schema
}))
)
app.use(
"/graphiql",
graphiqlExpress({
endpointURL: "/graphql"
})
)
app.listen(HTTP_PORT, () => {
console.log(`GraphQL-server listening on port ${HTTP_PORT}.`)
})
if (module.hot) {
module.hot.accept(["./server", "./graphql"], () => {
server.removeListener("request", currentApp)
server.on("request", app)
currentApp = app
})
}
export { app, HTTP_PORT }
| import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
import bodyParser from "body-parser"
import mongoose, { Schema } from "mongoose"
import schema from "./graphql"
import Item from "./db/item"
// Constants
const HTTP_PORT = 80
let currentApp = null
const app = express()
mongoose.Promise = global.Promise
mongoose.connect("mongodb://localhost:27017/runescape", {
useMongoClient: true
})
app.use(
"/graphql",
bodyParser.json({
limit: "15mb"
}),
graphqlExpress(() => ({
schema
}))
)
app.use(
"/graphiql",
graphiqlExpress({
endpointURL: "/graphql"
})
)
app.listen(HTTP_PORT, () => {
console.log(`GraphQL-server listening on port ${HTTP_PORT}.`)
})
if (module.hot) {
module.hot.accept(["./server", "./graphql"], () => {
server.removeListener("request", currentApp)
server.on("request", app)
currentApp = app
})
}
export { app, HTTP_PORT }
| Change port from 7700 to 80 | Change port from 7700 to 80
| JavaScript | mit | DevNebulae/ads-pt-api | ---
+++
@@ -7,7 +7,7 @@
import Item from "./db/item"
// Constants
-const HTTP_PORT = 7700
+const HTTP_PORT = 80
let currentApp = null
const app = express() |
948dd454a231de83b3f7ef522f99588dbcb109de | server/fixtures.js | server/fixtures.js | defaultFeedIds = [];
defaultFeeds = [{
name: 'Sneakers',
icon: 'money'
}, {
name: 'Electronics',
icon: 'laptop'
}, {
name: 'Clothing (Men)',
icon: 'male'
}, {
name: 'Clothing (Women)',
icon: 'female'
}, {
name: 'Books',
icon: 'book'
}, {
name: 'Others',
icon: 'random'
}];
if (!Feeds.findOne()) {
defaultFeedIds = _.map(defaultFeeds, function(feed) {
return Feeds.insert(feed);
});
console.log(defaultFeedIds);
}
| Meteor.startup(function() {
defaultFeedIds = [];
defaultFeeds = [{
name: 'Sneakers',
icon: 'money'
}, {
name: 'Electronics',
icon: 'laptop'
}, {
name: 'Clothing (Men)',
icon: 'male'
}, {
name: 'Clothing (Women)',
icon: 'female'
}, {
name: 'Books',
icon: 'book'
}, {
name: 'Others',
icon: 'random'
}];
if (!Feeds.findOne()) {
defaultFeedIds = _.map(defaultFeeds, function(feed) {
return Feeds.insert(feed);
});
console.log(defaultFeedIds);
}
});
| Put feed fixture in startup | Put feed fixture in startup
| JavaScript | mit | BaseNY/base,BaseNY/base,BaseNY/base | ---
+++
@@ -1,28 +1,29 @@
-defaultFeedIds = [];
+Meteor.startup(function() {
+ defaultFeedIds = [];
+ defaultFeeds = [{
+ name: 'Sneakers',
+ icon: 'money'
+ }, {
+ name: 'Electronics',
+ icon: 'laptop'
+ }, {
+ name: 'Clothing (Men)',
+ icon: 'male'
+ }, {
+ name: 'Clothing (Women)',
+ icon: 'female'
+ }, {
+ name: 'Books',
+ icon: 'book'
+ }, {
+ name: 'Others',
+ icon: 'random'
+ }];
-defaultFeeds = [{
- name: 'Sneakers',
- icon: 'money'
-}, {
- name: 'Electronics',
- icon: 'laptop'
-}, {
- name: 'Clothing (Men)',
- icon: 'male'
-}, {
- name: 'Clothing (Women)',
- icon: 'female'
-}, {
- name: 'Books',
- icon: 'book'
-}, {
- name: 'Others',
- icon: 'random'
-}];
-
-if (!Feeds.findOne()) {
- defaultFeedIds = _.map(defaultFeeds, function(feed) {
- return Feeds.insert(feed);
- });
- console.log(defaultFeedIds);
-}
+ if (!Feeds.findOne()) {
+ defaultFeedIds = _.map(defaultFeeds, function(feed) {
+ return Feeds.insert(feed);
+ });
+ console.log(defaultFeedIds);
+ }
+}); |
68312d1d3e9a2f4f3211c0ba91105e11270b6f3d | src/app/common/interceptors.js | src/app/common/interceptors.js | (function (angular) {
"use strict";
angular.module("mfl.gis.interceptor", [])
.factory("mfl.gis.interceptor.headers", [function () {
var etag_header = null;
var last_modified_header = null;
return {
"request" : function(config) {
if (etag_header) {
config.headers.ETag = etag_header;
config.headers["If-None-Match"] = etag_header;
}
if (last_modified_header) {
config.headers["If-Modified-Since"] = last_modified_header;
}
return config;
},
"response": function(response) {
var etag = response.headers("ETag");
var last_modified = response.headers("Last-Modified");
if (etag) {
etag_header = etag;
}
if (last_modified) {
last_modified_header = last_modified;
}
return response;
}
};
}]);
})(angular);
| (function (angular) {
"use strict";
angular.module("mfl.gis.interceptor", [])
.factory("mfl.gis.interceptor.headers", [function () {
var cache_headers = {};
var request_fxn = function(config) {
var headers = cache_headers[config.url];
if (_.isUndefined(headers)) {
console.log("cache miss : ", config.url);
return config;
}
console.log("cache hit : ", config.url);
if (headers.etag_header) {
config.headers.ETag = headers.etag_header;
config.headers["If-None-Match"] = headers.etag_header;
}
if (headers.last_modified_header) {
config.headers["If-Modified-Since"] = headers.last_modified_header;
}
return config;
};
var response_fxn = function(response) {
var etag = response.headers("ETag");
var last_modified = response.headers("Last-Modified");
var headers = {};
if (etag) {
headers.etag_header = etag;
}
if (last_modified) {
headers.last_modified_header = last_modified;
}
cache_headers[response.config.url] = headers;
return response;
};
return {
"request" : request_fxn,
"response": response_fxn
};
}]);
})(angular);
| Make cache headers sentitive to urls | Make cache headers sentitive to urls
| JavaScript | mit | MasterFacilityList/mfl_web,urandu/mfl_web,MasterFacilityList/mfl_web,urandu/mfl_web,MasterFacilityList/mfl_web,MasterFacilityList/mfl_web | ---
+++
@@ -4,33 +4,42 @@
angular.module("mfl.gis.interceptor", [])
.factory("mfl.gis.interceptor.headers", [function () {
- var etag_header = null;
- var last_modified_header = null;
+ var cache_headers = {};
+
+ var request_fxn = function(config) {
+ var headers = cache_headers[config.url];
+ if (_.isUndefined(headers)) {
+ console.log("cache miss : ", config.url);
+ return config;
+ }
+ console.log("cache hit : ", config.url);
+ if (headers.etag_header) {
+ config.headers.ETag = headers.etag_header;
+ config.headers["If-None-Match"] = headers.etag_header;
+ }
+ if (headers.last_modified_header) {
+ config.headers["If-Modified-Since"] = headers.last_modified_header;
+ }
+ return config;
+ };
+
+ var response_fxn = function(response) {
+ var etag = response.headers("ETag");
+ var last_modified = response.headers("Last-Modified");
+ var headers = {};
+ if (etag) {
+ headers.etag_header = etag;
+ }
+ if (last_modified) {
+ headers.last_modified_header = last_modified;
+ }
+ cache_headers[response.config.url] = headers;
+ return response;
+ };
return {
- "request" : function(config) {
-
- if (etag_header) {
- config.headers.ETag = etag_header;
- config.headers["If-None-Match"] = etag_header;
- }
- if (last_modified_header) {
- config.headers["If-Modified-Since"] = last_modified_header;
- }
- return config;
- },
-
- "response": function(response) {
- var etag = response.headers("ETag");
- var last_modified = response.headers("Last-Modified");
- if (etag) {
- etag_header = etag;
- }
- if (last_modified) {
- last_modified_header = last_modified;
- }
- return response;
- }
+ "request" : request_fxn,
+ "response": response_fxn
};
}]);
|
5c63c358a2aa8ea74aa13088f18dfe0e786ef6f4 | lib/socket/handler.js | lib/socket/handler.js | "use strict";
class SocketHandler {
constructor(socket) {
this.socket = socket;
socket.on(this.eventName, this.preEvent);
}
preEvent() {
if (this.requiresAuthentication) {
// TODO
return false;
}
return handleEvent.apply({}, arguments);
}
handleEvent() {
throw "Abstract event handler called";
}
get eventName() {
return "abstract event";
}
get requiresAuthentication() {
return true;
}
}
module.exports = SocketHandler;
| "use strict";
class SocketHandler {
constructor(socket) {
this.socket = socket;
socket.on(this.eventName, this.preEvent.bind(this));
}
preEvent() {
if (this.requiresAuthentication) {
// TODO
return false;
}
return this.handleEvent.apply(this, arguments);
}
handleEvent() {
throw "Abstract event handler called";
}
get eventName() {
return "abstract event";
}
get requiresAuthentication() {
return true;
}
}
module.exports = SocketHandler;
| Fix scope for preEvent and handleEvent calls | Fix scope for preEvent and handleEvent calls
| JavaScript | mit | Sxw1212/ReDash,Sxw1212/ReDash | ---
+++
@@ -3,7 +3,7 @@
class SocketHandler {
constructor(socket) {
this.socket = socket;
- socket.on(this.eventName, this.preEvent);
+ socket.on(this.eventName, this.preEvent.bind(this));
}
preEvent() {
@@ -12,7 +12,7 @@
return false;
}
- return handleEvent.apply({}, arguments);
+ return this.handleEvent.apply(this, arguments);
}
handleEvent() { |
23a2c12b26d128c6b9cda4764d5b0487eba8671b | gulpfile.js | gulpfile.js | var gulp = require( 'gulp' );
var browserify = require( 'browserify' );
var source = require( 'vinyl-source-stream' );
var uglify = require( 'gulp-uglify' );
var streamify = require( 'gulp-streamify' );
gulp.task( 'browserify', function() {
return browserify( './index.js' )
.bundle()
.pipe( source( 'vip-js-sdk.js' ) )
.pipe( streamify( uglify() ) )
.pipe( gulp.dest( './dist/' ) );
});
| var gulp = require( 'gulp' );
var browserify = require( 'browserify' );
var source = require( 'vinyl-source-stream' );
var uglify = require('gulp-uglify-es').default;;
var streamify = require( 'gulp-streamify' );
gulp.task( 'browserify', function() {
return browserify( './index.js' )
.bundle()
.pipe( source( 'vip-js-sdk.js' ) )
.pipe( streamify( uglify() ) )
.pipe( gulp.dest( './dist/' ) );
});
| Use gulp-uglify-es instead of gulp-uglify | Use gulp-uglify-es instead of gulp-uglify
To properly build the project - has ES in spots
| JavaScript | mit | Automattic/vip-js-sdk | ---
+++
@@ -1,7 +1,7 @@
var gulp = require( 'gulp' );
var browserify = require( 'browserify' );
var source = require( 'vinyl-source-stream' );
-var uglify = require( 'gulp-uglify' );
+var uglify = require('gulp-uglify-es').default;;
var streamify = require( 'gulp-streamify' );
gulp.task( 'browserify', function() { |
1e0ef500de5b3bdaa857b091176b8cae3e2a330f | src/rx-glob.js | src/rx-glob.js | import Rx from 'rx';
import glob from 'glob';
var rxGlobArray = Rx.Observable.fromNodeCallback(glob);
export
default
function rxGlob(...args) {
console.log(...args);
return rxGlobArray(...args).flatMap(Rx.Observable.from)
.tapOnNext(console.log);
}
rxGlob.hasMagic = glob.hasMagic;
| import Rx from 'rx';
import glob from 'glob';
var rxGlobArray = Rx.Observable.fromNodeCallback(glob);
export
default
function rxGlob(...args) {
return rxGlobArray(...args).flatMap(Rx.Observable.from)
.tapOnNext(console.log);
}
rxGlob.hasMagic = glob.hasMagic;
| Fix stray console.log that messed up output | Fix stray console.log that messed up output
| JavaScript | mit | motiz88/sqin | ---
+++
@@ -7,7 +7,6 @@
default
function rxGlob(...args) {
- console.log(...args);
return rxGlobArray(...args).flatMap(Rx.Observable.from)
.tapOnNext(console.log);
} |
989073056f890097c74d78634f75b360a8fbf715 | config/passport.js | config/passport.js | import passport from 'koa-passport';
import User from '../src/models/users'
import { Strategy } from 'passport-local'
passport.serializeUser((user, done) => {
done(null, user.id)
})
passport.deserializeUser(async (id, done) => {
try {
const user = await User.findById(id, '-password')
done(null, user)
} catch(err) {
done(err)
}
})
passport.use('local', new Strategy({
usernameField: 'username',
passwordField: 'password'
}, async (username, password, done) => {
try {
const user = await User.findOne({ username })
if(!user) { return done(null, false) }
try {
const isMatch = await user.validatePassword(password)
if(!isMatch) { return done(null, false) }
done(null, user)
} catch(err) {
done(err)
}
} catch(err) {
return done(err)
}
}))
| import passport from 'koa-passport';
import User from '../src/models/users'
import { Strategy } from 'passport-local'
passport.serializeUser((user, done) => {
done(null, user.id)
})
passport.deserializeUser(async (id, done) => {
try {
const user = await User.findById(id, '-password -salt')
done(null, user)
} catch(err) {
done(err)
}
})
passport.use('local', new Strategy({
usernameField: 'username',
passwordField: 'password'
}, async (username, password, done) => {
try {
const user = await User.findOne({ username })
if(!user) { return done(null, false) }
try {
const isMatch = await user.validatePassword(password)
if(!isMatch) { return done(null, false) }
done(null, user)
} catch(err) {
done(err)
}
} catch(err) {
return done(err)
}
}))
| Remove user salt from deserialize | Remove user salt from deserialize
| JavaScript | mit | adrianObel/koa2-api-boilerplate | ---
+++
@@ -8,7 +8,7 @@
passport.deserializeUser(async (id, done) => {
try {
- const user = await User.findById(id, '-password')
+ const user = await User.findById(id, '-password -salt')
done(null, user)
} catch(err) {
done(err) |
bfcc3af922c0cf0fba0a5614be4d400d79a6eaee | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var shell = require('gulp-shell');
gulp.task('js', function() {
return gulp.src(['js/*.js', 'gen/*.js'])
.pipe(concat('rapidframe.js'))
//.pipe(concat('rapidframe.min.js'))
//.pipe(uglify())
.pipe(gulp.dest('.'));
});
gulp.task('watch', ['default'], function() {
gulp.watch('js/*.js', ['js']);
gulp.watch('gen/*.js', ['js']);
});
gulp.task('default', ['js']);
| var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var shell = require('gulp-shell');
gulp.task('js', function() {
return gulp.src(['js/*.js', 'gen/*.js'])
//.pipe(concat('rapidframe.js'))
.pipe(concat('rapidframe.min.js'))
.pipe(uglify())
.pipe(gulp.dest('.'));
});
gulp.task('watch', ['default'], function() {
gulp.watch('js/*.js', ['js']);
gulp.watch('gen/*.js', ['js']);
});
gulp.task('default', ['js']);
| Build with uglify as default | chore: Build with uglify as default
| JavaScript | mit | carlmartus/rapidframe.js,carlmartus/rapidframe.js | ---
+++
@@ -5,9 +5,9 @@
gulp.task('js', function() {
return gulp.src(['js/*.js', 'gen/*.js'])
- .pipe(concat('rapidframe.js'))
- //.pipe(concat('rapidframe.min.js'))
- //.pipe(uglify())
+ //.pipe(concat('rapidframe.js'))
+ .pipe(concat('rapidframe.min.js'))
+ .pipe(uglify())
.pipe(gulp.dest('.'));
});
|
d28d419833b093b4f6d0da409d91f67637f341a8 | migrations/v1.0_v1.1.js | migrations/v1.0_v1.1.js | var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/dds');
require('../lib/config/mongoose').init(mongoose);
require('../lib/models/acceptanceTest');
var AcceptanceTest = mongoose.model('AcceptanceTest');
var AcceptanceTestActivity = mongoose.model('AcceptanceTestActivity');
var stream = AcceptanceTest.find().stream();
stream.on('data', function(acceptanceTest) {
var cleanedResults = [];
acceptanceTest.expectedResults.forEach(function(result) {
if (result.code.indexOf('_non_calulable') == -1)
cleanedResults.push(result);
});
var diff = cleanedResults.length - acceptanceTest.expectedResults.length;
if (! diff)
return console.log(acceptanceTest._id, 'Nothing to do');
acceptanceTest
.set('expectedResults', cleanedResults)
.save(function(err, data) {
if (err) {
console.log(acceptanceTest._id);
return console.trace(err);
}
console.log(acceptanceTest._id, 'Removed', diff, 'obsolete values to test');
});
});
stream.on('end', function() {
console.log('completed!');
process.exit();
});
stream.on('error', function(err) {
console.trace(err);
});
| var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/dds');
require('../lib/config/mongoose').init(mongoose);
require('../lib/models/acceptanceTest');
var AcceptanceTest = mongoose.model('AcceptanceTest');
var AcceptanceTestActivity = mongoose.model('AcceptanceTestActivity');
var stream = AcceptanceTest.find().stream();
stream.on('data', function(acceptanceTest) {
var cleanedResults = [];
acceptanceTest.expectedResults.forEach(function(result) {
if (result.code.indexOf('_non_calulable') == -1)
cleanedResults.push(result);
});
var diff = cleanedResults.length - acceptanceTest.expectedResults.length;
if (! diff)
return console.log(acceptanceTest._id, 'Nothing to do');
if (! cleanedResults.length) {
return acceptanceTest.remove(function(err, product) {
console.log(acceptanceTest._id, 'Deleted (all tested values removed)')
});
}
acceptanceTest
.set('expectedResults', cleanedResults)
.save(function(err, data) {
if (err) {
console.log(acceptanceTest._id);
return console.trace(err);
}
console.log(acceptanceTest._id, 'Removed', diff, 'obsolete values to test');
});
});
stream.on('end', function() {
console.log('completed!');
process.exit();
});
stream.on('error', function(err) {
console.trace(err);
});
| Delete tests that only wrongly tested uncomputable | Delete tests that only wrongly tested uncomputable
| JavaScript | agpl-3.0 | sgmap/ludwig-api | ---
+++
@@ -23,6 +23,12 @@
if (! diff)
return console.log(acceptanceTest._id, 'Nothing to do');
+ if (! cleanedResults.length) {
+ return acceptanceTest.remove(function(err, product) {
+ console.log(acceptanceTest._id, 'Deleted (all tested values removed)')
+ });
+ }
+
acceptanceTest
.set('expectedResults', cleanedResults)
.save(function(err, data) {
@@ -32,7 +38,6 @@
}
console.log(acceptanceTest._id, 'Removed', diff, 'obsolete values to test');
-
});
});
|
db48e742bdea3a3b9b0de459019f74f632b6ceef | verify-package-settings.js | verify-package-settings.js | "use strict";
const expect = require('chai').expect
const packageSettings = require('./package.json')
const Up = require('./' + packageSettings.main)
describe('The `main` field in package.json', () => {
it('points to the entry point of the library', () => {
expect(Up.parseAndRender('It *actually* worked?')).to.equal('<p>It <em>actually</em> worked?</p>')
})
})
describe('The `version` field in package.json', () => {
it('matches the version of the library', () => {
expect(packageSettings.version).to.equal(Up.VERSION)
})
})
| "use strict";
const path = require('path');
const expect = require('chai').expect
const packageSettings = require('./package.json')
const Up = require('./' + packageSettings.main)
describe('The `main` field in package.json', () => {
it('points to the entry point of the library', () => {
expect(Up.parseAndRender('It *actually* worked?')).to.equal('<p>It <em>actually</em> worked?</p>')
})
})
describe('The `typings` field in package.json', () => {
it('points to the typings for the entry point of the library', () => {
const typingsBasename = path.basename(packageSettings.typings, '.d.ts')
const mainBasename =path.basename(packageSettings.main, '.js')
expect(typingsBasename).to.equal(mainBasename)
})
})
describe('The `version` field in package.json', () => {
it('matches the version of the library', () => {
expect(packageSettings.version).to.equal(Up.VERSION)
})
})
| Verify `typings` field in package.json | Verify `typings` field in package.json
| JavaScript | mit | start/up,start/up | ---
+++
@@ -1,5 +1,6 @@
"use strict";
+const path = require('path');
const expect = require('chai').expect
const packageSettings = require('./package.json')
@@ -13,6 +14,16 @@
})
+describe('The `typings` field in package.json', () => {
+ it('points to the typings for the entry point of the library', () => {
+ const typingsBasename = path.basename(packageSettings.typings, '.d.ts')
+ const mainBasename =path.basename(packageSettings.main, '.js')
+
+ expect(typingsBasename).to.equal(mainBasename)
+ })
+})
+
+
describe('The `version` field in package.json', () => {
it('matches the version of the library', () => {
expect(packageSettings.version).to.equal(Up.VERSION) |
6280fc97dba8773a6833014f0cd5f6ae71012c7d | resources/assets/build/webpack.config.optimize.js | resources/assets/build/webpack.config.optimize.js | 'use strict'; // eslint-disable-line
const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
const imageminMozjpeg = require('imagemin-mozjpeg');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const config = require('./config');
module.exports = {
plugins: [
new ImageminPlugin({
optipng: { optimizationLevel: 7 },
gifsicle: { optimizationLevel: 3 },
pngquant: { quality: '65-90', speed: 4 },
svgo: {
plugins: [
{ removeUnknownsAndDefaults: false },
{ cleanupIDs: false },
{ removeViewBox: false },
],
},
plugins: [imageminMozjpeg({ quality: 75 })],
disable: (config.enabled.watcher),
}),
new UglifyJsPlugin({
uglifyOptions: {
ecma: 8,
compress: {
warnings: true,
drop_console: true,
},
},
}),
],
};
| 'use strict'; // eslint-disable-line
const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
const imageminMozjpeg = require('imagemin-mozjpeg');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const config = require('./config');
module.exports = {
plugins: [
new ImageminPlugin({
optipng: { optimizationLevel: 7 },
gifsicle: { optimizationLevel: 3 },
pngquant: { quality: '65-90', speed: 4 },
svgo: {
plugins: [
{ removeUnknownsAndDefaults: false },
{ cleanupIDs: false },
{ removeViewBox: false },
],
},
plugins: [imageminMozjpeg({ quality: 75 })],
disable: (config.enabled.watcher),
}),
new UglifyJsPlugin({
uglifyOptions: {
ecma: 5,
compress: {
warnings: true,
drop_console: true,
},
},
}),
],
};
| Change the ecma option from 8 to 5 | UglifyJs: Change the ecma option from 8 to 5
| JavaScript | mit | c50/c50_roots,ptrckvzn/sage,roots/sage,NicBeltramelli/sage,NicBeltramelli/sage,ptrckvzn/sage,c50/c50_roots,roots/sage,c50/c50_roots,NicBeltramelli/sage,ptrckvzn/sage | ---
+++
@@ -24,7 +24,7 @@
}),
new UglifyJsPlugin({
uglifyOptions: {
- ecma: 8,
+ ecma: 5,
compress: {
warnings: true,
drop_console: true, |
f545a0e2137b4864a242416b1af5d429faad405d | build-supported-words.js | build-supported-words.js | var fs = require('fs'),
words = require('./data/buzzwords.json');
fs.writeFileSync('Supported-buzzwords.md',
'Supported Buzzwords\n' +
'=================\n' +
'\n' +
words.map(function (word) {
return '* “' + word + '”';
}).join(';\n') +
'.\n'
);
| 'use strict';
var fs = require('fs'),
words = require('./data/buzzwords.json');
fs.writeFileSync('Supported-buzzwords.md',
'Supported Buzzwords\n' +
'=================\n' +
'\n' +
words.map(function (word) {
return '* “' + word + '”';
}).join(';\n') +
'.\n'
);
| Add strict mode to support generation | Add strict mode to support generation
| JavaScript | mit | wooorm/buzzwords | ---
+++
@@ -1,3 +1,5 @@
+'use strict';
+
var fs = require('fs'),
words = require('./data/buzzwords.json');
|
9a6369ffcae9f46945ad94840806d5b08099bae0 | gulpfile.js | gulpfile.js | var gulp = require("gulp");
var uglify = require("gulp-uglify");
var rename = require("gulp-rename");
var cleanCSS = require("gulp-clean-css");
var config = {};
config.srcPath = "./src/";
config.distPath = "./dist/";
config.cssSrcPath = config.srcPath + "css/*.css";
config.jsSrcPath = config.srcPath + "js/*.js";
config.cssDistPath = config.distPath + "css/";
config.jsDistPath = config.distPath + "js/";
// CSS Minification
gulp.task("css", () => {
return gulp.src(config.cssSrcPath)
.pipe(cleanCSS({compatibility: "ie8", level: {1: {specialComments: 0}} }))
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(config.cssDistPath));
});
// JS Minification
gulp.task("js", () => {
return gulp.src(config.jsSrcPath)
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(config.jsDistPath));
});
// gulp watch for css and js
gulp.task("watch", function() {
gulp.watch(config.jsSrcPath, ["js"]);
gulp.watch(config.cssSrcPath, ["css"]);
});
//gulp default
gulp.task("default", ["css", "js"]);
| var gulp = require("gulp");
var uglify = require("gulp-uglify");
var rename = require("gulp-rename");
var cleanCSS = require("gulp-clean-css");
var config = {};
config.srcPath = "./src/";
config.distPath = "./dist/";
config.cssSrcPath = config.srcPath + "css/*.css";
config.jsSrcPath = config.srcPath + "js/*.js";
config.cssDistPath = config.distPath + "css/";
config.jsDistPath = config.distPath + "js/";
// CSS Minification
gulp.task("css", () => {
return gulp.src(config.cssSrcPath)
.pipe(cleanCSS({compatibility: "ie8", level: {1: {specialComments: 0}} }))
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(config.cssDistPath));
});
// JS Minification
gulp.task("js", () => {
return gulp.src(config.jsSrcPath)
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(config.jsDistPath));
});
// gulp watch for css and js
gulp.task("watch", () => {
gulp.watch(config.jsSrcPath, ["js"]);
gulp.watch(config.cssSrcPath, ["css"]);
});
//gulp default
gulp.task("default", ["css", "js"]);
| Use short function like above | Standards: Use short function like above
| JavaScript | agpl-3.0 | nirmankarta/eddyst.one,nirmankarta/eddyst.one | ---
+++
@@ -34,7 +34,7 @@
});
// gulp watch for css and js
-gulp.task("watch", function() {
+gulp.task("watch", () => {
gulp.watch(config.jsSrcPath, ["js"]);
gulp.watch(config.cssSrcPath, ["css"]);
}); |
2ebb6791a94db6e84c7811aa69d2a1542e6d18f4 | lib/commands/migrate.js | lib/commands/migrate.js | var OS = require("os");
var Config = require("truffle-config");
var Contracts = require("../contracts");
var Resolver = require("truffle-resolver");
var Artifactor = require("truffle-artifactor");
var Migrate = require("truffle-migrate");
var Environment = require("../environment");
var command = {
command: 'migrate',
description: 'Run migrations to deploy contracts',
builder: {
reset: {
type: "boolean",
default: false
},
"compile-all": {
describe: "recompile all contracts",
type: "boolean",
default: false
}
},
run: function (options, done) {
var config = Config.detect(options);
Contracts.compile(config, function(err) {
if (err) return done(err);
Environment.detect(config, function(err) {
if (err) return done(err);
config.logger.log("Using network '" + config.network + "'." + OS.EOL);
Migrate.needsMigrating(config, function(err, needsMigrating) {
if (err) return done(err);
if (needsMigrating) {
Migrate.run(config, done);
} else {
config.logger.log("Network up to date.")
done();
}
});
});
});
}
}
module.exports = command;
| var OS = require("os");
var Config = require("truffle-config");
var Contracts = require("../contracts");
var Resolver = require("truffle-resolver");
var Artifactor = require("truffle-artifactor");
var Migrate = require("truffle-migrate");
var Environment = require("../environment");
var command = {
command: 'migrate',
description: 'Run migrations to deploy contracts',
builder: {
reset: {
type: "boolean",
default: false
},
"compile-all": {
describe: "recompile all contracts",
type: "boolean",
default: false
},
f: {
describe: "Specify a migration number to run from",
type: "number"
}
},
run: function (options, done) {
var config = Config.detect(options);
Contracts.compile(config, function(err) {
if (err) return done(err);
Environment.detect(config, function(err) {
if (err) return done(err);
config.logger.log("Using network '" + config.network + "'." + OS.EOL);
if (options.f) {
Migrate.runFrom(options.f, config, done);
} else {
Migrate.needsMigrating(config, function(err, needsMigrating) {
if (err) return done(err);
if (needsMigrating) {
Migrate.run(config, done);
} else {
config.logger.log("Network up to date.")
done();
}
});
}
});
});
}
}
module.exports = command;
| Add the -f option to run from a specific migration. | Add the -f option to run from a specific migration.
| JavaScript | mit | DigixGlobal/truffle,prashantpawar/truffle | ---
+++
@@ -18,6 +18,10 @@
describe: "recompile all contracts",
type: "boolean",
default: false
+ },
+ f: {
+ describe: "Specify a migration number to run from",
+ type: "number"
}
},
run: function (options, done) {
@@ -31,16 +35,20 @@
config.logger.log("Using network '" + config.network + "'." + OS.EOL);
- Migrate.needsMigrating(config, function(err, needsMigrating) {
- if (err) return done(err);
+ if (options.f) {
+ Migrate.runFrom(options.f, config, done);
+ } else {
+ Migrate.needsMigrating(config, function(err, needsMigrating) {
+ if (err) return done(err);
- if (needsMigrating) {
- Migrate.run(config, done);
- } else {
- config.logger.log("Network up to date.")
- done();
- }
- });
+ if (needsMigrating) {
+ Migrate.run(config, done);
+ } else {
+ config.logger.log("Network up to date.")
+ done();
+ }
+ });
+ }
});
});
} |
44676a86b28fdee89ccc2ced929a68f0f9c86329 | gulpfile.js | gulpfile.js | "use strict"
var gulp = require("gulp");
var eslint = require("gulp-eslint");
var babel = require("gulp-babel");
var SOURCE_PATH = ["./src/**/*.js", "./src/**/*.jsx"];
gulp.task("build", function () {
return gulp.src(SOURCE_PATH)
.pipe(babel())
.pipe(gulp.dest("lib"));
});
gulp.task("watch", function(callback) { gulp.watch(SOURCE_PATH, ["build"]) });
gulp.task("lint", function() {
return gulp.src(SOURCE_PATH)
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task("default", ["build", "watch"]);
| "use strict"
var gulp = require("gulp");
var eslint = require("gulp-eslint");
var babel = require("gulp-babel");
var SOURCE_PATH = ["./src/**/*.js", "./src/**/*.jsx"];
// gulp.task("build", function () {
// return gulp.src(SOURCE_PATH)
// .pipe(babel())
// .pipe(gulp.dest("lib"));
// });
// gulp.task("watch", function(callback) { gulp.watch(SOURCE_PATH, ["build"]) });
gulp.task("lint", function() {
return gulp.src(SOURCE_PATH)
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task("default", ["lint"]);
| Comment out build step (gulp). | Comment out build step (gulp).
| JavaScript | mit | philcockfield/ui-harness,philcockfield/ui-harness,philcockfield/ui-harness | ---
+++
@@ -5,12 +5,12 @@
var SOURCE_PATH = ["./src/**/*.js", "./src/**/*.jsx"];
-gulp.task("build", function () {
- return gulp.src(SOURCE_PATH)
- .pipe(babel())
- .pipe(gulp.dest("lib"));
-});
-gulp.task("watch", function(callback) { gulp.watch(SOURCE_PATH, ["build"]) });
+// gulp.task("build", function () {
+// return gulp.src(SOURCE_PATH)
+// .pipe(babel())
+// .pipe(gulp.dest("lib"));
+// });
+// gulp.task("watch", function(callback) { gulp.watch(SOURCE_PATH, ["build"]) });
@@ -23,4 +23,4 @@
-gulp.task("default", ["build", "watch"]);
+gulp.task("default", ["lint"]); |
601ea6b5155bd81e007bd8bad583e50e9f1ba42c | gulpfile.js | gulpfile.js | "use strict";
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
filter = require('gulp-filter'),
mocha = require('gulp-mocha');
gulp.task('default', ['test']);
gulp.task('watch', function () {
gulp.watch('test/*.js', ['test']);
});
gulp.task('test', ['lint'], function () {
gulp.src('test/*.js', {read: false})
.pipe(mocha({reporter: 'spec', ui: 'bdd'}));
});
gulp.task('lint', function () {
return gulp.src('**/*.js')
.pipe(filter(['*', '!node_modules/**/*']))
.pipe(jshint({node: true}))
.pipe(jshint.reporter('default'));
});
| "use strict";
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
filter = require('gulp-filter'),
mocha = require('gulp-mocha');
gulp.task('default', ['test']);
gulp.task('watch', function () {
gulp.watch(['**/*.js', '!node_modules/**/*.js'], ['test']);
});
gulp.task('test', ['lint'], function () {
gulp.src('test/*.js', {read: false})
.pipe(mocha({reporter: 'spec', ui: 'bdd'}));
});
gulp.task('lint', function () {
return gulp.src('**/*.js')
.pipe(filter(['*', '!node_modules/**/*']))
.pipe(jshint({node: true}))
.pipe(jshint.reporter('default'));
});
| Add all .js files to gulp.watch instead of just the files under 'test/' | Add all .js files to gulp.watch instead of just the files under 'test/'
| JavaScript | mit | keithmorris/gulp-nunit-runner | ---
+++
@@ -7,7 +7,7 @@
gulp.task('default', ['test']);
gulp.task('watch', function () {
- gulp.watch('test/*.js', ['test']);
+ gulp.watch(['**/*.js', '!node_modules/**/*.js'], ['test']);
});
gulp.task('test', ['lint'], function () { |
577baf7c652130a0677c74419c736ddc304d735c | lib/ruche/util/error.js | lib/ruche/util/error.js | // Module dependencies.
var debug = require('debug')('ruche:error');
/**
* Handle errors
* @param {Error} error
* @return {Error}
*/
var handle = function (err) {
debug(err);
process.exit(1)
return err;
};
var exception = function () {
process.on('uncaughtException', function (err) {
handle(err);
});
}
module.exports.handle = handle;
module.exports.exception = exception;
| // Module dependencies.
var debug = require('debug')('ruche:error');
/**
* Handle errors
* @param {Error} error
* @return {Error}
*/
var handle = function (err) {
debug(err);
process.exit(1)
return err;
};
/**
* The uncaughtException handler. Stops the process on Error
* @return {Boolean} Returns the status of the app.
*/
var exception = function () {
process.on('uncaughtException', function (err) {
handle(err);
return false;
});
return true;
}
module.exports.handle = handle;
module.exports.exception = exception;
| Add documentation to uncaughtException handler. | Add documentation to uncaughtException handler.
| JavaScript | mit | quentinrossetti/ruche,quentinrossetti/ruche,quentinrossetti/ruche | ---
+++
@@ -12,10 +12,16 @@
return err;
};
+/**
+ * The uncaughtException handler. Stops the process on Error
+ * @return {Boolean} Returns the status of the app.
+ */
var exception = function () {
process.on('uncaughtException', function (err) {
handle(err);
+ return false;
});
+ return true;
}
module.exports.handle = handle; |
4d476004060dfdd7c6c124fe53d077f4e9bdd859 | test/Login.js | test/Login.js | 'use strict';
import Login from '../src/Login';
describe('Login', function() {
it('should be tested', function() {
assert.fail('No tests for this module yet.');
});
});
| 'use strict';
import Login from '../src/Login';
describe('Login', function() {
beforeEach(function () {
this.xhr = sinon.useFakeXMLHttpRequest();
var requests = this.requests = [];
this.xhr.onCreate = function (xhr) {
requests.push(xhr);
};
});
afterEach(function () {
this.xhr.restore();
});
it('should add a component to the DOM', function() {
// assert.fail('No tests for this module yet.');
let login = new Login();
let el = document.querySelector('.loginmodal-container');
assert.ok(el);
});
it('should try to login and emit an error event if it fails', function(done) {
let callback = sinon.spy();
let login = new Login();
login.on('loginError', function () {
callback();
assert.deepEqual(callback.called, true);
done();
});
let btn = login.element.querySelector('input[type="submit"]');
btn.click();
});
it('should try to login and emit a success event if it works', function(done) {
let callback = sinon.spy();
let login = new Login();
login.userEl.value = 'test';
login.passEl.value = 'test';
login.on('loginSuccess', function (val) {
callback();
assert.deepEqual(callback.called, true);
assert.deepEqual(val.status, 200);
done();
});
let btn = login.element.querySelector('input[type="submit"]');
btn.click();
this.requests[0].respond(200);
});
});
| Add test for login component | Add test for login component
| JavaScript | bsd-3-clause | nhpatt/metal-login,nhpatt/metal-login | ---
+++
@@ -3,7 +3,58 @@
import Login from '../src/Login';
describe('Login', function() {
- it('should be tested', function() {
- assert.fail('No tests for this module yet.');
+
+ beforeEach(function () {
+ this.xhr = sinon.useFakeXMLHttpRequest();
+ var requests = this.requests = [];
+ this.xhr.onCreate = function (xhr) {
+ requests.push(xhr);
+ };
+ });
+
+ afterEach(function () {
+ this.xhr.restore();
+ });
+
+
+ it('should add a component to the DOM', function() {
+ // assert.fail('No tests for this module yet.');
+
+ let login = new Login();
+ let el = document.querySelector('.loginmodal-container');
+ assert.ok(el);
+ });
+
+ it('should try to login and emit an error event if it fails', function(done) {
+ let callback = sinon.spy();
+ let login = new Login();
+
+ login.on('loginError', function () {
+ callback();
+ assert.deepEqual(callback.called, true);
+ done();
+ });
+
+ let btn = login.element.querySelector('input[type="submit"]');
+ btn.click();
+ });
+
+ it('should try to login and emit a success event if it works', function(done) {
+ let callback = sinon.spy();
+
+ let login = new Login();
+ login.userEl.value = 'test';
+ login.passEl.value = 'test';
+
+ login.on('loginSuccess', function (val) {
+ callback();
+ assert.deepEqual(callback.called, true);
+ assert.deepEqual(val.status, 200);
+ done();
+ });
+
+ let btn = login.element.querySelector('input[type="submit"]');
+ btn.click();
+ this.requests[0].respond(200);
});
}); |
856cc359223a4acc2c8ba9ccebe965fa37a86e04 | sli/config/indexes/ingestion_batch_job_indexes.js | sli/config/indexes/ingestion_batch_job_indexes.js | //
// Copyright 2012 Shared Learning Collaborative, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
db["error"].ensureIndex({"batchJobId":1, "resourceId":1});
db["newBatchJob"].ensureIndex({"jobStartTimestamp":1}); // only for job reporting tool
db["batchJobStage"].ensureIndex({"jobId":1, "stageName":1});
db["transformationLatch"].ensureIndex({"jobId" : 1, "syncStage" : 1, "recordType" : 1}, {unique : true});
db["persistenceLatch"].ensureIndex({"jobId" : 1, "syncStage" : 1, "entities" : 1}, {unique : true});
db["stagedEntities"].ensureIndex({"jobId" : 1}, {unique : true});
| //
// Copyright 2012 Shared Learning Collaborative, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
db["error"].ensureIndex({"batchJobId":1, "resourceId":1});
db["newBatchJob"].ensureIndex({"jobStartTimestamp":1}); // only for job reporting tool
db["batchJobStage"].ensureIndex({"jobId":1, "stageName":1});
db["transformationLatch"].ensureIndex({"jobId" : 1, "syncStage" : 1, "recordType" : 1}, {unique : true});
db["persistenceLatch"].ensureIndex({"jobId" : 1, "syncStage" : 1, "entities" : 1}, {unique : true});
db["stagedEntities"].ensureIndex({"jobId" : 1}, {unique : true});
db["recordHash"].ensureIndex({"tenantId":1});
| Revert "DE2347 - Remove tenantId index from recordHash as intended" | Revert "DE2347 - Remove tenantId index from recordHash as intended"
This reverts commit 6718f6f8388ca42d85c6403129be29d2c36852e8.
Need to keep the index because purging the data in recordHash,
which remains shared across tenants in ingestion_batch_job,
requires a full-table-table scan when the index is absent.
That in turn breaks in CI which prohibits full table scans.
| JavaScript | apache-2.0 | inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service | ---
+++
@@ -21,3 +21,4 @@
db["transformationLatch"].ensureIndex({"jobId" : 1, "syncStage" : 1, "recordType" : 1}, {unique : true});
db["persistenceLatch"].ensureIndex({"jobId" : 1, "syncStage" : 1, "entities" : 1}, {unique : true});
db["stagedEntities"].ensureIndex({"jobId" : 1}, {unique : true});
+db["recordHash"].ensureIndex({"tenantId":1}); |
e53946933a575fa13682b538186828a90e4d9101 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var ts = require('gulp-typescript');
var tslint = require('gulp-tslint');
var jade = require('gulp-jade');
gulp.task('jade', function() {
gulp.src('./src/views/*.jade')
.pipe(jade())
.pipe(gulp.dest('./dist/'))
});
gulp.task('typescript', function() {
gulp.src('src/scripts/**/*.ts')
.pipe(tslint())
.pipe(tslint.report('verbose'))
.pipe(ts({
declarationFiles: true,
target: 'es5'
}));
});
gulp.task('default', function () {
});
| var gulp = require('gulp');
var ts = require('gulp-typescript');
var tslint = require('gulp-tslint');
var jade = require('gulp-jade');
gulp.task('jade', function() {
gulp.src('./src/views/*.jade')
.pipe(jade())
.pipe(gulp.dest('./dist/'))
});
gulp.task('typescript', function() {
gulp.src('src/scripts/**/*.ts')
.pipe(tslint())
.pipe(tslint.report('verbose'))
.pipe(ts({
declarationFiles: true,
target: 'es5'
})
.pipe(gulp.dest('./dist/scripts/')));
});
gulp.task('default', function () {
});
| Set JavaScript file destination directory, after TypeScript compile | Set JavaScript file destination directory, after TypeScript compile
| JavaScript | mit | kubosho/simple-music-player | ---
+++
@@ -16,7 +16,8 @@
.pipe(ts({
declarationFiles: true,
target: 'es5'
- }));
+ })
+ .pipe(gulp.dest('./dist/scripts/')));
});
gulp.task('default', function () { |
4ceb847fa6340bb869d9c8cb3e55701124d0b92b | app/assets/javascripts/views/navbar.js | app/assets/javascripts/views/navbar.js | $(document).ready(function() {
$(".welcome").on("click", function() {
console.log("YES");
$(this).slideUp(1500);
// $(this).parent().slideUp(1500);
$(this).parent().animate({ height: 'toggle', opacity: 0.5 }, 1500);
});
$("#about").on("click", function() {
var popupBox = $(".popup-about");
popupBox.fadeIn(400);
$('body').append('<div class="container" id="mask"></div>');
$("#mask").fadeIn(400);
});
$("#start").on("click", function() {
var popupBox = $(".popup-start");
popupBox.fadeIn(400);
$('body').append('<div class="container" id="mask"></div>');
$("#mask").fadeIn(400);
});
$("#meet").on("click", function() {
var popupBox = $(".popup-meet");
popupBox.fadeIn(400);
$('body').append('<div class="container" id="mask"></div>');
$("#mask").fadeIn(400);
});
});
| $(document).ready(function() {
$(".welcome").on("click", function() {
console.log("YES");
$(this).fadeOut(1400);
$(this).parent().slideUp(1800);
// $(this).slideUp(1200);
// $(this).parent().animate({ height: 'toggle', opacity: 0.5 }, 1500);
});
$("#about").on("click", function() {
var popupBox = $(".popup-about");
popupBox.fadeIn(400);
$('body').append('<div class="container" id="mask"></div>');
$("#mask").fadeIn(400);
});
$("#start").on("click", function() {
var popupBox = $(".popup-start");
popupBox.fadeIn(400);
$('body').append('<div class="container" id="mask"></div>');
$("#mask").fadeIn(400);
});
$("#meet").on("click", function() {
var popupBox = $(".popup-meet");
popupBox.fadeIn(400);
$('body').append('<div class="container" id="mask"></div>');
$("#mask").fadeIn(400);
});
});
| Modify slide and fade features | Modify slide and fade features
| JavaScript | mit | chi-bobolinks-2015/TheGoldenRecord,chi-bobolinks-2015/TheGoldenRecord,chi-bobolinks-2015/TheGoldenRecord | ---
+++
@@ -2,9 +2,10 @@
$(".welcome").on("click", function() {
console.log("YES");
- $(this).slideUp(1500);
- // $(this).parent().slideUp(1500);
- $(this).parent().animate({ height: 'toggle', opacity: 0.5 }, 1500);
+ $(this).fadeOut(1400);
+ $(this).parent().slideUp(1800);
+ // $(this).slideUp(1200);
+ // $(this).parent().animate({ height: 'toggle', opacity: 0.5 }, 1500);
});
$("#about").on("click", function() { |
37704ec24635ab7f256706e6c929733ab2b64e7d | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var eslint = require('gulp-eslint');
var coveralls = require('gulp-coveralls');
gulp.task('pre-test', function () {
return gulp.src(['lib/**/*.js', '!lib/micro-whalla.js'])
.pipe(istanbul({ includeUntested: true }))
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['lint', 'pre-test'], function () {
return gulp.src('test/*.test.js')
.pipe(mocha())
.pipe(istanbul.writeReports());
});
gulp.task('lint', function () {
return gulp.src(['**/*.js', '!node_modules/**', '!coverage/**'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('coveralls', function () {
return gulp.src('coverage/**/lcov.info')
.pipe(coveralls());
});
gulp.task('default', ['test'], function () {
});
| var gulp = require('gulp');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var eslint = require('gulp-eslint');
var coveralls = require('gulp-coveralls');
gulp.task('pre-test', function () {
return gulp.src(['lib/**/*.js', '!lib/micro-whalla.js', '!lib/helpers.js'])
.pipe(istanbul({ includeUntested: true }))
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['lint', 'pre-test'], function () {
return gulp.src('test/*.test.js')
.pipe(mocha())
.pipe(istanbul.writeReports());
});
gulp.task('lint', function () {
return gulp.src(['**/*.js', '!node_modules/**', '!coverage/**'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('coveralls', function () {
return gulp.src('coverage/**/lcov.info')
.pipe(coveralls());
});
gulp.task('default', ['test'], function () {
});
| Add helpers.js to ignore from tests | Add helpers.js to ignore from tests
| JavaScript | mit | czerwonkabartosz/Micro-Whalla | ---
+++
@@ -5,7 +5,7 @@
var coveralls = require('gulp-coveralls');
gulp.task('pre-test', function () {
- return gulp.src(['lib/**/*.js', '!lib/micro-whalla.js'])
+ return gulp.src(['lib/**/*.js', '!lib/micro-whalla.js', '!lib/helpers.js'])
.pipe(istanbul({ includeUntested: true }))
.pipe(istanbul.hookRequire());
}); |
52ee49be8d61da1b6accf3b05967e961ab240b77 | src/watcher.js | src/watcher.js | 'use strict'
const log = require('./log.js')
const mm = require('micromatch')
const chalk = require('chalk')
const watcher = require('simple-watcher')
class Watcher {
watch ({workingDir, exclude, callback}) {
log.info(`Scanning: ${chalk.yellow(workingDir)} ...`)
watcher(workingDir, (localPath) => {
log.debug('Changed:', localPath)
// Skip excluded.
if (exclude && mm([localPath], {dot: true}, exclude).length > 0) {
return
}
callback(localPath)
}, 0)
log.info('Awaiting changes ...')
}
}
module.exports = Watcher
| 'use strict'
const log = require('./log.js')
const mm = require('micromatch')
const chalk = require('chalk')
const watcher = require('simple-watcher')
class Watcher {
watch ({workingDir, exclude, callback}) {
log.info(`Scanning: ${chalk.yellow(workingDir)} ...`)
watcher(workingDir, (localPath) => {
log.debug('Changed:', localPath)
// Skip excluded.
if (exclude && mm([localPath], exclude, {dot: true}).length > 0) {
return
}
callback(localPath)
}, 0)
log.info('Awaiting changes ...')
}
}
module.exports = Watcher
| Fix order of micromatch parameters | Fix order of micromatch parameters
| JavaScript | mit | gavoja/aemsync | ---
+++
@@ -13,7 +13,7 @@
log.debug('Changed:', localPath)
// Skip excluded.
- if (exclude && mm([localPath], {dot: true}, exclude).length > 0) {
+ if (exclude && mm([localPath], exclude, {dot: true}).length > 0) {
return
}
|
7cb6aab651c603f0d0d3a2159193b3cb8e62a97d | gulpfile.js | gulpfile.js | // Generated by CoffeeScript 1.6.2
(function() {
var coffee, concat, gulp, gutil, mocha, uglify, wrap;
gulp = require('gulp');
coffee = require('gulp-coffee');
concat = require('gulp-concat');
gutil = require('gulp-util');
mocha = require('gulp-mocha');
uglify = require('gulp-uglify');
wrap = require('gulp-wrap-umd');
gulp.task('caffeinate', function() {
gulp.src('src/*.coffee').pipe(coffee({
bare: true
})).on('error', gutil.log).pipe(gulp.dest('./tmp/build'));
return gulp.src('test/*.coffee').pipe(coffee()).on('error', gutil.log).pipe(gulp.dest('./tmp'));
});
gulp.task('build', ['caffeinate'], function() {
return gulp.src(['lib/*.js', 'tmp/build/*.js']).pipe(concat('main.js')).pipe(wrap({
exports: 'exposed'
})).pipe(uglify()).pipe(gulp.dest('./dist/'));
});
gulp.task('test', ['build'], function() {
return gulp.src('tmp/*.js').pipe(mocha());
});
gulp.task('default', function() {
gulp.run('build');
return gulp.watch(['lib/base64-binary.js', 'src/validate-ssh.coffee'], function(event) {
return gulp.run('build');
});
});
}).call(this);
| //the build instructions are in gulpfile.coffee
//this file is a simple bridge since gulp doesn't support
//coffeescript files natively.
require('coffee-script');
require('./gulpfile.coffee');
| Use bridge gulp file instead of having to re-generate. | Use bridge gulp file instead of having to re-generate.
| JavaScript | mit | resin-io/validateSSHjs | ---
+++
@@ -1,43 +1,6 @@
-// Generated by CoffeeScript 1.6.2
-(function() {
- var coffee, concat, gulp, gutil, mocha, uglify, wrap;
+//the build instructions are in gulpfile.coffee
+//this file is a simple bridge since gulp doesn't support
+//coffeescript files natively.
- gulp = require('gulp');
-
- coffee = require('gulp-coffee');
-
- concat = require('gulp-concat');
-
- gutil = require('gulp-util');
-
- mocha = require('gulp-mocha');
-
- uglify = require('gulp-uglify');
-
- wrap = require('gulp-wrap-umd');
-
- gulp.task('caffeinate', function() {
- gulp.src('src/*.coffee').pipe(coffee({
- bare: true
- })).on('error', gutil.log).pipe(gulp.dest('./tmp/build'));
- return gulp.src('test/*.coffee').pipe(coffee()).on('error', gutil.log).pipe(gulp.dest('./tmp'));
- });
-
- gulp.task('build', ['caffeinate'], function() {
- return gulp.src(['lib/*.js', 'tmp/build/*.js']).pipe(concat('main.js')).pipe(wrap({
- exports: 'exposed'
- })).pipe(uglify()).pipe(gulp.dest('./dist/'));
- });
-
- gulp.task('test', ['build'], function() {
- return gulp.src('tmp/*.js').pipe(mocha());
- });
-
- gulp.task('default', function() {
- gulp.run('build');
- return gulp.watch(['lib/base64-binary.js', 'src/validate-ssh.coffee'], function(event) {
- return gulp.run('build');
- });
- });
-
-}).call(this);
+require('coffee-script');
+require('./gulpfile.coffee'); |
5deca95ccf4351038cb84eae9b6223d60f3f68cb | gulpfile.js | gulpfile.js | var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Less
| file for our application, as well as publishing vendor resources.
|
*/
elixir(function(mix) {
mix.sass('app.scss');
});
| var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
|
*/
elixir(function(mix) {
mix.sass('app.scss');
});
| Change comment to reflect the change of the default css preprocessor. | Change comment to reflect the change of the default css preprocessor. | JavaScript | mit | kerick-jeff/iPub,lcp0578/Wiki,superdol/Wiki,superdol/Wiki,remxcode/laravel-base,thosakwe/rGuard,tkc/laravel-unit-test-sample,farwish/laravel-pro,kerick-jeff/istore,hackel/laravel,Stolz/Wiki,farwish/laravel-pro,orckid-lab/dashboard,superdol/Wiki,slimkit/thinksns-plus,hackel/laravel,tkc/laravel-unit-test-sample,hackel/laravel,cbnuke/FilesCollection,zhiyicx/thinksns-plus,xezw211/wx,beautifultable/phpwind,flysap/skeleton,thosakwe/rGuard,SIJOT/SIJOT-2.x,thosakwe/rGuard,kerick-jeff/istore,flysap/skeleton,orckid-lab/dashboard,Stolz/Wiki,boomcms/boomcms,sergi10/rfuerzo,thosakwe/rGuard,thosakwe/rGuard,remxcode/laravel-base,lxerxa/actionview,zhiyicx/thinksns-plus,tkc/laravel-unit-test-sample,SIJOT/SIJOT-2.x,beautifultable/phpwind,xezw211/wx,zeropingheroes/lanyard,lxerxa/actionview,kerick-jeff/iPub,zeropingheroes/lanyard,zeropingheroes/lanyard,lcp0578/Wiki,xezw211/wx,slimkit/thinksns-plus,tinywitch/laravel,sergi10/rfuerzo,Stolz/Wiki,cbnuke/FilesCollection,lcp0578/Wiki,lxerxa/actionview,sergi10/rfuerzo,kerick-jeff/iPub,tkc/laravel-unit-test-sample,lxerxa/actionview | ---
+++
@@ -6,7 +6,7 @@
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
- | for your Laravel application. By default, we are compiling the Less
+ | for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
|
*/ |
864f02426a0fceca05a597d46a7e61210497b9a3 | gui/editor/src/command/TableCommand.js | gui/editor/src/command/TableCommand.js | import Command from './Command.js';
/**
* Table Command
*/
export default class TableCommand extends Command {
/**
* @inheritDoc
*/
execute() {
const figure = this.editor.document.createElement('figure');
const table = this.editor.document.createElement('table');
const figcaption = this.editor.document.createElement('figcaption');
figure.classList.add('table');
figure.appendChild(table);
figure.appendChild(figcaption);
['thead', 'tbody', 'tfoot'].forEach(part => {
const item = this.editor.document.createElement(part);
const tr = this.editor.document.createElement('tr');
table.appendChild(item);
item.appendChild(tr);
for (let i = 0; i < 2; ++i) {
let cell = this.editor.document.createElement(part === 'thead' ? 'th' : 'td');
tr.appendChild(cell);
}
});
this.editor.insert(figure);
}
}
| import Command from './Command.js';
/**
* Table Command
*/
export default class TableCommand extends Command {
/**
* @inheritDoc
*/
execute() {
const figure = this.editor.document.createElement('figure');
const table = this.editor.document.createElement('table');
const figcaption = this.editor.document.createElement('figcaption');
figure.classList.add('table');
figure.appendChild(table);
figure.appendChild(figcaption);
['thead', 'tbody', 'tfoot'].forEach(section => {
const item = this.editor.document.createElement(section);
const tr = this.editor.document.createElement('tr');
table.appendChild(item);
item.appendChild(tr);
for (let i = 0; i < 2; ++i) {
let cell = this.editor.document.createElement(section === 'thead' ? 'th' : 'td');
tr.appendChild(cell);
}
});
this.editor.insert(figure);
}
}
| Rename param to be consistent | Rename param to be consistent
| JavaScript | mit | akilli/cms,akilli/cms,akilli/cms | ---
+++
@@ -16,14 +16,14 @@
figure.appendChild(table);
figure.appendChild(figcaption);
- ['thead', 'tbody', 'tfoot'].forEach(part => {
- const item = this.editor.document.createElement(part);
+ ['thead', 'tbody', 'tfoot'].forEach(section => {
+ const item = this.editor.document.createElement(section);
const tr = this.editor.document.createElement('tr');
table.appendChild(item);
item.appendChild(tr);
for (let i = 0; i < 2; ++i) {
- let cell = this.editor.document.createElement(part === 'thead' ? 'th' : 'td');
+ let cell = this.editor.document.createElement(section === 'thead' ? 'th' : 'td');
tr.appendChild(cell);
}
}); |
1836576ba5045392f9af0473f48cbfac27ccd8ef | src/components/document/authors/authorsDirective.js | src/components/document/authors/authorsDirective.js | 'use strict';
// @ngInject
var authorsDirective = function() {
return {
scope: {
authors: '='
},
template: require('./authorstemplate.html'),
//@ngInject
controller: function($scope) {
$scope.fullnames = function (authors) {
return authors.reduce((m, a, i) => m + a.first_name + ' ' + a.last_name + (i < authors.length-1 ? ', ':''), '');
};
}
};
};
module.exports = authorsDirective;
| 'use strict';
// @ngInject
var authorsDirective = function() {
return {
scope: {
authors: '='
},
template: require('./authorstemplate.html'),
//@ngInject
controller: function($scope) {
$scope.fullnames = function (authors) {
return authors.reduce((m, a, i) => {
return m +
(a.first_name ? a.first_name + ' ' + a.last_name : a.name) +
(i < authors.length-1 ? ', ':'');
}, '');
};
}
};
};
module.exports = authorsDirective;
| Support first_name, last_name and name | Support first_name, last_name and name
| JavaScript | mit | npolar/npdc-common,npolar/npdc-common | ---
+++
@@ -10,7 +10,11 @@
//@ngInject
controller: function($scope) {
$scope.fullnames = function (authors) {
- return authors.reduce((m, a, i) => m + a.first_name + ' ' + a.last_name + (i < authors.length-1 ? ', ':''), '');
+ return authors.reduce((m, a, i) => {
+ return m +
+ (a.first_name ? a.first_name + ' ' + a.last_name : a.name) +
+ (i < authors.length-1 ? ', ':'');
+ }, '');
};
}
}; |
28d94abe7b927ddb8edfe50e1641d0614cc5c01b | src/build/minionette.js | src/build/minionette.js | var Minionette = (function(global, _, $, Backbone) {
'use strict';
// Define and export the Minionette namespace
var Minionette = {};
Backbone.Minionette = Minionette;
// @include ../jquery.cleanData.js
// @include ../view.js
// @include ../region.js
// @include ../model_view.js
// @include ../collection_view.js
return Minionette;
})(this, _, jQuery, Backbone);
| var Minionette = (function(global, _, $, Backbone) {
'use strict';
// Define and export the Minionette namespace
var Minionette = {};
Backbone.Minionette = Minionette;
// @include ../jquery.cleanData.js
// @include ../region.js
// @include ../view.js
// @include ../model_view.js
// @include ../collection_view.js
return Minionette;
})(this, _, jQuery, Backbone);
| Make sure Region is included before View | Make sure Region is included before View
View depends on Region
| JavaScript | mit | thejameskyle/minionette,jridgewell/minionette | ---
+++
@@ -7,8 +7,8 @@
// @include ../jquery.cleanData.js
+ // @include ../region.js
// @include ../view.js
- // @include ../region.js
// @include ../model_view.js
// @include ../collection_view.js
|
c710b5a7f3293c280483ae25655b0144076da984 | gulpfile.js | gulpfile.js | var gulp = require('gulp')
var shell = require('./')
var paths = {
js: ['*.js', 'test/*.js']
}
gulp.task('test', shell.task('mocha -R spec -r should'))
gulp.task('coverage', ['test'], shell.task('istanbul cover _mocha -- -R spec'))
gulp.task('coveralls', ['coverage'], shell.task('cat coverage/lcov.info | coveralls'))
gulp.task('lint', shell.task([
'jshint ' + paths.js.join(' '),
'jscs ' + paths.js.join(' '),
]))
gulp.task('default', ['coverage', 'lint'])
gulp.task('watch', function () {
// Keep watch running on errors.
gulp.on('err', function () {})
gulp.watch(paths.js, ['default'])
})
| var gulp = require('gulp')
var shell = require('./')
var paths = {
js: ['*.js', 'test/*.js']
}
gulp.task('test', shell.task('mocha -R spec -r should'))
gulp.task('coverage', ['test'], shell.task('istanbul cover _mocha -- -R spec'))
gulp.task('coveralls', ['coverage'], shell.task('cat coverage/lcov.info | coveralls'))
gulp.task('lint', shell.task([
'jshint ' + paths.js.join(' '),
'jscs ' + paths.js.join(' '),
]))
gulp.task('default', ['coverage', 'lint'])
gulp.task('watch', function () {
gulp.watch(paths.js, ['default'])
})
| Remove dirty hack for keeping watch running on errors | Remove dirty hack for keeping watch running on errors
| JavaScript | mit | realtymaps/gulp-shell,Xerkus/gulp-shell,AcklenAvenue/gulp-shell,alfonso-presa/gulp-shell | ---
+++
@@ -19,8 +19,5 @@
gulp.task('default', ['coverage', 'lint'])
gulp.task('watch', function () {
- // Keep watch running on errors.
- gulp.on('err', function () {})
-
gulp.watch(paths.js, ['default'])
}) |
5ade2739a47f3fb2a3a8ee5bc5c62619f1c78e74 | src/client/etherscan.js | src/client/etherscan.js | /**
* @file Etherscan API client.
* @module client/etherscan
*/
'use strict'
/**
* Etherscan API client.
* @static
*/
class Client {
}
// Expose
module.exports = Client
| /**
* @file Etherscan API client.
* @module client/etherscan
*/
'use strict'
/**
* Private members store.
* @private
*/
const privs = new WeakMap()
/**
* Etherscan API client.
* @static
*/
class Client {
/**
* No parameters.
*/
constructor () {
const priv = {}
privs.set(this, priv)
}
}
// Expose
module.exports = Client
| Add private members store to Etherscan client | Add private members store to Etherscan client
| JavaScript | unlicense | jestcrows/ethtaint,jestcrows/ethtaint | ---
+++
@@ -6,11 +6,23 @@
'use strict'
/**
+ * Private members store.
+ * @private
+ */
+const privs = new WeakMap()
+
+/**
* Etherscan API client.
* @static
*/
class Client {
-
+ /**
+ * No parameters.
+ */
+ constructor () {
+ const priv = {}
+ privs.set(this, priv)
+ }
}
// Expose |
a635b7b9f5b6b49ce079f3ea15e62df089f39452 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var $ = require('gulp-load-plugins')({
camelize: true
});
var config = {
source: {
scripts: {
path: 'app/',
files: './app/**/*.js'
}
},
build: {
scripts: 'build/scrips/'
}
}
gulp.task('build-scripts', function() {
return gulp.src(config.source.scripts.files)
.pipe($.concat('app-build.js'))
.pipe($.uglify({mangle: false }))
.pipe(gulp.dest(config.build.scripts));
});
gulp.task('default', function() {
// place code for your default task here
}); | var gulp = require('gulp');
var $ = require('gulp-load-plugins')({
camelize: true
});
var config = {
source: {
scripts: {
path: 'app/',
files: './app/**/*.js'
},
markup: {
path: 'app/',
files: './app/**/*.html'
}
},
build: {
scripts: 'build/scrips/',
markup: 'build/'
}
}
gulp.task('build-scripts', function() {
return gulp.src(config.source.scripts.files)
.pipe($.concat('app-build.js'))
.pipe($.uglify({mangle: false }))
.pipe(gulp.dest(config.build.scripts));
});
gulp.task('build-markup', function() {
return gulp.src(config.source.markup.files)
.pipe(gulp.dest(config.build.markup));
});
gulp.task('default', function() {
// place code for your default task here
}); | Add gulp task build markup | Add gulp task build markup | JavaScript | mit | letanure/gulp-demo,letanure/gulp-demo | ---
+++
@@ -8,10 +8,15 @@
scripts: {
path: 'app/',
files: './app/**/*.js'
+ },
+ markup: {
+ path: 'app/',
+ files: './app/**/*.html'
}
},
build: {
- scripts: 'build/scrips/'
+ scripts: 'build/scrips/',
+ markup: 'build/'
}
}
@@ -20,7 +25,11 @@
.pipe($.concat('app-build.js'))
.pipe($.uglify({mangle: false }))
.pipe(gulp.dest(config.build.scripts));
+});
+gulp.task('build-markup', function() {
+ return gulp.src(config.source.markup.files)
+ .pipe(gulp.dest(config.build.markup));
});
gulp.task('default', function() { |
3c7218c4e42017c4c602fb4fe86dd5641ff93cde | gulpfile.js | gulpfile.js | var gulp = require('gulp')
var sass = require('gulp-sass')
var browserSync = require('browser-sync').create()
gulp.task('sass', function () {
return gulp.src('./scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css'))
})
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: './'
}
})
})
gulp.task('default', ['sass', 'browser-sync'], function() {
gulp.watch('./sass/**/*.scss', ['sass'])
})
| var gulp = require('gulp')
var sass = require('gulp-sass')
var browserSync = require('browser-sync').create()
gulp.task('sass', function () {
return gulp.src('./scss/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('./css'))
.pipe(browserSync.stream())
})
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: './'
}
})
gulp.watch('./**/*.scss', ['sass'])
gulp.watch('./index.html').on('change', browserSync.reload)
})
gulp.task('default', ['browser-sync'], function() {
gulp.watch('./sass/**/*.scss', ['sass'])
})
| Fix gulfile not watching Sass changes | Fix gulfile not watching Sass changes
| JavaScript | mit | ellsclytn/AirCalc,ellsclytn/AirCalc | ---
+++
@@ -4,8 +4,9 @@
gulp.task('sass', function () {
return gulp.src('./scss/**/*.scss')
- .pipe(sass().on('error', sass.logError))
+ .pipe(sass())
.pipe(gulp.dest('./css'))
+ .pipe(browserSync.stream())
})
gulp.task('browser-sync', function() {
@@ -14,8 +15,11 @@
baseDir: './'
}
})
+
+ gulp.watch('./**/*.scss', ['sass'])
+ gulp.watch('./index.html').on('change', browserSync.reload)
})
-gulp.task('default', ['sass', 'browser-sync'], function() {
+gulp.task('default', ['browser-sync'], function() {
gulp.watch('./sass/**/*.scss', ['sass'])
}) |
9cffc665772326208a446bc203ff127f877aa318 | src/data/mutations/addRanking.js | src/data/mutations/addRanking.js | import StoriesItemType from '../types/StoriesItemType'
import RankingInputItemType from '../types/RankingInputItemType'
import {Story, User, Ranking} from '../models'
const addRanking = {
name: 'addRanking',
type: StoriesItemType,
args: {
story: {type: RankingInputItemType}
},
async resolve (value, {story}) {
let userId = value.request.user.id
let storyId = story.id
let ranking = await Ranking.findOne({where: {userId, storyId}})
if (! ranking){
Ranking.create({userId, storyId})
}
let result = await Story.findById(storyId, {
include: [{
model: User,
as: 'user'
},{
model: Ranking,
as: 'rankings'
}]
})
return result
}
}
export default addRanking
| import StoriesItemType from '../types/StoriesItemType'
import RankingInputItemType from '../types/RankingInputItemType'
import {Story, User, Ranking} from '../models'
const addRanking = {
name: 'addRanking',
type: StoriesItemType,
args: {
story: {type: RankingInputItemType}
},
async resolve (value, {story}) {
let userId = value.request.user.id
let storyId = story.id
let user = await User.findById(userId)
if (user){
let ranking = await Ranking.findOne({where: {userId, storyId}})
if (! ranking){
Ranking.create({userId, storyId})
}
let result = await Story.findById(storyId, {
include: [{
model: User,
as: 'user'
},{
model: Ranking,
as: 'rankings'
}]
})
return result
}else{
throw 'Invalid user!'
}
}
}
export default addRanking
| Add user check to add ranking | Add user check to add ranking
| JavaScript | mit | DominikePessoa/rateissuesfront,DominikePessoa/rateissuesfront,cassioscabral/rateissuesfront,cassioscabral/rateissuesfront | ---
+++
@@ -11,20 +11,25 @@
async resolve (value, {story}) {
let userId = value.request.user.id
let storyId = story.id
- let ranking = await Ranking.findOne({where: {userId, storyId}})
- if (! ranking){
- Ranking.create({userId, storyId})
+ let user = await User.findById(userId)
+ if (user){
+ let ranking = await Ranking.findOne({where: {userId, storyId}})
+ if (! ranking){
+ Ranking.create({userId, storyId})
+ }
+ let result = await Story.findById(storyId, {
+ include: [{
+ model: User,
+ as: 'user'
+ },{
+ model: Ranking,
+ as: 'rankings'
+ }]
+ })
+ return result
+ }else{
+ throw 'Invalid user!'
}
- let result = await Story.findById(storyId, {
- include: [{
- model: User,
- as: 'user'
- },{
- model: Ranking,
- as: 'rankings'
- }]
- })
- return result
}
}
|
4017470f2f16cb62ab89ad2b181e9338188c3fdb | lib/user-credentials.js | lib/user-credentials.js | var md5= require('./md5');
/*
* Hide the password. Uses the password to form authorization strings,
* but provides no interface for exporting it.
*/
function user_credentials(username,password) {
if (username.is_user_credentials &&
typeof username.basic === 'function' &&
typeof username.digest === 'function'
) {
return username;
}
var basic_string= !password && password !== '' ?
new Buffer(username, "ascii").toString("base64")
:
new Buffer(username+':'+password, "ascii").toString("base64")
;
function basic()
{
return basic_string;
}
function digest(realm) {
return !password && password !== '' ?
md5(username+':'+realm)
:
md5(username+':'+realm+':'+password)
}
return {
basic: basic, // basic() returns a hash of username:password
digest: digest, // digest(realm) returns a u & p hash for that realm
username: username,
is_user_credentials: true
}
}
module.exports= user_credentials;
| var md5= require('./md5');
/*
* Hide the password. Uses the password to form authorization strings,
* but provides no interface for exporting it.
*/
function user_credentials(username,password) {
if (username.is_user_credentials &&
typeof username.basic === 'function' &&
typeof username.digest === 'function'
) {
return username;
}
var basic_string= !password && password !== '' ?
new Buffer(username, "ascii").toString("base64")
:
new Buffer(username+':'+password, "ascii").toString("base64")
;
function Credentials()
{
this.username= username;
}
Credentials.prototype.basic= function()
{
return basic_string;
}
Credentials.prototype.digest= function(realm)
{
return !password && password !== '' ?
md5(username+':'+realm)
:
md5(username+':'+realm+':'+password)
}
Credentials.prototype.is_user_credentials= function()
{
return true;
}
return new Credentials;
}
module.exports= user_credentials;
| Refactor user credentials as a prototyped object. | Refactor user credentials as a prototyped object.
| JavaScript | mit | randymized/www-authenticate | ---
+++
@@ -17,22 +17,28 @@
:
new Buffer(username+':'+password, "ascii").toString("base64")
;
- function basic()
+
+ function Credentials()
+ {
+ this.username= username;
+ }
+ Credentials.prototype.basic= function()
{
return basic_string;
}
- function digest(realm) {
+ Credentials.prototype.digest= function(realm)
+ {
return !password && password !== '' ?
md5(username+':'+realm)
:
md5(username+':'+realm+':'+password)
}
- return {
- basic: basic, // basic() returns a hash of username:password
- digest: digest, // digest(realm) returns a u & p hash for that realm
- username: username,
- is_user_credentials: true
+ Credentials.prototype.is_user_credentials= function()
+ {
+ return true;
}
+
+ return new Credentials;
}
module.exports= user_credentials; |
3748b6e2d9d97238a3ee9580a3d62dd60380edb7 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var nodemon = require('nodemon');
var webpack = require('webpack');
var clientConfig = require('./webpack.config');
var path = require('path');
function onBuild(cb) {
return function(err, stats) {
if (err)
console.log('Error', err);
else
console.log(stats.toString());
if (cb) cb();
}
}
// Serverside (backend) tasks group
// Nothing so far!
// Clientside (frontend) tasks
gulp.task('client-watch', function() {
// Changes within 100 ms = one rebuild
webpack(clientConfig).watch(100, onBuild);
});
gulp.task('client-build', function(cb) {
webpack(clientConfig).run(onBuild(cb));
});
// Group tasks
// For development - rebuilds whenever something changes
gulp.task('watch', ['client-watch']);
// For production - builds everything
gulp.task('build', ['client-build']);
// Nodemon is used. Maybe it's better to use gulp's own watch system?
gulp.task('run', ['client-watch'], function() {
nodemon({
execMap: {
js: 'node'
},
script: path.join(__dirname, 'server/main.js'),
ext: 'js json'
}).on('restart', function() {
console.log('Restarted!');
});
});
| var gulp = require('gulp');
var nodemon = require('nodemon');
var webpack = require('webpack');
var clientConfig = require('./webpack.config');
var path = require('path');
var wpCompiler = webpack(clientConfig);
function onBuild(cb) {
return function(err, stats) {
if (err)
console.log('Error', err);
else
console.log(stats.toString());
if (cb) cb();
}
}
// Serverside (backend) tasks group
// Nothing so far!
// Clientside (frontend) tasks
gulp.task('client-watch', function() {
// Changes within 100 ms = one rebuild
wpCompiler.watch({
aggregateTimeout: 100
},
onBuild());
});
gulp.task('client-build', function(cb) {
wpCompiler.run(onBuild(cb));
});
// Group tasks
// For development - rebuilds whenever something changes
gulp.task('watch', ['client-watch']);
// For production - builds everything
gulp.task('build', ['client-build']);
// Nodemon is used. Maybe it's better to use gulp's own watch system?
gulp.task('run', ['client-watch'], function() {
nodemon({
execMap: {
js: 'node'
},
script: path.join(__dirname, 'server/main.js'),
ext: 'js json'
}).on('restart', function() {
console.log('Restarted!');
});
});
| Fix onBuild callback for webpack watch mode, now it properly outputs what it should to the log (screen). Also microrefactor the webpack calling code. | Fix onBuild callback for webpack watch mode, now it properly outputs what it should to the log (screen). Also microrefactor the webpack calling code.
| JavaScript | mit | bragin/ublog,bragin/ublog | ---
+++
@@ -3,6 +3,8 @@
var webpack = require('webpack');
var clientConfig = require('./webpack.config');
var path = require('path');
+
+var wpCompiler = webpack(clientConfig);
function onBuild(cb) {
return function(err, stats) {
@@ -21,11 +23,14 @@
// Clientside (frontend) tasks
gulp.task('client-watch', function() {
// Changes within 100 ms = one rebuild
- webpack(clientConfig).watch(100, onBuild);
+ wpCompiler.watch({
+ aggregateTimeout: 100
+ },
+ onBuild());
});
gulp.task('client-build', function(cb) {
- webpack(clientConfig).run(onBuild(cb));
+ wpCompiler.run(onBuild(cb));
});
// Group tasks |
d2652f66c5cd09730a789373fe1cc0f51d357b7d | gulpfile.js | gulpfile.js | /*
Copyright 2014 Spotify AB
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global require */
var gulp = require('gulp');
var qunit = require('gulp-qunit');
var jshint = require('gulp-jshint');
var htmlhint = require("gulp-htmlhint");
var csslint = require("gulp-csslint");
gulp.task('test', function() {
return gulp.src('./test.html').pipe(qunit());
});
gulp.task('jslint', function() {
return gulp.src('*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('htmllint', function() {
return gulp.src(["*.html", "!test.html"])
.pipe(htmlhint())
.pipe(htmlhint.reporter())
.pipe(htmlhint.failReporter());
});
gulp.task('csslint', function() {
gulp.src('*.css')
.pipe(csslint())
.pipe(csslint.reporter())
.pipe(csslint.failReporter());
});
| /*
Copyright 2014 Spotify AB
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/* global require */
var gulp = require('gulp');
var qunit = require('gulp-qunit');
var jshint = require('gulp-jshint');
var htmlhint = require("gulp-htmlhint");
var csslint = require("gulp-csslint");
gulp.task('test', function() {
return gulp.src('file://test.html').pipe(qunit());
});
gulp.task('jslint', function() {
return gulp.src('*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('htmllint', function() {
return gulp.src(["*.html", "!test.html"])
.pipe(htmlhint())
.pipe(htmlhint.reporter())
.pipe(htmlhint.failReporter());
});
gulp.task('csslint', function() {
gulp.src('*.css')
.pipe(csslint())
.pipe(csslint.reporter())
.pipe(csslint.failReporter());
});
| Fix headless unit test running | Fix headless unit test running
Now "npm install && npm test" works locally again.
| JavaScript | apache-2.0 | spotify/threaddump-analyzer,rprabhat/threaddump-analyzer,rprabhat/threaddump-analyzer,spotify/threaddump-analyzer | ---
+++
@@ -23,7 +23,7 @@
var csslint = require("gulp-csslint");
gulp.task('test', function() {
- return gulp.src('./test.html').pipe(qunit());
+ return gulp.src('file://test.html').pipe(qunit());
});
gulp.task('jslint', function() { |
533cee40b8fa8d6ec9066b13f2b094881dee9b9c | gulpfile.js | gulpfile.js | const fs = require("fs");
const path = require("path");
const { src, dest, task, watch, series } = require('gulp');
const Gitdown = require('@gnd/gitdown');
const rename = require("gulp-rename");
const debug = require("gulp-debug");
const pandoc = require("gulp-pandoc");
task('gitdown', async () => {
if (!fs.existsSync("dist")) {
fs.mkdirSync("dist");
}
const gitdown = Gitdown.readFile(path.join(__dirname, "src", "index.md"));
gitdown.registerHelper("scroll-up", {
compile: (config) => {
return "<sup>[ [^](#user-content-contents) _Back to contents_ ]</sup>";
}
});
await gitdown.writeFile('dist/_merged.md');
});
task('pandoc', () => {
return src("dist/_merged.md")
.pipe(debug({ title: "merged" }))
.pipe(pandoc({
from: "gfm",
to: "gfm",
args: ['--wrap=none'],
ext: "md"
}))
.pipe(debug({ title: "pandoc output:" }))
.pipe(rename("output.md"))
.pipe(dest("dist"));
});
task('build', series("gitdown", "pandoc"));
task('watch', series(["build", () => {
watch('./src', series(['build']));
}]));
task('default', series('build'));
| const fs = require("fs");
const path = require("path");
const { src, dest, task, watch, series } = require('gulp');
const Gitdown = require('@gnd/gitdown');
const rename = require("gulp-rename");
const debug = require("gulp-debug");
const pandoc = require("gulp-pandoc");
task('gitdown', async () => {
if (!fs.existsSync("dist")) {
fs.mkdirSync("dist");
}
const gitdown = Gitdown.readFile(path.join(__dirname, "src", "index.md"));
gitdown.registerHelper("scroll-up", {
compile: (config) => {
if (config.downRef) {
return `<sup>[ [∧](#user-content-contents) _Back to contents_ | _${config.downTitle}_ [∨](${config.downRef}) ]</sup>`;
} else {
return "<sup>[ [∧](#user-content-contents) _Back to contents_ ]</sup>";
}
}
});
await gitdown.writeFile('dist/_merged.md');
});
task('pandoc', () => {
return src("dist/_merged.md")
.pipe(debug({ title: "merged" }))
.pipe(pandoc({
from: "gfm",
to: "gfm",
args: ['--wrap=none'],
ext: "md"
}))
.pipe(debug({ title: "pandoc output:" }))
.pipe(rename("output.md"))
.pipe(dest("dist"));
});
task('build', series("gitdown", "pandoc"));
task('watch', series(["build", () => {
watch('./src', series(['build']));
}]));
task('default', series('build'));
| Make scroll-up thingy support scroll-down thingy | Make scroll-up thingy support scroll-down thingy
| JavaScript | mit | ConsenSys/truffle | ---
+++
@@ -15,7 +15,11 @@
gitdown.registerHelper("scroll-up", {
compile: (config) => {
- return "<sup>[ [^](#user-content-contents) _Back to contents_ ]</sup>";
+ if (config.downRef) {
+ return `<sup>[ [∧](#user-content-contents) _Back to contents_ | _${config.downTitle}_ [∨](${config.downRef}) ]</sup>`;
+ } else {
+ return "<sup>[ [∧](#user-content-contents) _Back to contents_ ]</sup>";
+ }
}
});
|
4fcee02539bddc4c2b0079fa6f4e5707a6f887c6 | gulpfile.js | gulpfile.js | var gulp = require("gulp");
var sass = require("gulp-sass");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
.pipe(gulp.dest('dist'));
});
| var gulp = require("gulp");
var sass = require("gulp-sass");
var rename = require("gulp-rename");
var autoprefixer = require("gulp-autoprefixer");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
.pipe(autoprefixer())
.pipe(gulp.dest('dist'));
gulp.src('src/hipster-grid-system.scss')
.pipe(sass({outputStyle: 'compressed'}))
.pipe(autoprefixer())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest('dist'));
});
| Add support autoprefixer for cross-browser. Add support minify dist file. | Add support autoprefixer for cross-browser.
Add support minify dist file.
| JavaScript | mit | erdoganbulut/hipster-grid-system | ---
+++
@@ -1,8 +1,18 @@
var gulp = require("gulp");
var sass = require("gulp-sass");
+var rename = require("gulp-rename");
+var autoprefixer = require("gulp-autoprefixer");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
+ .pipe(autoprefixer())
+ .pipe(gulp.dest('dist'));
+ gulp.src('src/hipster-grid-system.scss')
+ .pipe(sass({outputStyle: 'compressed'}))
+ .pipe(autoprefixer())
+ .pipe(rename({
+ suffix: ".min"
+ }))
.pipe(gulp.dest('dist'));
}); |
c13fa02042618b63c416983cb749e0ba8f1db8cc | _temp/hud/src/index.js | _temp/hud/src/index.js | 'use strict';
// DEV TIME CODE
if (FAKE_SERVER) {
require('fake');
}
// DEV TIME CODE
require('./index.scss');
var $ = require('$jquery');
var util = require('lib/util');
var state = require('./state');
var repository = require('./repository');
var sections = require('./sections/section');
//var details = args.newData.hud;
var setup = state.current();
// only load things when we have the data ready to go
repository.getData(function(details) {
// generate the html needed for the sections
var html = sections.render(details, setup);
html = '<div class="glimpse"><div class="glimpse-icon"></div><div class="glimpse-hud">' + html + '</div></div>';
// insert the html into the dom
var holder = $(html).appendTo('body')
// force the correct state from previous load
state.setup(holder);
// setup events that we need to listen to
sections.postRender(holder);
// TODO: need to find a better place for this
$('.glimpse-icon').click(function() {
window.open(util.resolveClientUrl(util.currentRequestId(), true), 'GlimpseClient');
});
}); | 'use strict';
// DEV TIME CODE
if (FAKE_SERVER) {
require('fake');
}
// DEV TIME CODE
require('./index.scss');
var $ = require('$jquery');
var util = require('lib/util');
var state = require('./state');
var repository = require('./repository');
var sections = require('./sections/section');
//var details = args.newData.hud;
var setup = state.current();
// only load things when we have the data ready to go
repository.getData(function(details) {
$(function() { setTimeout(function() {
// generate the html needed for the sections
var html = sections.render(details, setup);
html = '<div class="glimpse"><div class="glimpse-icon"></div><div class="glimpse-hud">' + html + '</div></div>';
// insert the html into the dom
var holder = $(html).appendTo('body')
// force the correct state from previous load
state.setup(holder);
// setup events that we need to listen to
sections.postRender(holder);
// TODO: need to find a better place for this
$('.glimpse-icon').click(function() {
window.open(util.resolveClientUrl(util.currentRequestId(), true), 'GlimpseClient');
});
}, 0); });
}); | Fix bug where Navigation Timing info could be accessed to quickly and hence produce weird values | Fix bug where Navigation Timing info could be accessed to quickly and hence produce weird values
| JavaScript | unknown | Glimpse/Glimpse.Client.Prototype,avanderhoorn/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype,avanderhoorn/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype | ---
+++
@@ -19,21 +19,23 @@
// only load things when we have the data ready to go
repository.getData(function(details) {
- // generate the html needed for the sections
- var html = sections.render(details, setup);
- html = '<div class="glimpse"><div class="glimpse-icon"></div><div class="glimpse-hud">' + html + '</div></div>';
-
- // insert the html into the dom
- var holder = $(html).appendTo('body')
-
- // force the correct state from previous load
- state.setup(holder);
-
- // setup events that we need to listen to
- sections.postRender(holder);
-
- // TODO: need to find a better place for this
- $('.glimpse-icon').click(function() {
- window.open(util.resolveClientUrl(util.currentRequestId(), true), 'GlimpseClient');
- });
+ $(function() { setTimeout(function() {
+ // generate the html needed for the sections
+ var html = sections.render(details, setup);
+ html = '<div class="glimpse"><div class="glimpse-icon"></div><div class="glimpse-hud">' + html + '</div></div>';
+
+ // insert the html into the dom
+ var holder = $(html).appendTo('body')
+
+ // force the correct state from previous load
+ state.setup(holder);
+
+ // setup events that we need to listen to
+ sections.postRender(holder);
+
+ // TODO: need to find a better place for this
+ $('.glimpse-icon').click(function() {
+ window.open(util.resolveClientUrl(util.currentRequestId(), true), 'GlimpseClient');
+ });
+ }, 0); });
}); |
767e66816b18085e0ab553eb0368b34fa94e6547 | packages/redis/index.js | packages/redis/index.js | const Redis = require('ioredis');
module.exports = url => {
const redis = new Redis(url);
redis.setJSON = async (...arguments) => {
arguments[1] = JSON.stringify(arguments[1]);
if (typeof arguments[2] === 'object' && arguments[2].asSeconds) {
arguments[2] = parseInt(arguments[2].asSeconds());
}
if (typeof arguments[2] === 'number') {
arguments[3] = parseInt(arguments[2]);
arguments[2] = 'EX';
}
return await redis.set.apply(redis, arguments);
}
redis.getJSON = async key => {
const value = await redis.get(key);
if (value) {
return JSON.parse(value);
}
return value;
}
return redis;
};
| const Redis = require('ioredis');
module.exports = url => {
const redis = new Redis(url);
redis.setJSON = async (...arguments) => {
arguments[1] = JSON.stringify(arguments[1]);
if (typeof arguments[2] === 'object' && arguments[2].asSeconds) {
arguments[2] = parseInt(arguments[2].asSeconds());
}
if (typeof arguments[2] === 'number') {
arguments[3] = parseInt(arguments[2]);
arguments[2] = 'EX';
}
if (typeof arguments[2] === 'undefined') {
arguments = [arguments[0], arguments[1]];
}
return await redis.set.apply(redis, arguments);
}
redis.getJSON = async key => {
const value = await redis.get(key);
if (value) {
return JSON.parse(value);
}
return value;
}
return redis;
};
| Fix redis syntax error if third argument is undefined | Fix redis syntax error if third argument is undefined
| JavaScript | mit | sharaal/dnode,sharaal/dnode | ---
+++
@@ -12,6 +12,9 @@
arguments[3] = parseInt(arguments[2]);
arguments[2] = 'EX';
}
+ if (typeof arguments[2] === 'undefined') {
+ arguments = [arguments[0], arguments[1]];
+ }
return await redis.set.apply(redis, arguments);
}
|
b361f2ca2d51038f00b64fba0cb96d1cf635dd55 | commands/togethertube.js | commands/togethertube.js | const Command = require('../structures/command.js');
const request = require('request');
module.exports = class TogetherTube extends Command {
constructor(client) {
super(client);
this.name = "togethertube";
this.aliases ["ttube", "ttb"];
}
run(message, args, commandLang) {
let embed = this.client.getDekuEmbed(message);
message.channel.startTyping();
request('https://togethertube.com/room/create', (error, response) => {
if (error) {
embed.setColor(this.client.config.colors.error);
embed.setTitle(commandLang.error_title);
embed.setDescription(commandLang.error_description);
} else {
embed.setDescription(response.request.uri.href);
embed.setAuthor('TogetherTube', 'https://togethertube.com/assets/img/favicons/favicon-32x32.png', 'https://togethertube.com/');
message.channel.stopTyping();
message.channel.send({embed});
}
});
}
}
| const Command = require('../structures/command.js');
const request = require('request');
module.exports = class TogetherTube extends Command {
constructor(client) {
super(client);
this.name = "togethertube";
this.aliases = ["ttube", "ttb"];
}
run(message, args, commandLang) {
let embed = this.client.getDekuEmbed(message);
message.channel.startTyping();
request('https://togethertube.com/room/create', (error, response) => {
if (error) {
embed.setColor(this.client.config.colors.error);
embed.setTitle(commandLang.error_title);
embed.setDescription(commandLang.error_description);
} else {
embed.setDescription(response.request.uri.href);
embed.setAuthor('TogetherTube', 'https://togethertube.com/assets/img/favicons/favicon-32x32.png', 'https://togethertube.com/');
}
message.channel.stopTyping();
message.channel.send({embed});
});
}
}
| Fix aliases and error message.g | Fix aliases and error message.g
| JavaScript | mit | pedrofracassi/deku | ---
+++
@@ -5,8 +5,8 @@
constructor(client) {
super(client);
- this.name = "togethertube";
- this.aliases ["ttube", "ttb"];
+ this.name = "togethertube";
+ this.aliases = ["ttube", "ttb"];
}
run(message, args, commandLang) {
@@ -20,9 +20,9 @@
} else {
embed.setDescription(response.request.uri.href);
embed.setAuthor('TogetherTube', 'https://togethertube.com/assets/img/favicons/favicon-32x32.png', 'https://togethertube.com/');
- message.channel.stopTyping();
+ }
+ message.channel.stopTyping();
message.channel.send({embed});
- }
});
}
|
be788cdbacab391543739cf651f2c5562cc04a85 | app/models/taxonomy.js | app/models/taxonomy.js | import DS from 'ember-data';
import OsfModel from 'ember-osf/models/osf-model';
/**
* @module ember-preprints
* @submodule models
*/
/**
* Model for OSF APIv2 preprints. This model may be used with one of several API endpoints. It may be queried directly. In the future, there will be multiple taxonomy endpoints under the same namespace.
* For field and usage information, see:
* https://api.osf.io/v2/docs/#!/v2/Plos_Taxonomy_GET
* @class Taxonomy
*/
export default OsfModel.extend({
type: DS.attr('string'),
text: DS.attr('string'),
// TODO: Api implements this as a list field for now. This should be a relationship field in the future, when API supports it
parentIds: DS.attr(),
});
| import DS from 'ember-data';
import OsfModel from 'ember-osf/models/osf-model';
/**
* @module ember-preprints
* @submodule models
*/
/**
* Model for OSF APIv2 preprints. This model may be used with one of several API endpoints. It may be queried directly. In the future, there will be multiple taxonomy endpoints under the same namespace.
* For field and usage information, see:
* https://api.osf.io/v2/docs/#!/v2/Plos_Taxonomy_GET
* @class Taxonomy
*/
export default OsfModel.extend({
type: DS.attr('string'),
text: DS.attr('string'),
parents: DS.attr(),
});
| Update field name -remove TODO | Update field name
-remove TODO
| JavaScript | apache-2.0 | pattisdr/ember-preprints,baylee-d/ember-preprints,caneruguz/ember-preprints,CenterForOpenScience/ember-preprints,CenterForOpenScience/ember-preprints,laurenrevere/ember-preprints,baylee-d/ember-preprints,pattisdr/ember-preprints,laurenrevere/ember-preprints,caneruguz/ember-preprints,hmoco/ember-preprints,hmoco/ember-preprints | ---
+++
@@ -15,6 +15,5 @@
export default OsfModel.extend({
type: DS.attr('string'),
text: DS.attr('string'),
- // TODO: Api implements this as a list field for now. This should be a relationship field in the future, when API supports it
- parentIds: DS.attr(),
+ parents: DS.attr(),
}); |
0dab4acbf0b8c8c14bce3518cf47fb566a7e839d | static/js/main.js | static/js/main.js | /**
* Created by jonathan on 3/7/15.
*/
var CameraApp = function() {};
CameraApp.prototype = {
framesPerSecond: 1,
setup: function() {
this.image = document.getElementById('CameraImage');
this.imageSource = 'http://104.206.193.11:49709/dcnvr/video/live/image/2?w=320&h=240';
this.loadImage();
},
loadImage: function() {
var calculatedDelay = 1000 / this.framesPerSecond;
var currentTime = new Date().getTime();
if (this.lastLoadTime != undefined){
calculatedDelay = calculatedDelay - (currentTime - this.lastLoadTime);
}
this.lastLoadTime = currentTime;
if (calculatedDelay <= 0) {
this.image.src = this.imageSource + '&random=' + Math.random();
} else {
var cameraApp = this;
this.timer = setTimeout(function() {
cameraApp.image.src = cameraApp.imageSource + '&random=' + Math.random();
}, calculatedDelay);
}
}
};
var cameraApp = null;
$(document).ready(function () {
cameraApp = new CameraApp();
$('#CameraImage').load(function() {
cameraApp.loadImage();
});
cameraApp.setup();
});
| /**
* Created by jonathan on 3/7/15.
*/
var CameraApp = function() {};
CameraApp.prototype = {
framesPerSecond: 1,
timeoutInMinutes: 1,
setup: function() {
this.startTime = new Date().getTime();
this.image = document.getElementById('CameraImage');
this.imageSource = 'http://104.206.193.11:49709/dcnvr/video/live/image/2?w=320&h=240';
this.loadImage();
},
loadImage: function() {
var calculatedDelay = 1000 / this.framesPerSecond;
var currentTime = new Date().getTime();
if (currentTime - this.startTime > this.timeoutInMinutes * 60000)
{
if (!confirm('Live video viewing has timed out. Do you want to continue viewing?'))
{
return;
} else {
this.startTime = new Date().getTime();
}
}
if (this.lastLoadTime != undefined){
calculatedDelay = calculatedDelay - (currentTime - this.lastLoadTime);
}
this.lastLoadTime = currentTime;
if (calculatedDelay <= 0) {
this.image.src = this.imageSource + '&random=' + Math.random();
} else {
var cameraApp = this;
this.timer = setTimeout(function() {
cameraApp.image.src = cameraApp.imageSource + '&random=' + Math.random();
}, calculatedDelay);
}
}
};
var cameraApp = null;
$(document).ready(function () {
cameraApp = new CameraApp();
$('#CameraImage').load(function() {
cameraApp.loadImage();
});
cameraApp.setup();
});
| Add live video feed timeout | Add live video feed timeout
| JavaScript | mit | bytedreamer/LollypopCatToy,bytedreamer/LollypopCatToy,bytedreamer/LollypopCatToy | ---
+++
@@ -6,8 +6,10 @@
CameraApp.prototype = {
framesPerSecond: 1,
+ timeoutInMinutes: 1,
setup: function() {
+ this.startTime = new Date().getTime();
this.image = document.getElementById('CameraImage');
this.imageSource = 'http://104.206.193.11:49709/dcnvr/video/live/image/2?w=320&h=240';
this.loadImage();
@@ -16,6 +18,18 @@
loadImage: function() {
var calculatedDelay = 1000 / this.framesPerSecond;
var currentTime = new Date().getTime();
+
+ if (currentTime - this.startTime > this.timeoutInMinutes * 60000)
+ {
+ if (!confirm('Live video viewing has timed out. Do you want to continue viewing?'))
+ {
+ return;
+ } else {
+ this.startTime = new Date().getTime();
+ }
+ }
+
+
if (this.lastLoadTime != undefined){
calculatedDelay = calculatedDelay - (currentTime - this.lastLoadTime);
} |
0688a80f86e0fcc36d861ccc53e347e5822f119c | packages/diffhtml/lib/tasks/patch-node.js | packages/diffhtml/lib/tasks/patch-node.js | import patchNode from '../node/patch';
import Transaction from '../transaction';
import { CreateNodeHookCache, VTree } from '../util/types';
import globalThis from '../util/global';
/**
* Processes a set of patches onto a tracked DOM Node.
*
* @param {Transaction} transaction
* @return {void}
*/
export default function patch(transaction) {
const { mount, state, patches } = transaction;
const { mutationObserver, measure, scriptsToExecute } = state;
measure('patch node');
const { ownerDocument } = /** @type {HTMLElement} */ (mount);
const promises = transaction.promises || [];
state.ownerDocument = ownerDocument || globalThis.document;
// Always disconnect a MutationObserver before patching.
if (mutationObserver) {
mutationObserver.disconnect();
}
// Hook into the Node creation process to find all script tags, and mark them
// for execution.
const collectScripts = (/** @type {VTree} */vTree) => {
if (vTree.nodeName === 'script') {
scriptsToExecute.set(vTree, vTree.attributes.type);
}
};
CreateNodeHookCache.add(collectScripts);
// Skip patching completely if we aren't in a DOM environment.
if (state.ownerDocument) {
promises.push(...patchNode(patches, state));
}
CreateNodeHookCache.delete(collectScripts);
transaction.promises = promises;
measure('patch node');
}
| import patch from '../node/patch';
import Transaction from '../transaction';
import { CreateNodeHookCache, VTree } from '../util/types';
import globalThis from '../util/global';
/**
* Processes a set of patches onto a tracked DOM Node.
*
* @param {Transaction} transaction
* @return {void}
*/
export default function patchNode(transaction) {
const { mount, state, patches } = transaction;
const { mutationObserver, measure, scriptsToExecute } = state;
measure('patch node');
const { ownerDocument } = /** @type {HTMLElement} */ (mount);
const promises = transaction.promises || [];
state.ownerDocument = ownerDocument || globalThis.document;
// Always disconnect a MutationObserver before patching.
if (mutationObserver) {
mutationObserver.disconnect();
}
// Hook into the Node creation process to find all script tags, and mark them
// for execution.
const collectScripts = (/** @type {VTree} */vTree) => {
if (vTree.nodeName === 'script') {
scriptsToExecute.set(vTree, vTree.attributes.type);
}
};
CreateNodeHookCache.add(collectScripts);
// Skip patching completely if we aren't in a DOM environment.
if (state.ownerDocument) {
promises.push(...patch(patches, state));
}
CreateNodeHookCache.delete(collectScripts);
transaction.promises = promises;
measure('patch node');
}
| Rename public function to match task name | Rename public function to match task name
| JavaScript | mit | tbranyen/diffhtml,tbranyen/diffhtml,tbranyen/diffhtml,tbranyen/diffhtml | ---
+++
@@ -1,4 +1,4 @@
-import patchNode from '../node/patch';
+import patch from '../node/patch';
import Transaction from '../transaction';
import { CreateNodeHookCache, VTree } from '../util/types';
import globalThis from '../util/global';
@@ -9,7 +9,7 @@
* @param {Transaction} transaction
* @return {void}
*/
-export default function patch(transaction) {
+export default function patchNode(transaction) {
const { mount, state, patches } = transaction;
const { mutationObserver, measure, scriptsToExecute } = state;
@@ -37,7 +37,7 @@
// Skip patching completely if we aren't in a DOM environment.
if (state.ownerDocument) {
- promises.push(...patchNode(patches, state));
+ promises.push(...patch(patches, state));
}
CreateNodeHookCache.delete(collectScripts); |
5bf7329fdb2f67aceafc0f0b3e7265f0082d76e1 | lib/util.js | lib/util.js | var url = require("url");
var qs = require("qs");
/**
* getNextLink
* @function
* @param {Object} response A response object returned from calling 'client.makeRequest'
* @returns A parsed version of the link to the subsequent page, or null if no such page exists.
*/
var getNextLink = function (response) {
if (response.headers.link) {
var links = response.headers.link.split(",");
for (var elem in links) {
if (links[elem].includes("rel=\"next\"")) {
var linkRegex = /<(.*)>/;
var link = linkRegex.exec(links[elem])[1];
var parsedUrl = url.parse(link);
return qs.parse(parsedUrl.query);
}
}
}
return null;
};
module.exports.getNextLink = getNextLink; | var url = require("url");
var qs = require("qs");
/**
* getNextLink
* @function
* @param {Object} response A response object returned from calling 'client.makeRequest'
* @returns A parsed version of the link to the subsequent page, or null if no such page exists.
*/
var getNextLink = function (response) {
if (response.headers.link) {
var links = response.headers.link.split(",");
for (var elem in links) {
if (links[elem].indexOf("rel=\"next\"") !== -1) {
var linkRegex = /<(.*)>/;
var link = linkRegex.exec(links[elem])[1];
var parsedUrl = url.parse(link);
return qs.parse(parsedUrl.query);
}
}
}
return null;
};
module.exports.getNextLink = getNextLink; | Switch string.incluldes() to string.indexOf() for compatibility reasons | Switch string.incluldes() to string.indexOf() for compatibility reasons
| JavaScript | mit | bandwidthcom/node-bandwidth,bandwidthcom/node-bandwidth | ---
+++
@@ -11,7 +11,7 @@
if (response.headers.link) {
var links = response.headers.link.split(",");
for (var elem in links) {
- if (links[elem].includes("rel=\"next\"")) {
+ if (links[elem].indexOf("rel=\"next\"") !== -1) {
var linkRegex = /<(.*)>/;
var link = linkRegex.exec(links[elem])[1];
var parsedUrl = url.parse(link); |
a6509c1044bc53b22234ee3f935084989c59ea73 | src/remove-duplicate-elements.js | src/remove-duplicate-elements.js | // Remove duplicate elements from array
function removeDups(arr){
var dupes ={},
returnArray = [],
el;
for(var i =0; i<arr.length; i++){
el = arr[i];
if(!dupes[el]){
returnArray.push(el);
dupes[el] = true;
}
}
return returnArray;
}
removeDups([1,3,3,3,1,5,6,7,8,1]); | // Remove duplicate elements from array
function removeDups(arr){
var dupes ={},
returnArray = [],
el;
for(var i =0; i<arr.length; i++){
el = arr[i];
if(!dupes[el]){
returnArray.push(el);
dupes[el] = true;
}
}
return returnArray;
}
removeDups([10,30,3,30,3,10,5,6,7,8,1,1, 'test', 'test']); | Remove duplicate elements in an array (FIX) | Remove duplicate elements in an array (FIX)
| JavaScript | mit | dedurus/js-algos | ---
+++
@@ -15,4 +15,4 @@
return returnArray;
}
-removeDups([1,3,3,3,1,5,6,7,8,1]);
+removeDups([10,30,3,30,3,10,5,6,7,8,1,1, 'test', 'test']); |
bd13289c96e95952696b392ff232c5e27333750c | tools/analyzeBundle.js | tools/analyzeBundle.js | import webpack from 'webpack';
import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer';
import config from '../webpack.config.prod';
config.plugins.push(new BundleAnalyzerPlugin());
const compiler = webpack(config);
compiler.run((error, stats) => {
if (error) {
throw new Error(error);
}
console.log(stats); // eslint-disable-line no-console
});
| import webpack from 'webpack';
import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer';
import config from '../webpack.config.prod';
config.plugins.push(new BundleAnalyzerPlugin());
process.env.NODE_ENV = 'production';
const compiler = webpack(config);
compiler.run((error, stats) => {
if (error) {
throw new Error(error);
}
console.log(stats); // eslint-disable-line no-console
});
| Set prod env when analyzing bundle | Set prod env when analyzing bundle
| JavaScript | mit | coryhouse/react-slingshot,flibertigibet/react-redux-starter-kit-custom,flibertigibet/react-redux-starter-kit-custom,danpersa/remindmetolive-react,coryhouse/react-slingshot,danpersa/remindmetolive-react,danpersa/remindmetolive-react | ---
+++
@@ -3,6 +3,8 @@
import config from '../webpack.config.prod';
config.plugins.push(new BundleAnalyzerPlugin());
+
+process.env.NODE_ENV = 'production';
const compiler = webpack(config);
|
91363795e88b13f13bd15842039e2cf94e1e357f | assets/scripts/main.js | assets/scripts/main.js | import $ from 'jquery';
import Router from './util/router';
import common from './routes/Common';
import home from './routes/Home';
import about_us from './routes/About';
// Import Bootstrap
import 'bootstrap/dist/js/umd/util.js';
import 'bootstrap/dist/js/umd/alert.js';
import 'bootstrap/dist/js/umd/button.js';
import 'bootstrap/dist/js/umd/carousel.js';
import 'bootstrap/dist/js/umd/collapse.js';
import 'bootstrap/dist/js/umd/dropdown.js';
import 'bootstrap/dist/js/umd/modal.js';
import 'bootstrap/dist/js/umd/scrollspy.js';
import 'bootstrap/dist/js/umd/tab.js';
import 'bootstrap/dist/js/umd/tooltip.js';
import 'bootstrap/dist/js/umd/popover.js';
// Use this variable to set up the common and page specific functions. If you
// rename this variable, you will also need to rename the namespace below.
const routes = {
// All pages
common,
// Home page
home,
// About us page, note the change from about-us to about_us.
about_us
};
// Load Events
$(document).ready(() => new Router(routes).loadEvents());
| import $ from 'jquery';
import Router from './util/router';
import common from './routes/Common';
import home from './routes/Home';
import about_us from './routes/About';
// Import npm dependencies
import 'bootstrap/dist/js/umd/util.js';
import 'bootstrap/dist/js/umd/alert.js';
import 'bootstrap/dist/js/umd/button.js';
import 'bootstrap/dist/js/umd/carousel.js';
import 'bootstrap/dist/js/umd/collapse.js';
import 'bootstrap/dist/js/umd/dropdown.js';
import 'bootstrap/dist/js/umd/modal.js';
import 'bootstrap/dist/js/umd/scrollspy.js';
import 'bootstrap/dist/js/umd/tab.js';
import 'bootstrap/dist/js/umd/tooltip.js';
import 'bootstrap/dist/js/umd/popover.js';
// Use this variable to set up the common and page specific functions. If you
// rename this variable, you will also need to rename the namespace below.
const routes = {
// All pages
common,
// Home page
home,
// About us page, note the change from about-us to about_us.
about_us
};
// Load Events
$(document).ready(() => new Router(routes).loadEvents());
| Update comment for importing deps | Update comment for importing deps | JavaScript | mit | agusgarcia/sage9,JulienMelissas/sage,mckelvey/sage,levito/kleineweile-wp-theme,ChrisLTD/sage,ChrisLTD/sage,skemantix/sage,PCHC/pharmacyresidency2017,generoi/sage,teaguecnelson/tn-tellis-bds,gkmurray/sage,NicBeltramelli/sage,skemantix/sage,ptrckvzn/sage,agusgarcia/sage9,sacredwebsite/sage,sacredwebsite/sage,c50/c50_roots,sacredwebsite/sage,teaguecnelson/tn-tellis-bds,agusgarcia/sage9,skemantix/sage,ptrckvzn/sage,roots/sage,levito/kleineweile-wp-theme,democracy-os-fr/sage,ptrckvzn/sage,NicBeltramelli/sage,kalenjohnson/sage,democracy-os-fr/sage,c50/c50_roots,teaguecnelson/tn-tellis-bds,mckelvey/sage,JulienMelissas/sage,PCHC/pharmacyresidency2017,JulienMelissas/sage,mckelvey/sage,c50/c50_roots,kalenjohnson/sage,levito/kleineweile-wp-theme,PCHC/pharmacyresidency2017,democracy-os-fr/sage,NicBeltramelli/sage,ChrisLTD/sage,generoi/sage,generoi/sage,gkmurray/sage,roots/sage,kalenjohnson/sage,gkmurray/sage,ChrisLTD/sage,gkmurray/sage | ---
+++
@@ -4,7 +4,7 @@
import home from './routes/Home';
import about_us from './routes/About';
-// Import Bootstrap
+// Import npm dependencies
import 'bootstrap/dist/js/umd/util.js';
import 'bootstrap/dist/js/umd/alert.js';
import 'bootstrap/dist/js/umd/button.js'; |
4f0e80b7dc2744c9527cebc5b9c99605f1f92f0a | geocoder.js | geocoder.js | var geocoder = require('node-geocoder') ("google", "https", {
apiKey: '<YOUR-KEY>'
});
var csv = require('csv');
process.stdin
.pipe(csv.parse())
.pipe(csv.transform(function(data, callback){
setImmediate(function(){
geocoder.geocode(data[1])
.then(function(res) {
data.push(res[0].latitude);
data.push(res[0].longitude);
callback(null, data);
})
.catch(function(err) {
console.log(data[0] + " " + err);
});
});}, {parallel: 20}))
.pipe(csv.stringify({quotedString: true}))
.pipe(process.stdout);
| var apiKey = "<YOUR-KEY>";
var geocoder = require('node-geocoder') ("google", "https", { apiKey: apiKey });
var csv = require('csv');
process.stdin
.pipe(csv.parse())
.pipe(csv.transform(function(data, callback){
setImmediate(function(){
geocoder.geocode(data[1])
.then(function(res) {
data.push(res[0].latitude);
data.push(res[0].longitude);
callback(null, data);
})
.catch(function(err) {
console.log(data[0] + " " + err);
});
});}, {parallel: 20}))
.pipe(csv.stringify({quotedString: true}))
.pipe(process.stdout);
| Relocate the key to be able to find it eaven easier | Relocate the key to be able to find it eaven easier
| JavaScript | mit | jpenninkhof/geocoder | ---
+++
@@ -1,6 +1,5 @@
-var geocoder = require('node-geocoder') ("google", "https", {
- apiKey: '<YOUR-KEY>'
-});
+var apiKey = "<YOUR-KEY>";
+var geocoder = require('node-geocoder') ("google", "https", { apiKey: apiKey });
var csv = require('csv');
process.stdin |
33f2a8f4c1dec243db8f33098174ab6bdf201aa9 | gulpfile.js | gulpfile.js | 'use strict';
var gulp = require('gulp');
var files = ['manifest.json', 'background.js'];
var xpiName = 'catgifs.xpi';
gulp.task('default', function () {
console.log(files, xpiName)
});
| 'use strict';
var gulp = require('gulp');
var zip = require('gulp-zip');
var files = ['manifest.json', 'background.js'];
var xpiName = 'catgifs.xpi';
gulp.task('default', function () {
gulp.src(files)
.pipe(zip(xpiName))
.pipe(gulp.dest('.'));
});
| Use gulp to create the xpi. | Use gulp to create the xpi. | JavaScript | mpl-2.0 | bwinton/catgif-extension | ---
+++
@@ -1,10 +1,14 @@
'use strict';
var gulp = require('gulp');
+var zip = require('gulp-zip');
var files = ['manifest.json', 'background.js'];
var xpiName = 'catgifs.xpi';
gulp.task('default', function () {
- console.log(files, xpiName)
+ gulp.src(files)
+ .pipe(zip(xpiName))
+ .pipe(gulp.dest('.'));
});
+ |
46d0b833d4bce66dd7f4a717cab9968bf113551c | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var shell = require('gulp-shell');
var tsc = require('gulp-tsc');
gulp.task('build', function () {
return gulp.src([
'./**/*.ts',
'!./node_modules/**/*.ts'
])
.pipe(tsc({
target: 'ES5',
removeComments: true,
sourceMap: true
}))
.pipe(gulp.dest('.'));
});
gulp.task('run', [ 'build' ], shell.task([
'node main.js'
]));
| var gulp = require('gulp');
var shell = require('gulp-shell');
var tsc = require('gulp-tsc');
gulp.task('build', function () {
return gulp.src([
'./**/*.ts',
'!./node_modules/**/*.ts'
])
.pipe(tsc({
target: 'ES5',
removeComments: true,
sourceMap: true
}))
.pipe(gulp.dest('.'));
});
gulp.task('run', [ 'build' ], shell.task([
'NODE_PATH=$NODE_PATH:./lib node main.js'
]));
| Add lib to NODE_PATH when running the app. | Add lib to NODE_PATH when running the app.
| JavaScript | apache-2.0 | SollmoStudio/beyond.ts,sgkim126/beyond.ts,SollmoStudio/beyond.ts,murmur76/beyond.js,noraesae/beyond.ts,sgkim126/beyond.ts,murmur76/beyond.ts,murmur76/beyond.js,murmur76/beyond.ts,noraesae/beyond.ts | ---
+++
@@ -16,5 +16,5 @@
});
gulp.task('run', [ 'build' ], shell.task([
- 'node main.js'
+ 'NODE_PATH=$NODE_PATH:./lib node main.js'
])); |
e6233ddf0d44b1d1086790e084ba2937e31b7480 | gulpfile.js | gulpfile.js | 'use strict';
var gulp = require('gulp');
var options = {
name: 'ec2prices',
dependantFiles: ['node_modules/babel/browser-polyfill.js'],
mainFiles: [
'app/scripts/app.es6',
'app/scripts/**/!(*.spec|*.mock).{js,es6}'
],
templateFiles: ['app/scripts/**/*.htm{,l}'],
specFiles: ['app/scripts/**/*.{spec,mock}.es6'],
views: {
src: ['app/views/{,*/}*.htm{,l}'],
base: 'app/views/'
},
normalFiles: ['app/instances.json'],
buildDir: 'build',
version: false,
};
require('./gulp/copy.js')(options);
require('./gulp/css.js')(options);
require('./gulp/deploy.js')(options);
require('./gulp/html.js')(options);
require('./gulp/js.js')(options);
require('./gulp/lint.js')(options);
require('./gulp/serve.js')(options);
require('./gulp/tests.js')(options);
gulp.task('default', ['lint', 'js', 'html', 'copy', 'css']);
| 'use strict';
var gulp = require('gulp');
var options = {
name: 'ec2prices',
dependantFiles: ['node_modules/babel/browser-polyfill.js'],
mainFiles: [
'app/scripts/app.es6',
'app/scripts/**/!(*.spec|*.mock).{js,es6}'
],
templateFiles: ['app/scripts/**/*.htm{,l}'],
specFiles: ['app/scripts/**/*.{spec,mock}.es6'],
views: {
src: ['app/views/{,*/}*.htm{,l}'],
base: 'app/views/'
},
normalFiles: ['app/instances.json'],
buildDir: 'build',
version: false,
};
require('./gulp/copy.js')(options);
require('./gulp/css.js')(options);
require('./gulp/deploy.js')(options);
require('./gulp/html.js')(options);
require('./gulp/js.js')(options);
require('./gulp/lint.js')(options);
require('./gulp/serve.js')(options);
require('./gulp/tests.js')(options);
gulp.task('default', ['lint', 'test', 'js', 'html', 'copy', 'css']);
| Add the test task dependency back to the default gulp task | Add the test task dependency back to the default gulp task
| JavaScript | mit | solarnz/ec2pric.es,solarnz/ec2pric.es,solarnz/ec2pric.es | ---
+++
@@ -30,4 +30,4 @@
require('./gulp/serve.js')(options);
require('./gulp/tests.js')(options);
-gulp.task('default', ['lint', 'js', 'html', 'copy', 'css']);
+gulp.task('default', ['lint', 'test', 'js', 'html', 'copy', 'css']); |
4ded0d94d560d9793af9b9d1e2cb17495aa5c111 | optimize/node/engine.js | optimize/node/engine.js | var parse = require('./parse');
var clean = require('./clean');
module.exports = Engine = {};
var pythons = [];
var outputs = [];
var pythonNum = 0;
Engine.runPython = function(operation, a, b, cb) {
if (operation === 'local' || operation === 'global') {
var cleanup = clean.cleanMin(operation, a, b, cb);
a = cleanup.func;
b = cleanup.options;
cb = cleanup.callback;
b = JSON.stringify(b);
} else if (operation === 'nnls') {
cb = clean.cleanCB(cb);
a = JSON.stringify(a);
b = JSON.stringify(b);
}
// immediately invoked function in case user invokes runPython multiple times,
// starting multiple child processes, causing race condition,
// causing stdouts to potentially overlap.
(function (num){
pythons[num] = require('child_process').spawn(
'python',
[__dirname + '/../py/exec.py', operation, a, b]);
outputs[num] = '';
pythons[num].stdout.on('data', function(data){
outputs[num] += data;
});
pythons[num].stdout.on('close', function(){
// cb(outputs[num]);
cb(JSON.parse(outputs[num]));
});
})(pythonNum++)
}
| var parse = require('./parse');
var clean = require('./clean');
module.exports = Engine = {};
var pythons = [];
var outputs = [];
var pythonNum = 0;
Engine.runPython = function(operation, a, b, cb, xData, yData) {
if (operation === 'local' || operation === 'global') {
var cleanup = clean.cleanMin(operation, a, b, cb);
a = cleanup.func;
b = cleanup.options;
cb = cleanup.callback;
b = JSON.stringify(b);
} else if (operation === 'nnls') {
cb = clean.cleanCB(cb);
a = JSON.stringify(a);
b = JSON.stringify(b);
} else if (operation === 'fit') {
var cleanup = clean.cleanFit(a, b, cb, xData, yData);
a = cleanup.func;
b = cleanup.options;
cb = cleanup.callback;
b = JSON.stringify(b);
}
// immediately invoked function in case user invokes runPython multiple times,
// starting multiple child processes, causing race condition,
// causing stdouts to potentially overlap (otherwise).
(function (num){
pythons[num] = require('child_process').spawn(
'python',
[__dirname + '/../py/exec.py', operation, a, b]);
outputs[num] = '';
pythons[num].stdout.on('data', function(data){
outputs[num] += data;
});
pythons[num].stdout.on('close', function(){
// cb(outputs[num]);
cb(JSON.parse(outputs[num]));
});
})(pythonNum++)
}
| Add specification for fit operation | Add specification for fit operation
| JavaScript | mit | acjones617/scipy-node,acjones617/scipy-node | ---
+++
@@ -7,7 +7,7 @@
var outputs = [];
var pythonNum = 0;
-Engine.runPython = function(operation, a, b, cb) {
+Engine.runPython = function(operation, a, b, cb, xData, yData) {
if (operation === 'local' || operation === 'global') {
var cleanup = clean.cleanMin(operation, a, b, cb);
a = cleanup.func;
@@ -18,11 +18,17 @@
cb = clean.cleanCB(cb);
a = JSON.stringify(a);
b = JSON.stringify(b);
+ } else if (operation === 'fit') {
+ var cleanup = clean.cleanFit(a, b, cb, xData, yData);
+ a = cleanup.func;
+ b = cleanup.options;
+ cb = cleanup.callback;
+ b = JSON.stringify(b);
}
// immediately invoked function in case user invokes runPython multiple times,
// starting multiple child processes, causing race condition,
- // causing stdouts to potentially overlap.
+ // causing stdouts to potentially overlap (otherwise).
(function (num){
pythons[num] = require('child_process').spawn(
'python', |
39e7bfe0a481f598d9405081e6a7db0a375ba8ca | imports/api/database-controller/module-fulfilment/moduleFulfilment.js | imports/api/database-controller/module-fulfilment/moduleFulfilment.js | import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
class ModuleFulfilmentCollection extends Mongo.Collection {
insert(fulfilmentData, callBack){
const fulfilmentDoc = fulfilmentData;
let result;
//validate document
return super.insert( fulfilmentDoc, callBack);
};
update(selector, modifier){
const result = super.update(selector, modifier);
return result;
};
remove(selector){
const result = super.remove(selector);
return result;
};
}
export const ModuleFulfilments = new ModuleFulfilmentCollection("modfulfilment");
/*
* moduleMapping type,
* @key academicYear
* @value moduleMapping object
*/
const fulfilmentSchema = {
moduleCode: {
type: String
},
moduleMapping: {
type: object,
blackbox: true
}
}
ModuleFulfilments.attachSchema(fulfilmentSchema);
| import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
class ModuleFulfilmentCollection extends Mongo.Collection {
insert(fulfilmentData, callBack){
const fulfilmentDoc = fulfilmentData;
let result;
//validate document
return super.insert( fulfilmentDoc, callBack);
};
update(selector, modifier){
const result = super.update(selector, modifier);
return result;
};
remove(selector){
const result = super.remove(selector);
return result;
};
}
export const ModuleFulfilments = new ModuleFulfilmentCollection("modfulfilment");
/*
* moduleMapping type,
* @key academicYear
* @value moduleMapping object
*/
const fulfilmentSchema = {
moduleCode: {
type: String
},
moduleMapping: {
type: Object,
blackbox: true
}
}
ModuleFulfilments.attachSchema(fulfilmentSchema);
| FIX wrong db schema declaration | FIX wrong db schema declaration
| JavaScript | mit | nus-mtp/nus-oracle,nus-mtp/nus-oracle | ---
+++
@@ -32,7 +32,7 @@
type: String
},
moduleMapping: {
- type: object,
+ type: Object,
blackbox: true
}
} |
c395a70e473936bb0a4719d0b5d1cc03b8acf218 | Resources/app/config/app.js | Resources/app/config/app.js | var config = {
/** app mode **/
mode: 'DEV',
/** db name **/
db: 'tiapp-exercise',
/** android tablet minimum form factor **/
tablet: {
width: 899,
height: 899
},
/** Actions **/
action: [
{module: 'Try', name: 'doSave', path: 'Como.Controller.Try.doSave'},
{module: 'Try', name: 'showLogin', path: 'Como.Controller.Try.showLogin'},
{module: 'Try', name: 'doLogin', path: 'Como.Controller.Try.doLogin'},
{module: 'Try', name: 'doLogout', path: 'Como.Controller.Try.doLogout'}
]
};
module.exports = config;
| var config = {
/** app mode **/
mode: 'DEV',
/** db name **/
db: 'tiapp-como',
/** android tablet minimum form factor **/
tablet: {
width: 899,
height: 899
},
/** Actions **/
action: [
{module: 'Try', name: 'doSave', path: 'Como.Controller.Try.doSave'},
{module: 'Try', name: 'showLogin', path: 'Como.Controller.Try.showLogin'},
{module: 'Try', name: 'doLogin', path: 'Como.Controller.Try.doLogin'},
{module: 'Try', name: 'doLogout', path: 'Como.Controller.Try.doLogout'}
]
};
module.exports = config;
| Update to change db name on config | Update to change db name on config
| JavaScript | apache-2.0 | geekzy/tiapp-como | ---
+++
@@ -3,7 +3,7 @@
mode: 'DEV',
/** db name **/
- db: 'tiapp-exercise',
+ db: 'tiapp-como',
/** android tablet minimum form factor **/
tablet: { |
912dcf904aac4e8730e3c45b2282d39e1c75170b | test/autoprefixer_test.js | test/autoprefixer_test.js | 'use strict';
var grunt = require('grunt');
/*
======== A Handy Little Nodeunit Reference ========
https://github.com/caolan/nodeunit
Test methods:
test.expect(numAssertions)
test.done()
Test assertions:
test.ok(value, [message])
test.equal(actual, expected, [message])
test.notEqual(actual, expected, [message])
test.deepEqual(actual, expected, [message])
test.notDeepEqual(actual, expected, [message])
test.strictEqual(actual, expected, [message])
test.notStrictEqual(actual, expected, [message])
test.throws(block, [error], [message])
test.doesNotThrow(block, [error], [message])
test.ifError(value)
*/
exports.autoprefixer = {
setUp: function (done) {
// setup here if necessary
done();
},
default_options: function (test) {
test.expect(1);
var actual = grunt.file.read('tmp/default_options.css');
var expected = grunt.file.read('test/expected/default_options.css');
test.strictEqual(actual, expected, 'should describe what the default behavior is.');
test.done();
},
custom_options: function (test) {
test.expect(1);
var actual = grunt.file.read('tmp/custom_options.css');
var expected = grunt.file.read('test/expected/custom_options.css');
test.strictEqual(actual, expected, 'should describe what the custom option(s) behavior is.');
test.done();
},
};
| 'use strict';
var grunt = require('grunt');
/*
======== A Handy Little Nodeunit Reference ========
https://github.com/caolan/nodeunit
Test methods:
test.expect(numAssertions)
test.done()
Test assertions:
test.ok(value, [message])
test.equal(actual, expected, [message])
test.notEqual(actual, expected, [message])
test.deepEqual(actual, expected, [message])
test.notDeepEqual(actual, expected, [message])
test.strictEqual(actual, expected, [message])
test.notStrictEqual(actual, expected, [message])
test.throws(block, [error], [message])
test.doesNotThrow(block, [error], [message])
test.ifError(value)
*/
exports.autoprefixer = {
setUp: function (done) {
// setup here if necessary
done();
},
custom_options: function (test) {
test.expect(1);
var actual = grunt.file.read('tmp/custom_options.css');
var expected = grunt.file.read('test/expected/custom_options.css');
test.strictEqual(actual, expected, 'should describe what the custom option(s) behavior is.');
test.done();
},
};
| Remove test for default options | Remove test for default options
| JavaScript | mit | yuhualingfeng/grunt-autoprefixer,nqdy666/grunt-autoprefixer,nDmitry/grunt-autoprefixer | ---
+++
@@ -27,15 +27,6 @@
// setup here if necessary
done();
},
- default_options: function (test) {
- test.expect(1);
-
- var actual = grunt.file.read('tmp/default_options.css');
- var expected = grunt.file.read('test/expected/default_options.css');
- test.strictEqual(actual, expected, 'should describe what the default behavior is.');
-
- test.done();
- },
custom_options: function (test) {
test.expect(1);
|
af9adbb32651ae83dba7522211e540a20d0fe01b | blueprints/local-config/files/__config__/__name__.local.js | blueprints/local-config/files/__config__/__name__.local.js | /* jshint node: true */
module.exports = function(environment) {
return {};
}; | /* jshint node: true */
/* ==================
* USAGE INSTRUCTIONS
* ==================
*
* If you'd like to make a local change to this file, you need
* to tell git to ignore any changes to this file. You can do
* this by running:
*
* git update-index --skip-worktree [file-path]
*
* If you want to undo the ignore and actually commit changes:
*
* git update-index --no-skip-worktree [file-path]
*
*/
module.exports = function(environment) {
return {};
}; | Add usage instructions to config blueprint | Add usage instructions to config blueprint
| JavaScript | mit | asakusuma/ember-local-config,asakusuma/ember-local-config | ---
+++
@@ -1,4 +1,20 @@
/* jshint node: true */
+
+/* ==================
+ * USAGE INSTRUCTIONS
+ * ==================
+ *
+ * If you'd like to make a local change to this file, you need
+ * to tell git to ignore any changes to this file. You can do
+ * this by running:
+ *
+ * git update-index --skip-worktree [file-path]
+ *
+ * If you want to undo the ignore and actually commit changes:
+ *
+ * git update-index --no-skip-worktree [file-path]
+ *
+ */
module.exports = function(environment) {
return {}; |
04a10e43de71a1f8ff19bf840ffc48dcf9e4e266 | wafer/static/js/scheduledatetime.js | wafer/static/js/scheduledatetime.js | // Basic idea from Bojan Mihelac -
// http://source.mihelac.org/2010/02/19/django-time-widget-custom-time-shortcuts/
// Django imports jQuery into the admin site using noConflict(True)
// We wrap this in an anonymous function to stick to jQuery's $ idiom
// and ensure we're using the admin version of jQuery, rather than
// anything else pulled in
(function($) {
var Schedule = {
init: function() {
time_format = get_format('TIME_INPUT_FORMATS')[0];
$(".timelist").each(function(num) {
// Clear existing list
$( this ).empty();
// Fill list with time values
for (i=8; i < 20; i++) {
var time = new Date(1970,1,1,i,0,0);
quickElement("a", quickElement("li", this, ""),
time.strftime(time_format), "href",
"javascript:DateTimeShortcuts.handleClockQuicklink(" + num +
", " + i + ");");
}
});
}
}
// We need to be called after django's DateTimeShortcuts.init, which
// is triggered by a load event
$( window ).bind('load', Schedule.init);
}(django.jQuery));
| // Override the default setting on the django admin DateTimeShortcut
// Django 2 nicely does make this overridable, but we need to
// set it up before the DateTimeShortcuts init is called by
// window.onload, so we attach it to DOMContentLoaded
//
// The names of the input fields are also a bit opaque, and
// unfornately not something we can easily pass in
document.addEventListener("DOMContentLoaded", function() {
console.log(window.DateTimeShortcuts);
// These are for the single admin pages
window.DateTimeShortcuts.clockHours.end_time_1 = [];
window.DateTimeShortcuts.clockHours.start_time_1 = [];
for (let hour = 8; hour <= 20; hour++) {
let verbose_name = new Date(1970, 1, 1, hour, 0, 0).strftime('%H:%M');
window.DateTimeShortcuts.clockHours.end_time_1.push([verbose_name, hour])
window.DateTimeShortcuts.clockHours.start_time_1.push([verbose_name, hour])
}
// This is for the inline options - we define 30, which is hopefully sane
for (let inline = 0; inline < 30; inline++) {
let name = 'form-' + inline + '-end_time_1';
console.log('computed name: ' + name);
window.DateTimeShortcuts.clockHours[name] = [];
for (let hour = 8; hour <= 20; hour++) {
let verbose_name = new Date(1970, 1, 1, hour, 0, 0).strftime('%H:%M');
window.DateTimeShortcuts.clockHours[name].push([verbose_name, hour])
}
}
});
| Rework the scheduletime helper to work with later admintimewidget helper code | Rework the scheduletime helper to work with later admintimewidget helper code
| JavaScript | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | ---
+++
@@ -1,31 +1,29 @@
-// Basic idea from Bojan Mihelac -
-// http://source.mihelac.org/2010/02/19/django-time-widget-custom-time-shortcuts/
+// Override the default setting on the django admin DateTimeShortcut
+// Django 2 nicely does make this overridable, but we need to
+// set it up before the DateTimeShortcuts init is called by
+// window.onload, so we attach it to DOMContentLoaded
+//
+// The names of the input fields are also a bit opaque, and
+// unfornately not something we can easily pass in
-// Django imports jQuery into the admin site using noConflict(True)
-// We wrap this in an anonymous function to stick to jQuery's $ idiom
-// and ensure we're using the admin version of jQuery, rather than
-// anything else pulled in
-
-(function($) {
- var Schedule = {
- init: function() {
- time_format = get_format('TIME_INPUT_FORMATS')[0];
- $(".timelist").each(function(num) {
- // Clear existing list
- $( this ).empty();
- // Fill list with time values
- for (i=8; i < 20; i++) {
- var time = new Date(1970,1,1,i,0,0);
- quickElement("a", quickElement("li", this, ""),
- time.strftime(time_format), "href",
- "javascript:DateTimeShortcuts.handleClockQuicklink(" + num +
- ", " + i + ");");
- }
- });
+document.addEventListener("DOMContentLoaded", function() {
+ console.log(window.DateTimeShortcuts);
+ // These are for the single admin pages
+ window.DateTimeShortcuts.clockHours.end_time_1 = [];
+ window.DateTimeShortcuts.clockHours.start_time_1 = [];
+ for (let hour = 8; hour <= 20; hour++) {
+ let verbose_name = new Date(1970, 1, 1, hour, 0, 0).strftime('%H:%M');
+ window.DateTimeShortcuts.clockHours.end_time_1.push([verbose_name, hour])
+ window.DateTimeShortcuts.clockHours.start_time_1.push([verbose_name, hour])
+ }
+ // This is for the inline options - we define 30, which is hopefully sane
+ for (let inline = 0; inline < 30; inline++) {
+ let name = 'form-' + inline + '-end_time_1';
+ console.log('computed name: ' + name);
+ window.DateTimeShortcuts.clockHours[name] = [];
+ for (let hour = 8; hour <= 20; hour++) {
+ let verbose_name = new Date(1970, 1, 1, hour, 0, 0).strftime('%H:%M');
+ window.DateTimeShortcuts.clockHours[name].push([verbose_name, hour])
}
}
-
- // We need to be called after django's DateTimeShortcuts.init, which
- // is triggered by a load event
- $( window ).bind('load', Schedule.init);
-}(django.jQuery));
+}); |
7ac6877cc11671359f31439bfd32f4c79253c0ae | tests/generated-assets.js | tests/generated-assets.js | var expect = require('chai').expect,
request = require('superagent').agent(),
PrettyCSS = require('PrettyCSS'),
testhost = require('../src/server').testhost();
describe('fields.css', function() {
var res;
before(function (done) {
request.get(testhost + '/css/fields.css').end(function(r) {
res = r;
done();
});
});
it('has text/css content-type', function() {
expect(res.type).to.equal('text/css');
});
it('is valid CSS', function() {
expect(PrettyCSS.parse(res.text).errors.length).to.equal(0);
});
});
/*describe('svc/bndb_initializer', function() {
var res;
before(function (done) {
request.get(testhost + '/svc/bndb_initializer.js').end(function(r) {
res = r;
done();
});
});
it('has text/javascript content-type', function() {
expect(res.type).to.equal('text/javascript');
});
it('valid JS', function() {
expect(jshint(res.text)).to.equal(true);
});
});*/
| var expect = require('chai').expect,
request = require('superagent').agent(),
PrettyCSS = require('PrettyCSS'),
Q = require('q'),
connect = Q.defer(),
environment = require('./lib/environment').default;
require('../src/server').harness(function (url) {
connect.resolve(url);
});
describe('fields.css', function() {
var res;
before(function (done) {
connect.promise.done(function (testhost) {
request.get(testhost + '/css/fields.css').end(function(r) {
res = r;
done();
});
});
});
it('has text/css content-type', function() {
expect(res.type).to.equal('text/css');
});
it('is valid CSS', function() {
expect(PrettyCSS.parse(res.text).errors.length).to.equal(0);
});
});
/*describe('svc/bndb_initializer', function() {
var res;
before(function (done) {
request.get(testhost + '/svc/bndb_initializer.js').end(function(r) {
res = r;
done();
});
});
it('has text/javascript content-type', function() {
expect(res.type).to.equal('text/javascript');
});
it('valid JS', function() {
expect(jshint(res.text)).to.equal(true);
});
});*/
| Use new harness in generated assets unit test | Use new harness in generated assets unit test
| JavaScript | agpl-3.0 | jcamins/biblionarrator,jcamins/biblionarrator | ---
+++
@@ -1,15 +1,23 @@
var expect = require('chai').expect,
request = require('superagent').agent(),
PrettyCSS = require('PrettyCSS'),
- testhost = require('../src/server').testhost();
+ Q = require('q'),
+ connect = Q.defer(),
+ environment = require('./lib/environment').default;
+
+require('../src/server').harness(function (url) {
+ connect.resolve(url);
+});
describe('fields.css', function() {
var res;
before(function (done) {
- request.get(testhost + '/css/fields.css').end(function(r) {
- res = r;
- done();
+ connect.promise.done(function (testhost) {
+ request.get(testhost + '/css/fields.css').end(function(r) {
+ res = r;
+ done();
+ });
});
});
it('has text/css content-type', function() { |
72db9a234093081be4b48fb9a1af73a5c2c4f5c0 | test/server/process/normalizeArgs.spec.js | test/server/process/normalizeArgs.spec.js | import normalizeArgs, { __RewireAPI__ as rewireAPI } from '../../../src/server/process/normalizeArgs';
describe('normalizeArgs', () => {
afterEach(() => {
rewireAPI.__ResetDependency__('process');
});
it('should normalize for Windows with no COMSPEC', () => {
rewireAPI.__Rewire__('process', {
platform: 'win32',
env: {}
});
const result = normalizeArgs('echo Hello world');
expect(result).toEqual({
file: 'cmd.exe',
args: ['/s', '/c', '"echo Hello world"'],
options: { windowsVerbatimArguments: true }
});
});
it('should normalize for Windows with COMSPEC defined', () => {
rewireAPI.__Rewire__('process', {
platform: 'win32',
env: { comspec: 'command.com' }
});
const result = normalizeArgs('echo Hello again');
expect(result).toEqual({
file: 'command.com',
args: ['/s', '/c', '"echo Hello again"'],
options: { windowsVerbatimArguments: true }
});
});
it('should normalize for Unix-like systems', () => {
rewireAPI.__Rewire__('process', {
platform: 'darwin'
});
const result = normalizeArgs('echo Hello from the other side');
expect(result).toEqual({
file: '/bin/sh',
args: ['-c', 'echo Hello from the other side'],
options: {}
});
});
});
| import normalizeArgs, { __RewireAPI__ as rewireAPI } from '../../../src/server/process/normalizeArgs';
describe('normalizeArgs', () => {
afterEach(() => {
rewireAPI.__ResetDependency__('process');
});
it('should normalize for Windows with no COMSPEC', () => {
rewireAPI.__Rewire__('process', {
platform: 'win32',
env: {}
});
const result = normalizeArgs('echo Hello world');
expect(result).toEqual({
file: 'cmd.exe',
args: ['/s', '/c', 'echo Hello world'],
options: { windowsVerbatimArguments: true }
});
});
it('should normalize for Windows with COMSPEC defined', () => {
rewireAPI.__Rewire__('process', {
platform: 'win32',
env: { comspec: 'command.com' }
});
const result = normalizeArgs('echo Hello again');
expect(result).toEqual({
file: 'command.com',
args: ['/s', '/c', 'echo Hello again'],
options: { windowsVerbatimArguments: true }
});
});
it('should normalize for Unix-like systems', () => {
rewireAPI.__Rewire__('process', {
platform: 'darwin'
});
const result = normalizeArgs('echo Hello from the other side');
expect(result).toEqual({
file: '/bin/sh',
args: ['-c', 'echo Hello from the other side'],
options: {}
});
});
});
| Remove quotes from tests in normalizeArgs | Remove quotes from tests in normalizeArgs
| JavaScript | mit | danistefanovic/hooka | ---
+++
@@ -14,7 +14,7 @@
const result = normalizeArgs('echo Hello world');
expect(result).toEqual({
file: 'cmd.exe',
- args: ['/s', '/c', '"echo Hello world"'],
+ args: ['/s', '/c', 'echo Hello world'],
options: { windowsVerbatimArguments: true }
});
});
@@ -28,7 +28,7 @@
const result = normalizeArgs('echo Hello again');
expect(result).toEqual({
file: 'command.com',
- args: ['/s', '/c', '"echo Hello again"'],
+ args: ['/s', '/c', 'echo Hello again'],
options: { windowsVerbatimArguments: true }
});
}); |
6bba09d9f9946d3498d6b31112074cd07bc6fc86 | generators/app/templates/app/scripts/main.js | generators/app/templates/app/scripts/main.js | import App from './app';
import 'babel-polyfill';
common.app = new App(common);
common.app.start();
| import App from './app';
common.app = new App(common);
common.app.start();
| Remove babel-polyfill import in man.js | Remove babel-polyfill import in man.js
| JavaScript | mit | snphq/generator-sp,i-suhar/generator-sp,snphq/generator-sp,snphq/generator-sp,i-suhar/generator-sp,i-suhar/generator-sp | ---
+++
@@ -1,4 +1,3 @@
import App from './app';
-import 'babel-polyfill';
common.app = new App(common);
common.app.start(); |
7dffff7f5706c4816855a638a33dca5d271915f2 | app/test/token/store-token-generative.spec.js | app/test/token/store-token-generative.spec.js | "use strict";
const apiRequest = require( "../../src/token/api-request" );
const storeToken = require( "../../src/token/store-token" );
const Promise = require( "bluebird" );
const expect = require( "expect.js" );
const sinonSandbox = require( "sinon" ).sandbox.create();
describe.only( "Generative testing", function() {
["SOME", "RANDOM", "STRINGS"].forEach(function( randomString ) {
describe( `Given the token '${randomString}'`, function() {
let fakeToken;
beforeEach(function() {
fakeToken = randomString
});
describe( `When storing the token '${randomString}'`, function() {
let promiseToStoreToken;
let mockedApiRequest;
beforeEach(function() {
mockedApiRequest = sinonSandbox
.mock( apiRequest )
.expects( "post" )
.withExactArgs( "/store-token", fakeToken );
promiseToStoreToken = storeToken( fakeToken, apiRequest );
});
afterEach(function() {
sinonSandbox.restore();
});
it( "persists", function() {
return Promise.try(function() {
return promiseToStoreToken;
}).then(function() {
mockedApiRequest.verify();
});
});
});
});
});
}); | "use strict";
const apiRequest = require( "../../src/token/api-request" );
const storeToken = require( "../../src/token/store-token" );
const Promise = require( "bluebird" );
const expect = require( "expect.js" );
const sinonSandbox = require( "sinon" ).sandbox.create();
describe( "Generative testing", function() {
["SOME", "RANDOM", "STRINGS"].forEach(function( randomString ) {
describe( `Given the token '${randomString}'`, function() {
let fakeToken;
beforeEach(function() {
fakeToken = randomString
});
describe( `When storing the token '${randomString}'`, function() {
let promiseToStoreToken;
let mockedApiRequest;
beforeEach(function() {
mockedApiRequest = sinonSandbox
.mock( apiRequest )
.expects( "post" )
.withExactArgs( "/store-token", fakeToken );
promiseToStoreToken = storeToken( fakeToken, apiRequest );
});
afterEach(function() {
sinonSandbox.restore();
});
it( "persists", function() {
return Promise.try(function() {
return promiseToStoreToken;
}).then(function() {
mockedApiRequest.verify();
});
});
});
});
});
}); | Remove the .only from the generative test | Remove the .only from the generative test
| JavaScript | mit | FagnerMartinsBrack/talk-mocking-and-false-positives,FagnerMartinsBrack/talk-mocking-and-false-positives | ---
+++
@@ -6,7 +6,7 @@
const expect = require( "expect.js" );
const sinonSandbox = require( "sinon" ).sandbox.create();
-describe.only( "Generative testing", function() {
+describe( "Generative testing", function() {
["SOME", "RANDOM", "STRINGS"].forEach(function( randomString ) {
describe( `Given the token '${randomString}'`, function() {
let fakeToken; |
68a4152d6042284aed8db18f5f0403023d7938a0 | app/js/filters/titlecase.js | app/js/filters/titlecase.js | formsAngular.filter('titleCase',[function() {
return function(str, stripSpaces) {
var value = str.replace(/(_|\.)/g, ' ').replace(/[A-Z]/g, ' $&').replace(/\w\S*/g, function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
if (stripSpaces) {
value = value.replace(/\s/g,'');
}
return value;
}
}]); | formsAngular.filter('titleCase',[function() {
return function(str, stripSpaces) {
var value = str.replace(/(_|\.)/g, ' ').replace(/[a-z][A-Z]/g, ' $&').replace(/\w\S*/g, function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
if (stripSpaces) {
value = value.replace(/\s/g,'');
}
return value;
}
}]); | Stop titleCase introducing double spaces | Stop titleCase introducing double spaces
| JavaScript | mit | forms-angular/forms-angular,forms-angular/forms-angular,DerekDomino/forms-angular,DerekDomino/forms-angular,behzad88/forms-angular,forms-angular/forms-angular,b12consulting/forms-angular,b12consulting/forms-angular,DerekDomino/forms-angular,behzad88/forms-angular | ---
+++
@@ -1,6 +1,6 @@
formsAngular.filter('titleCase',[function() {
return function(str, stripSpaces) {
- var value = str.replace(/(_|\.)/g, ' ').replace(/[A-Z]/g, ' $&').replace(/\w\S*/g, function (txt) {
+ var value = str.replace(/(_|\.)/g, ' ').replace(/[a-z][A-Z]/g, ' $&').replace(/\w\S*/g, function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
if (stripSpaces) { |
6a26cf39c0ee32e58c73a1e8b5b62422e802e2e6 | tests/dummy/app/components/button-cell.js | tests/dummy/app/components/button-cell.js | import Em from 'ember';
import LlamaBodyCell from 'llama-table/components/llama-body-cell/component';
import layout from 'dummy/templates/components/button-cell';
var computed = Em.computed;
var gt = computed.gt;
var not = computed.not;
var ButtonCell = LlamaBodyCell.extend({
layout: layout,
showButton: not('isFooter'),
actions: {
click: function () {
var controller = this.get('root');
var rows = controller.get('rows');
var row = this.get('content');
var index = rows.indexOf(row);
controller.sendAction(this.get('actionName'), index);
},
},
});
export default ButtonCell;
| import Em from 'ember';
import LlamaBodyCell from 'llama-table/components/llama-body-cell/component';
import layout from 'dummy/templates/components/button-cell';
var computed = Em.computed;
var gt = computed.gt;
var not = computed.not;
var ButtonCell = LlamaBodyCell.extend({
layout: layout,
showButton: not('isFooter'),
actions: {
click: function () {
var controller = this.get('root');
var rows = controller.get('rows');
var rowController = this.get('content');
var row = Em.get(rowController, 'content');
var index = rows.indexOf(row);
controller.sendAction(this.get('actionName'), index);
},
},
});
export default ButtonCell;
| Fix remove button in demo table | Fix remove button in demo table
| JavaScript | mit | luxbet/ember-cli-llama-table,j-/ember-cli-llama-table,luxbet/ember-cli-llama-table,j-/ember-cli-llama-table | ---
+++
@@ -12,7 +12,8 @@
click: function () {
var controller = this.get('root');
var rows = controller.get('rows');
- var row = this.get('content');
+ var rowController = this.get('content');
+ var row = Em.get(rowController, 'content');
var index = rows.indexOf(row);
controller.sendAction(this.get('actionName'), index);
}, |
4c6048b04acc62d35502739d4bf1938fd92f7240 | Gruntfile.js | Gruntfile.js | module.exports = function (grunt) {
grunt.initConfig({
nodewebkit: {
options: {
platforms: ['win', 'osx'],
buildDir: './build',
version: '0.12.1'
},
src: [
'index.html',
'package.json',
'./components/**/*',
'./css/**/*',
'./images/**/*',
'./js/**/*',
'./node_module/**/*'
]
}
});
grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.registerTask('build', ['nodewebkit']);
}; | module.exports = function (grunt) {
grunt.initConfig({
nodewebkit: {
options: {
platforms: ['win', 'osx', 'linux'],
buildDir: './build',
version: '0.12.1'
},
src: [
'index.html',
'package.json',
'./components/**/*',
'./css/**/*',
'./images/**/*',
'./js/**/*',
'./node_module/**/*'
]
}
});
grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.registerTask('build', ['nodewebkit']);
}; | Add linux in build options | Add linux in build options
| JavaScript | mit | tnilles/basalt,tnilles/basalt | ---
+++
@@ -3,7 +3,7 @@
grunt.initConfig({
nodewebkit: {
options: {
- platforms: ['win', 'osx'],
+ platforms: ['win', 'osx', 'linux'],
buildDir: './build',
version: '0.12.1'
}, |
31da6e2c375d4eec9b4056b05939ebe496915a67 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['Gruntfile.js', 'lib/**/*.js'],
options: {
globalstrict: true,
node: true,
globals: {
jQuery: true,
console: false,
module: true,
document: true
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/**/*.js'],
env: {
NODE_ENV: "test"
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('test-env', function() {process.env.NODE_ENV = "test";});
grunt.registerTask('test', ['test-env', 'jshint', 'mochaTest' ]);
grunt.registerTask('default', ['test']);
};
| 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
globalstrict: true,
node: true,
globals: {
jQuery: true,
console: false,
module: true,
document: true
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/**/*.js'],
env: {
NODE_ENV: "test"
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('test-env', function() {process.env.NODE_ENV = "test";});
grunt.registerTask('test', ['test-env', 'jshint', 'mochaTest' ]);
grunt.registerTask('default', ['test']);
};
| Remove `file` field from jshint configuration. | Remove `file` field from jshint configuration.
Tests were failing with message
"Warning: Path must be a string. Received null"
Closes imdone/imdone-core#48
| JavaScript | mit | imdone/imdone-core,imdone/imdone-core | ---
+++
@@ -5,7 +5,6 @@
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
- files: ['Gruntfile.js', 'lib/**/*.js'],
options: {
globalstrict: true,
node: true, |
18590218bc4096b10bb5aade82e5c83af41768ea | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc',
}
},
mochacli: {
all: ['test/**/*.js'],
options: {
reporter: 'spec',
ui: 'tdd'
}
},
'mocha_istanbul': {
coveralls: {
src: [ 'test/lib', 'test/lib/utils' ],
options: {
coverage: true,
legend: true,
check: {
lines: 100,
statements: 99
},
root: './lib',
reportFormats: ['lcov']
}
}
}
})
grunt.event.on('coverage', function(lcov, done){
require('coveralls').handleInput(lcov, function(error) {
if (error) {
console.log(error)
return done(error)
}
done()
})
})
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-mocha-cli')
grunt.loadNpmTasks('grunt-mocha-istanbul')
// Configure tasks
grunt.registerTask('coveralls', ['mocha_istanbul:coveralls'])
grunt.registerTask('default', ['test'])
grunt.registerTask('test', ['mochacli', 'jshint', 'coveralls'])
}
| 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc',
}
},
mochacli: {
all: ['test/**/*.js'],
options: {
reporter: 'spec',
ui: 'tdd'
}
},
'mocha_istanbul': {
coveralls: {
src: [ 'test/lib', 'test/lib/utils' ],
options: {
coverage: true,
legend: true,
check: {
lines: 100,
statements: 100
},
root: './lib',
reportFormats: ['lcov']
}
}
}
})
grunt.event.on('coverage', function(lcov, done){
require('coveralls').handleInput(lcov, function(error) {
if (error) {
console.log(error)
return done(error)
}
done()
})
})
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-mocha-cli')
grunt.loadNpmTasks('grunt-mocha-istanbul')
// Configure tasks
grunt.registerTask('coveralls', ['mocha_istanbul:coveralls'])
grunt.registerTask('default', ['test'])
grunt.registerTask('test', ['mochacli', 'jshint', 'coveralls'])
}
| Update coverage values to match current | Update coverage values to match current
| JavaScript | apache-2.0 | xmpp-ftw/xmpp-ftw-wtf | ---
+++
@@ -25,7 +25,7 @@
legend: true,
check: {
lines: 100,
- statements: 99
+ statements: 100
},
root: './lib',
reportFormats: ['lcov'] |
d54be665eda70dbb074de72704eb64311e5d8c84 | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
// TODO: platforms shouldn't be hardcoded here
var platforms = ['win64'];
// Build up array of destinations for Twister deamon files
var destinations = {files: []};
platforms.forEach(function (platform) {
destinations.files.push({
expand: true,
src: ['./twister-data/**'],
dest: './builds/Twisting/' + platform + '/'
});
});
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
nodewebkit: {
options: {
platforms: platforms,
buildDir: './builds'
},
src: './src/**/*'
},
copy: {
twister: destinations
},
less: {
development: {
files: {
"./src/app/styles/style.css": "./src/app/styles/main.less"
}
}
},
auto_install: {
subdir: {
options: {
cwd: 'src',
stdout: true,
stderr: true,
failOnError: true,
}
}
},
});
grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-auto-install');
grunt.registerTask('build', ['less', 'nodewebkit', 'copy:twister']);
grunt.registerTask('compile', ['less']);
grunt.registerTask('postinstall', ['auto_install']);
};
| module.exports = function(grunt) {
// TODO: platforms shouldn't be hardcoded here
var platforms = ['win64'];
// Build up array of destinations for Twister deamon files
var destinations = {files: []};
platforms.forEach(function (platform) {
destinations.files.push({
expand: true,
src: ['./twister-data/**'],
dest: './builds/Twisting/' + platform + '/'
});
});
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
nodewebkit: {
options: {
platforms: platforms,
buildDir: './builds'
},
src: ['./src/**/*', '!./src/twister-data/**/*', '!./src/*.exe', '!./src/*.pak', '!./src/*.dll']
},
copy: {
twister: destinations
},
less: {
development: {
files: {
"./src/app/styles/style.css": "./src/app/styles/main.less"
}
}
},
auto_install: {
subdir: {
options: {
cwd: 'src',
stdout: true,
stderr: true,
failOnError: true,
}
}
},
});
grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-auto-install');
grunt.registerTask('build', ['less', 'nodewebkit', 'copy:twister']);
grunt.registerTask('compile', ['less']);
grunt.registerTask('postinstall', ['auto_install']);
};
| Fix Grunt file for local testing | Fix Grunt file for local testing
| JavaScript | mit | ArcoMul/Twisting,ArcoMul/Twisting | ---
+++
@@ -21,7 +21,7 @@
platforms: platforms,
buildDir: './builds'
},
- src: './src/**/*'
+ src: ['./src/**/*', '!./src/twister-data/**/*', '!./src/*.exe', '!./src/*.pak', '!./src/*.dll']
},
copy: {
twister: destinations |
f321bea271fd94c665c1e524a743e2b88ed21134 | src/components/Rectangle.js | src/components/Rectangle.js | import React from 'react';
import styles from 'stylesheets/components/common/typography';
const Rectangle = () => (
<div>
<h1 className={styles.heading}>Rechteck</h1>
<div>
<h2>Eingabe</h2>
<form>
<div>
<label id="rechteck_a">a:
<input type="text" />
</label>
</div>
<div>
<label id="rechteck_b">b:
<input type="text" />
</label>
</div>
</form>
<h2>Flächeninhalt</h2>
<span>0</span>
</div>
</div>
);
export default Rectangle;
| import React from 'react';
import styles from 'stylesheets/components/common/typography';
class Rectangle extends React.Component {
constructor(props) {
super(props);
this.state = {
edgeA: 0,
edgeB: 0,
area: 0
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
const name = event.target.name;
const value = event.target.value;
const area =
name === 'edgeA' ?
this.computeArea(value, this.state.edgeB):
this.computeArea(this.state.edgeA, value);
this.setState({
[event.target.name]: value,
area: area
});
}
computeArea(edgeA, edgeB) {
return edgeA * edgeB;
}
render() {
return (
<div>
<h1 className={styles.heading}>Rechteck</h1>
<div>
<h2>Eingabe</h2>
<form>
<div>
<label>Seite a:
<input
type="text"
name="edgeA"
value={this.state.edgeA}
onChange={this.handleChange}
/>
</label>
</div>
<div>
<label>Seite b:
<input
type="text"
name="edgeB"
value={this.state.edgeB}
onChange={this.handleChange}
/>
</label>
</div>
</form>
<h2>Flächeninhalt</h2>
<span>{this.state.area}</span>
</div>
</div>
);
}
}
export default Rectangle;
| Implement computation of rectangle's area | Implement computation of rectangle's area
| JavaScript | mit | laschuet/geometrie_in_react,laschuet/geometrie_in_react | ---
+++
@@ -2,27 +2,69 @@
import styles from 'stylesheets/components/common/typography';
-const Rectangle = () => (
- <div>
- <h1 className={styles.heading}>Rechteck</h1>
- <div>
- <h2>Eingabe</h2>
- <form>
+class Rectangle extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ edgeA: 0,
+ edgeB: 0,
+ area: 0
+ };
+ this.handleChange = this.handleChange.bind(this);
+ }
+
+ handleChange(event) {
+ const name = event.target.name;
+ const value = event.target.value;
+ const area =
+ name === 'edgeA' ?
+ this.computeArea(value, this.state.edgeB):
+ this.computeArea(this.state.edgeA, value);
+
+ this.setState({
+ [event.target.name]: value,
+ area: area
+ });
+ }
+
+ computeArea(edgeA, edgeB) {
+ return edgeA * edgeB;
+ }
+
+ render() {
+ return (
+ <div>
+ <h1 className={styles.heading}>Rechteck</h1>
<div>
- <label id="rechteck_a">a:
- <input type="text" />
- </label>
+ <h2>Eingabe</h2>
+ <form>
+ <div>
+ <label>Seite a:
+ <input
+ type="text"
+ name="edgeA"
+ value={this.state.edgeA}
+ onChange={this.handleChange}
+ />
+ </label>
+ </div>
+ <div>
+ <label>Seite b:
+ <input
+ type="text"
+ name="edgeB"
+ value={this.state.edgeB}
+ onChange={this.handleChange}
+ />
+ </label>
+ </div>
+ </form>
+ <h2>Flächeninhalt</h2>
+ <span>{this.state.area}</span>
</div>
- <div>
- <label id="rechteck_b">b:
- <input type="text" />
- </label>
- </div>
- </form>
- <h2>Flächeninhalt</h2>
- <span>0</span>
- </div>
- </div>
-);
+ </div>
+ );
+ }
+}
export default Rectangle; |
272693c4b3f83542e72cac826171b712903dd0a7 | src/components/ImageCardComponent.js | src/components/ImageCardComponent.js | import React from 'react';
class ImageCardComponent extends React.Component {
static propTypes = {
uri: React.PropTypes.string.isRequired,
uploadedAt: React.PropTypes.string.isRequired
};
render() {
return (
<div className='ImageCardComponent'>
<div className='card'>
<a href={this.props.uri}>
<img className='card-image-top img-responsive' src={this.props.uri}/>
</a>
<div className='card-block hidden-xs-down'>
<a href={this.props.uri} style={{ wordBreak: 'break-all', wordWrap: 'break-word' }}>{this.props.uri}</a>
</div>
<footer className='card-footer text-muted text-right'>
<span className='uploaded-at'>
<time dateTime={this.props.uploadedAt}>{this.props.ploadedAt}</time>
</span>
</footer>
</div>
</div>
);
}
}
export default ImageCardComponent;
| import React from 'react';
class ImageCardComponent extends React.Component {
static propTypes = {
uri: React.PropTypes.string.isRequired,
uploadedAt: React.PropTypes.string.isRequired
};
render() {
return (
<div className='ImageCardComponent'>
<div className='card'>
<a href={this.props.uri}>
<img className='card-image-top img-responsive' src={this.props.uri}/>
</a>
<div className='card-block hidden-xs-down'>
<a href={this.props.uri} style={{ wordBreak: 'break-all', wordWrap: 'break-word' }}>{this.props.uri}</a>
</div>
<footer className='card-footer text-muted text-right'>
<span className='uploaded-at'>
<time dateTime={this.props.uploadedAt}>{this.props.uploadedAt}</time>
</span>
</footer>
</div>
</div>
);
}
}
export default ImageCardComponent;
| Fix typo 'ploadedAt' => 'uploadedAt' | Fix typo 'ploadedAt' => 'uploadedAt' | JavaScript | mit | ykzts/gyazo-web-client | ---
+++
@@ -18,7 +18,7 @@
</div>
<footer className='card-footer text-muted text-right'>
<span className='uploaded-at'>
- <time dateTime={this.props.uploadedAt}>{this.props.ploadedAt}</time>
+ <time dateTime={this.props.uploadedAt}>{this.props.uploadedAt}</time>
</span>
</footer>
</div> |
e714a374e85fbf90dffcdf4c9991cdb0ce1e35c2 | lib/deps.js | lib/deps.js | var canihaz = require('canihaz'),
fs = require('fs'),
p = require('path');
/**
* Install dependency modules that are not yet installed, and needed for executing the tasks.
*
* @param {Array} depNames: an array of dependency module names
* @param {String} dir: application directory where node_modules dir is located
* @param {Function} cb: standard cb(err, result) callback
*/
function install(depNames, dir, cb) {
fs.readdir(p.join(dir, 'node_modules'), function(err, installed) {
var uninstalled = [];
depNames.forEach(function (depName) {
if (installed.indexOf(depName) === -1) {
uninstalled.push(depName);
}
});
if (uninstalled.length > 0) {
console.log('[deps] Installing modules: %s (might take a while, once-off only)', uninstalled .join(', '));
canihaz({ key: 'optDependencies' }).apply(this, depNames.concat(cb));
} else {
cb();
}
});
}
exports.install = install; | var canihaz = require('canihaz'),
fs = require('fs'),
p = require('path');
const GLOBALS = ['npm'];
/**
* Install dependency modules that are not yet installed, and needed for executing the tasks.
* Global modules (like npm) are assumed to already exist.
*
* @param {Array} depNames: an array of dependency module names
* @param {String} dir: application directory where node_modules dir is located
* @param {Function} cb: standard cb(err, result) callback
*/
function install(depNames, dir, cb) {
fs.readdir(p.join(dir, 'node_modules'), function(err, installed) {
var uninstalled = [];
depNames.forEach(function (depName) {
if (installed.indexOf(depName) === -1 && GLOBALS.indexOf(depName) === -1) {
uninstalled.push(depName);
}
});
if (uninstalled.length > 0) {
console.log('[deps] Installing modules: %s (might take a while, once-off only)', uninstalled .join(', '));
canihaz({ key: 'optDependencies' }).apply(this, depNames.concat(cb));
} else {
cb();
}
});
}
exports.install = install; | Add global modules list, to be excluded from lazy installation. | Add global modules list, to be excluded from lazy installation.
| JavaScript | mit | cliffano/bob | ---
+++
@@ -2,8 +2,11 @@
fs = require('fs'),
p = require('path');
+const GLOBALS = ['npm'];
+
/**
* Install dependency modules that are not yet installed, and needed for executing the tasks.
+ * Global modules (like npm) are assumed to already exist.
*
* @param {Array} depNames: an array of dependency module names
* @param {String} dir: application directory where node_modules dir is located
@@ -13,7 +16,7 @@
fs.readdir(p.join(dir, 'node_modules'), function(err, installed) {
var uninstalled = [];
depNames.forEach(function (depName) {
- if (installed.indexOf(depName) === -1) {
+ if (installed.indexOf(depName) === -1 && GLOBALS.indexOf(depName) === -1) {
uninstalled.push(depName);
}
}); |
787aba818986daf0a17342b8d86918c8925541e8 | js/links.js | js/links.js | function setupLinkHandling() {
window.history.pushState({"html": document.documentElement.outerHTML}, "", window.location.href);
var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; i++) {
if (anchors[i].href.startsWith("http://localhost") || anchors[i].href.startsWith("https://atomhacks.github.io")) {
anchors[i].onclick = function() {
var href = this.href;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
window.history.pushState({"html": this.responseText}, "", href);
document.getElementsByTagName("html")[0].innerHTML = this.responseText;
setupLinkHandling();
setupNavigation();
generateShapes();
}
};
xhttp.open("GET", href, true);
xhttp.send();
return false;
};
}
}
window.onpopstate = function(e) {
if (e.state) {
document.getElementsByTagName("html")[0].innerHTML = e.state.html;
}
};
}
setupLinkHandling();
| function setupLinkHandling() {
window.history.pushState({"html": document.documentElement.outerHTML}, "", window.location.href);
var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; i++) {
if (["localhost", "atomhacks.github.io", "bxhackers.club"].includes(window.location.hostname)) {
anchors[i].onclick = function() {
var href = this.href;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
window.history.pushState({"html": this.responseText}, "", href);
document.getElementsByTagName("html")[0].innerHTML = this.responseText;
setupLinkHandling();
setupNavigation();
generateShapes();
}
};
xhttp.open("GET", href, true);
xhttp.send();
return false;
};
}
}
window.onpopstate = function(e) {
if (e.state) {
document.getElementsByTagName("html")[0].innerHTML = e.state.html;
}
};
}
setupLinkHandling();
| Fix custom page loading with new domain | Fix custom page loading with new domain
| JavaScript | mit | atomhacks/club,atomhacks/club,atomhacks/club | ---
+++
@@ -4,7 +4,7 @@
var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; i++) {
- if (anchors[i].href.startsWith("http://localhost") || anchors[i].href.startsWith("https://atomhacks.github.io")) {
+ if (["localhost", "atomhacks.github.io", "bxhackers.club"].includes(window.location.hostname)) {
anchors[i].onclick = function() {
var href = this.href;
var xhttp = new XMLHttpRequest(); |
f27b29bc8075903889eb854f6641a4704add59cf | AppMetadata.js | AppMetadata.js | 'use strict';
/**
Application-wide metadata is stored here for reuse
*/
module.exports = {
FRONTEND_VERSION: 31
};
| 'use strict';
/**
Application-wide metadata is stored here for reuse
*/
module.exports = {
FRONTEND_VERSION: 32
};
| Increment version to force refresh | Increment version to force refresh
| JavaScript | mit | nicktindall/cyclon.p2p-webrtc-demo,nicktindall/cyclon.p2p-webrtc-demo | ---
+++
@@ -4,5 +4,5 @@
Application-wide metadata is stored here for reuse
*/
module.exports = {
- FRONTEND_VERSION: 31
+ FRONTEND_VERSION: 32
}; |
14d3e65b2130937df97b0f1c3837a97bea28b5e9 | src/game/vue-game-plugin.js | src/game/vue-game-plugin.js | import GameStateManager from "./GameStates/GameStateManager";
import CommandParser from "./Commands/CommandParser";
import GenerateName from "./Generators/NameGenerator";
export default {
install: (Vue) => {
Vue.prototype.$game = {
startGame() {
return GameStateManager.StartGame();
},
generateName() {
return GenerateName();
},
parseCommand(command) {
return CommandParser.ParseCommand(command);
}
}
}
}
| import GameStateManager from "./GameStates/GameStateManager";
// import CommandParser from "./Commands/CommandParser";
import GenerateName from "./Generators/NameGenerator";
export default {
install: (Vue) => {
Vue.prototype.$game = {
startGame() {
return GameStateManager.StartGame();
},
generateName() {
return GenerateName();
},
parseCommand(command) {
// return CommandParser.ParseCommand(command);
console.log("Parsing " + command);
}
}
}
}
| Stop using command parser file | Stop using command parser file
| JavaScript | mit | Trymunx/Dragon-Slayer,Trymunx/Dragon-Slayer | ---
+++
@@ -1,5 +1,5 @@
import GameStateManager from "./GameStates/GameStateManager";
-import CommandParser from "./Commands/CommandParser";
+// import CommandParser from "./Commands/CommandParser";
import GenerateName from "./Generators/NameGenerator";
export default {
@@ -12,7 +12,8 @@
return GenerateName();
},
parseCommand(command) {
- return CommandParser.ParseCommand(command);
+ // return CommandParser.ParseCommand(command);
+ console.log("Parsing " + command);
}
}
} |
2ba4862ed41b50cf8a2dc7eb67abf0fc7b7426cf | assets/code-blocks.js | assets/code-blocks.js | var fs = require('fs')
var path = require('path')
var codeBlocks = document.querySelectorAll('code[data-path]')
Array.prototype.forEach.call(codeBlocks, function (code) {
code.textContent = fs.readFileSync(path.join(__dirname, code.dataset.path))
})
| var fs = require('fs')
var path = require('path')
var codeBlocks = document.querySelectorAll('code[data-path]')
Array.prototype.forEach.call(codeBlocks, function (code) {
var codePath = code.dataset.path
code.textContent = fs.readFileSync(path.join(__dirname, '..', codePath))
})
| Use new path based on changed __dirname | Use new path based on changed __dirname
| JavaScript | mit | electron/electron-api-demos,electron/electron-api-demos,blep/electron-api-demos,blep/electron-api-demos,electron/electron-api-demos,PanCheng111/XDF_Personal_Analysis,blep/electron-api-demos,blep/electron-api-demos,PanCheng111/XDF_Personal_Analysis,PanCheng111/XDF_Personal_Analysis | ---
+++
@@ -3,5 +3,6 @@
var codeBlocks = document.querySelectorAll('code[data-path]')
Array.prototype.forEach.call(codeBlocks, function (code) {
- code.textContent = fs.readFileSync(path.join(__dirname, code.dataset.path))
+ var codePath = code.dataset.path
+ code.textContent = fs.readFileSync(path.join(__dirname, '..', codePath))
}) |
e8a791cb546031733f1e74c2831e28fd0685cec1 | webpack.common.js | webpack.common.js | const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: {
login: './public/src/js/login.js',
register: './public/src/js/register.js',
'admin-search': './public/src/js/admin-search.js',
'admin-users': './public/src/js/admin-users.js',
'admin-user': './public/src/js/admin-user.js',
'manage-admin': './public/src/js/manage-admin.js',
'manage-device': './public/src/js/manage-device.js',
manage: './public/src/js/manage.js',
captcha: './public/src/js/captcha.js'
},
plugins: [
new CleanWebpackPlugin(['public/dist/js'])
],
output: {
filename: '[name].min.js',
path: path.resolve(__dirname, 'public/dist/js')
},
resolve: {
modules: [
path.resolve(__dirname, "public/src/modules"),
"node_modules"
]
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}
]
}
};
| const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: {
login: './public/src/js/login.js',
register: './public/src/js/register.js',
'admin-search': './public/src/js/admin-search.js',
'admin-users': './public/src/js/admin-users.js',
'admin-user': './public/src/js/admin-user.js',
'manage-admin': './public/src/js/manage-admin.js',
'manage-device': './public/src/js/manage-device.js',
manage: './public/src/js/manage.js',
captcha: './public/src/js/captcha.js'
},
plugins: [
new CleanWebpackPlugin(['public/dist/js'])
],
output: {
filename: '[name].min.js',
path: path.resolve(__dirname, 'public/dist/js')
},
resolve: {
modules: [
path.resolve(__dirname, 'public/src/modules'),
'node_modules'
]
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}
]
}
};
| Use single quotes in webpack config | Use single quotes in webpack config
| JavaScript | bsd-3-clause | usi-lfkeitel/packet-guardian,packet-guardian/packet-guardian,packet-guardian/packet-guardian,usi-lfkeitel/packet-guardian,packet-guardian/packet-guardian,usi-lfkeitel/packet-guardian,packet-guardian/packet-guardian,packet-guardian/packet-guardian | ---
+++
@@ -25,8 +25,8 @@
resolve: {
modules: [
- path.resolve(__dirname, "public/src/modules"),
- "node_modules"
+ path.resolve(__dirname, 'public/src/modules'),
+ 'node_modules'
]
},
|
94e165492705454da2f6fae8c9d3ca3902e2c35f | js/locales/foundation-datepicker.lv.js | js/locales/foundation-datepicker.lv.js | w/**
* Latvian translation for foundation-datepicker
* Artis Avotins <artis@apit.lv>
*/
;(function($){
$.fn.fdatepicker.dates['lv'] = {
days: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena", "Svētdiena"],
daysShort: ["Sv", "P", "O", "T", "C", "Pk", "S", "Sv"],
daysMin: ["Sv", "Pr", "Ot", "Tr", "Ce", "Pk", "St", "Sv"],
months: ["Janvāris", "Februāris", "Marts", "Aprīlis", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jūn", "Jūl", "Aug", "Sep", "Okt", "Nov", "Dec."],
today: "Šodien",
weekStart: 1
};
}(jQuery)); | /**
* Latvian translation for foundation-datepicker
* Artis Avotins <artis@apit.lv>
*/
;(function($){
$.fn.fdatepicker.dates['lv'] = {
days: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena", "Svētdiena"],
daysShort: ["Sv", "P", "O", "T", "C", "Pk", "S", "Sv"],
daysMin: ["Sv", "Pr", "Ot", "Tr", "Ce", "Pk", "St", "Sv"],
months: ["Janvāris", "Februāris", "Marts", "Aprīlis", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jūn", "Jūl", "Aug", "Sep", "Okt", "Nov", "Dec."],
today: "Šodien",
weekStart: 1
};
}(jQuery));
| Remove stray character breaking scripts. | Remove stray character breaking scripts. | JavaScript | apache-2.0 | najlepsiwebdesigner/foundation-datepicker,najlepsiwebdesigner/foundation-datepicker | ---
+++
@@ -1,4 +1,4 @@
-w/**
+/**
* Latvian translation for foundation-datepicker
* Artis Avotins <artis@apit.lv>
*/ |
277bf2ab16b7936a35dcf65fa886ee836a2f98e5 | lib/argv.js | lib/argv.js | var argv = require('cmdenv')('micromono')
/**
* Parse commmand line and environment options
*/
argv
.allowUnknownOption()
.option('-s --service [services]', 'Names of services to require. Use comma to separate multiple services. (e.g. --service account,cache) Env name: MICROMONO_SERVICE')
.option('-d --service-dir [dir]', 'Directory of locally available services. Env name: MICROMONO_SERVICE_DIR')
.option('-w --allow-pending', 'White list mode - allow starting the balancer without all required services are loaded/probed.')
.option('-p --port [port]', 'The http port which balancer/service binds to.')
.option('-H --host [host]', 'The host which balancer/service binds to.')
.option('-r --rpc [type]', 'Type of rpc to use.', 'axon')
.option('--rpc-port [port]', 'The port which service binds the rpc server to.')
.option('-b --bundle-asset', 'Bundle production ready version of asset files.')
module.exports = argv
| var argv = require('cmdenv')('micromono')
/**
* Parse commmand line and environment options
*/
argv
.allowUnknownOption()
.option('-s --service [services]', 'Names of services to require. Use comma to separate multiple services. (e.g. --service account,cache) Env name: MICROMONO_SERVICE')
.option('-d --service-dir [dir]', 'Directory of locally available services. Env name: MICROMONO_SERVICE_DIR')
.option('-p --port [port]', 'The http port which balancer/service binds to.')
.option('-H --host [host]', 'The host which balancer/service binds to.')
.option('-r --rpc [type]', 'Type of rpc to use.', 'axon')
.option('--rpc-port [port]', 'The port which service binds the rpc server to.')
.option('--rpc-host [host]', 'The host which service binds the rpc server to.')
.option('-b --bundle-asset', 'Bundle production ready version of asset files.')
module.exports = argv
| Add rpc host and remove --allow-pending. | Add rpc host and remove --allow-pending.
| JavaScript | mit | lsm/micromono,lsm/micromono,lsm/micromono | ---
+++
@@ -7,11 +7,11 @@
.allowUnknownOption()
.option('-s --service [services]', 'Names of services to require. Use comma to separate multiple services. (e.g. --service account,cache) Env name: MICROMONO_SERVICE')
.option('-d --service-dir [dir]', 'Directory of locally available services. Env name: MICROMONO_SERVICE_DIR')
- .option('-w --allow-pending', 'White list mode - allow starting the balancer without all required services are loaded/probed.')
.option('-p --port [port]', 'The http port which balancer/service binds to.')
.option('-H --host [host]', 'The host which balancer/service binds to.')
.option('-r --rpc [type]', 'Type of rpc to use.', 'axon')
.option('--rpc-port [port]', 'The port which service binds the rpc server to.')
+ .option('--rpc-host [host]', 'The host which service binds the rpc server to.')
.option('-b --bundle-asset', 'Bundle production ready version of asset files.')
module.exports = argv |
f46aae10757ea8d86d1870503972e7c8d379aa81 | src/tizen/SplashScreenProxy.js | src/tizen/SplashScreenProxy.js | ( function() {
win = null;
module.exports = {
show: function() {
if ( win === null ) {
win = window.open('splashscreen.html');
}
},
hide: function() {
if ( win !== null ) {
win.close();
win = null;
}
}
};
require("cordova/tizen/commandProxy").add("SplashScreen", module.exports);
})();
| /*
*
* 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"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
( function() {
win = null;
module.exports = {
show: function() {
if ( win === null ) {
win = window.open('splashscreen.html');
}
},
hide: function() {
if ( win !== null ) {
win.close();
win = null;
}
}
};
require("cordova/tizen/commandProxy").add("SplashScreen", module.exports);
})();
| Add license headers to Tizen code | CB-6465: Add license headers to Tizen code
| JavaScript | apache-2.0 | IWAtech/cordova-plugin-splashscreen,Icenium/cordova-plugin-splashscreen,revolunet/cordova-plugin-splashscreen,journeyapps/cordova-splashscreen,bamlab/cordova-plugin-splashscreen,chrskrchr/cordova-plugin-splashscreen,sportstech/cordova-plugin-splashscreen,Panajev/cordova-plugin-splashscreen,journeyapps/cordova-splashscreen,Choppel/cordova-plugin-splashscreen,hebert-nr/spin,kitmaxdevelop/cordova-plugin-splashscreen,Panajev/cordova-plugin-splashscreen,petermetz/cordova-plugin-splashscreen,dpolivy/cordova-plugin-splashscreen,Choppel/cordova-plugin-splashscreen,chrskrchr/cordova-plugin-splashscreen,Icenium/cordova-plugin-splashscreen,Panajev/cordova-plugin-splashscreen,petermetz/cordova-plugin-splashscreen,Newstex/cordova-plugin-splashscreen,petermetz/cordova-plugin-splashscreen,sportstech/cordova-plugin-splashscreen,journeyapps/cordova-splashscreen,petermetz/cordova-plugin-splashscreen,hebert-nr/spin,Lazza/cordova-plugin-splashscreen,Icenium/cordova-plugin-splashscreen,dpolivy/cordova-plugin-splashscreen,polyvi/cordova-plugin-splashscreen,bamlab/cordova-plugin-splashscreen,hebert-nr/spin,bamlab/cordova-plugin-splashscreen,Panajev/cordova-plugin-splashscreen,Seedstars/cordova-plugin-splashscreen,Newstex/cordova-plugin-splashscreen,kitmaxdevelop/cordova-plugin-splashscreen,blackberry-webworks/cordova-plugin-splashscreen,Seedstars/cordova-plugin-splashscreen,Choppel/cordova-plugin-splashscreen,kitmaxdevelop/cordova-plugin-splashscreen,editweb/cordova-plugin-splashscreen,hebert-nr/spin,hebert-nr/spin,corimf/cordova-plugin-splashscreen,journeyapps/cordova-splashscreen,Lazza/cordova-plugin-splashscreen,jfrumar/cordova-plugin-splashscreen,apache/cordova-plugin-splashscreen,Newstex/cordova-plugin-splashscreen,editweb/cordova-plugin-splashscreen,Choppel/cordova-plugin-splashscreen,polyvi/cordova-plugin-splashscreen,jfrumar/cordova-plugin-splashscreen,chrskrchr/cordova-plugin-splashscreen,dpolivy/cordova-plugin-splashscreen,jfrumar/cordova-plugin-splashscreen,purplecabbage/cordova-plugin-splashscreen,editweb/cordova-plugin-splashscreen,corimf/cordova-plugin-splashscreen,IWAtech/cordova-plugin-splashscreen,purplecabbage/cordova-plugin-splashscreen,revolunet/cordova-plugin-splashscreen,polyvi/cordova-plugin-splashscreen,editweb/cordova-plugin-splashscreen,Lazza/cordova-plugin-splashscreen,Seedstars/cordova-plugin-splashscreen,Seedstars/cordova-plugin-splashscreen,caseywebdev/cordova-plugin-splashscreen,kitmaxdevelop/cordova-plugin-splashscreen,jfrumar/cordova-plugin-splashscreen,Lazza/cordova-plugin-splashscreen,dpolivy/cordova-plugin-splashscreen,chrskrchr/cordova-plugin-splashscreen,IWAtech/cordova-plugin-splashscreen,caseywebdev/cordova-plugin-splashscreen,sportstech/cordova-plugin-splashscreen,purplecabbage/cordova-plugin-splashscreen,Newstex/cordova-plugin-splashscreen,blackberry-webworks/cordova-plugin-splashscreen,blackberry-webworks/cordova-plugin-splashscreen,bamlab/cordova-plugin-splashscreen,corimf/cordova-plugin-splashscreen,blackberry-webworks/cordova-plugin-splashscreen,revolunet/cordova-plugin-splashscreen,corimf/cordova-plugin-splashscreen,caseywebdev/cordova-plugin-splashscreen,sportstech/cordova-plugin-splashscreen,IWAtech/cordova-plugin-splashscreen,Icenium/cordova-plugin-splashscreen,polyvi/cordova-plugin-splashscreen,caseywebdev/cordova-plugin-splashscreen,purplecabbage/cordova-plugin-splashscreen,revolunet/cordova-plugin-splashscreen | ---
+++
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
( function() {
win = null; |
ed720392553313a44aec6903d186021f93b96cb9 | newrelic.js | newrelic.js | 'use strict';
// Configuration for the New Relic Node.js agent
exports.config = {
app_name: process.env.NEW_RELIC_APP_NAME || 'app',
logging: {
filepath: process.env.NEW_RELIC_LOG || 'stdout'
}
};
| 'use strict';
// Configuration for the New Relic Node.js agent
module.exports.config = {
app_name: process.env.NEW_RELIC_APP_NAME || 'app',
logging: {
filepath: process.env.NEW_RELIC_LOG || 'stdout'
}
};
| Use always "module.exports", not the alias "exports" | Use always "module.exports", not the alias "exports"
| JavaScript | mit | dragonservice/sso-server | ---
+++
@@ -2,7 +2,7 @@
// Configuration for the New Relic Node.js agent
-exports.config = {
+module.exports.config = {
app_name: process.env.NEW_RELIC_APP_NAME || 'app',
logging: {
filepath: process.env.NEW_RELIC_LOG || 'stdout' |
51df22908705f471b0128416b6843c2351ab2036 | app/index.js | app/index.js | const yeoman = require( 'yeoman-generator' );
const description = require( './description' );
module.exports = yeoman.Base.extend({
constructor: function constructor( ...args ) {
yeoman.Base.apply( this, args );
this.argument( 'name', {
type: String, required: false,
desc: description.name,
});
this.option( 'debug', {
type: Boolean, required: false, alias: 'd', defaults: false,
desc: 'Debug mode',
});
},
initialize: function initialize() {
if ( this.options.debug ) {
this.log( `ARGUMENT: name ${ this.name }` );
}
},
});
| const yeoman = require( 'yeoman-generator' );
const description = require( './description' );
module.exports = yeoman.Base.extend({
constructor: function constructor( ...args ) {
yeoman.Base.apply( this, args );
this.argument( 'name', {
type: String, required: false,
desc: description.name,
});
this.option( 'debug', {
type: Boolean, required: false, alias: 'd', defaults: false,
desc: 'Debug mode',
});
},
initializing: function initializing() {
if ( this.options.debug ) {
this.log( `ARGUMENT: name ${ this.name }` );
}
},
});
| Rename init method according to the spec. | Rename init method according to the spec.
| JavaScript | mit | edloidas/generator-tao | ---
+++
@@ -13,7 +13,7 @@
desc: 'Debug mode',
});
},
- initialize: function initialize() {
+ initializing: function initializing() {
if ( this.options.debug ) {
this.log( `ARGUMENT: name ${ this.name }` );
} |
1de0ea9b9793f0695a2e17c2a2d0fd4cff786f4d | Server/src/test/resources/client/sector_identifier.js | Server/src/test/resources/client/sector_identifier.js | [ "https://${test.server.name}/oxauth-rp/home.seam",
"https://client.example.org/callback",
"https://client.example.org/callback2",
"https://client.other_company.example.net/callback",
"https://client.example.com/cb",
"https://client.example.com/cb1",
"https://client.example.com/cb2" ] | [ "https://${test.server.name}/oxauth-rp/home.htm",
"https://client.example.org/callback",
"https://client.example.org/callback2",
"https://client.other_company.example.net/callback",
"https://client.example.com/cb",
"https://client.example.com/cb1",
"https://client.example.com/cb2" ] | Fix uri in secto_identifier js | Fix uri in secto_identifier js
| JavaScript | mit | GluuFederation/oxAuth,madumlao/oxAuth,madumlao/oxAuth,GluuFederation/oxAuth,madumlao/oxAuth,GluuFederation/oxAuth,GluuFederation/oxAuth,GluuFederation/oxAuth,madumlao/oxAuth,madumlao/oxAuth | ---
+++
@@ -1,4 +1,4 @@
-[ "https://${test.server.name}/oxauth-rp/home.seam",
+[ "https://${test.server.name}/oxauth-rp/home.htm",
"https://client.example.org/callback",
"https://client.example.org/callback2",
"https://client.other_company.example.net/callback", |
7de243b38dc879ee29e34adf1e3a0fd49f772592 | webpack.config.js | webpack.config.js | 'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
const webpack = require('webpack');
const path = require('path');
const PATHS = {
app: path.join(__dirname, 'app'),
build: path.join(__dirname, 'build')
};
module.exports = {
entry: {
app: PATHS.app
},
output: {
path: PATHS.build,
filename: 'bundle.js'
},
watch: NODE_ENV === 'development',
watchOptions: {
aggregateTimeout: 100
},
devtool: NODE_ENV === 'development' ? 'cheap-module-inline-source-map' : null,
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
})
],
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js']
},
resolveLoader: {
modulesDirectories: ['node_modules'],
modulesTemplates: ['*-loader', '*'],
extensions: ['', '.js']
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
}
]
}
}; | 'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
const webpack = require('webpack');
const path = require('path');
const PATHS = {
app: path.join(__dirname, 'app'),
build: path.join(__dirname, 'build')
};
module.exports = {
entry: {
app: PATHS.app
},
output: {
path: PATHS.build,
filename: 'bundle.js'
},
watch: NODE_ENV === 'development',
watchOptions: {
aggregateTimeout: 100
},
devtool: NODE_ENV === 'development' ? 'cheap-module-inline-source-map' : null,
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
})
],
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js']
},
resolveLoader: {
modulesDirectories: ['node_modules'],
modulesTemplates: ['*-loader', '*'],
extensions: ['', '.js']
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
},
include: [
PATHS.app
]
}
]
}
}; | Add include property to babel loader | Add include property to babel loader
| JavaScript | mit | boriskaiser/starterkit,boriskaiser/starterkit | ---
+++
@@ -46,7 +46,10 @@
loader: 'babel',
query: {
presets: ['es2015', 'react']
- }
+ },
+ include: [
+ PATHS.app
+ ]
}
]
} |
d9e2d9c515ba46bae3b86ca44119e445ae51e9ee | lib/services/facebook.service.js | lib/services/facebook.service.js | var serviceName = "facebook";
var request = require("request");
var serviceConfig = require("./../config/services.config.json");
var result = {
service: serviceName,
status: false
}
function facebook (cb) {
request({
url: serviceConfig[serviceName],
method: "GET",
headers: {
"User-Agent": 'request'
}
}, function(error, response, body) {
if(error) {
result["message"] = "Problem with the connection.";
result["data"] = error;
return cb(result);
}
if(body) {
try {
body = JSON.parse(body);
} catch (e) {
result["message"] = "Could not parse the response.";
return cb(result);
}
if(body.current.health != 1) {
result["status"] = false;
result["message"] = body.current.subject;
return cb(result);
}
result["status"] = true;
result["message"] = body.current.subject;
return cb(result);
}
result["message"] = "Empty response. Try Again.";
return cb(result);
});
}
module.exports = facebook;
| var serviceName = "facebook";
var request = require("request");
var serviceConfig = require("./../config/services.config.json");
function facebook (cb) {
var result = {
service: serviceName,
status: false
};
request({
url: serviceConfig[serviceName],
method: "GET",
headers: {
"User-Agent": 'request'
}
}, function(error, response, body) {
if(error) {
result["message"] = "Problem with the connection.";
result["data"] = error;
return cb(result);
}
if(body) {
try {
body = JSON.parse(body);
} catch (e) {
result["message"] = "Could not parse the response.";
return cb(result);
}
if(body.current.health != 1) {
result["message"] = body.current.subject;
return cb(result);
}
result["status"] = true;
result["message"] = body.current.subject;
return cb(result);
}
result["message"] = "Empty response. Try Again.";
return cb(result);
});
}
module.exports = facebook;
| Make result object local to function | Make result object local to function
| JavaScript | mit | punit1108/upstatejs | ---
+++
@@ -3,12 +3,11 @@
var request = require("request");
var serviceConfig = require("./../config/services.config.json");
-var result = {
- service: serviceName,
- status: false
-}
-
function facebook (cb) {
+ var result = {
+ service: serviceName,
+ status: false
+ };
request({
url: serviceConfig[serviceName],
@@ -32,7 +31,6 @@
}
if(body.current.health != 1) {
- result["status"] = false;
result["message"] = body.current.subject;
return cb(result);
} |
780def87c61f5aa1a0af7f25e85abe79a16d55c5 | lib/main.js | lib/main.js | 'use strict';
var contextify = require('contextify');
var fs = require('fs');
var Context = function () {
var rawContext = contextify();
rawContext.globals = rawContext.getGlobal();
return {
run: function (source, filename) {
rawContext.run(source, filename);
},
runFile: function (fileName, callback) {
fs.readFile(
fileName,
'utf8',
function (err, data) {
if (err) {
callback(undefined, err);
}
else {
callback(rawContext.run(data, fileName));
}
}
);
},
hasAngular: function () {
return typeof rawContext.angular === 'object';
},
getAngular: function () {
return rawContext.angular;
},
module: function () {
return rawContext.angular.module.apply(
rawContext.angular.module,
arguments
);
},
injector: function (modules) {
return rawContext.angular.inject(modules);
},
dispose: function () {
rawContext.dispose();
}
};
};
exports.Context = Context;
| 'use strict';
var contextify = require('contextify');
var fs = require('fs');
var Context = function () {
var rawContext = contextify();
rawContext.globals = rawContext.getGlobal();
return {
run: function (source, filename) {
rawContext.run(source, filename);
},
runFile: function (fileName, callback) {
fs.readFile(
fileName,
'utf8',
function (err, data) {
if (err) {
callback(undefined, err);
}
else {
callback(rawContext.run(data, fileName));
}
}
);
},
hasAngular: function () {
return typeof rawContext.angular === 'object';
},
getAngular: function () {
return rawContext.angular;
},
module: function () {
return rawContext.angular.module.apply(
rawContext.angular.module,
arguments
);
},
injector: function (modules) {
return rawContext.angular.injector(modules);
},
dispose: function () {
rawContext.dispose();
}
};
};
exports.Context = Context;
| Correct typo of 'injector' method name as 'inject'. | Correct typo of 'injector' method name as 'inject'.
| JavaScript | mit | fusikky/node-angularcontext,rit/node-angularcontext,thrashr888/node-angularcontext,apparentlymart/node-angularcontext | ---
+++
@@ -44,7 +44,7 @@
},
injector: function (modules) {
- return rawContext.angular.inject(modules);
+ return rawContext.angular.injector(modules);
},
dispose: function () { |
d8271950357cda3fd4fdefc79e4c1f95432b8c41 | public/js/initialize.js | public/js/initialize.js | $(document).ready(function() {
$.ajax({
url: '/questions/index',
method: 'GET',
dataType: 'json'
}).done(function(data){
user_questions = data['questions']
updateQuestions(user_questions);
});
$(".button").click(function(e){
e.preventDefault();
$('#question_form').show();
$('.block_screen').show();
});
$('.block_screen').click(function(e){
e.preventDefault();
clearModal();
});
$('input[value="Delete Question"]').submit(function(e){
e.preventDefault();
console.log(e);
})
$('.container').on('submit', 'form.post_question', function(e){
e.preventDefault();
postQuestion(this);
});
$('.container').on('click', '.edit', function(e){
e.preventDefault();
var question = getQuestion($(this).text(), user_questions);
editQuestion(question);
})
});
//-----------------Variables-----------------------
var user_questions = [];
//-----------------VIEWS---------------------------
var clearModal = function(){
$('#question_form').hide();
$('#edit_question_form').hide();
$('.block_screen').hide();
};
var postQuestion = function(instance){
var question = $(instance).serialize();
$.ajax({
url: '/questions',
method: 'POST',
data: question,
dataType: 'json'
})
.done(function(data){
clearModal();
$(instance)[0].reset();
var question = [data['question']];
updateQuestions(question);
user_questions.push(question[0])
});
};
var updateQuestions = function(questions){
for(var i = 0;i<questions.length;i++){
if (questions[i].status === 'unanswered'){
$('#unanswered').append('<a href="#" class="edit">'+questions[i].question+'<a><br>');
}else if (questions[i].status === 'answered'){
$('#answered').append('<a href="#" class="edit">'+questions[i].question+'<a><br>');
} else if (questions[i].status === 'active'){
$('#unanswered').append('<p style="background-color:red">'+questions[i].question+'<p>');
}
};
};
var getQuestion = function(question, questions){
for(var i = 0; i<questions.length;i++){
if (question === questions[i].question){
return questions[i];
}
}
};
var editQuestion = function(question){
//TODO REFACTOR
$("#edit_question_form input[name='question[question]']").val(question.question);
$("#edit_question_form input[name='question[challenge_name]']").val(question.challenge_name);
$("#edit_question_form input[name='question[error_msg]']").val(question.error_msg);
$("#edit_question_form textarea[name='question[code]']").val(question.code);
$("#edit_question_form input[name='question[location]']").val(question.location);
$('#edit_question_form').show();
$('.block_screen').show();
}
| $(document).ready(function(){
var controller = new Controller(View);
}); | Edit Initialize JS to Activate Controller/View On Load | Edit Initialize JS to Activate Controller/View On Load
| JavaScript | mit | n-zeplo/AskDBC,n-zeplo/AskDBC | ---
+++
@@ -1,97 +1,3 @@
-$(document).ready(function() {
-
- $.ajax({
- url: '/questions/index',
- method: 'GET',
- dataType: 'json'
- }).done(function(data){
- user_questions = data['questions']
- updateQuestions(user_questions);
- });
-
-
- $(".button").click(function(e){
- e.preventDefault();
- $('#question_form').show();
- $('.block_screen').show();
- });
-
- $('.block_screen').click(function(e){
- e.preventDefault();
- clearModal();
- });
- $('input[value="Delete Question"]').submit(function(e){
- e.preventDefault();
- console.log(e);
- })
-
- $('.container').on('submit', 'form.post_question', function(e){
- e.preventDefault();
- postQuestion(this);
- });
- $('.container').on('click', '.edit', function(e){
- e.preventDefault();
- var question = getQuestion($(this).text(), user_questions);
- editQuestion(question);
- })
-
+$(document).ready(function(){
+ var controller = new Controller(View);
});
-
-//-----------------Variables-----------------------
-var user_questions = [];
-
-
-//-----------------VIEWS---------------------------
-var clearModal = function(){
- $('#question_form').hide();
- $('#edit_question_form').hide();
- $('.block_screen').hide();
-};
-
-var postQuestion = function(instance){
- var question = $(instance).serialize();
- $.ajax({
- url: '/questions',
- method: 'POST',
- data: question,
- dataType: 'json'
- })
- .done(function(data){
- clearModal();
- $(instance)[0].reset();
- var question = [data['question']];
- updateQuestions(question);
- user_questions.push(question[0])
- });
-};
-
-var updateQuestions = function(questions){
- for(var i = 0;i<questions.length;i++){
- if (questions[i].status === 'unanswered'){
- $('#unanswered').append('<a href="#" class="edit">'+questions[i].question+'<a><br>');
- }else if (questions[i].status === 'answered'){
- $('#answered').append('<a href="#" class="edit">'+questions[i].question+'<a><br>');
- } else if (questions[i].status === 'active'){
- $('#unanswered').append('<p style="background-color:red">'+questions[i].question+'<p>');
- }
- };
-};
-
-var getQuestion = function(question, questions){
- for(var i = 0; i<questions.length;i++){
- if (question === questions[i].question){
- return questions[i];
- }
- }
-};
-
-var editQuestion = function(question){
- //TODO REFACTOR
- $("#edit_question_form input[name='question[question]']").val(question.question);
- $("#edit_question_form input[name='question[challenge_name]']").val(question.challenge_name);
- $("#edit_question_form input[name='question[error_msg]']").val(question.error_msg);
- $("#edit_question_form textarea[name='question[code]']").val(question.code);
- $("#edit_question_form input[name='question[location]']").val(question.location);
- $('#edit_question_form').show();
- $('.block_screen').show();
-} |
bd4355e232324d68689443b524683c803b9991ed | public/js/views/home.js | public/js/views/home.js | (function () {
'use strict';
mare.views.Home = Backbone.View.extend({
el: 'body',
initialize: function() {
// DOM cache any commonly used elements to improve performance
this.$featuredPanelOverlay = $( '.panel-overlay' );
// initialize the owl carousel and make any needed modifications to slideshow image loading
this.initializeSlideshow();
},
/* initializes the slideshow */
initializeSlideshow: function initializeSlideshow() {
// initialize the slideshow default settings
$( '#slideshow' ).owlCarousel({
autoPlay : 3000,
singleItem : true,
lazyLoad : true,
lazyEffect: 'fade',
autoHeight: true,
transitionStyle : 'fade'
});
// prevents the slideshow image descriptions from loading in before the images do
// TODO: This doesn't seem to be working as well as it needs to.
$( '#slideshow img' ).load(function() {
$(this).siblings( '.slideshow__description' ).removeClass( 'hidden' );
});
}
});
}()); | (function () {
'use strict';
mare.views.Home = Backbone.View.extend({
el: 'body',
initialize: function() {
// DOM cache any commonly used elements to improve performance
this.$featuredPanelOverlay = $( '.panel-overlay' );
// initialize the owl carousel and make any needed modifications to slideshow image loading
this.initializeSlideshow();
},
/* initializes the slideshow */
initializeSlideshow: function initializeSlideshow() {
// initialize the slideshow default settings
$( '#slideshow' ).owlCarousel({
autoPlay : 5000,
singleItem : true,
lazyLoad : true,
lazyEffect: 'fade',
autoHeight: true,
transitionStyle : 'fade'
});
// prevents the slideshow image descriptions from loading in before the images do
// TODO: This doesn't seem to be working as well as it needs to.
$( '#slideshow img' ).load(function() {
$(this).siblings( '.slideshow__description' ).removeClass( 'hidden' );
});
}
});
}()); | Increase transition time for slideshow images from 3 seconds to 5 seconds | Increase transition time for slideshow images from 3 seconds to 5 seconds
| JavaScript | mit | autoboxer/MARE,autoboxer/MARE | ---
+++
@@ -15,7 +15,7 @@
initializeSlideshow: function initializeSlideshow() {
// initialize the slideshow default settings
$( '#slideshow' ).owlCarousel({
- autoPlay : 3000,
+ autoPlay : 5000,
singleItem : true,
lazyLoad : true,
lazyEffect: 'fade', |
9778f7c92896804bca436120471f7dc9577b39f9 | src/modules/entityModels.js | src/modules/entityModels.js | import fetch from 'isomorphic-fetch'
export const REQUEST_ENTITY_MODELS = 'REQUEST_ENTITY_MODELS'
export const RECEIVE_ENTITY_MODELS = 'RECEIVE_ENTITY_MODELS'
function requestEntityModels() {
return {
type: REQUEST_ENTITY_MODELS
}
}
function receiveEntityModels(json) {
return {
type: RECEIVE_ENTITY_MODELS,
models: json,
receivedAt: Date.now()
}
}
export function fetchEntityModels() {
return (dispatch, getState) => {
if (getState().entityModels.length > 0) {
return null
}
dispatch(requestEntityModels())
return fetch(`http://localhost:8080/nice2/rest/entities`)
.then(response => response.json())
.then(json => dispatch(receiveEntityModels(json)))
}
}
const ACTION_HANDLERS = {
[RECEIVE_ENTITY_MODELS]: (entityModels, { models }) =>
Object.keys(models.entities).map(modelName => ({
name: modelName,
label: models.entities[modelName].metaData.label
}))
}
const initialState = []
export default function entityModelsReducer(state = initialState, action: Action) {
const handler = ACTION_HANDLERS[action.type]
return handler ? handler(state, action) : state
}
| import fetch from 'isomorphic-fetch'
export const REQUEST_ENTITY_MODELS = 'REQUEST_ENTITY_MODELS'
export const RECEIVE_ENTITY_MODELS = 'RECEIVE_ENTITY_MODELS'
function requestEntityModels() {
return {
type: REQUEST_ENTITY_MODELS
}
}
function receiveEntityModels(json) {
return {
type: RECEIVE_ENTITY_MODELS,
models: json,
receivedAt: Date.now()
}
}
export function fetchEntityModels() {
return (dispatch, getState) => {
if (getState().entityModels.length > 0) {
return null
}
dispatch(requestEntityModels())
return fetch(`http://localhost:8080/nice2/rest/entities`, {
credentials: 'include'
})
.then(response => response.json())
.then(json => dispatch(receiveEntityModels(json)))
}
}
const ACTION_HANDLERS = {
[RECEIVE_ENTITY_MODELS]: (entityModels, { models }) =>
Object.keys(models.entities).map(modelName => ({
name: modelName,
label: models.entities[modelName].metaData.label
}))
}
const initialState = []
export default function entityModelsReducer(state = initialState, action: Action) {
const handler = ACTION_HANDLERS[action.type]
return handler ? handler(state, action) : state
}
| Include credentials when entity models are fetched | Include credentials when entity models are fetched
| JavaScript | agpl-3.0 | tocco/tocco-client,tocco/tocco-client,tocco/tocco-client | ---
+++
@@ -23,7 +23,9 @@
return null
}
dispatch(requestEntityModels())
- return fetch(`http://localhost:8080/nice2/rest/entities`)
+ return fetch(`http://localhost:8080/nice2/rest/entities`, {
+ credentials: 'include'
+ })
.then(response => response.json())
.then(json => dispatch(receiveEntityModels(json)))
} |
2759872ce05575f6d5bc45a5df9f071d8763c089 | src/util/defineClass.js | src/util/defineClass.js | import _ from 'lodash'
import postcss from 'postcss'
export default function(className, properties) {
const decls = _.map(properties, (value, property) => {
return postcss.decl({
prop: _.kebabCase(property),
value: value,
})
})
return postcss.rule({
selector: `.${className}`,
}).append(decls)
}
| import _ from 'lodash'
import postcss from 'postcss'
export default function(className, properties) {
const decls = _.map(properties, (value, property) => {
return postcss.decl({
prop: _.kebabCase(property),
value: `${value}`,
})
})
return postcss.rule({
selector: `.${className}`,
}).append(decls)
}
| Convert all property values to strings | Convert all property values to strings
Allows using unquoted numeric values. Tricky to test because only
breaks when trying to run the whole thing through cssnext in the full
chain. Will figure it out later :)
| JavaScript | mit | tailwindcss/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss | ---
+++
@@ -5,7 +5,7 @@
const decls = _.map(properties, (value, property) => {
return postcss.decl({
prop: _.kebabCase(property),
- value: value,
+ value: `${value}`,
})
})
|
6568e4bacc41eb4666aa37a007a39215432fea37 | lib/ascii-art.js | lib/ascii-art.js | 'use strict';
var ascii = require('image-to-ascii');
function mock() {
return function(url, callback) {
callback('[ascii art]');
};
}
function prod() {
return function(url, callback) {
ascii({
colored: false,
path: url
}, function (err, result) {
callback(err ? 'Ascii art error: ' + err : result);
});
};
}
module.exports = (process.env.IRC_ENV === undefined) ? mock() : prod();
| 'use strict';
var ascii = require('image-to-ascii');
function mock() {
return function(url, callback) {
callback('[ascii art]');
};
}
function prod() {
return function(url, callback) {
ascii({
colored: false,
path: url,
size: {height: 30}
}, function (err, result) {
callback(err ? 'Ascii art error: ' + err : result);
});
};
}
module.exports = (process.env.IRC_ENV === undefined) ? mock() : prod();
| Set ascii art max height to 30 lines | Set ascii art max height to 30 lines
| JavaScript | mit | earldouglas/sectery | ---
+++
@@ -12,7 +12,8 @@
return function(url, callback) {
ascii({
colored: false,
- path: url
+ path: url,
+ size: {height: 30}
}, function (err, result) {
callback(err ? 'Ascii art error: ' + err : result);
}); |
adf821a39271131ef5ba4116b29ec38a6a3b13db | lib/countdown.js | lib/countdown.js | 'use strict';
(function() {
var root = this;
var Countdown = function(duration, onTick, onComplete){
this.secondsLeft = duration;
var tick = function() {
if (this.secondsLeft > 0) {
onTick(this.secondsLeft);
this.secondsLeft -= 1;
} else {
clearInterval(this.interval);
onComplete();
}
}
//setting the interval, by call tick and passing through this via a self-calling function wrap
this.interval = setInterval(
(function(self){
return function() { tick.call(self) }
})(this),1000
);
}
Countdown.prototype.abort = function() {
clearInterval(this.interval);
}
if (typeof exports !== 'undefined') module.exports = exports = Countdown;
else root.Countdown = Countdown;
}).call(this);
| 'use strict';
(function() {
var root = this;
var Countdown = function(duration, onTick, onComplete){
this.secondsLeft = duration;
var tick = function() {
if (this.secondsLeft > 0) {
onTick(this.secondsLeft);
this.secondsLeft -= 1;
} else {
clearInterval(this.interval);
onComplete();
}
}
// First tick.
tick.call(this);
// Setting the interval, by call tick and passing through this via a self-calling function wrap.
this.interval = setInterval(
(function(self){
return function() { tick.call(self) }
})(this), 1000
);
}
Countdown.prototype.abort = function() {
clearInterval(this.interval);
}
if (typeof exports !== 'undefined') module.exports = exports = Countdown;
else root.Countdown = Countdown;
}).call(this);
| Fix a bug related to the first tick not being called | Fix a bug related to the first tick not being called
| JavaScript | mit | gumroad/countdown.js | ---
+++
@@ -14,11 +14,15 @@
onComplete();
}
}
- //setting the interval, by call tick and passing through this via a self-calling function wrap
+
+ // First tick.
+ tick.call(this);
+
+ // Setting the interval, by call tick and passing through this via a self-calling function wrap.
this.interval = setInterval(
(function(self){
return function() { tick.call(self) }
- })(this),1000
+ })(this), 1000
);
}
|
3857c7cce4967365d560dc8ed4c9436cac6409e9 | lib/info-view.js | lib/info-view.js | 'use babel'
export default class InfoView {
constructor(serializedState) {
// Create root element
this.rootElement = document.createElement('div')
this.rootElement.classList.add('root-info')
// Create message element
const message = document.createElement('div')
message.textContent = 'The Moie package is Alive! It\'s ALIVE!'
message.classList.add('message')
this.rootElement.appendChild(message)
}
// Returns an object that can be retrieved when package is activated
serialize() {}
// Tear down any state and detach
destroy() {
this.rootElement.remove()
}
getRoot() {
return this.rootElement
}
}
| 'use babel'
jQuery = require('jquery')
export default class InfoView {
constructor(serializedState) {
// Create root element
this.rootElement = document.createElement('div')
this.rootElement.classList.add('root-info')
// Create message element
this.message = document.createElement('div')
this.message.textContent = 'The Moie package is Alive! It\'s ALIVE!'
this.message.classList.add('message')
this.rootElement.appendChild(this.message)
}
// Returns an object that can be retrieved when package is activated
serialize() {}
// Tear down any state and detach
destroy() {
this.rootElement.remove()
}
getRoot() {
return this.rootElement
}
addLines(lines) {
const html = lines.reduce((acc, elem) => elem + acc + "<br/>", "")
jQuery(this.message).html(html)
}
}
| Add addLines for updating messages | Add addLines for updating messages
| JavaScript | mit | THM-MoTE/mope-atom-plugin | ---
+++
@@ -1,4 +1,6 @@
'use babel'
+
+jQuery = require('jquery')
export default class InfoView {
@@ -8,10 +10,10 @@
this.rootElement.classList.add('root-info')
// Create message element
- const message = document.createElement('div')
- message.textContent = 'The Moie package is Alive! It\'s ALIVE!'
- message.classList.add('message')
- this.rootElement.appendChild(message)
+ this.message = document.createElement('div')
+ this.message.textContent = 'The Moie package is Alive! It\'s ALIVE!'
+ this.message.classList.add('message')
+ this.rootElement.appendChild(this.message)
}
// Returns an object that can be retrieved when package is activated
@@ -25,4 +27,9 @@
getRoot() {
return this.rootElement
}
+
+ addLines(lines) {
+ const html = lines.reduce((acc, elem) => elem + acc + "<br/>", "")
+ jQuery(this.message).html(html)
+ }
} |
02cb89e6786714e27778478c18f9df6b501009c8 | lib/selectors.js | lib/selectors.js | 'use strict';
const MATHOID_IMG_CLASS = 'mwe-math-fallback-image-inline';
const MediaSelectors = [
'*[typeof^=mw:Image]',
'*[typeof^=mw:Video]',
'*[typeof^=mw:Audio]',
`img.${MATHOID_IMG_CLASS}`
];
const VideoSelectors = MediaSelectors.filter(selector => selector.includes('Video'));
const PronunciationParentSelector = 'span.IPA';
const PronunciationSelector = 'a[rel=mw:MediaLink]';
const SpokenWikipediaId = '#section_SpokenWikipedia';
module.exports = {
MediaSelectors,
VideoSelectors,
PronunciationParentSelector,
PronunciationSelector,
SpokenWikipediaId,
MATHOID_IMG_CLASS
};
| 'use strict';
const MATHOID_IMG_CLASS = 'mwe-math-fallback-image-inline';
const MediaSelectors = [
'*[typeof^="mw:Image"]',
'*[typeof^="mw:Video"]',
'*[typeof^="mw:Audio"]',
`img.${MATHOID_IMG_CLASS}`
];
const VideoSelectors = MediaSelectors.filter(selector => selector.includes('Video'));
const PronunciationParentSelector = 'span.IPA';
const PronunciationSelector = 'a[rel="mw:MediaLink"]';
const SpokenWikipediaId = '#section_SpokenWikipedia';
module.exports = {
MediaSelectors,
VideoSelectors,
PronunciationParentSelector,
PronunciationSelector,
SpokenWikipediaId,
MATHOID_IMG_CLASS
};
| Fix 'parsePronunciation' bug causing js string error w/ some articles. | Fix 'parsePronunciation' bug causing js string error w/ some articles.
Unsure why this is only happening with some articles.
Noticed when using this converter on `enwiki > Elon_Musk`:
https://github.com/wikimedia/pcs-html-converter
T242479
Change-Id: Id95a75caf2ae708b2b1559dbc475a9bd3bc29fb0
| JavaScript | apache-2.0 | wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps | ---
+++
@@ -3,16 +3,16 @@
const MATHOID_IMG_CLASS = 'mwe-math-fallback-image-inline';
const MediaSelectors = [
- '*[typeof^=mw:Image]',
- '*[typeof^=mw:Video]',
- '*[typeof^=mw:Audio]',
+ '*[typeof^="mw:Image"]',
+ '*[typeof^="mw:Video"]',
+ '*[typeof^="mw:Audio"]',
`img.${MATHOID_IMG_CLASS}`
];
const VideoSelectors = MediaSelectors.filter(selector => selector.includes('Video'));
const PronunciationParentSelector = 'span.IPA';
-const PronunciationSelector = 'a[rel=mw:MediaLink]';
+const PronunciationSelector = 'a[rel="mw:MediaLink"]';
const SpokenWikipediaId = '#section_SpokenWikipedia';
module.exports = { |
a4703dc67d0857d52911c68ce4dc42f20629dc79 | step-01/js/main.js | step-01/js/main.js | 'use strict';
// On this codelab, you will be streaming only video (video: true).
const mediaStreamConstraints = {
video: true,
};
// Video element where stream will be placed.
const localVideo = document.querySelector('video');
// Handles success by adding the MediaStream to the video element.
function gotLocalMediaStream(mediaStream) {
localVideo.srcObject = mediaStream;
};
// Handles error by logging a message to the console with the error message.
function handleLocalMediaStreamError(error) {
console.log('navigator.getUserMedia error: ', error);
};
// Initializes media stream.
navigator.mediaDevices.getUserMedia(mediaStreamConstraints)
.then(gotLocalMediaStream).catch(handleLocalMediaStreamError);
| 'use strict';
// On this codelab, you will be streaming only video (video: true).
const mediaStreamConstraints = {
video: true,
};
// Video element where stream will be placed.
const localVideo = document.querySelector('video');
// Handles success by adding the MediaStream to the video element.
function gotLocalMediaStream(mediaStream) {
localVideo.srcObject = mediaStream;
}
// Handles error by logging a message to the console with the error message.
function handleLocalMediaStreamError(error) {
console.log('navigator.getUserMedia error: ', error);
}
// Initializes media stream.
navigator.mediaDevices.getUserMedia(mediaStreamConstraints)
.then(gotLocalMediaStream).catch(handleLocalMediaStreamError);
| Remove ; after function definitions | Remove ; after function definitions
| JavaScript | apache-2.0 | googlecodelabs/webrtc-web,googlecodelabs/webrtc-web | ---
+++
@@ -11,12 +11,12 @@
// Handles success by adding the MediaStream to the video element.
function gotLocalMediaStream(mediaStream) {
localVideo.srcObject = mediaStream;
-};
+}
// Handles error by logging a message to the console with the error message.
function handleLocalMediaStreamError(error) {
console.log('navigator.getUserMedia error: ', error);
-};
+}
// Initializes media stream.
navigator.mediaDevices.getUserMedia(mediaStreamConstraints) |
9bbb27f85c6c8b59d19d620803cb75eb24fa74ed | app/reducers.js | app/reducers.js | import { combineReducers } from 'redux'
import { reducer as form } from 'redux-form'
import filter from './components/filter/filter.reducer'
import routes from './components/routes/routes.reducer'
import sort from './components/sort/sort.reducer'
const rootReducer = combineReducers({
filter,
routes,
sort,
token,
orgs,
form
})
export default rootReducer | import { combineReducers } from 'redux'
import { reducer as form } from 'redux-form'
import filter from './components/filter/filter.reducer'
import routes from './components/routes/routes.reducer'
import sort from './components/sort/sort.reducer'
const rootReducer = combineReducers({
filter,
routes,
sort,
form
})
export default rootReducer | Remove usage of bad import | Remove usage of bad import
| JavaScript | mit | chrisronline/route-finder,chrisronline/route-finder | ---
+++
@@ -8,8 +8,6 @@
filter,
routes,
sort,
- token,
- orgs,
form
})
|
749a1d238ac408827671189820a31d77951f6a07 | lib/util.js | lib/util.js | var humps = require('humps');
var STATUS_CONNECTING = 'connecting',
STATUS_CONNECTED = 'connected',
STATUS_DISCONNECTED = 'disconnected',
STATUS_ERROR = 'error',
STATUS_CLOSED = 'closed',
STATUS_UNKNOWN = 'unknown';
var statusMappings = {
'new': STATUS_CONNECTING,
'checking': STATUS_CONNECTING,
'connected': STATUS_CONNECTING,
'completed': STATUS_CONNECTED,
'failed': STATUS_ERROR,
'disconnected': STATUS_DISCONNECTED,
'closed': STATUS_CLOSED
};
exports.connectionId = function(source, target) {
return (source < target
? source + ':' + target
: target + ':' + source);
}
exports.toStatus = function(iceConnectionState) {
if (!iceConnectionState) return STATUS_UNKNOWN;
var status = statusMappings[iceConnectionState.toLowerCase()];
return status || STATUS_UNKNOWN;
}
exports.standardizeKey = function(prefix, key) {
if (!key) return key;
var normalized = key;
if (key.indexOf(prefix) === 0) {
normalized = key.replace(prefix, '');
}
return humps.camelize(normalized);
}
exports.SIGNALLER_EVENTS = ['init', 'open', 'connected', 'disconnected', 'error']; | var humps = require('humps');
var STATUS_CONNECTING = 'connecting',
STATUS_CONNECTED = 'connected',
STATUS_DISCONNECTED = 'disconnected',
STATUS_ERROR = 'error',
STATUS_CLOSED = 'closed',
STATUS_UNKNOWN = 'unknown';
var statusMappings = {
'new': STATUS_CONNECTING,
'checking': STATUS_CONNECTING,
'connected': STATUS_CONNECTED,
'completed': STATUS_CONNECTED,
'failed': STATUS_ERROR,
'disconnected': STATUS_DISCONNECTED,
'closed': STATUS_CLOSED
};
exports.connectionId = function(source, target) {
return (source < target
? source + ':' + target
: target + ':' + source);
}
exports.toStatus = function(iceConnectionState) {
if (!iceConnectionState) return STATUS_UNKNOWN;
var status = statusMappings[iceConnectionState.toLowerCase()];
return status || STATUS_UNKNOWN;
}
exports.standardizeKey = function(prefix, key) {
if (!key) return key;
var normalized = key;
if (key.indexOf(prefix) === 0) {
normalized = key.replace(prefix, '');
}
return humps.camelize(normalized);
}
exports.SIGNALLER_EVENTS = ['init', 'open', 'connected', 'disconnected', 'error']; | Update iceConnectionState.connected to trigger the connected state, instead of connecting | Update iceConnectionState.connected to trigger the connected state, instead of connecting
| JavaScript | apache-2.0 | rtc-io/rtc-health,eightyeight/rtc-health | ---
+++
@@ -10,7 +10,7 @@
var statusMappings = {
'new': STATUS_CONNECTING,
'checking': STATUS_CONNECTING,
- 'connected': STATUS_CONNECTING,
+ 'connected': STATUS_CONNECTED,
'completed': STATUS_CONNECTED,
'failed': STATUS_ERROR,
'disconnected': STATUS_DISCONNECTED, |
d726aacd848520d79223f6b128cf2768c32b5812 | test/ui-testing/stub.js | test/ui-testing/stub.js | module.exports.test = function(uiTestCtx) {
describe('Module test: checkout:stub', function() {
const { config, helpers: { login, openApp, logout }, meta: { testVersion } } = uiTestCtx;
const nightmare = new Nightmare(config.nightmare);
this.timeout(Number(config.test_timeout));
describe('Login > Open module "Instances" > Logout', () => {
before( done => {
login(nightmare, config, done); // logs in with the default admin credentials
})
after( done => {
logout(nightmare, config, done);
})
it('should open module "Instances" and find version tag ', done => {
nightmare
.use(openApp(nightmare, config, done, 'instances', testVersion))
.then(result => result )
})
})
})
}
| module.exports.test = function(uiTestCtx) {
describe('Module test: instances:stub', function() {
const { config, helpers: { login, openApp, logout }, meta: { testVersion } } = uiTestCtx;
const nightmare = new Nightmare(config.nightmare);
this.timeout(Number(config.test_timeout));
describe('Login > Open module "Instances" > Logout', () => {
before( done => {
login(nightmare, config, done); // logs in with the default admin credentials
})
after( done => {
logout(nightmare, config, done);
})
it('should open module "Instances" and find version tag ', done => {
nightmare
.use(openApp(nightmare, config, done, 'instances', testVersion))
.then(result => result )
})
})
})
}
| Fix typo in test log. | Tests: Fix typo in test log.
| JavaScript | apache-2.0 | cledvina/ui-instances | ---
+++
@@ -1,6 +1,6 @@
module.exports.test = function(uiTestCtx) {
- describe('Module test: checkout:stub', function() {
+ describe('Module test: instances:stub', function() {
const { config, helpers: { login, openApp, logout }, meta: { testVersion } } = uiTestCtx;
const nightmare = new Nightmare(config.nightmare);
|
44811f0ca64f2ebd7aea57ab9398cf80d0371588 | src/utils/utils.spec.js | src/utils/utils.spec.js | import { getUrlFromCriterias, storeToArray } from './utils';
describe('Utils', () => {
test('getUrlFromCriterias', () => {
expect(getUrlFromCriterias()).toBe('');
expect(getUrlFromCriterias({})).toBe('');
expect(getUrlFromCriterias({ key1: 'value-key1' })).toBe(
'?key1=value-key1',
);
expect(getUrlFromCriterias({ key1: undefined })).toBe('');
expect(
getUrlFromCriterias({ key1: 'value-key1', key2: 'value-key2' }),
).toBe('?key1=value-key1&key2=value-key2');
expect(getUrlFromCriterias({ key1: 'value-key1', key2: undefined })).toBe(
'?key1=value-key1',
);
});
test('storeToArray', () => {
expect(storeToArray()).toEqual([]);
});
});
| import { getUrlFromCriterias, storeToArray, verifyVariable } from './utils';
describe('Utils', () => {
test('getUrlFromCriterias', () => {
expect(getUrlFromCriterias()).toBe('');
expect(getUrlFromCriterias({})).toBe('');
expect(getUrlFromCriterias({ key1: 'value-key1' })).toBe(
'?key1=value-key1',
);
expect(getUrlFromCriterias({ key1: undefined })).toBe('');
expect(
getUrlFromCriterias({ key1: 'value-key1', key2: 'value-key2' }),
).toBe('?key1=value-key1&key2=value-key2');
expect(getUrlFromCriterias({ key1: 'value-key1', key2: undefined })).toBe(
'?key1=value-key1',
);
});
test('storeToArray', () => {
expect(storeToArray()).toEqual([]);
});
test('verifyVariable', () => {
const label = 'Value0: $Value1 $Value2 $Value3$ Value4';
expect(verifyVariable(label)).toBe('Value0: $Value1$ $Value2$ $Value3$ Value4');
});
});
| Add test for function verifyVariable | Add test for function verifyVariable
| JavaScript | mit | InseeFr/Pogues,InseeFr/Pogues,InseeFr/Pogues | ---
+++
@@ -1,4 +1,4 @@
-import { getUrlFromCriterias, storeToArray } from './utils';
+import { getUrlFromCriterias, storeToArray, verifyVariable } from './utils';
describe('Utils', () => {
test('getUrlFromCriterias', () => {
@@ -18,4 +18,10 @@
test('storeToArray', () => {
expect(storeToArray()).toEqual([]);
});
+
+ test('verifyVariable', () => {
+ const label = 'Value0: $Value1 $Value2 $Value3$ Value4';
+ expect(verifyVariable(label)).toBe('Value0: $Value1$ $Value2$ $Value3$ Value4');
+ });
+
}); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.