commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
6113b3bf024e578bb920713470c94d5e9853c684 | src/app/utils/notification/NotificationProviderLibNotify.js | src/app/utils/notification/NotificationProviderLibNotify.js | import NotificationProvider from "./NotificationProvider";
import LibNotify from "node-notifier/notifiers/notifysend";
import which from "utils/node/fs/which";
import UTIL from "util";
function NotificationProviderLibNotify() {
this.provider = new LibNotify();
}
UTIL.inherits( NotificationProviderLibNotify, Notific... | import NotificationProvider from "./NotificationProvider";
import LibNotify from "node-notifier/notifiers/notifysend";
import which from "utils/node/fs/which";
import UTIL from "util";
function NotificationProviderLibNotify() {
this.provider = new LibNotify({
// don't run `which notify-send` twice
suppressOsdChe... | Disable node-notifier's which call of notify-send | Disable node-notifier's which call of notify-send
| JavaScript | mit | chhe/livestreamer-twitch-gui,bastimeyer/livestreamer-twitch-gui,streamlink/streamlink-twitch-gui,streamlink/streamlink-twitch-gui,bastimeyer/livestreamer-twitch-gui,bastimeyer/livestreamer-twitch-gui,chhe/livestreamer-twitch-gui,streamlink/streamlink-twitch-gui,chhe/livestreamer-twitch-gui |
4b5965328d8dc4388793fd7dfbbc0df3b5d9ca73 | grunt.js | grunt.js | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
test: {
files: ['test/**/*.js']
},
lint: {
files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js']
},
watch: {
files: '<config:lint.files>',
tasks: 'default'
},... | 'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
test: {
files: ['test/**/*.js']
},
lint: {
files: ['lib/**/*.js', 'test/**/*.coffee']
},
watch: {
files: ['<config:coffee.app.src>', 'src/**/*.jade'],
... | Set up for compilation from src to lib | Set up for compilation from src to lib
| JavaScript | mit | ddubyah/thumblr |
605e59e704422fd780fa23a757a17225c8400255 | index.js | index.js | connect = require('connect');
serveServer = require('serve-static');
jade = require("./lib/processor/jade.js");
function miniharp(root) {
//console.log(root);
var app = connect()
.use(serveServer(root))
.use(jade(root));
return app;
};
module.exports = miniharp; | connect = require('connect');
serveServer = require('serve-static');
jade = require("./lib/processor/jade.js");
less = require("./lib/processor/less.js");
function miniharp(root) {
//console.log(root);
var app = connect()
.use(serveServer(root))
.use(jade(root))
.use(less(root));
return app;
};
modu... | Add less preprocessor to the mini-harp app | Add less preprocessor to the mini-harp app
| JavaScript | mit | escray/besike-nodejs-harp,escray/besike-nodejs-harp |
75e55d7bd009fcc0bd670c592a34319c8b2655ed | index.js | index.js | 'use strict';
var got = require('got');
var cheerio = require('cheerio');
var md = require('html-md');
module.exports = function(id, callback) {
var url = 'http://www.stm.dk/_p_' + id + '.html';
got(url, function(err, data){
var $ = cheerio.load(data);
var meta = $('meta[name="created"]');
var speec... | 'use strict';
var got = require('got');
var cheerio = require('cheerio');
var md = require('html-md');
module.exports = function(id, callback) {
var url = 'http://www.stm.dk/_p_' + id + '.html';
got(url, function(err, data){
var $ = cheerio.load(data);
var meta = $('meta[name="created"]');
var speec... | Add image property to callback data | Add image property to callback data
| JavaScript | mit | matiassingers/statsministeriet-speeches-scraper |
3a89935c293c8133ad9dd48c0be01949083a9c4a | client/js/libs/handlebars/colorClass.js | client/js/libs/handlebars/colorClass.js | "use strict";
// Generates a string from "color-1" to "color-32" based on an input string
module.exports = function(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
hash += str.charCodeAt(i);
}
return "color-" + (1 + hash % 32);
};
| "use strict";
// Generates a string from "color-1" to "color-32" based on an input string
module.exports = function(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
hash += str.charCodeAt(i);
}
/*
Modulo 32 lets us be case insensitive for ascii
due to A being ascii 65 (100 0001)
while a being... | Add reminder that ascii is awesome. | Add reminder that ascii is awesome.
| JavaScript | mit | thelounge/lounge,MaxLeiter/lounge,realies/lounge,realies/lounge,williamboman/lounge,ScoutLink/lounge,williamboman/lounge,thelounge/lounge,FryDay/lounge,MaxLeiter/lounge,realies/lounge,FryDay/lounge,ScoutLink/lounge,ScoutLink/lounge,MaxLeiter/lounge,williamboman/lounge,FryDay/lounge |
854e8f71d40d7d2a077a208f3f6f33f9a0dc23f4 | index.js | index.js | // http://stackoverflow.com/questions/11935175/sampling-a-random-subset-from-an-array
var featureCollection = require('turf-featurecollection');
/**
* Takes a {@link FeatureCollection} and returns a FeatureCollection with given number of {@link Feature|features} at random.
*
* @module turf/sample
* @category data
... | // http://stackoverflow.com/questions/11935175/sampling-a-random-subset-from-an-array
var featureCollection = require('turf-featurecollection');
/**
* Takes a {@link FeatureCollection} and returns a FeatureCollection with given number of {@link Feature|features} at random.
*
* @module turf/sample
* @category data
... | Switch doc to closure compiler templating | Switch doc to closure compiler templating
| JavaScript | mit | Turfjs/turf-sample |
024de1e7eff4e4f688266d14abfe0dbcaedf407e | index.js | index.js | require('./env');
var http = require('http');
var koa = require('koa');
var app = koa();
app.use(require('koa-bodyparser')());
app.use(function *(next) {
if (typeof this.request.body === 'undefined' || this.request.body === null) {
this.request.body = {};
}
yield next;
});
app.use(require('koa-views')('view... | require('./env');
var mount = require('koa-mount');
var koa = require('koa');
var app = koa();
app.use(require('koa-bodyparser')());
app.use(function *(next) {
if (typeof this.request.body === 'undefined' || this.request.body === null) {
this.request.body = {};
}
yield next;
});
app.use(mount('/build', requ... | Use koa-static to serve static files | Use koa-static to serve static files
| JavaScript | mit | luin/doclab,luin/doclab |
3b9847a61da0b294ddfee133cda962fa393f914d | client/components/Reaction.js | client/components/Reaction.js | import React, {Component} from 'react'
import './Reaction.sass'
class Reaction extends Component {
constructor() {
super();
this.state = { React: false };
}
componentDidMount() {
var thiz = this;
setTimeout(function () {
thiz.setState({ React: true });
}, Math.random()*5000);
}
r... | import React, {Component} from 'react'
import './Reaction.sass'
class Reaction extends Component {
constructor() {
super();
this.state = { React: false };
}
componentDidMount() {
var thiz = this;
setTimeout(function () {
thiz.setState({ React: true });
}, Math.random()*5000);
}
get... | Add OnClick and Onload for reaction and create times | Add OnClick and Onload for reaction and create times
| JavaScript | mit | Jeffrey-Meesters/React-Shoot,Jeffrey-Meesters/React-Shoot |
59d6f506b93982816e2f98a76b361b2a9ebd57ac | index.js | index.js | 'use strict';
require('./patch/functionName');
(function (window, document, undefined) {
var oldMappy = window.Mappy
var Mappy = require('./lib/main')
//Node style module export
if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = Mappy;
}
/**
* Resets the window.Mappy variabl... | 'use strict';
(function (window, document, undefined) {
var oldMappy = window.Mappy
var Mappy = require('./lib/main')
//Node style module export
if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = Mappy;
}
/**
* Resets the window.Mappy variable to its original state and return... | Remove function constructor name patch | Remove function constructor name patch
| JavaScript | mit | mediasuitenz/mappy,mediasuitenz/mappy |
65bb0ff4fce04e58febe70936adf503d432f9d41 | index.js | index.js | #!/usr/bin/env node
var program = require('commander');
var userArgs = process.argv.splice(2);
var message = userArgs.join(' ');
if (message.length > 140) {
console.log('Message was too long. Can only be 140 characters. It was: ', message.length);
process.exit(1);
}
console.log(message);
| #!/usr/bin/env node
var program = require('commander');
var userArgs = process.argv.splice(2);
var message = userArgs.join(' ');
var confluenceUrl = process.env.CONFLUENCE_URL
if (message.length > 140) {
console.log('Message was too long. Can only be 140 characters. It was: ', message.length);
process.exit(1);
}
... | Read confluence url from env | Read confluence url from env
| JavaScript | mit | tylerpeterson/confluence-user-status |
6ec2bff81999a815fe44f1ddf3a02c9edc46829c | index.js | index.js | /*
* gaze
* https://github.com/shama/gaze
*
* Copyright (c) 2014 Kyle Robinson Young
* Licensed under the MIT license.
*/
try {
// Attempt to resolve optional pathwatcher
require('bindings')('pathwatcher.node');
var version = process.versions.node.split('.');
module.exports = (version[0] === '0' && versi... | /*
* gaze
* https://github.com/shama/gaze
*
* Copyright (c) 2014 Kyle Robinson Young
* Licensed under the MIT license.
*/
// If on node v0.8, serve gaze04
var version = process.versions.node.split('.');
if (version[0] === '0' && version[1] === '8') {
module.exports = require('./lib/gaze04.js');
} else {
try ... | Determine whether pathwatcher built without running it. Ref GH-98. | Determine whether pathwatcher built without running it. Ref GH-98.
| JavaScript | mit | bevacqua/gaze,modulexcite/gaze,bevacqua/gaze,prodatakey/gaze,modulexcite/gaze,bevacqua/gaze,prodatakey/gaze,modulexcite/gaze,prodatakey/gaze |
0d0bc8deee992e72d593ec6e4f2cb038eff22614 | index.js | index.js | var httpProxy = require('http-proxy');
var http = require('http');
var CORS_HEADERS = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'HEAD, POST, GET, PUT, PATCH, DELETE',
'Access-Control-Max-Age': '86400',
'Access-Control-Allow-Headers': "X-Requested-With, X-HTTP-Method-Override, Conten... | var httpProxy = require('http-proxy');
var http = require('http');
var CORS_HEADERS = {
'access-control-allow-origin': '*',
'access-control-allow-methods': 'HEAD, POST, GET, PUT, PATCH, DELETE',
'access-control-max-age': '86400',
'access-control-allow-headers': "X-Requested-With, X-HTTP-Method-Override, Conten... | Fix CORS handling for POST and DELETE | Fix CORS handling for POST and DELETE
| JavaScript | mpl-2.0 | yourcelf/gspreadsheets-cors-proxy |
c722da297169e89fc6d79860c2c305dc3b4a1c60 | index.js | index.js | 'use strict'
var path = require('path')
module.exports = function (file) {
var segments = file.split(path.sep)
var index = segments.lastIndexOf('node_modules')
if (index === -1) return
if (!segments[index + 1]) return
var scoped = segments[index + 1].indexOf('@') === 0
var name = scoped ? segments[index +... | 'use strict'
var path = require('path')
module.exports = function (file) {
var segments = file.split(path.sep)
var index = segments.lastIndexOf('node_modules')
if (index === -1) return
if (!segments[index + 1]) return
var scoped = segments[index + 1][0] === '@'
var name = scoped ? segments[index + 1] + '/... | Improve speed of detection of scoped packages | Improve speed of detection of scoped packages
| JavaScript | mit | watson/module-details-from-path |
66de12f38c0d0021dad895070e9b823d99d433e4 | index.js | index.js | 'use strict';
const YQL = require('yql');
const _ = require('lodash');
module.exports = (opts, callback) => {
opts = opts || [];
let query;
if (_.isEmpty(opts)) {
query = new YQL('select * from weather.forecast where woeid in (select woeid from geo.places(1) where text="Dhaka, Bangladesh")');
} else {
query... | 'use strict';
const axios = require('axios');
const API_URL = 'https://micro-weather.now.sh';
module.exports = (opts) => {
let city = opts[0] || 'Dhaka';
let country = opts[1] || 'Bangladesh';
return axios.get(`${API_URL}?city=${city}&country=${country}`);
};
| Refactor main weather module to use API | Refactor main weather module to use API
Signed-off-by: Riyadh Al Nur <d7e60315016355bdcd32d48dde148183e3d8bb86@verticalaxisbd.com>
| JavaScript | mit | riyadhalnur/weather-cli |
69a1ac6f09fef4f7954677a005ebfe32235ed5cd | index.js | index.js | import React from 'react';
import Match from 'react-router/Match';
import Miss from 'react-router/Miss';
import Users from './Users';
class UsersRouting extends React.Component {
NoMatch() {
return <div>
<h2>Uh-oh!</h2>
<p>How did you get to <tt>{this.props.location.pathname}</tt>?</p>
</div>
}... | import React from 'react';
import Match from 'react-router/Match';
import Miss from 'react-router/Miss';
import Users from './Users';
class UsersRouting extends React.Component {
constructor(props){
super(props);
this.connectedUsers = props.connect(Users);
}
NoMatch() {
return <div>
<h2>Uh-oh!... | Call connect() on the Users component only once, and cache the result. This seems to fix STRIPES-97 at last! | Call connect() on the Users component only once, and cache the result. This seems to fix STRIPES-97 at last!
| JavaScript | apache-2.0 | folio-org/ui-users,folio-org/ui-users |
9a7bada461b9c2096b282952333eb6869aa613cb | index.js | index.js | /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-ui-sortable',
included: function(app) {
app.import(app.bowerDirectory + '/jquery-ui/ui/version.js');
app.import(app.bowerDirectory + '/jquery-ui/ui/data.js');
app.import(app.bowerDirectory + '/jquery-ui/ui/ie.js');
app.import(ap... | /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-ui-sortable',
included: function(app) {
app.import(app.bowerDirectory + '/jquery-ui/ui/version.js');
app.import(app.bowerDirectory + '/jquery-ui/ui/data.js');
app.import(app.bowerDirectory + '/jquery-ui/ui/ie.js');
app.import(ap... | Update dependencies to be an exact copy of jquery-ui's custom download option | Update dependencies to be an exact copy of jquery-ui's custom download option
| JavaScript | mit | 12StarsMedia/ember-ui-sortable,12StarsMedia/ember-ui-sortable |
3c660bb65805957ef71481c97277c0093cae856a | tests/integration/lambda-invoke/lambdaInvokeHandler.js | tests/integration/lambda-invoke/lambdaInvokeHandler.js | 'use strict'
const { config, Lambda } = require('aws-sdk')
const { stringify } = JSON
config.update({
accessKeyId: 'ABC',
secretAccessKey: 'SECRET',
})
const lambda = new Lambda({
apiVersion: '2015-03-31',
endpoint: 'http://localhost:3000',
})
exports.noPayload = async function noPayload() {
const params... | 'use strict'
const { config, Lambda } = require('aws-sdk')
const { stringify } = JSON
config.update({
accessKeyId: 'ABC',
secretAccessKey: 'SECRET',
})
const lambda = new Lambda({
apiVersion: '2015-03-31',
endpoint: 'http://localhost:3000',
})
exports.noPayload = async function noPayload() {
const params... | Fix lambda invoke with no payload | Fix lambda invoke with no payload
| JavaScript | mit | dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline |
9a38407db4740cb027f40cf2dbd7c4fbf3996816 | test/e2e/view-offender-manager-overview.js | test/e2e/view-offender-manager-overview.js | const expect = require('chai').expect
const dataHelper = require('../helpers/data/aggregated-data-helper')
var workloadOwnerId
var workloadOwnerGrade
describe('View overview', function () {
before(function () {
return dataHelper.selectIdsForWorkloadOwner()
.then(function (results) {
var workloadO... | const expect = require('chai').expect
const dataHelper = require('../helpers/data/aggregated-data-helper')
var workloadOwnerId
var workloadOwnerGrade
describe('View overview', function () {
before(function () {
return dataHelper.selectIdsForWorkloadOwner()
.then(function (results) {
var workloadO... | Use the first workload owner id in e2e test | Use the first workload owner id in e2e test
| JavaScript | mit | ministryofjustice/wmt-web,ministryofjustice/wmt-web |
798f0a318578df8f91744accf1ec1a55310ee6ef | docs/ember-cli-build.js | docs/ember-cli-build.js | /*jshint node:true*/
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you ... | /*jshint node:true*/
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
fingerprint: {
prepend: '/Julz.jl/'
}
});
// Use `app.import` to add additional libraries to the generated
// out... | Prepend ember fingerprints with Julz.jl path | Prepend ember fingerprints with Julz.jl path | JavaScript | mit | djsegal/julz,djsegal/julz |
b1d90a138b7d285c0764d930b5b430b4e49ac2b0 | milliseconds-to-iso-8601-duration.js | milliseconds-to-iso-8601-duration.js | (function (millisecondsToISO8601Duration) {
'use strict';
millisecondsToISO8601Duration.iso8601duration = function(milliseconds) {
var offset = Math.floor(milliseconds);
var milliseconds = offset % 1000;
offset = Math.floor(offset / 1000);
var seconds = offset % 60;
offset = Math.floor(offset / 60);
var ... | (function (millisecondsToISO8601Duration) {
'use strict';
millisecondsToISO8601Duration.iso8601duration = function(milliseconds) {
var offset = Math.floor(milliseconds);
var milliseconds = offset % 1000;
offset = Math.floor(offset / 1000);
var seconds = offset % 60;
offset = Math.floor(offset / 60);
var ... | Handle zero-padding for millisecond component | Handle zero-padding for millisecond component
Fixes tests for 1 and 12 milliseconds.
| JavaScript | mit | wking/milliseconds-to-iso-8601-duration,wking/milliseconds-to-iso-8601-duration |
955e8af495b9e43585fd088c8ed21fa92fb6307b | imports/api/events.js | imports/api/events.js | import { Mongo } from 'meteor/mongo';
export const Events = new Mongo.Collection('events');
| import { Mongo } from 'meteor/mongo';
import { ValidatedMethod } from 'meteor/mdg:validated-method';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
export const Events = new Mongo.Collection('events');
Events.deny({
insert() {
return true;
},
update() {
return true;
},
remove() {
re... | Add method to create an event | Add method to create an event
| JavaScript | mit | f-martinez11/ActiveU,f-martinez11/ActiveU |
c335e4816d0d7037dc2d9ea3fb02005612e16d9a | rollup.config.js | rollup.config.js | import uglify from "rollup-plugin-uglify"
export default {
plugins: [
uglify()
]
}
| import uglify from "rollup-plugin-uglify"
export default {
plugins: [
uglify({
compress: {
collapse_vars: true,
pure_funcs: ["Object.defineProperty"]
}
})
]
}
| Optimize uglifyjs's output via options. | Optimize uglifyjs's output via options.
| JavaScript | mit | jbucaran/hyperapp,hyperapp/hyperapp,hyperapp/hyperapp |
fd9b4b9c8f7196269f84a77522bf3fd90ee360ff | www/js/load-ionic.js | www/js/load-ionic.js | (function () {
var options = (function () {
// Holy shit
var optionsArray = location.href.split('?')[1].split('#')[0].split('=')
var result = {}
optionsArray.forEach(function (value, index) {
// 0 is a property name and 1 the value of 0
if (index % 2 === 1) {
return
}
... | (function () {
var options = (function () {
// Holy shit
var optionsArray
var result = {}
try {
optionsArray = location.href.split('?')[1].split('#')[0].split('=')
} catch (e) {
return {}
}
optionsArray.forEach(function (value, index) {
// 0 is a property name and 1 th... | Fix error `cannot read split of undefined` | Fix error `cannot read split of undefined`
| JavaScript | mit | IonicBrazil/ionic-garden,Jandersoft/ionic-garden,IonicBrazil/ionic-garden,Jandersoft/ionic-garden |
7571f2b5b4ecca329cf508ef07dd113e6dbe53fc | resources/assets/js/bootstrap.js | resources/assets/js/bootstrap.js |
window._ = require('lodash');
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/
window.$ = window.jQuery = require('jquery');
require('boot... |
window._ = require('lodash');
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/
window.$ = window.jQuery = require('jquery');
require('boot... | Use module name instead of path | Use module name instead of path | JavaScript | apache-2.0 | zhiyicx/thinksns-plus,beautifultable/phpwind,cbnuke/FilesCollection,orckid-lab/dashboard,zeropingheroes/lanyard,slimkit/thinksns-plus,tinywitch/laravel,hackel/laravel,cbnuke/FilesCollection,zhiyicx/thinksns-plus,zeropingheroes/lanyard,remxcode/laravel-base,hackel/laravel,orckid-lab/dashboard,beautifultable/phpwind,zero... |
b26c2afa7c54ead6d5c3ed608bc45a31e9d51e0f | addon/components/scroll-to-here.js | addon/components/scroll-to-here.js | import Ember from 'ember';
import layout from '../templates/components/scroll-to-here';
export default Ember.Component.extend({
layout: layout
});
| import Ember from 'ember';
import layout from '../templates/components/scroll-to-here';
let $ = Ember.$;
function Window() {
let w = $(window);
this.top = w.scrollTop();
this.bottom = this.top + (w.prop('innerHeight') || w.height());
}
function Target(selector) {
let target = $(selector);
this.isEmpty = ... | Add scroll to here logic | Add scroll to here logic
| JavaScript | mit | ember-montevideo/ember-cli-scroll-to-here,ember-montevideo/ember-cli-scroll-to-here |
e5350251a99d92dc75c3db04674ed6044029f920 | addon/initializers/simple-token.js | addon/initializers/simple-token.js | import TokenAuthenticator from '../authenticators/token';
export function initialize(application) {
application.register('authenticator:token', TokenAuthenticator);
}
export default {
name: 'simple-token',
initialize
};
| import TokenAuthenticator from '../authenticators/token';
import TokenAuthorizer from '../authorizers/token';
export function initialize(application) {
application.register('authenticator:token', TokenAuthenticator);
application.register('authorizer:token', TokenAuthorizer);
}
export default {
name: 'simple-tok... | Fix authorizer missing from container | Fix authorizer missing from container
Using routes with authorization was failing because the container didn't
contain a definition for the factory. Adding the authorizer in the
initialization fixes this.
Fixes issue #6
| JavaScript | mit | datajohnny/ember-simple-token,datajohnny/ember-simple-token |
6ba02cc85b13ddd89ef7a787feee9398dff24c68 | scripts/start.js | scripts/start.js | // This script is used to serve the built files in production and proxy api requests to the service.
// Would be preferrable to replace with apache.
const express = require('express');
const proxy = require('express-http-proxy');
const compression = require('compression');
const path = require('path');
const app = ex... | // This script is used to serve the built files in production and proxy api requests to the service.
// Would be preferrable to replace with apache.
const express = require('express');
const proxy = require('express-http-proxy');
const compression = require('compression');
const path = require('path');
const app = ex... | Remove acme challenge and enable forcing https | Remove acme challenge and enable forcing https
| JavaScript | mit | TulevaEE/onboarding-client,TulevaEE/onboarding-client,TulevaEE/onboarding-client |
0095363683a71a75de3da3470fc65fe4aa7da5ab | src/client/js/controllers/plusMin.js | src/client/js/controllers/plusMin.js | import app from '../app';
import '../services/PlusMinClient';
app.controller('plusMinController', function ($element, $scope, $http, PlusMinClient) {
let client = PlusMinClient;
$scope.state = 'loading';
$scope.toState = function (state) {
$scope.state = state;
};
$scope.openList = function (list) {
... | import app from '../app';
import '../services/PlusMinClient';
app.controller('plusMinController', function ($element, $scope, $http, PlusMinClient) {
let client = PlusMinClient;
$scope.state = 'loading';
$scope.toState = function (state) {
$scope.state = state;
};
$scope.openList = function (list) {
... | Add list editor and list selector | Add list editor and list selector
| JavaScript | mit | LuudJanssen/plus-min-list,LuudJanssen/plus-min-list,LuudJanssen/plus-min-list |
1adbfa5376dc39faacbc4993a64c599409aadff4 | static/js/order_hardware_software.js | static/js/order_hardware_software.js | $(document).ready(function () {
if (!id_category_0.checked && !id_category_1.checked){
$("#id_institution").parents('.row').hide();
$("#id_department").parents('.row').hide();
}
$("#id_category_0").click(function () {
$("#id_institution").parents('.row').show();
$("#id_depart... | $(document).ready(function () {
if (!id_category_0.checked && !id_category_1.checked){
$("#id_institution").parents('.row').hide();
$("#id_department").parents('.row').hide();
}
$("#id_category_0").click(function () {
$("#id_institution").parents('.row').show();
$("#id_depart... | Hide fields if "Consumption items" is selected | Hide fields if "Consumption items" is selected
| JavaScript | mpl-2.0 | neuromat/nira,neuromat/nira,neuromat/nira |
17f3f1fb9967f3db50d0997d7be480726aaf0219 | server/models/user.js | server/models/user.js | module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull:... | module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull:... | Edit model associations using new syntax | Edit model associations using new syntax
| JavaScript | mit | 3m3kalionel/PostIt,3m3kalionel/PostIt |
4d9a9d30326bda7d88b4877a9e75c94949df79ca | plugins/kalabox-core/events.js | plugins/kalabox-core/events.js | 'use strict';
module.exports = function(kbox) {
var events = kbox.core.events;
var deps = kbox.core.deps;
var envs = [];
// EVENT: pre-engine-create
events.on('pre-engine-create', function(createOptions, done) {
var codeRoot = deps.lookup('globalConfig').codeDir;
var kboxCode = 'KBOX_CODEDIR=' + co... | 'use strict';
var _ = require('lodash');
module.exports = function(kbox) {
var events = kbox.core.events;
var deps = kbox.core.deps;
// EVENT: pre-engine-create
events.on('pre-engine-create', function(createOptions, done) {
var envs = [];
var codeRoot = deps.lookup('globalConfig').codeDir;
var k... | Fix some ENV add bugs | Fix some ENV add bugs
| JavaScript | mit | kalabox/kalabox-cli,rabellamy/kalabox,ManatiCR/kalabox,RobLoach/kalabox,RobLoach/kalabox,ari-gold/kalabox,rabellamy/kalabox,oneorangecat/kalabox,ManatiCR/kalabox,oneorangecat/kalabox,ari-gold/kalabox,kalabox/kalabox-cli |
cd841f91370e770e73992e3bf8cd0930c4fa4e82 | assets/javascript/head.scripts.js | assets/javascript/head.scripts.js | /**
* head.script.js
*
* Essential scripts, to be loaded in the head of the document
* Use gruntfile.js to include the necessary script files.
*/
// Load respimage if <picture> element is not supported
if(!window.HTMLPictureElement){
enhance.loadJS('/assets/javascript/lib/polyfills/respimage.min.js');
}
| /**
* head.script.js
*
* Essential scripts, to be loaded in the head of the document
* Use gruntfile.js to include the necessary script files.
*/
// Load respimage if <picture> element is not supported
if(!window.HTMLPictureElement) {
document.createElement('picture');
enhance.loadJS('/assets/javascript/lib/pol... | Create hidden picture element when respimage is loaded. | Create hidden picture element when respimage is loaded.
Seen in this example: https://github.com/fabianmichael/kirby-imageset#23-template-setup.
| JavaScript | mit | jolantis/artlantis,jolantis/artlantis |
7292d5c3db9d8a274567735d6bde06e8dcbd2b7b | src/clincoded/static/libs/render_variant_title.js | src/clincoded/static/libs/render_variant_title.js | 'use strict';
import React from 'react';
/**
* Method to display the title of a variant.
* 1st option is the ClinVar Preferred Title if it's present.
* 2nd alternative is a string constructed with the canonical transcript, gene symbol and protein change.
* The fallback is the GRCh38 NC_ HGVS name.
* @param {objec... | 'use strict';
import React from 'react';
/**
* Method to display the title of a variant.
* 1st option is the ClinVar Preferred Title if it's present.
* 2nd alternative is a string constructed with the canonical transcript, gene symbol and protein change.
* The fallback is the GRCh38 NC_ HGVS name.
* @param {objec... | Add option to only return a string instead of JSX | Add option to only return a string instead of JSX
| JavaScript | mit | ClinGen/clincoded,ClinGen/clincoded,ClinGen/clincoded,ClinGen/clincoded,ClinGen/clincoded |
cbec0d253d7b451cb5584329b21900dbbce7ab19 | src/components/common/SourceOrCollectionWidget.js | src/components/common/SourceOrCollectionWidget.js | import PropTypes from 'prop-types';
import React from 'react';
import { Col } from 'react-flexbox-grid/lib';
import { DeleteButton } from './IconButton';
const SourceOrCollectionWidget = (props) => {
const { object, onDelete, onClick, children } = props;
const isCollection = object.tags_id !== undefined;
const ... | import PropTypes from 'prop-types';
import React from 'react';
import { Col } from 'react-flexbox-grid/lib';
import { DeleteButton } from './IconButton';
const SourceOrCollectionWidget = (props) => {
const { object, onDelete, onClick, children } = props;
const isCollection = object.tags_id !== undefined;
const ... | Handle list of media/collections that aren't clickable | Handle list of media/collections that aren't clickable
| JavaScript | apache-2.0 | mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools |
89b7985d0b21fe006d54f613ea7dc6625d5525f5 | src/server/modules/counter/subscriptions_setup.js | src/server/modules/counter/subscriptions_setup.js | export default {
countUpdated: () => ({
// Run the query each time count updated
countUpdated: () => true
})
};
| export default {
countUpdated: () => ({
// Run the query each time count updated
countUpdated: {
filter: () => {
return true;
}
}
})
};
| Fix Counter subscription filter definition | Fix Counter subscription filter definition
| JavaScript | mit | sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit,sysgears/apollo-universal-starter-kit |
aaf220bd9c37755bcf3082098c3df96d7a197001 | webpack/webpack.config.base.babel.js | webpack/webpack.config.base.babel.js | import path from 'path';
const projectRoot = path.join(__dirname, '..');
export default {
cache: true,
entry: [
path.join(projectRoot, 'src', 'hibp.js'),
],
output: {
library: 'hibp',
libraryTarget: 'umd',
path: path.join(projectRoot, 'dist'),
},
module: {
rules: [
{
test... | import path from 'path';
const projectRoot = path.join(__dirname, '..');
export default {
cache: true,
entry: [
path.join(projectRoot, 'src', 'hibp.js'),
],
output: {
library: 'hibp',
libraryTarget: 'umd',
umdNamedDefine: true,
path: path.join(projectRoot, 'dist'),
},
module: {
rul... | Set the AMD module name in the UMD build | Set the AMD module name in the UMD build
| JavaScript | mit | wKovacs64/hibp,wKovacs64/hibp,wKovacs64/hibp |
3b9cebffb70d2fc08b8cf48f86ceb27b42d8d9b4 | migrations/20131122023554-make-user-table.js | migrations/20131122023554-make-user-table.js | var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('users', {
columns: {
id: { type: 'int', primaryKey: true, autoIncrement: true },
firstName: { type: 'string', notNull: true},
lastName: { type: 'string', notNull: true},
... | var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('users', {
columns: {
id: { type: 'int', primaryKey: true, autoIncrement: true },
firstName: { type: 'string', notNull: true},
lastName: { type: 'string', notNull: true},
... | Call user migrate down callback | Call user migrate down callback
| JavaScript | bsd-3-clause | t3mpus/tempus-api |
aa35d4f0801549420ae01f0be3c9dececaa6c345 | core/devMenu.js | core/devMenu.js | "use strict";
const electron = require("electron");
const {app} = electron;
const {Menu} = electron;
const {BrowserWindow} = electron;
module.exports.setDevMenu = function () {
var devMenu = Menu.buildFromTemplate([{
label: "Development",
submenu: [{
label: "Reload",
accele... | "use strict";
const electron = require("electron");
const {app} = electron;
const {Menu} = electron;
const {BrowserWindow} = electron;
module.exports.setDevMenu = function () {
var devMenu = Menu.buildFromTemplate([{
label: "Development",
submenu: [{
label: "Reload",
accele... | Change development reload shortcut to F5 | Change development reload shortcut to F5
This prevents interference when using bash's Ctrl-R command
| JavaScript | mit | petschekr/Chocolate-Shell,petschekr/Chocolate-Shell |
0b54a083f4c1a3bdeb097fbf2462aa6d6bc484d5 | basis/jade/syntax_samples/index.js | basis/jade/syntax_samples/index.js | #!/usr/bin/env node
var assert = require('assert');
var jade = require('jade');
var source = [
'each v, i in list',
' div #{v},#{i}'
].join('\n');
var fn = jade.compile(source);
var html = fn({ list:['a', 'b', 'c'] });
assert.strictEqual(html, '<div>a,0</div><div>b,1</div><div>c,2</div>');
| #!/usr/bin/env node
var assert = require('assert');
var jade = require('jade');
var source = [
'each v, i in list',
' div #{v},#{i}'
].join('\n');
var fn = jade.compile(source);
var html = fn({ list:['a', 'b', 'c'] });
assert.strictEqual(html, '<div>a,0</div><div>b,1</div><div>c,2</div>');
// #{} と !{}
var sour... | Add a sample of jade | Add a sample of jade
| JavaScript | mit | kjirou/nodejs-codes |
e6de9cdbc7ee08097b041550fc1b1edd60a98619 | src/sanity/inputResolver/inputResolver.js | src/sanity/inputResolver/inputResolver.js | import array from 'role:@sanity/form-builder/input/array?'
import boolean from 'role:@sanity/form-builder/input/boolean?'
import date from 'role:@sanity/form-builder/input/date?'
import email from 'role:@sanity/form-builder/input/email?'
import geopoint from 'role:@sanity/form-builder/input/geopoint?'
import number fro... | import array from 'role:@sanity/form-builder/input/array?'
import boolean from 'role:@sanity/form-builder/input/boolean?'
import date from 'role:@sanity/form-builder/input/date?'
import email from 'role:@sanity/form-builder/input/email?'
import geopoint from 'role:@sanity/form-builder/input/geopoint?'
import number fro... | Split up vars for consistency with official Sanity terms | Split up vars for consistency with official Sanity terms
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
fed23fcd236419462e5e5ee8f71db0d88eedfbe3 | parseCloudCode/parse/cloud/main.js | parseCloudCode/parse/cloud/main.js |
// Use Parse.Cloud.define to define as many cloud functions as you want.
// For example:
Parse.Cloud.define("hello", function(request, response) {
response.success("Doms Cloud Code!");
});
|
// Use Parse.Cloud.define to define as many cloud functions as you want.
// For example:
Parse.Cloud.define("hello", function(request, response) {
console.log("hello5");
response.success("Doms Cloud Code");
});
//test function
Parse.Cloud.beforeSave("MatchScore", function(request, response) {
if (request.object.get... | Add user to the leaderboard | Add user to the leaderboard
adds the user to the bottom of the leaderboard in last place
| JavaScript | mit | Mccoy123/sotonSquashAppCloudCode,Mccoy123/sotonSquashAppCloudCode |
7dd2cfca7e87cd1d2d84c9685e1dbf4ad4c5a8a5 | packages/lingui-cli/src/lingui-add-locale.js | packages/lingui-cli/src/lingui-add-locale.js | const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const program = require('commander')
const getConfig = require('lingui-conf').default
const plurals = require('make-plural')
const config = getConfig()
program.parse(process.argv)
function validateLocales (locales) {
const unknown... | const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const program = require('commander')
const getConfig = require('lingui-conf').default
const plurals = require('make-plural')
const config = getConfig()
function validateLocales (locales) {
const unknown = locales.filter(locale => !... | Add help to add-locale command | fix: Add help to add-locale command
| JavaScript | mit | lingui/js-lingui,lingui/js-lingui |
ededc73fd74777d0d44b3d1613414fe3787a6c9f | lib/cartodb/middleware/allow-query-params.js | lib/cartodb/middleware/allow-query-params.js | module.exports = function allowQueryParams(params) {
return function allowQueryParamsMiddleware(req, res, next) {
req.context.allowedQueryParams = params;
next();
};
};
| module.exports = function allowQueryParams(params) {
if (!Array.isArray(params)) {
throw new Error('allowQueryParams must receive an Array of params');
}
return function allowQueryParamsMiddleware(req, res, next) {
req.context.allowedQueryParams = params;
next();
};
};
| Throw on invalid params argument | Throw on invalid params argument
| JavaScript | bsd-3-clause | CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb |
3fb83189ad65c6cd0ca13bf1e7ecfe41ca0eed8c | dev/amdDev.js | dev/amdDev.js | 'use strict';
require.config({
paths: {
raphael: '../raphael'
//you will need eve if you use the nodeps version
/*eve: '../bower_components/eve/eve'*/
}
});
require(['raphael'], function(Raphael) {
var paper = Raphael(0, 0, 640, 720, "container");
paper.circle(100, 100, 100); /... | 'use strict';
require.config({
paths: {
raphael: '../raphael'
//you will need eve if you use the nodeps version
/*eve: '../bower_components/eve/eve'*/
}
});
require(['raphael'], function(Raphael) {
var paper = Raphael(0, 0, 640, 720, "container");
paper.circle(100, 100, 100).at... | Add gradient to test page | Add gradient to test page
| JavaScript | mit | DmitryBaranovskiy/raphael,DmitryBaranovskiy/raphael,danielgindi/raphael,danielgindi/raphael |
83cd7781120c105b8eeffe3b957d6a5a1b365cdf | app/assets/javascripts/vivus/application.js | app/assets/javascripts/vivus/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | Fix the navigation generating js | Fix the navigation generating js
| JavaScript | mit | markcipolla/vivus,markcipolla/vivus,markcipolla/vivus |
7c326ab8b6cadbc12e01c98c5e0789cb12dc5969 | src/AppRouter.js | src/AppRouter.js | import React from 'react';
import {
Router,
Route,
hashHistory,
IndexRoute
} from 'react-router';
import App from './App';
import RecentTracks from './components/RecentTracks';
import TopArtists from './components/TopArtists';
let AppRouter = React.createClass ({
render() {
return (
<Router histor... | import React from 'react';
import {
Router,
Route,
browserHistory,
IndexRoute
} from 'react-router';
import App from './App';
import RecentTracks from './components/RecentTracks';
import TopArtists from './components/TopArtists';
let AppRouter = React.createClass ({
render() {
return (
<Router his... | Use browserHistory to get rid of url queries | Use browserHistory to get rid of url queries
| JavaScript | bsd-3-clause | jeromelachaud/Last.fm-Activities-React,jeromelachaud/Last.fm-Activities-React |
fa588af379d1f779ed501048e132b33241428bc6 | app/components/quantity-widget-component.js | app/components/quantity-widget-component.js |
var DEFAULT_MIN = 1;
var DEFAULT_MAX = 3;
App.QuantityWidgetComponent = Ember.Component.extend({
tagName: 'div',
classNameBindings: [ ':quantity-widget', 'isMin', 'isMax' ],
attributeBindings: [ 'name:data-icon' ],
actions: {
increment: function () {
if (this.get('isMax')) return;
this.set('... |
var DEFAULT_MIN = 1;
var DEFAULT_MAX = 3;
App.QuantityWidgetComponent = Ember.Component.extend({
tagName: 'div',
classNameBindings: [ ':quantity-widget', 'isMin', 'isMax' ],
attributeBindings: [ 'name:data-icon' ],
actions: {
increment: function () {
if (this.get('isMax')) return;
this.set('... | Update quantity widget tooltips per prototype | Update quantity widget tooltips per prototype
| JavaScript | mit | dollarshaveclub/ember-uni-form,dollarshaveclub/ember-uni-form |
ffc9c2475174ea4d87c7f389f77631f2c7cd9a35 | app/javascript/app/reducers/auth-reducer.js | app/javascript/app/reducers/auth-reducer.js | import {
AUTH_USER,
UNAUTH_USER,
AUTH_ERROR,
SET_USER_DATA,
SET_CREDIT_CARDS,
SET_DEFAULT_CARD
} from '../constants/';
const initialState = {
authenticated: false,
errors: null,
user: null,
creditCardDefault: null,
creditCards: null
};
const AuthReducer = (state=initialState, action) => {
swit... | import {
AUTH_USER,
UNAUTH_USER,
AUTH_ERROR,
SET_USER_DATA,
SET_CREDIT_CARDS,
SET_DEFAULT_CARD,
ADD_CREDIT_CARD
} from '../constants/';
const initialState = {
authenticated: false,
errors: null,
user: null,
creditCardDefault: null,
creditCards: null
};
const AuthReducer = (state=initialState, ... | Refactor auth reducer to handler the new auth-card actions | Refactor auth reducer to handler the new auth-card actions
| JavaScript | mit | GiancarlosIO/ecommerce-book-app,GiancarlosIO/ecommerce-book-app,GiancarlosIO/ecommerce-book-app |
dd9345272923cc723eede78af5fb61797237df13 | lib/buster-util.js | lib/buster-util.js | if (typeof buster == "undefined") {
var buster = {};
}
buster.util = (function () {
var toString = Object.prototype.toString;
var div = typeof document != "undefined" && document.createElement("div");
return {
isNode: function (obj) {
if (!div) {
return false;
... | if (typeof buster == "undefined") {
var buster = {};
}
buster.util = (function () {
var toString = Object.prototype.toString;
var div = typeof document != "undefined" && document.createElement("div");
return {
isNode: function (obj) {
if (!div) {
return false;
... | Fix keys implementation - Object.keys does not work on functions | Fix keys implementation - Object.keys does not work on functions
| JavaScript | bsd-3-clause | geddski/buster-core,busterjs/buster-core,busterjs/buster-core |
72d231edb93d2a9bf6ead440c9b46d6b35d70717 | seequmber/testResults/testResults.js | seequmber/testResults/testResults.js | 'use strict';
function TestResults(dataTable) {
var Cucumber = require('cucumber');
var TestResult = require('./testResult');
var maximums = [0, 0, 0, 0];
var testCollection = Cucumber.Type.Collection();
(function rowToTestResult() {
dataTable.getRows().syncForEach(function(row) {
... | 'use strict';
function TestResults(dataTable) {
var Cucumber = require('cucumber');
var TestResult = require('./testResult');
var maximums = [0, 0, 0, 0];
var testCollection = Cucumber.Type.Collection();
(function rowToTestResult() {
var rows = dataTable.getRows();
rows = rows.sor... | Sort test results according to version | Sort test results according to version
| JavaScript | mit | seeq12/seequcumber,seeq12/seequcumber,seeq12/seequcumber |
eff1b5b49924d1313470a645d00a2d5ddab2c735 | ember_modules/routes/tasks.js | ember_modules/routes/tasks.js | var route = Ember.Route.extend({
model: function() {
return this.store.all('task');
},
afterModel: function(tasks, transition) {
if (transition.targetName == "tasks.index") {
if($(document).width() > 700) {
Ember.run.next(this, function(){
var ... | var route = Ember.Route.extend({
model: function() {
return this.store.all('task');
},
afterModel: function(tasks, transition) {
if (transition.targetName == "tasks.index" || transition.targetName == "tasks") {
if($(document).width() > 700) {
Ember.run.next(this, ... | Check for multiple target routes for deciding when to transition. | Check for multiple target routes for deciding when to transition.
| JavaScript | agpl-3.0 | coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am |
14eaff77c0293e55005a30ae64b4bffeb16c9ce3 | src/client/components/Text.js | src/client/components/Text.js | import React from 'react'
import _ from 'lodash'
import fp from 'lodash/fp'
export default props => {
const { children: text } = props
const linkPattern = /([a-z]+:\/\/[^,\s]+)/g
const parts = fp.filter(s => s !== '')(text.split(linkPattern))
const textNodes = _.map(parts, (part, i) => {
if (linkPattern... | import React from 'react'
import _ from 'lodash'
import fp from 'lodash/fp'
export default props => {
const { children: text } = props
// Anything starting with one or more word characters followed by :// is considered a link.
const linkPattern = /(\w+:\/\/\S+)/g
const parts = fp.filter(s => s !== '')(text.s... | Simplify regex for finding links | Simplify regex for finding links
| JavaScript | mit | daGrevis/msks,daGrevis/msks,daGrevis/msks |
7893445133fc85c7305ffba75a34936624bf3ca5 | addon/components/object-list-view-input-cell.js | addon/components/object-list-view-input-cell.js | import BaseComponent from './flexberry-base';
export default BaseComponent.extend({
tagName: 'td',
classNames: [],
column: null,
record: null
});
| import BaseComponent from './flexberry-base';
export default BaseComponent.extend({
tagName: 'td',
classNames: [],
column: null,
record: null,
didInsertElement: function() {
var _this = this;
this.$('input').change(function() {
_this.record.set(_this.column.propName, _this.$(this).val());
... | Add support of two way binding | Add support of two way binding
in object-list-view-input-cell component
| JavaScript | mit | Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry |
a4311dc96f20b7f13275df7828c7c5a4b7b8dc52 | config.js | config.js | export default {
authToken: process.env.AUTH_TOKEN || 'secret',
env: process.env.NODE_ENV,
host: process.env.HOST || 'localhost',
github: {
apiUrl: 'https://api.github.com',
username: process.env.GITHUB_USERNAME || 'username'
},
mongo: {
url: process.env.MONGO_URL || 'mongodb://localhost:27017/F... | export default {
authToken: process.env.AUTH_TOKEN || 'secret',
env: process.env.NODE_ENV,
host: process.env.HOST || 'localhost',
github: {
apiUrl: 'https://api.github.com',
username: process.env.GITHUB_USERNAME || 'username'
},
jobs: {
frequency: {
githubActivity: process.env.JOBS_FREQUEN... | Add github activity job frequency option | Add github activity job frequency option
| JavaScript | mit | franvarney/franvarney-api |
d2cab051760db8de79c6b59b3e67f28b11fe6c35 | src/js/View.js | src/js/View.js | import '@webcomponents/webcomponentsjs';
class View extends HTMLElement {
static wrapped() {
const Cls = document.registerElement(this.name, this);
return (params) => Object.assign(new Cls(), params);
}
createdCallback() {
if (!this.constructor.html) {
return;
}... | import '@webcomponents/webcomponentsjs';
class View extends HTMLElement {
static wrapped() {
customElements.define(this.name, this);
return (params) => Object.assign(new this(), params);
}
constructor() {
super();
if (!this.constructor.html) {
return;
}... | Update to proper customElements spec | Update to proper customElements spec
| JavaScript | mit | HiFiSamurai/ui-toolkit,HiFiSamurai/ui-toolkit |
8dc281e7ddd4ec10f499cf19bb5743ebfa951179 | app/components/participant-checkbox.js | app/components/participant-checkbox.js | import Ember from 'ember';
import { task } from 'ember-concurrency';
export default Ember.Component.extend({
store: Ember.inject.service(),
flashMessages: Ember.inject.service(),
isDisabled: false,
isSelected: Ember.computed(
'member',
'participants.@each.member',
function(){
let mapped = thi... | import Ember from 'ember';
import { task } from 'ember-concurrency';
export default Ember.Component.extend({
store: Ember.inject.service(),
flashMessages: Ember.inject.service(),
isDisabled: false,
isSelected: Ember.computed(
'member',
'participants.@each.member',
function(){
let mapped = thi... | Fix double-no clicking on participants | Fix double-no clicking on participants
| JavaScript | bsd-2-clause | barberscore/barberscore-web,barberscore/barberscore-web,barberscore/barberscore-web |
c3943b7962770cf4e3379fa29eb6dcf9958d0297 | src/js/events/MarathonActions.js | src/js/events/MarathonActions.js | import ActionTypes from '../constants/ActionTypes';
var AppDispatcher = require('./AppDispatcher');
var Config = require('../config/Config');
var RequestUtil = require('../utils/RequestUtil');
module.exports = {
fetchApps: RequestUtil.debounceOnError(
Config.getRefreshRate(),
function (resolve, reject) {
... | import ActionTypes from '../constants/ActionTypes';
var AppDispatcher = require('./AppDispatcher');
var Config = require('../config/Config');
var RequestUtil = require('../utils/RequestUtil');
module.exports = {
fetchApps: RequestUtil.debounceOnError(
Config.getRefreshRate(),
function (resolve, reject) {
... | Change marathon endpoint to groups | Change marathon endpoint to groups
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
58ac6e0986e0123732a7eb85c12c151fac028f4a | src/js/bpm-counter.js | src/js/bpm-counter.js | class BpmCounter {
constructor() {
this.numTaps = 0;
this.bpm = 0;
this.startTapTime = new Date();
}
restart() {
this.numTaps = 0;
this.bpm = 0;
}
tick() {
if (this.numTaps === 0) {
this.startTapTime = new Date();
}
this.numTaps++;
let currentTime = new Date();
... | class BpmCounter {
constructor() {
this.numTaps = 0;
this.bpm = 0;
this.startTapTime = new Date();
}
restart() {
this.numTaps = 0;
this.bpm = 0;
}
tick() {
if (this.numTaps === 0) {
this.startTapTime = new Date();
}
this.numTaps++;
let currentTime = new Date();
... | Fix bug where the first tap gave a bpm of infinity | Fix bug where the first tap gave a bpm of infinity | JavaScript | mit | khwang/plum,khwang/plum |
53f0ff80ae2adea22fa7821bd78b57a4920e272c | webapp/display/changes/jobstep_details.js | webapp/display/changes/jobstep_details.js | import React, { PropTypes } from 'react';
import APINotLoaded from 'es6!display/not_loaded';
import ChangesUI from 'es6!display/changes/ui';
import * as api from 'es6!server/api';
import custom_content_hook from 'es6!utils/custom_content';
/*
* Shows artifacts for a jobstep
*/
export var JobstepDetails = React.cr... | import React, { PropTypes } from 'react';
import APINotLoaded from 'es6!display/not_loaded';
import ChangesUI from 'es6!display/changes/ui';
import * as api from 'es6!server/api';
import custom_content_hook from 'es6!utils/custom_content';
/*
* Shows artifacts for a jobstep
*/
export var JobstepDetails = React.cr... | Fix artifact display on job steps (which broke because the API changes to return an object rather than a list) | Fix artifact display on job steps (which broke because the API changes to return an object rather than a list)
Test Plan: manual =(
Reviewers: mkedia, kylec
Reviewed By: kylec
Subscribers: changesbot
Differential Revision: https://tails.corp.dropbox.com/D143542
| JavaScript | apache-2.0 | dropbox/changes,dropbox/changes,dropbox/changes,dropbox/changes |
4233edea9f06647e77033222f113392b44049f53 | Server.js | Server.js | const util = require('util');
const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
const request = require('./request');
class Server {
constructor(verbose) {
this.app = new Koa();
this.app.use(async (ctx, next) => {
try {
await next();
} catch (error) {
ctx... | const util = require('util');
const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
const request = require('./request');
class Server {
constructor(verbose) {
this.app = new Koa();
this.app.use(async (ctx, next) => {
try {
await next();
} catch (error) {
ctx... | Return HTTP 502 and error message if upstream server error. | Return HTTP 502 and error message if upstream server error.
| JavaScript | mit | quentinadam/node-request-server |
ab838c82bd48a01a99c152b2392518382d9181e3 | app/controllers/dashboard/session-manager/index.js | app/controllers/dashboard/session-manager/index.js | import Ember from 'ember';
export default Ember.Controller.extend({
sortProperties: [
'statusSort:asc',
'organizationKindSort:asc',
'nomen:asc',
],
sortedSessions: Ember.computed.sort(
'model',
'sortProperties'
),
actions: {
sortBy(sortProperties) {
this.set('sortProperties', [s... | import Ember from 'ember';
export default Ember.Controller.extend({
sortProperties: [
'statusSort:asc',
'organizationKindSort:asc',
'nomen:asc',
],
uniqueSessions: Ember.computed.uniq(
'model',
),
sortedSessions: Ember.computed.sort(
'uniqueSessions',
'sortProperties'
),
actions: ... | Fix duplicates on session manager | Fix duplicates on session manager
| JavaScript | bsd-2-clause | barberscore/barberscore-web,barberscore/barberscore-web,barberscore/barberscore-web |
566df4420093daf02422cbf344d49d0da089e583 | src/lib/fileUpload.js | src/lib/fileUpload.js | var ssh2 = require('ssh2');
var SocketIOFileUpload = require('socketio-file-upload');
var completeFileUpload = function(client, sshCredentials) {
return function(event) {
var credentials = sshCredentials(client.instance);
var connection = ssh2();
connection.on('end', function() {
});
connection... | var ssh2 = require('ssh2');
var SocketIOFileUpload = require('socketio-file-upload');
var completeFileUpload = function(client, sshCredentials) {
return function(event) {
var credentials = sshCredentials(client.instance);
var connection = ssh2();
connection.on('end', function() {
});
connection... | Fix bug with uploading octed data like images | Fix bug with uploading octed data like images
| JavaScript | mit | antonleykin/InteractiveShell,antonleykin/InteractiveShell,antonleykin/InteractiveShell,fhinkel/InteractiveShell,fhinkel/InteractiveShell,fhinkel/InteractiveShell,fhinkel/InteractiveShell |
4c5483125fcd12e111cffe1a1cadf67b8777ff7e | src/nbsp-positions.js | src/nbsp-positions.js | 'use strict';
var execall = require('regexp.execall');
module.exports = function (text) {
return execall(/ \w{1,2} [^ ]/g, text).map(function (match) {
return match.index + match[0].length - 2;
});
};
| 'use strict';
var execall = require('regexp.execall');
module.exports = function (text) {
return execall(/(^|\s\W*)(\w{1,2})(?= [^ ])/g, text)
.filter(function (match) {
return !/\d/.test(match[1]);
})
.map(function (match) {
return match.index + match[0].length;
});
};
| Improve regular expression's overlapping and details | Improve regular expression's overlapping and details
| JavaScript | mit | eush77/nbsp-advisor |
d64d4fd171002890c5bc3a5e2ea697e03b37c59d | src/dom_components/view/ToolbarButtonView.js | src/dom_components/view/ToolbarButtonView.js | var Backbone = require('backbone');
module.exports = Backbone.View.extend({
events() {
return (
this.model.get('events') || {
mousedown: 'handleClick'
}
);
},
attributes() {
return this.model.get('attributes');
},
initialize(opts) {
this.editor = opts.config.editor;
},... | var Backbone = require('backbone');
module.exports = Backbone.View.extend({
events() {
return (
this.model.get('events') || {
mousedown: 'handleClick'
}
);
},
attributes() {
return this.model.get('attributes');
},
initialize(opts) {
this.editor = opts.config.editor;
},... | Add the possibility to append `label` on component toolbar buttons | Add the possibility to append `label` on component toolbar buttons
| JavaScript | bsd-3-clause | QuorumDMS/grapesjs,artf/grapesjs,artf/grapesjs,QuorumDMS/grapesjs,artf/grapesjs |
5fee62511ed5e733d501e86ac8fe8e0516ba8a54 | src/util/maintenance/index.js | src/util/maintenance/index.js | const AssignedSchedule = require('../../structs/db/AssignedSchedule.js')
const pruneGuilds = require('./pruneGuilds.js')
const pruneFeeds = require('./pruneFeeds.js')
const pruneFormats = require('./pruneFormats.js')
const pruneFailCounters = require('./pruneFailCounters.js')
const pruneSubscribers = require('./pruneSu... | const AssignedSchedule = require('../../structs/db/AssignedSchedule.js')
const pruneGuilds = require('./pruneGuilds.js')
const pruneFeeds = require('./pruneFeeds.js')
const pruneFormats = require('./pruneFormats.js')
const pruneFailCounters = require('./pruneFailCounters.js')
const pruneSubscribers = require('./pruneSu... | Add missing funcs to util maintenance | Add missing funcs to util maintenance
| JavaScript | mit | synzen/Discord.RSS,synzen/Discord.RSS |
3de08c1740dac5c258d7291aba11f996c6e27c47 | bin/gh.js | bin/gh.js | #!/usr/bin/env node
/*
* Copyright 2013 Eduardo Lundgren, All Rights Reserved.
*
* Code licensed under the BSD License:
* https://github.com/eduardolundgren/blob/master/LICENSE.md
*
* @author Eduardo Lundgren <eduardolundgren@gmail.com>
*/
var async = require('async'),
fs = require('fs'),
nopt = require('nopt... | #!/usr/bin/env node
/*
* Copyright 2013 Eduardo Lundgren, All Rights Reserved.
*
* Code licensed under the BSD License:
* https://github.com/eduardolundgren/blob/master/LICENSE.md
*
* @author Eduardo Lundgren <eduardolundgren@gmail.com>
*/
var async = require('async'),
fs = require('fs'),
nopt = require('nopt... | Change constructor to receive (options, repo, branch) | Change constructor to receive (options, repo, branch)
| JavaScript | bsd-3-clause | tomzx/gh,TomzxForks/gh,oouyang/gh,TomzxForks/gh,oouyang/gh,dustinryerson/gh,dustinryerson/gh,modulexcite/gh,modulexcite/gh,tomzx/gh,henvic/gh,henvic/gh |
5205890e7806ea1997d02e8bb2b1554e34418d04 | site/assets/_folder-of-crap.js | site/assets/_folder-of-crap.js | $(".container").addClass("tk-proxima-nova");
$(".page-header").addClass("tk-league-gothic");
$("td:nth-child(2)").each(function() {
$(this).text(moment($.trim($(this).text()), "DD-MMM-YYYY HH:mm").fromNow());
});
| $("td:nth-child(2)").each(function() {
$(this).text(moment($.trim($(this).text()), "DD-MMM-YYYY HH:mm").fromNow());
});
| Change how Typekit fonts are applied. | Change how Typekit fonts are applied.
Prevent the FOUC that sometimes occurs by having Typekit apply fonts
instead of handling it ourselves.
| JavaScript | mit | damiendart/robotinaponcho,damiendart/robotinaponcho,damiendart/robotinaponcho |
1b5cde782e42cf48c29a09921b1aec62c5be876a | eloquent_js/chapter09/ch09_ex03.js | eloquent_js/chapter09/ch09_ex03.js | let number = /^[+-]?\d*(\d\.|\.\d)?\d*([eE][+-]?\d+)?$/;
| let number = /^[+-]?(\d+(\.\d*)?|\.\d+)([Ee][+-]?\d+)?$/;
| Add chapter 9, exercise 3 | Add chapter 9, exercise 3
| JavaScript | mit | bewuethr/ctci |
d648388d8c9297efb610e86904853b937c051582 | eloquent_js/chapter11/ch11_ex01.js | eloquent_js/chapter11/ch11_ex01.js | async function locateScalpel(nest) {
let curNest = nest.name;
for (;;) {
let scalpelLoc = await anyStorage(nest, curNest, "scalpel");
if (scalpelLoc == curNest) return curNest;
curNest = scalpelLoc;
}
}
function locateScalpel2(nest) {
let next = nest.name;
function getNext(n... | async function locateScalpel(nest) {
let current = nest.name;
for (;;) {
let next = await anyStorage(nest, current, "scalpel");
if (next == current) {
return next;
}
current = next;
}
}
function locateScalpel2(nest) {
function next(current) {
return anyStorage(nest, current, "scalpel")
.then(valu... | Add chapter 11, exercise 1 | Add chapter 11, exercise 1
| JavaScript | mit | bewuethr/ctci |
d959e87e16280eb4cbcb7ca80b64c89cacde2662 | addon/components/simple-table-cell.js | addon/components/simple-table-cell.js | import Ember from 'ember';
import layout from '../templates/components/simple-table-cell';
export default Ember.Component.extend({
layout,
tagName: 'th',
classNameBindings: ['columnsClass'],
attributeBindings: ['rowspan', 'colspan', 'columnsStyle:style'],
columnsClass: Ember.computed.alias('columns.classes... | import Ember from 'ember';
import layout from '../templates/components/simple-table-cell';
export default Ember.Component.extend({
layout,
tagName: 'th',
classNameBindings: ['columnsClass'],
attributeBindings: ['rowspan', 'colspan', 'columnsStyle:style'],
columnsClass: Ember.computed('columns.classes', {
... | Fix styles and classes for grouped columns | Fix styles and classes for grouped columns
| JavaScript | mit | Baltazore/ember-simple-table,Baltazore/ember-simple-table |
2c1b1b6d2b35ce363ca950e57d11e0e33b95dac2 | fetch-node.js | fetch-node.js | 'use strict';
var fetch = require('node-fetch');
var URL = require('url').URL;
function wrapFetchForNode(fetch) {
// Support schemaless URIs on the server for parity with the browser.
// https://github.com/matthew-andrews/isomorphic-fetch/pull/10
return function (u, options) {
if (u instanceof URL) {
... | 'use strict';
var fetch = require('node-fetch');
var URL = require('url').URL;
function wrapFetchForNode(fetch) {
// Support schemaless URIs on the server for parity with the browser.
// https://github.com/matthew-andrews/isomorphic-fetch/pull/10
return function (u, options) {
if (typeof u === 'string' && u... | Change to treat the string as a special case | Change to treat the string as a special case
| JavaScript | mit | qubyte/fetch-ponyfill,qubyte/fetch-ponyfill |
3515ea1cf459874f3a487e7c30fc585eb21f1f7f | app/assets/scripts/utils/constants.js | app/assets/scripts/utils/constants.js | 'use strict';
import { t } from '../utils/i18n';
export const fileTypesMatrix = {
'admin-bounds': {
display: t('Administrative Boundaries'),
description: t('A GeoJSON containing polygons with the administrative boundaries.')
},
origins: {
display: t('Population data'),
description: t('A GeoJSON w... | 'use strict';
import { t } from '../utils/i18n';
export const fileTypesMatrix = {
'admin-bounds': {
display: t('Administrative Boundaries'),
description: t('A GeoJSON containing polygons with the administrative boundaries.'),
helpPath: '/help#administrative-boundaries'
},
origins: {
display: t('P... | Add help path to poi data | Add help path to poi data
| JavaScript | mit | WorldBank-Transport/rra-frontend,WorldBank-Transport/rra-frontend,WorldBank-Transport/rra-frontend |
28590b794f879b426d9aaf1247ddbed2ae30170e | client/app/redux/reducers/series/series.test.js | client/app/redux/reducers/series/series.test.js | import assert from 'assert';
import series from './series';
import * as TYPES from '../../actions/types';
describe('A series reducer for redux state', () => {
//Test states
const seriesDefaultState = {};
const seriesWithTicker = { GOOGL: [] };
//Test actions
const testAddSeries = {
type: TYPES.ADD_SERIES,
... | import assert from 'assert';
import series from './series';
import * as TYPES from '../../actions/types';
describe('A series reducer for redux state', () => {
//Test states
const seriesDefaultState = {};
const seriesWithTicker = { GOOGL: [] };
//Test actions
const testAddSeries = {
type: TYPES.ADD_SERIES,
... | Test coverage for DEL_SERIES action | Test coverage for DEL_SERIES action
| JavaScript | mit | fongelias/cofin,fongelias/cofin |
f447483548193175cbb68780ba5a4b146183c964 | __tests__/app.test.js | __tests__/app.test.js | /* eslint-env jest */
const { exec } = require('child_process')
const request = require('supertest')
let app
// start a mongo instance loaded with test data using docker
beforeAll(async () => {
await exec('docker run --name scraper_test_db -d --rm -p 27017:27017 mongo')
await exec('docker cp dump/ scraper_test_db... | /* eslint-env jest */
const util = require('util')
const exec = util.promisify(require('child_process').exec)
const request = require('supertest')
let app
// start a mongo instance loaded with test data using docker
beforeAll(async () => {
await exec('docker run --name scraper_test_db -d --rm -p 27017:27017 mongo')... | Test db should have data now | Test db should have data now
Didn’t realize that child_process functions don’t return promises
| JavaScript | apache-2.0 | classmere/api |
3797f5b68e1426135dbc60729610087a3502d2ed | spec/install/get-email-spec.js | spec/install/get-email-spec.js | 'use strict';
const fs = require('fs');
const GetEmail = require('../../lib/install/get-email');
describe('GetEmail', () => {
let step;
beforeEach(() => {
step = new GetEmail();
});
describe('.start()', () => {
describe('when the user has a .gitconfig file', () => {
beforeEach(() => {
... | 'use strict';
const fs = require('fs');
const GetEmail = require('../../lib/install/get-email');
describe('GetEmail', () => {
let step;
beforeEach(() => {
step = new GetEmail();
});
describe('.start()', () => {
afterEach(() => {
fs.readFileSync.andCallThrough();
});
describe('when the... | Fix tests relying on fs spies | :green_heart: Fix tests relying on fs spies
| JavaScript | bsd-3-clause | kiteco/kite-installer |
f22f904a07059b3060d6818b926ec6aaf9571f71 | src/operator/create/fromArray.js | src/operator/create/fromArray.js | const fromArray = array => createObservable((push, end) => {
array.forEach(value => { push(value); });
end();
});
| const fromArray = array => createObservable((push, end) => {
if (array == null) {
array = [];
}
array.forEach(value => { push(value); });
end();
});
| Allow observable creation with no argument | Allow observable creation with no argument
| JavaScript | mit | hhelwich/observable,hhelwich/observable |
bc861e0d9ac49bbba0fdd4288f67463a9aca36af | lib/builder-registry.js | lib/builder-registry.js | 'use babel'
import fs from 'fs-plus'
import path from 'path'
export default class BuilderRegistry {
getBuilder (filePath) {
const builders = this.getAllBuilders()
const candidates = builders.filter((builder) => builder.canProcess(filePath))
switch (candidates.length) {
case 0: return null
ca... | 'use babel'
import _ from 'lodash'
import fs from 'fs-plus'
import path from 'path'
import MagicParser from './parsers/magic-parser'
export default class BuilderRegistry {
getBuilder (filePath) {
const builders = this.getAllBuilders()
const candidates = builders.filter((builder) => builder.canProcess(filePa... | Use TeX magic to allow bulder override | Use TeX magic to allow bulder override
| JavaScript | mit | thomasjo/atom-latex,thomasjo/atom-latex,thomasjo/atom-latex |
43d297eadf58327bfefe81ced42bdb23099548fe | lib/dujs/domainscope.js | lib/dujs/domainscope.js | /*
* DomainScope module
* @lastmodifiedBy ChengFuLin(chengfulin0806@gmail.com)
* @lastmodifiedDate 2015-07-28
*/
var Scope = require('./scope');
/**
* DomainScope
* @param {Object} cfg Graph of the domain scope
* @constructor
*/
function DomainScope(cfg) {
"use strict";
Scope.call(this, cfg, Scope.DOMAIN_SCO... | /*
* DomainScope module
* @lastmodifiedBy ChengFuLin(chengfulin0806@gmail.com)
* @lastmodifiedDate 2015-07-28
*/
var Scope = require('./scope');
/**
* DomainScope
* @constructor
*/
function DomainScope() {
"use strict";
Scope.call(this, null, Scope.DOMAIN_SCOPE_NAME, Scope.DOMAIN_TYPE, null);
}
DomainScope.p... | Refactor to be constructed without parameters | Refactor to be constructed without parameters
| JavaScript | mit | chengfulin/dujs,chengfulin/dujs |
1624dadd1dd621ae631e73db85385dce79138d71 | lib/material/endgame.js | lib/material/endgame.js | 'use strict';
var generate = require('../generate');
exports.endgames = [
'nefarious purposes',
'a Washington takeover',
'a terrorist plot',
'world domination',
'a plot against the queen'
];
exports.get = generate.random(exports.endgames);
| 'use strict';
var generate = require('../generate');
exports.endgames = [
'a plot against the queen',
'a terrorist plot',
'a Washington takeover',
'nefarious purposes',
'world domination',
];
exports.get = generate.random(exports.endgames);
| Make sorting and trailing commas consistent | Make sorting and trailing commas consistent
| JavaScript | mit | rowanmanning/conspire |
8e44baa3db6723dd83cf8bd5d9686c3d2eb33be1 | src/lib/Knekt.js | src/lib/Knekt.js | /**
* Created by Alex on 29/01/2017.
*/
import Hapi from 'hapi';
export class Knekt {
constructor() {
this._server = new Hapi.Server();
this.plugins = [];
}
setConnection(host, port) {
this._server.connection({host: host, port: port});
}
listen() {
this._server.start((err) => {
if (err)... | /**
* Created by Alex on 29/01/2017.
*/
import Hapi from 'hapi';
//core routes
import Descriptor from './routes/descriptor';
export class Knekt {
constructor() {
this._server = new Hapi.Server();
this.plugins = [];
}
setConnection(host, port) {
this._server.connection({host: host, port: port});
... | Update to register descriptor route | Update to register descriptor route
| JavaScript | mit | goKnekt/Knekt-Server |
c19971d7e5d141af526645118f9e909545178047 | client.js | client.js | var CodeMirror = require('codemirror')
, bindCodemirror = require('gulf-codemirror')
module.exports = setup
module.exports.consumes = ['editor']
module.exports.provides = []
function setup(plugin, imports, register) {
var editor = imports.editor
editor.registerEditor('CodeMirror', 'text', 'An extensible and per... | var CodeMirror = require('codemirror')
, bindCodemirror = require('gulf-codemirror')
module.exports = setup
module.exports.consumes = ['editor']
module.exports.provides = []
function setup(plugin, imports, register) {
var editor = imports.editor
editor.registerEditor('CodeMirror', 'text', 'An extensible and per... | Fix setup function: Should return promise | Fix setup function: Should return promise
| JavaScript | mpl-2.0 | hivejs/hive-editor-text-codemirror |
f066554b77700604f9f5e8de76e2c976d91ab7b0 | feature-detects/css/shapes.js | feature-detects/css/shapes.js | define(['Modernizr', 'createElement', 'docElement'], function( Modernizr, createElement, docElement ) {
// http://www.w3.org/TR/css3-exclusions
// http://www.w3.org/TR/css3-exclusions/#shapes
// Examples: http://html.adobe.com/webstandards/cssexclusions
// Separate test for CSS shapes as WebKit has just... | define(['Modernizr', 'createElement', 'docElement', 'prefixed', 'testStyles'], function( Modernizr, createElement, docElement, prefixed, testStyles ) {
// http://www.w3.org/TR/css3-exclusions
// http://www.w3.org/TR/css3-exclusions/#shapes
// Examples: http://html.adobe.com/webstandards/cssexclusions
//... | Add testStyles and prefixed to the depedencies. | Add testStyles and prefixed to the depedencies.
| JavaScript | mit | Modernizr/Modernizr,Modernizr/Modernizr |
60cda85ccf90bae9911ba49a710f2f10f79dab3c | funnel/assets/js/rsvp_list.js | funnel/assets/js/rsvp_list.js | import 'footable';
$(() => {
$('.participants').footable({
sorting: {
enabled: true,
},
});
});
| import 'footable';
$(() => {
$('.participants').footable({
paginate: false,
sorting: true,
});
});
| Disable pagination in rsvp page | Disable pagination in rsvp page
| JavaScript | agpl-3.0 | hasgeek/funnel,hasgeek/funnel,hasgeek/funnel,hasgeek/funnel,hasgeek/funnel |
26c03b575dad5dbe4720b147279bdadde24f0748 | packages/postcss-merge-longhand/src/index.js | packages/postcss-merge-longhand/src/index.js | import postcss from 'postcss';
import margin from './lib/decl/margin';
import padding from './lib/decl/padding';
import borders from './lib/decl/borders';
import columns from './lib/decl/columns';
const processors = [
margin,
padding,
borders,
columns,
];
export default postcss.plugin('postcss-merge-l... | import postcss from 'postcss';
import margin from './lib/decl/margin';
import padding from './lib/decl/padding';
import borders from './lib/decl/borders';
import columns from './lib/decl/columns';
const processors = [
margin,
padding,
borders,
columns,
];
export default postcss.plugin('postcss-merge-l... | Resolve issue with running plugin on multiple rules. | Resolve issue with running plugin on multiple rules.
| JavaScript | mit | ben-eb/cssnano |
8d3779a37df7d199753e350b83bbe884fdae8fa8 | sencha-workspace/SlateAdmin/app/model/person/progress/NoteRecipient.js | sencha-workspace/SlateAdmin/app/model/person/progress/NoteRecipient.js | /*jslint browser: true, undef: true, white: false, laxbreak: true *//*global Ext,Slate*/
Ext.define('SlateAdmin.model.person.progress.NoteRecipient', {
extend: 'Ext.data.Model',
idProperty: 'ID',
groupField: 'RelationshipGroup',
fields: [
'FullName',
'Email',
'Label',
'S... | /*jslint browser: true, undef: true, white: false, laxbreak: true *//*global Ext,Slate*/
Ext.define('SlateAdmin.model.person.progress.NoteRecipient', {
extend: 'Ext.data.Model',
idProperty: 'ID',
groupField: 'RelationshipGroup',
fields: [
'FullName',
'Email',
'Label',
'S... | Disable start/limit params on recipients request | Disable start/limit params on recipients request
| JavaScript | mit | SlateFoundation/slate-admin,SlateFoundation/slate,SlateFoundation/slate-admin,SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate-admin,SlateFoundation/slate-admin,SlateFoundation/slate-admin |
c0227b60be16470032ab03ff29ae88047fca7479 | src/formatISODuration/index.js | src/formatISODuration/index.js | import requiredArgs from '../_lib/requiredArgs/index.js'
/**
* @name formatISODuration
* @category Common Helpers
* @summary Format a Duration Object according to ISO 8601 Duration standards (https://www.digi.com/resources/documentation/digidocs/90001437-13/reference/r_iso_8601_duration_format.htm)
*
* @param {Du... | import requiredArgs from '../_lib/requiredArgs/index.js'
/**
* @name formatISODuration
* @category Common Helpers
* @summary Format a duration object according as ISO 8601 duration string
*
* @description
* Format a duration object according to the ISO 8601 duration standard (https://www.digi.com/resources/docum... | Fix formatISODuration documentation (ci skip) | Fix formatISODuration documentation (ci skip)
| JavaScript | mit | date-fns/date-fns,date-fns/date-fns,date-fns/date-fns |
951638fe79b179096c11912d3a15283bc0b13dd8 | app/services/data/get-caseload-progress.js | app/services/data/get-caseload-progress.js | const config = require('../../../knexfile').web
const knex = require('knex')(config)
const orgUnitFinder = require('../helpers/org-unit-finder')
module.exports = function (id, type) {
var orgUnit = orgUnitFinder('name', type)
var table = orgUnit.caseProgressView
return knex(table)
.where(table + '.id', id)
... | const config = require('../../../knexfile').web
const knex = require('knex')(config)
const orgUnitFinder = require('../helpers/org-unit-finder')
module.exports = function (id, type) {
var orgUnit = orgUnitFinder('name', type)
var table = orgUnit.caseProgressView
return knex(table)
.where('id', id)
.sele... | Update case progress query to include name | 636: Update case progress query to include name
| JavaScript | mit | ministryofjustice/wmt-web,ministryofjustice/wmt-web |
739f618adf2fa1a971092ce6bedd913c95cc2600 | assets/js/components/surveys/SurveyQuestionSingleSelectChoice.js | assets/js/components/surveys/SurveyQuestionSingleSelectChoice.js | /**
* SurveyQuestionSingleSelectChoice component.
*
* Site Kit by Google, Copyright 2021 Google 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
*
* https://www.apache.org/lic... | /**
* SurveyQuestionSingleSelectChoice component.
*
* Site Kit by Google, Copyright 2021 Google 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
*
* https://www.apache.org/lic... | Add radio button and link up to state. | Add radio button and link up to state.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp |
7782fc4d22078f0b741d20678143bd8d80876609 | git/routes.js | git/routes.js | var router = require("express").Router();
var db = require("./db");
router.get("/", function (req, res) {
var o = {
map: function () {
if (this.parents.length === 1) {
for (var i = 0; i < this.files.length; i++) {
emit(this.author,
{
additions: this.files[i].addi... | var router = require("express").Router();
var db = require("./db");
router.get("/", function (req, res) {
var o = {
map: function () {
if (this.parents.length === 1) {
for (var i = 0; i < this.files.length; i++) {
emit(this.author,
{
additions: this.files[i].addi... | Return more sane data through API | Return more sane data through API
| JavaScript | mit | bjornarg/dev-dashboard,bjornarg/dev-dashboard |
824a95776d93c5fe6314d11d17e7f810d2994414 | accounts-anonymous-client.js | accounts-anonymous-client.js | AccountsAnonymous.login = function (callback) {
callback = callback || function () {};
if (Meteor.userId()) {
callback(new Meteor.Error('accounts-anonymous-already-logged-in',
"You can't login anonymously while you are already logged in."));
return;
}
Accounts.callLoginMethod({
methodArguments... | AccountsAnonymous.login = function (callback) {
callback = callback || function () {};
if (Meteor.userId()) {
callback(new Meteor.Error(AccountsAnonymous._ALREADY_LOGGED_IN_ERROR,
"You can't login anonymously while you are already logged in."));
return;
}
Accounts.callLoginMethod({
methodArgum... | Use constant for error message. | Use constant for error message.
| JavaScript | mit | brettle/meteor-accounts-anonymous |
fe17a2b4115bdedd639b4c26a9a54ee33dbb5bf7 | addon/array-pager.js | addon/array-pager.js | import Em from 'ember';
import ArraySlice from 'array-slice';
var get = Em.get;
var set = Em.set;
var ArrayPager = ArraySlice.extend({
// 1-based
page: function (key, page) {
var limit = get(this, 'limit');
var offset;
// default value
if (arguments.length <= 1) {
offset = get(this, 'offset') || 0;
ret... | import Em from 'ember';
import ArraySlice from 'array-slice';
var computed = Em.computed;
var get = Em.get;
var set = Em.set;
var ArrayPager = ArraySlice.extend({
// 1-based
page: computed('offset', 'limit', function (key, page) {
var limit = get(this, 'limit');
var offset;
// default value
if (arguments.len... | Use `Ember.computed` instead of `Function.prototype.property` | Use `Ember.computed` instead of `Function.prototype.property`
| JavaScript | mit | j-/ember-cli-array-pager,j-/ember-cli-array-pager |
a433c763359129ba034309097681368e7f2b38e8 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... | Add angular assets to asset pipeline | Add angular assets to asset pipeline
| JavaScript | mit | godspeedyoo/rails-angular-skeleton,godspeedyoo/rails-angular-skeleton,godspeedyoo/sc2tracker,godspeedyoo/sc2tracker,godspeedyoo/rails-angular-skeleton,godspeedyoo/sc2tracker |
204820f700ed8f8c89e50b310b7f1433bec4402e | js/analytics.js | js/analytics.js | /**
* @constructor
*/
function Analytics() {
this.service_ = null;
}
Analytics.prototype.start = function(settings) {
if (this.service_) {
throw 'Analytics should be started only once per session.';
}
this.service_ = analytics.getService('text_app');
var propertyId = 'UA-48886257-1';
if (chrome.runt... | /**
* @constructor
*/
function Analytics() {
this.service_ = null;
}
Analytics.prototype.start = function(settings) {
if (this.service_) {
throw 'Analytics should be started only once per session.';
}
this.service_ = analytics.getService('text_app');
var propertyId = 'UA-48886257-2';
if (chrome.runt... | Use chrome.runtime.id instead of name to select Analytics property. | Use chrome.runtime.id instead of name to select Analytics property.
| JavaScript | bsd-3-clause | codex8/text-app,modulexcite/text-app,l3dlp/text-app,zkendall/WordBinder,l3dlp/text-app,zkendall/WordBinder,codex8/text-app,modulexcite/text-app,modulexcite/text-app,l3dlp/text-app,codex8/text-app,zkendall/WordBinder |
8fdb62c51eab8f19cb5e6e7b3dac6bf28f017411 | packages/components/containers/themes/CustomThemeModal.js | packages/components/containers/themes/CustomThemeModal.js | import React, { useState } from 'react';
import { c } from 'ttag';
import PropTypes from 'prop-types';
import { FormModal, PrimaryButton, Label, Alert, TextArea } from 'react-components';
const CustomThemeModal = ({ onSave, theme: initialTheme = '', ...rest }) => {
const [theme, setTheme] = useState(initialTheme);... | import React, { useState } from 'react';
import { c } from 'ttag';
import PropTypes from 'prop-types';
import { FormModal, PrimaryButton, Label, Alert, TextArea } from 'react-components';
const CustomThemeModal = ({ onSave, theme: initialTheme = '', ...rest }) => {
const [theme, setTheme] = useState(initialTheme);... | Use larger modal for Custom CSS | [MAILWEB-801] Use larger modal for Custom CSS
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
9f7b8362fbc99bc3c2832413de7963e19a21637f | app/assets/javascripts/sw.js | app/assets/javascripts/sw.js | console.log('Started', self);
self.addEventListener('install', function(event) {
self.skipWaiting();
console.log('Installed', event);
});
self.addEventListener('activate', function(event) {
console.log('Activated', event);
});
self.addEventListener('push', function(event) {
console.log('Push message', e... | console.log('Started', self);
self.addEventListener('install', function(event) {
self.skipWaiting();
console.log('Installed', event);
});
self.addEventListener('activate', function(event) {
console.log('Activated', event);
});
self.addEventListener('push', function(event) {
var title = 'Push message';
... | Add notification icon and delete code that didn't work | Add notification icon and delete code that didn't work
| JavaScript | mit | coreyja/glassy-collections,coreyja/glassy-collections,coreyja/glassy-collections |
21fd5924b841f9926b8ba6ca57b387539222fe54 | lib/parse/readme.js | lib/parse/readme.js | var _ = require('lodash');
var marked = require('marked');
var textRenderer = require('marked-text-renderer');
function extractFirstNode(nodes, nType) {
return _.chain(nodes)
.filter(function(node) {
return node.type == nType;
})
.pluck("text")
.first()
.value();
}
function parseReadm... | var _ = require('lodash');
var marked = require('marked');
var textRenderer = require('marked-text-renderer');
function extractFirstNode(nodes, nType) {
return _.chain(nodes)
.filter(function(node) {
return node.type == nType;
})
.pluck("text")
.first()
.value();
}
function parseReadm... | Fix generate failing on README parsing | Fix generate failing on README parsing
Failed if no title or description could be extracted
| JavaScript | apache-2.0 | CN-Sean/gitbook,OriPekelman/gitbook,hujianfei1989/gitbook,iamchenxin/gitbook,JohnTroony/gitbook,xxxhycl2010/gitbook,qingying5810/gitbook,bjlxj2008/gitbook,JozoVilcek/gitbook,kamyu104/gitbook,strawluffy/gitbook,ferrior30/gitbook,yaonphy/SwiftBlog,shibe97/gitbook,gencer/gitbook,palerdot/gitbook,mautic/documentation,haamo... |
7e15fe42282c594260e7185760246a50f9ee7e50 | lib/socketErrors.js | lib/socketErrors.js | var createError = require('createerror');
var httpErrors = require('httperrors');
var socketCodesMap = require('./socketCodesMap');
var _ = require('lodash');
var SocketError = createError({ name: 'SocketError' });
function createSocketError(errorCode) {
var statusCode = socketCodesMap[errorCode] || 'Unknown';
... | var createError = require('createerror');
var httpErrors = require('httperrors');
var socketCodesMap = require('./socketCodesMap');
var _ = require('lodash');
var SocketError = createError({ name: 'SocketError' });
function createSocketError(errorCode) {
var statusCode = socketCodesMap[errorCode] || 'Unknown';
... | Add a small comment to an export. | Add a small comment to an export.
| JavaScript | bsd-3-clause | alexjeffburke/node-socketerrors |
c6594d95ad6a2f694837561df71ec0997ae50fa9 | app/reducers/alertMessage.js | app/reducers/alertMessage.js | import _ from 'lodash';
import {
OPEN_ALERT_MESSAGE,
CLOSE_ALERT_MESSAGE,
} from '../actions/actionTypes';
const initialState = {
show: false,
messages: {
th: '',
en: '',
},
technical: {
message: '',
code: '',
},
};
const getInitialState = () => ({
...initialState,
});
export default ... | import _ from 'lodash';
import {
OPEN_ALERT_MESSAGE,
CLOSE_ALERT_MESSAGE,
} from '../actions/actionTypes';
const initialState = {
show: false,
title: {
th: '',
en: ''
},
messages: {
th: '',
en: '',
},
technical: {
message: '',
code: '',
},
};
const getInitialState = () => ({
... | Add alert message reducer format | Add alert message reducer format
| JavaScript | mit | hlex/vms,hlex/vms |
57c466b4ee66259f80be6cd5d1d858051f462118 | imports/api/payments/collection.js | imports/api/payments/collection.js | import { Mongo } from 'meteor/mongo';
import moment from 'moment';
const Payments = new Mongo.Collection('payments');
Payments.refund = (orderId) => {
if (orderId) {
const payment = Payments.findOne({ order_id: orderId });
if (payment && payment.charge.id) {
import StripeHelper from '../cards/server/s... | import { Mongo } from 'meteor/mongo';
import moment from 'moment';
const Payments = new Mongo.Collection('payments');
Payments.refund = (orderId) => {
if (orderId) {
const payment = Payments.findOne({ order_id: orderId });
if (payment && payment.charge.id) {
import StripeHelper from '../cards/server/s... | Use most recent payment when sending final charged to Shopify | Use most recent payment when sending final charged to Shopify
| JavaScript | mit | hwillson/shopify-hosted-payments,hwillson/shopify-hosted-payments |
a7e8bb0e37d1981bb287345c5ab575cedd1b4708 | test/integration/endpoints.js | test/integration/endpoints.js | var fs = require('fs'),
fileModule = require('file'),
testDir = '/tests',
testFileName = 'integration_test.js';
process.env.INTEGRATION = true;
describe('endpoint', function() {
it('should load the server and set everything up properly',function(done){
this.timeout(1000); //Server should not take more than 1 s... | var fs = require('fs'),
path = require('path'),
fileModule = require('file'),
testDir = '/tests',
testFileName = 'integration_test.js';
process.env.INTEGRATION = true;
describe('endpoint', function() {
it('should load the server and set everything up properly',function(done){
this.timeout(1000); //Server sh... | Check the file extension before requiring a test. | Check the file extension before requiring a test.
My vim swap files kept getting caught in the test runner so I made the
change to only load up .js files.
| JavaScript | mit | apis-is/apis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.