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 |
|---|---|---|---|---|---|---|---|---|---|
8c3335cf84588aa2ccabe78a96bb668be74fd160 | src/lib/mapper.js | src/lib/mapper.js | 'use strict';
const _ = require('lodash');
const log = require('./log');
let nameToId = {};
let mapper = {
/**
* Add light name to identifier mapping.
*
* @param {string} id - Light identifier
* @param {string} name - Light name mapping
*/
add: function addName(id, name) {
if (!id || !name) ... | 'use strict';
const _ = require('lodash');
const log = require('./log');
let nameToId = {};
let mapper = {
/**
* Add light name to identifier mapping.
*
* @param {string} id - Light identifier
* @param {string} name - Light name mapping
*/
add: function addName(id, name) {
if (!id || !name) ... | Fix crash on unknown light name | Fix crash on unknown light name
| JavaScript | mit | ristomatti/lifxsh |
8d1a0fd2c8f3bf48b6effdbc656df3e6f904d949 | examples/index.js | examples/index.js | #! /usr/bin/env node
// Ref: http://docopt.org/
/*
Chain commands
Positional arguments
Named arguments
Required arguments
Limit arguments options
Set option type (e.g. string, number)
Set number of options (exact, min, & max)
Nest commands & arguments
*/
'use strict';
(function () {
var jargs = require('../src... | #! /usr/bin/env node
// Ref: http://docopt.org/
/*
Chain commands
Positional arguments
Named arguments
Required arguments
Limit arguments options
Set option type (e.g. string, number)
Set number of options (exact, min, & max)
Nest commands & arguments
*/
'use strict';
(function () {
var jargs = require('../src... | Adjust API to be more "React-like" | Adjust API to be more "React-like"
| JavaScript | mit | JakeSidSmith/jargs |
b763199fe0d1b6920cd1827f16529ddc1e021422 | gulpfile.babel.js | gulpfile.babel.js | 'use strict';
import gulp from 'gulp';
import babel from 'gulp-babel';
import istanbul from 'gulp-istanbul';
import mocha from 'gulp-mocha';
gulp.task('pre-test', () => {
return gulp.src(['dist/index.js'])
// Covering files
.pipe(istanbul())
// Force `require` to return covered files
... | 'use strict';
import gulp from 'gulp';
import babel from 'gulp-babel';
import istanbul from 'gulp-istanbul';
import mocha from 'gulp-mocha';
gulp.task('pre-test', () => {
return gulp.src(['dist/index.js'])
// Covering files
.pipe(istanbul())
// Force `require` to return covered files
... | Update coverage's minimum acceptable thresholds | Update coverage's minimum acceptable thresholds
| JavaScript | mit | cheton/gcode-parser |
b73810201d3ef977e8322bc81594c779914eba10 | examples/console/start.js | examples/console/start.js | const syrup = require('../../');
const _ = require('lodash');
syrup.scenario('array', `${__dirname}/test-array`);
syrup.scenario('object', `${__dirname}/test-object`);
syrup.scenario('save', `${__dirname}/test-save`);
syrup.scenario('get', `${__dirname}/test-get`, ['save']);
syrup.pour(function (error, results) {
... | const syrup = require('../../');
syrup.scenario('array', `${__dirname}/test-array`);
syrup.scenario('object', `${__dirname}/test-object`);
syrup.scenario('save', `${__dirname}/test-save`);
syrup.scenario('get', `${__dirname}/test-get`, ['save']);
syrup.pour(function (error, results) {
console.log(JSON.stringify(r... | Remove the unneeded lodash require | Remove the unneeded lodash require
| JavaScript | mpl-2.0 | thejsninja/syrup |
9c02fcfd2c70299d7bb785e9ac2a299320bf83d1 | src/components/ByLine.js | src/components/ByLine.js | /**
* ByLine.js
* Description: view component that makes up a news item preview
* Modules: React and React Native Modules
* Dependencies: styles.js SmallText
* Author: Tiffany Tse
*/
//import modules
import React, { PropTypes } from 'react';
import { StyleSheet, View } from 'react-native';
import SmallText from '... | /**
* ByLine.js
* Description: view component that makes up a news item preview
* Modules: React and React Native Modules
* Dependencies: styles.js SmallText
* Author: Tiffany Tse
*/
//import modules
import React, { PropTypes } from 'react';
import { StyleSheet, View } from 'react-native';
import SmallText from '... | Refactor date in Byline to use string | Refactor date in Byline to use string
| JavaScript | mit | titse/NYTimes-Clone,titse/NYTimes-Clone,titse/NYTimes-Clone |
32b688e53c0170f7e4f0c37d38d4b299bbf9cf66 | grunt/scss-lint.js | grunt/scss-lint.js | // Check SCSS for code quality
module.exports = function(grunt) {
grunt.config('scsslint', {
allFiles: [
'scss/**/*.scss',
],
options: {
bundleExec: false,
colorizeOutput: true,
config: '.scss-lint.yml',
exclude: [
'... | // Check SCSS for code quality
module.exports = function(grunt) {
grunt.config('scsslint', {
allFiles: [
'scss/**/*.scss',
],
options: {
bundleExec: false,
colorizeOutput: true,
config: '.scss-lint.yml',
exclude: [
'... | Exclude forms partial as well. | Exclude forms partial as well.
| JavaScript | mit | yellowled/yl-bp,yellowled/yl-bp |
5b204b9a00767a0844ce4e364b989b1adcd03360 | lib/core/src/client/preview/url.js | lib/core/src/client/preview/url.js | import { history, document } from 'global';
import qs from 'qs';
import { toId } from '@storybook/router/utils';
export function pathToId(path) {
const match = (path || '').match(/^\/story\/(.+)/);
if (!match) {
throw new Error(`Invalid path '${path}', must start with '/story/'`);
}
return match[1];
}
ex... | import { history, document } from 'global';
import qs from 'qs';
import { toId } from '@storybook/router/utils';
export function pathToId(path) {
const match = (path || '').match(/^\/story\/(.+)/);
if (!match) {
throw new Error(`Invalid path '${path}', must start with '/story/'`);
}
return match[1];
}
ex... | Fix initial viewMode parsing typo | Fix initial viewMode parsing typo
| JavaScript | mit | storybooks/storybook,storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook |
2a2ef17d85f9336799c3e39249f960f75cac7cf6 | src/core-uri-handlers.js | src/core-uri-handlers.js | // Converts a query string parameter for a line or column number
// to a zero-based line or column number for the Atom API.
function getLineColNumber (numStr) {
const num = parseInt(numStr || 0, 10)
return Math.max(num - 1, 0)
}
function openFile (atom, {query}) {
const {filename, line, column} = query
atom.w... | const fs = require('fs-plus')
// Converts a query string parameter for a line or column number
// to a zero-based line or column number for the Atom API.
function getLineColNumber (numStr) {
const num = parseInt(numStr || 0, 10)
return Math.max(num - 1, 0)
}
function openFile (atom, {query}) {
const {filename, ... | Use containsLocation() for URL handler processing | Use containsLocation() for URL handler processing
| JavaScript | mit | atom/atom,atom/atom,brettle/atom,brettle/atom,brettle/atom,Mokolea/atom,Mokolea/atom,PKRoma/atom,PKRoma/atom,Mokolea/atom,atom/atom,PKRoma/atom |
62d9fedc4b56f986d04480f9b342ae2ef5d37f60 | scripts/actions/RepoActionCreators.js | scripts/actions/RepoActionCreators.js | 'use strict';
var AppDispatcher = require('../dispatcher/AppDispatcher'),
ActionTypes = require('../constants/ActionTypes'),
RepoAPI = require('../utils/RepoAPI'),
StarredReposByUserStore = require('../stores/StarredReposByUserStore'),
RepoStore = require('../stores/RepoStore');
var RepoActionCreators... | 'use strict';
var AppDispatcher = require('../dispatcher/AppDispatcher'),
ActionTypes = require('../constants/ActionTypes'),
RepoAPI = require('../utils/RepoAPI'),
StarredReposByUserStore = require('../stores/StarredReposByUserStore'),
RepoStore = require('../stores/RepoStore');
var RepoActionCreators... | Add a comment regarding unused action | Add a comment regarding unused action | JavaScript | mit | stylecoder/flux-react-router-example,AnthonyWhitaker/flux-react-router-example,machnicki/healthunlocked,goatslacker/flux-react-router-example,tiengtinh/flux-react-router-example,machnicki/healthunlocked,keshavnandan/flux-react-router-example,bertomartin/flux-react-router-example,ycavatars/flux-react-router-example,kesh... |
002452c5b597e98408e5b28b6658f34e54a66500 | app/public/sa-tracking.js | app/public/sa-tracking.js | 'use strict';
var events = [];
var requestInterval = 5000;
window.addEventListener('click', function(e) {
e = event || window.event;
events.push(processEvent(e));
});
var processEvent = function(e) {
// Event attributes
var eventProps = ['type', 'timeStamp'];
// Event target attributes
var targetP... | 'use strict';
var events = [];
var requestInterval = 5000;
window.addEventListener('click', function(e) {
e = event || window.event;
events.push(processEvent(e));
});
var processEvent = function(e) {
// Event attributes
var eventProps = ['type', 'timeStamp'];
// Event target attributes
var targetP... | Fix invalid state error by instantiating new XHR with each request | Fix invalid state error by instantiating new XHR with each request
| JavaScript | mit | Sextant-WDB/sextant-ng |
d2702efedfda3ffdb944a8118befc5d6409e8741 | lib/visualizer.js | lib/visualizer.js | 'use strict'
const visualizeBoardS = Symbol('visualizeBoard')
const visualizeOrdersS = Symbol('visualizeOrders')
module.exports = class Visualizer {
constructor (mapSvg, visualizeBoard, visualizeOrders) {
this.map = mapSvg
this[visualizeBoardS] = visualizeBoard
this[visualizeOrdersS] = visualizeOrders
... | 'use strict'
module.exports = class Visualizer {
constructor (mapSvg, visualizeBoard, visualizeOrders) {
this.map = mapSvg
}
visualizeBoard (board) {
}
visualizeOrders (orders) {
}
addEventListenerForUnits (event, listener) {
const units = this.map.querySelectorAll('.vizdip-unit')
if (units... | Fix the signature of Visualizer | Fix the signature of Visualizer
ref #1
| JavaScript | mit | KarmaMi/vizdip,KarmaMi/vizdip,KarmaMi/vizdip,KarmaMi/vizdip |
893f7371ae0d2517d4276ab4e868ce03b0cf1dbe | lint/lib/linters/RuboCop.js | lint/lib/linters/RuboCop.js | "use strict";
function RuboCop(opts) {
this.exe = "rubocop";
this.ext = process.platform === 'win32' ? ".bat" : "";
this.path = opts.path;
this.responsePath = "stdout";
this.args = ["-s", "{path}", "-f", "json", "--force-exclusion"] ;
if (opts.lint) this.args.push("-l");
if (opts.only) this.args = this.args.c... | "use strict";
function RuboCop(opts) {
this.exe = "rubocop";
this.ext = process.platform === 'win32' ? ".bat" : "";
this.path = opts.path;
this.responsePath = "stdout";
this.args = ["-s", "{path}", "-f", "json"] ;
if (opts.lint) this.args.push("-l");
if (opts.only) this.args = this.args.concat("--only", opts.... | Remove force exclusion for rubocop | Remove force exclusion for rubocop
Fixes https://github.com/rubyide/vscode-ruby/issues/175 | JavaScript | mit | rubyide/vscode-ruby,rubyide/vscode-ruby,rubyide/vscode-ruby,rubyide/vscode-ruby,rubyide/vscode-ruby |
18dbfb541960465944971269a393af668ecbb33d | specs/database.js | specs/database.js | var chai = require('chai');
var expect = chai.expect;
var db = require('../server/db/config');
var models = require('../server/db/models');
describe('database storage', function() {
var testData = {
x: 37.783599,
y: -122.408974,
z: 69,
message: 'Brooks was here'
};
var invalidTestData = {
x: ... | var chai = require('chai');
var expect = chai.expect;
var db = require('../server/db/config');
var models = require('../server/db/models');
describe('database storage', function() {
var testData = {
x: 37.783599,
y: -122.408974,
z: 69,
message: 'Brooks was here'
};
var invalidTestData = {
x: ... | Add tests to confirm message retrieval | Add tests to confirm message retrieval
| JavaScript | mit | team-oath/uncovery,team-oath/uncovery,team-oath/uncovery,team-oath/uncovery,scottdixon/uncovery,scottdixon/uncovery,scottdixon/uncovery,scottdixon/uncovery |
d2adfb4288153b333a0aef69428a0312d163d085 | Kinect2Scratch.js | Kinect2Scratch.js | (function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};
// Block... | (function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};
// Block... | Change boolean to reporter for block with dropdowns | Change boolean to reporter for block with dropdowns
| JavaScript | bsd-3-clause | visor841/SkelScratch,Calvin-CS/SkelScratch |
2b928608f1bad3f1721838afa00dccddb724f48b | util/schemesPreviewGenerator.js | util/schemesPreviewGenerator.js | const nunjucks = require('nunjucks');
const fs = require('fs-promise');
const path = require('path');
const yaml = require('js-yaml');
const Promise = require('bluebird');
const schemesDir = '../db/schemes';
fs
.readdir(schemesDir)
.then(function(schemeFileNames) {
const promises = [];
schemeFileNames.for... | const nunjucks = require('nunjucks');
const fs = require('fs-promise');
const path = require('path');
const yaml = require('js-yaml');
const Promise = require('bluebird');
const schemesDir = path.join(__dirname, '../db/schemes');
fs
.readdir(schemesDir)
.then(function(schemeFileNames) {
const promises = [];
... | Read files relative from script's directory | fix(cli): Read files relative from script's directory
| JavaScript | mit | base16-builder/base16-builder,aloisdg/base16-builder,base16-builder/base16-builder,aloisdg/base16-builder,aloisdg/base16-builder,base16-builder/base16-builder |
daeb051c4fba5603cad33cc414528052c09a0afd | src/geolocator.js | src/geolocator.js | angular.module('aGeolocator', [])
.factory('Geolocator', ['$http', '$q', function($http, $q){
GEOIP_URL = "https://www.telize.com/geoip"
_getIPLocation = function() {
$http.get(GEOIP_URL).then(function(res) {
return res.data;
}).catch(function(err){
return $q.reject(err.data);
... | angular.module('aGeolocator', [])
.factory('Geolocator', ['$http', '$q', function($http, $q){
var GEOIP_URL = "https://www.telize.com/geoip";
var _getIPLocation = function() {
return $http.get(GEOIP_URL).then(function(res) {
return res.data;
}).catch(function(err){
return $q.rejec... | Fix returned result and variable declaration | Fix returned result and variable declaration
| JavaScript | bsd-2-clause | asoesilo/geolocator |
227b01b527deab80958e30bd8bf6a194b06317aa | src/components/Admin/Menubar.js | src/components/Admin/Menubar.js | import React from 'react';
import { Link } from 'react-router-dom';
export const Menubar = () => (
<div className="sub-navigation">
<div className="limit-width">
<Link className="sub-navigation__link" to="/admin/profile"><span>Profile</span></Link>
<Link className="sub-navigation__l... | import React from 'react';
import { NavLink } from 'react-router-dom';
export const Menubar = () => (
<div className="sub-navigation">
<div className="limit-width">
<NavLink activeClassName="active" className="sub-navigation__link" to="/admin/profile"><span>Profile</span></NavLink>
... | Swap Link to Navlink for settings active class | Swap Link to Navlink for settings active class
| JavaScript | apache-2.0 | nahody/biografia,nahody/biografia |
d59767ea4bf2e0eeeb8537302d071284dc0459e6 | src/constants/LanguageColors.js | src/constants/LanguageColors.js | const LANGUAGE_COLORS = {
Scala: '#BB0017',
Clojure: '#00AA00',
JS: '#CCAA00',
JavaScript: '#CCAA00',
CoffeeScript: '#CCAA00',
Ruby: '#9B111E',
VB: '#663300',
'C#': '#7600BC',
Go: '#996633',
HTML5: '#FF0032',
Swift: '#FC4831',
Shell: '#03C103',
Python: '#0000CC',
'C++': '#FF0099',
Groovy: ... | import GITHUBCOLORS from '../config/github-colors.json';
const LANGUAGE_COLORS = GITHUBCOLORS;
LANGUAGE_COLORS.DEFAULT= '#B3B3B3';
export default LANGUAGE_COLORS;
| Add github programming language colrs | Add github programming language colrs
| JavaScript | mit | zalando/zalando.github.io-dev,zalando/zalando.github.io-dev |
97f346c585a727806718db2b02bed6a9ca5ec5c9 | src/js/cordova.js | src/js/cordova.js | 'use strict';
// Load only within android app: cordova=android
if (window.location.search.search('cordova') > 0) {
(function(d, script) {
script = d.createElement('script');
script.type = 'text/javascript';
script.src = 'js/cordova/cordova.js';
d.getElementsByTagName('head')[0].appendChild(script);
... | 'use strict';
// Load only within android app: cordova=android
if (window.location.search.search('cordova') > 0) {
(function(d, script) {
// When cordova is loaded
function onLoad() {
d.addEventListener('deviceready', onDeviceReady, false);
}
// Device APIs are available
function onDeviceR... | Update application cache on device resume | Update application cache on device resume
| JavaScript | agpl-3.0 | P2Pvalue/teem,P2Pvalue/pear2pear,Grasia/teem,P2Pvalue/teem,Grasia/teem,Grasia/teem,P2Pvalue/teem,P2Pvalue/pear2pear |
0448d3651cbf8df005ed20dd05ab1241ae940f76 | app/helpers/moment-calendar.js | app/helpers/moment-calendar.js | export { default, momentCalendar } from 'ember-moment/helpers/moment-calendar';
| import Ember from 'ember';
import config from '../config/environment';
import CalendarHelper from 'ember-moment/helpers/moment-calendar';
export default CalendarHelper.extend({
globalAllowEmpty: !!Ember.get(config, 'moment.allowEmpty')
});
| Extend the CalendarHelper with global allowEmpty from config. | Extend the CalendarHelper with global allowEmpty from config. | JavaScript | mit | exop-group/ember-moment,stefanpenner/ember-moment,exop-group/ember-moment,stefanpenner/ember-moment |
753171601f3471320ac3ec560b5148f9da687622 | app/scripts/src/content/item.js | app/scripts/src/content/item.js | 'use strict';
/* This was necessary to priorize Star Wars: The Clone Wars (2008) over Star Wars: Clone Wars (2003).
I left this object because it could be useful for other movies/shows */
var fullTitles = {
'Star Wars: The Clone Wars': '"Star Wars: The Clone Wars"',
'The Office (U.S.)': 'The Office (US)'
}
func... | 'use strict';
/* This was necessary to priorize Star Wars: The Clone Wars (2008) over Star Wars: Clone Wars (2003).
I left this object because it could be useful for other movies/shows */
var fullTitles = {
'Star Wars: The Clone Wars': '"Star Wars: The Clone Wars"',
'The Office (U.S.)': 'The Office (US)',
'The... | Add more fullTitles for Item - The Blind Side was returing Blind Side - The Avengers was returning Avenged | Add more fullTitles for Item
- The Blind Side was returing Blind Side
- The Avengers was returning Avenged
| JavaScript | mit | MrMamen/traktNRK,MrMamen/traktNRK,tegon/traktflix,MrMamen/traktflix,MrMamen/traktflix,tegon/traktflix |
15df89b668ce34c7d7e0cec6d44471baf031eb24 | www/js/proj4.js | www/js/proj4.js | var proj4 = require('proj4');
proj4.defs('EPSG:25832', '+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs');
var lat = 59.932624;
var lng = 10.734738;
var xy = proj4('EPSG:25832', { x: lng, y: lat })
console.log(xy);
| var proj4 = require('proj4');
proj4.defs('EPSG:25832', '+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs');
var lat = 59.932624;
var lng = 10.734738;
var xy = proj4('EPSG:25832', { x: lng, y: lat })
console.log(xy);
// Fetch closest stations: http://reis.ruter.no/reisrest/stop/getcloseststopsbycoordinates/?coordina... | Add note on how to fetch closest stations from the ruter API | Add note on how to fetch closest stations from the ruter API
| JavaScript | mit | hkwaller/next,hkwaller/next,hkwaller/next,hkwaller/next |
0b8a5a18f05eed0c10f357f3f8f7231ff964d087 | tools/scripts/property-regex.js | tools/scripts/property-regex.js | const {
assemble,
writeFile,
unicodeVersion
} = require('./utils.js');
// This includes only the binary properties required by UTS18 RL1.2 for level 1 Unicode regex
// support, minus `Assigned` which has special handling since it is the inverse of Unicode category
// `Unassigned`. To include all binary pro... | const {
assemble,
writeFile,
unicodeVersion
} = require('./utils.js');
// This includes only the binary properties required by UTS18 RL1.2 for level 1 Unicode regex
// support, minus `Assigned` which has special handling since it is the inverse of Unicode category
// `Unassigned`. To include all binary pro... | Add Emoji list of `Binary_Property`s | Add Emoji list of `Binary_Property`s
| JavaScript | mit | slevithan/xregexp,slevithan/XRegExp,slevithan/XRegExp,slevithan/xregexp,GerHobbelt/xregexp,GerHobbelt/xregexp,slevithan/xregexp,GerHobbelt/xregexp |
91e539f98821963bb0f6fd35ef188660e6ff01c6 | imports/client/startup/routes.js | imports/client/startup/routes.js | import { Meteor } from 'meteor/meteor';
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, browserHistory, IndexRoute } from 'react-router';
import AppContainer from '../containers/AppContainer';
import AboutPage from '../pages/AboutPage';
import NotFoundPage from '../pages/NotFound... | import { Meteor } from 'meteor/meteor';
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, browserHistory, IndexRoute } from 'react-router';
import AppContainer from '../containers/AppContainer';
import AboutPage from '../pages/AboutPage';
import NotFoundPage from '../pages/NotFound... | Remove AppContainer layout from 404 page | Remove AppContainer layout from 404 page
| JavaScript | apache-2.0 | evancorl/skate-scenes,evancorl/skate-scenes,evancorl/portfolio,evancorl/skate-scenes,evancorl/portfolio,evancorl/portfolio |
e7f43a25af82d8d840ad7765c7f610f7a8e58a5b | test-projects/electron-log-test-webpack/webpack.config.js | test-projects/electron-log-test-webpack/webpack.config.js | module.exports = [
{
mode: "development",
entry: ['./src/main.js'],
output: { filename: 'main.js' },
target: 'electron-main',
module: {
rules: [
{
test: /.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
presets: [r... | 'use strict';
const path = require('path');
module.exports = [
{
mode: "development",
entry: ['./src/main.js'],
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
target: 'electron-main',
module: {
rules: [
{
test: /.js$/,
lo... | Fix test-projects install/build: webpack 4 changes | Fix test-projects install/build: webpack 4 changes
| JavaScript | mit | megahertz/electron-log,megahertz/electron-log,megahertz/electron-log |
666410d49d3aac697200737dea8d19b77d5708a4 | resources/public/javascript/tryclojure.js | resources/public/javascript/tryclojure.js | function eval_clojure(code) {
var data;
$.ajax({
url: "eval.json",
data: { expr : code },
async: false,
success: function(res) { data = res; }
});
return data;
}
function html_escape(val) {
var result = val;
result = result.replace(/\n/g, "<br/>");
result = r... | function eval_clojure(code) {
var data;
$.ajax({
url: "eval.json",
data: {
command: {
expr: code,
mode: mode
}
},
async: false,
success: function(res) { data = res; }
});
return data;
}
function html_escape(val) {
v... | Send console mode - code or story. | Send console mode - code or story. | JavaScript | mit | maryrosecook/islaclj |
525286d37f8fcc29c3ad0a9036f1217b87b4fd81 | website/app/application/core/projects/project/files/file-edit-controller.js | website/app/application/core/projects/project/files/file-edit-controller.js | (function (module) {
module.controller("FileEditController", FileEditController);
FileEditController.$inject = ['file', '$scope'];
/* @ngInject */
function FileEditController(file, $scope) {
console.log('FileEditController');
var ctrl = this;
ctrl.file = file;
$scope.$... | (function (module) {
module.controller("FileEditController", FileEditController);
FileEditController.$inject = ['file'];
/* @ngInject */
function FileEditController(file) {
var ctrl = this;
ctrl.file = file;
}
}(angular.module('materialscommons'))); | Remove debug of ui router state changes. | Remove debug of ui router state changes.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
f9ba237e2746b485e062c30749c45927af832424 | src/js/bin4features.js | src/js/bin4features.js | $(document).ready(function() {
var menuUrl = "https://www.bin4burgerlounge.com/our-downtown-menu/";
$.ajax({
url: "http://www.corsmirror.com/v1/cors?url=" + menuUrl,
dataType: "html",
crossDomain: true,
success: writeData
});
function writeData(data, textStatus, jqXHR) ... | $(document).ready(function() {
var menuUrl = "https://www.bin4burgerlounge.com/our-downtown-menu/";
$.ajax({
url: "https://cors-anywhere.herokuapp.com/" + menuUrl,
dataType: "html",
crossDomain: true,
success: writeData
});
function writeData(data, textStatus, jqXHR) {
... | Revert "Update CORS provider, again..." | Revert "Update CORS provider, again..."
This reverts commit cdd91c9eca4ea4675296e96c8ede6c8f8d7a3236.
| JavaScript | mit | connor-bracewell/nnorco,connor-bracewell/nnorco,connor-bracewell/nnorco,connor-bracewell/nnorco |
91ea8bacfefc231cc18c472bdd11c50e14370cf8 | spec/responseparser_spec.js | spec/responseparser_spec.js | var ResponseParser = require('../lib/responseparser'),
winston = require('winston'),
fs = require('fs'),
path = require('path');
describe('responseparser', function() {
var parser = new ResponseParser({
format: 'xml',
logger: new winston.Logger({ transports: [] })
});
it('should return xml when format is xm... | var ResponseParser = require('../lib/responseparser'),
winston = require('winston'),
fs = require('fs'),
path = require('path');
describe('responseparser', function() {
var parser = new ResponseParser({
format: 'xml',
logger: new winston.Logger({ transports: [] })
});
it('should return xml when format is xm... | Add case sensitive test for format in response parser | Add case sensitive test for format in response parser
| JavaScript | isc | raoulmillais/7digital-api,7digital/7digital-api,raoulmillais/node-7digital-api |
19fb3ee91715ea8da3a5cb6e1d3dd5e7016ad493 | src/charting/MobileChart.js | src/charting/MobileChart.js | import React, { PropTypes } from 'react';
import EChart from './EChart';
import SizeProvider from '../_common/SizeProvider';
import createOptions from './options/MobileChartOptions';
const theme = {
background: 'white',
line: 'rgba(42, 48, 82, 0.8)',
fill: 'rgba(42, 48, 82, 0.2)',
text: '#999',
gri... | import React, { PropTypes } from 'react';
import EChart from './EChart';
import SizeProvider from '../_common/SizeProvider';
import createOptions from './options/MobileChartOptions';
const theme = {
background: 'white',
line: 'rgba(42, 48, 82, 0.8)',
fill: 'rgba(42, 48, 82, 0.2)',
text: '#999',
gri... | Fix error when tick history is empty | Fix error when tick history is empty
| JavaScript | mit | nazaninreihani/binary-next-gen,qingweibinary/binary-next-gen,binary-com/binary-next-gen,qingweibinary/binary-next-gen,nazaninreihani/binary-next-gen,nuruddeensalihu/binary-next-gen,binary-com/binary-next-gen,nuruddeensalihu/binary-next-gen,nuruddeensalihu/binary-next-gen,nazaninreihani/binary-next-gen,qingweibinary/bin... |
7fa60523599a56255cde78a49e848166bd233c6e | src/charts/Chart.Scatter.js | src/charts/Chart.Scatter.js | 'use strict';
module.exports = function(Chart) {
var defaultConfig = {
hover: {
mode: 'single'
},
scales: {
xAxes: [{
type: 'linear', // scatter should not use a category axis
position: 'bottom',
id: 'x-axis-1' // need an ID so datasets can reference the scale
}],
yAxes: [{
type: '... | 'use strict';
module.exports = function(Chart) {
var defaultConfig = {
hover: {
mode: 'single'
},
scales: {
xAxes: [{
type: 'linear', // scatter should not use a category axis
position: 'bottom',
id: 'x-axis-1' // need an ID so datasets can reference the scale
}],
yAxes: [{
type: '... | Update scatter chart default config to hide lines | Update scatter chart default config to hide lines
| JavaScript | mit | chartjs/Chart.js,simonbrunel/Chart.js,panzarino/Chart.js,jtcorbett/Chart.js,ldwformat/Chart.js,nnnick/Chart.js,jtcorbett/Chart.js,touletan/Chart.js,supernovel/Chart.js,touletan/Chart.js,chartjs/Chart.js,panzarino/Chart.js,touletan/Chart.js,touletan/Chart.js,chartjs/Chart.js,chartjs/Chart.js,ldwformat/Chart.js,simonbrun... |
9ce2d3174b07945812805e44a51a0da43c8174a0 | portal/www/portal/join-project.js | portal/www/portal/join-project.js | function handle_lookup(data) {
if (data.code == 0) {
// Project lookup was successful
// redirect to join-this-project.php?project_id=id
// get project from value field, and project_id from that
var project = data.value
var url = "join-this-project.php?project_id=" + project.project_id;
window... | function show_lookup_error(msg) {
$('#finderror').append(msg);
$('#findname').select();
}
function handle_lookup(data) {
if (data.code == 0) {
// Project lookup was successful
// redirect to join-this-project.php?project_id=id
// get project from value field, and project_id from that
var project ... | Handle expired projects in join lookup | Handle expired projects in join lookup
If a project is expired, notify the user but do not carry on to the
join-this-project page.
| JavaScript | mit | tcmitchell/geni-portal,tcmitchell/geni-portal,tcmitchell/geni-portal,tcmitchell/geni-portal,tcmitchell/geni-portal |
0a078a7649a27614731b15a0f3867f7e025452e3 | website/app/application/core/projects/project/project-controller.js | website/app/application/core/projects/project/project-controller.js | Application.Controllers.controller('projectsProject',
["$scope", "provStep", "ui",
"project", "current", "pubsub", projectsProject]);
function projectsProject ($scope, provStep, ui, project, current, pubsub) {
$scope.isActive = function (tab) {... | Application.Controllers.controller('projectsProject',
["$scope", "provStep", "ui",
"project", "current", "pubsub", "recent",
projectsProject]);
function projectsProject ($scope, provStep, ui, project, current, pu... | Move code around to put functions at bottom. | Move code around to put functions at bottom.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
9884facbb5ebdfefed43a37dcff54896ae99a182 | src/components/search_bar.js | src/components/search_bar.js | import React from 'react';
class SearchBar extends React.Component {
render() {
return <input />;
}
}
export default SearchBar; | import React, { Component } from 'react';
class SearchBar extends Component {
render() {
return <input onChange={this.onInputChange} />;
}
onInputChange(event) {
console.log(event.target.value);
}
}
export default SearchBar; | Add some syntactic sugar to the import command to shorten the class exstension. | Add some syntactic sugar to the import command to shorten the class exstension.
| JavaScript | mit | JosephLeon/redux-simple-starter-tutorial,JosephLeon/redux-simple-starter-tutorial |
f266cc41aeb9604393a2b9a2652de609d6d8212a | src/components/viewport/RefreshOnFocus.js | src/components/viewport/RefreshOnFocus.js | const REFRESH_PERIOD = 30 * 60 * 1000 // 30 minutes in microseconds
const focusSupported = typeof document !== 'undefined' &&
typeof document.addEventListener !== 'undefined' &&
typeof document.visibilityState !== 'undefined'
let hiddenAt = null
function onHide() {
hidd... | const REFRESH_PERIOD = 30 * 60 * 1000 // 30 minutes in microseconds
const focusEnabled = ENV.ENABLE_REFRESH_ON_FOCUS
const focusSupported = typeof document !== 'undefined' &&
typeof document.addEventListener !== 'undefined' &&
typeof document.visibilityState !== 'undefined'... | Enable refresh on focus by env var. | Enable refresh on focus by env var.
So in dev and staging we can try to fix bugs without losing critical
state.
| JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
4c7752df347bdb366f00cfad742a5ab799c34b65 | app/assets/javascripts/trln_argon/advanced_search_scope.js | app/assets/javascripts/trln_argon/advanced_search_scope.js | Blacklight.onLoad(function() {
$(window).on('load', function(){
//remove default mast search to fix duplicate IDs
$(".blacklight-catalog-advanced_search #search-navbar").remove();
$(".blacklight-trln-advanced_search #search-navbar").remove();
// change adv search scope
window.location.href.in... | Blacklight.onLoad(function() {
$(window).on('load', function(){
//remove default mast search to fix duplicate IDs
$(".blacklight-catalog-advanced_search #search-navbar").remove();
$(".blacklight-trln-advanced_search #search-navbar").remove();
// change adv search scope
$(".blacklight-trln-adv... | Remove window.location.href in advanced search js | Remove window.location.href in advanced search js
| JavaScript | mit | trln/trln_argon,trln/trln_argon,trln/trln_argon,trln/trln_argon |
775e2ff03c0be1446def3cb9d815e30e1bac4314 | server/routes/itemRoute.js | server/routes/itemRoute.js | "use strict";
const { Router } = require('express')
const router = Router()
const Item = require('../models/Item')
router.get('/api/items', (req, res, err) =>
Item
.find()
.then(item => res.json( item ))
.catch(err)
)
////////just returning a single id by its id//////////
router.get('/api/items/:_id', ... | "use strict";
const { Router } = require('express')
const router = Router()
const Item = require('../models/Item')
router.get('/api/items', (req, res, err) =>
Item
.find()
.then(item => res.json( item ))
.catch(err)
)
////////just returning a single id by its id//////////
router.get('/api/items/:_id', ... | PUT API route is now working in postman | PUT API route is now working in postman
| JavaScript | mit | mmeadow3/nodEbay,mmeadow3/nodEbay |
97da0fe508b4664086d9391308ae9e0c87e6d16d | src/rebase-prod-css.js | src/rebase-prod-css.js | import postcss from 'postcss'
import { readFileSync as slurp } from 'fs'
import { resolve, isAbsolute } from 'path'
import { parse as parseUrl } from 'url'
import { default as rebaseUrl } from 'postcss-url'
export default function rebase(pkg, opts, filename) {
return postcss([
rebaseUrl({
url: (url, de... | import postcss from 'postcss'
import { readFileSync as slurp } from 'fs'
import { resolve, isAbsolute } from 'path'
import { parse as parseUrl } from 'url'
import { default as rebaseUrl } from 'postcss-url'
export default function rebase(pkg, opts, filename) {
return postcss([
rebaseUrl({
url: (url, de... | Replace `\` with `/` in resolved path | Replace `\` with `/` in resolved path
This fixes url rebasing on windows. We probably should use something
other than the `path` module for resolving, but that can come at
a later time – this'll do for now.
| JavaScript | mit | zambezi/ez-build,zambezi/ez-build |
1c1dddffb39767e1a99bb371f2b9a39a089ce86c | src/routes/machines.js | src/routes/machines.js | /**
* @package admiral
* @author Andrew Munsell <andrew@wizardapps.net>
* @copyright 2015 WizardApps
*/
exports = module.exports = function(app, config, fleet) {
/**
* Get the machines in the cluster
*/
app.get('/v1/machines', function(req, res) {
fleet.list_machinesAsync()
.t... | /**
* @package admiral
* @author Andrew Munsell <andrew@wizardapps.net>
* @copyright 2015 WizardApps
*/
exports = module.exports = function(app, config, fleet) {
/**
* Get the machines in the cluster
*/
app.get('/v1/machines', function(req, res) {
fleet.list_machinesAsync()
.t... | Fix order of headers in response | Fix order of headers in response
| JavaScript | mit | andrewmunsell/admiral |
ea0abf1f9a2000830c2810ccdbe9685ce9aa1f54 | raft/scripts/frames/conclusion.js | raft/scripts/frames/conclusion.js |
"use strict";
/*jslint browser: true, nomen: true*/
/*global define*/
define([], function () {
return function (frame) {
var player = frame.player(),
layout = frame.layout();
frame.after(1, function() {
frame.model().clear();
layout.invalidate();
})
... |
"use strict";
/*jslint browser: true, nomen: true*/
/*global define*/
define([], function () {
return function (frame) {
var player = frame.player(),
layout = frame.layout();
frame.after(1, function() {
frame.model().clear();
layout.invalidate();
})
... | Update Raft web site link | Update Raft web site link | JavaScript | mit | benbjohnson/thesecretlivesofdata |
ece2da770d255a2e016a5aea561cee07f6ba89c9 | simul/app/components/profile.js | simul/app/components/profile.js | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
import I18n from 'react-native-i18n'
class Profile extends Component{
async _onPressAddStory(){
try {
}
}
render() {
return (
<View style={styles.container}>
... | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
import I18n from 'react-native-i18n'
class Profile extends Component{
_onPressAddStory(){
}
render() {
return (
<View style={styles.container}>
<Text style={styles.ti... | Fix error, need to add PressAddStory button | Fix error, need to add PressAddStory button
| JavaScript | mit | sf-red-pandas-2016/simul-react-native,sf-red-pandas-2016/simul-react-native,sf-red-pandas-2016/simul-react-native |
30e6cf089f7e8aec41d7edd32d71c168c7db116a | string/dashes-to-camel-case.js | string/dashes-to-camel-case.js | export default function dashesToCamelCase(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}; | export default function dashesToCamelCase(str) {
return str.replace(/-([a-z])/g, function (g) {
return g[1].toUpperCase();
});
}; | Add helper for converting dashed words to lower camel case | Add helper for converting dashed words to lower camel case
| JavaScript | mit | complayjs/helpers |
fb7cd0f61d5b4cca3c3ba30ad79772fc02418b5b | src/build/webpack.base.config.js | src/build/webpack.base.config.js | const path = require('path')
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const HtmlWebpackPlugin = require('html-webpack-plugin')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: resolve('src/index.js'),
output: {
path: resolve('dist'),
fil... | const path = require('path')
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const HtmlWebpackPlugin = require('html-webpack-plugin')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: resolve('src/index.js'),
output: {
path: resolve('dist'),
fil... | Update HTML Webpack Plugin to use index.html as template | Update HTML Webpack Plugin to use index.html as template
| JavaScript | mit | jocodev1/mithril-cli,jocodev1/mithril-cli |
3052dc420f956cdbbf1d2e479287231e40c38308 | source/models/v3/application.js | source/models/v3/application.js | define(
['data/data', 'collections/v3/interactions', 'collections/v3/datasuitcases', 'models/v3/DataSuitcase', 'collections/v3/forms', 'models/v3/form'],
function (Backbone, InteractionCollection, DataSuitcaseCollection, DataSuitcase, FormCollection, Form) {
"use strict";
var Application = Backbone.Model.ex... | define(
['data/data', 'collections/v3/interactions', 'collections/v3/datasuitcases', 'models/v3/DataSuitcase', 'collections/v3/forms', 'models/v3/form'],
function (Backbone, InteractionCollection, DataSuitcaseCollection, DataSuitcase, FormCollection, Form) {
"use strict";
var Application = Backbone.Model.ex... | Create a collection for Forms | Create a collection for Forms
| JavaScript | bsd-3-clause | blinkmobile/bic-jqm,blinkmobile/bic-jqm |
5b365981625964aa609f80fa622a0372d558a368 | src/protocol/message/compression/index.js | src/protocol/message/compression/index.js | const { KafkaJSNotImplemented } = require('../../../errors')
const Types = {
None: 0,
GZIP: 1,
Snappy: 2,
LZ4: 3,
}
const Codecs = {
[Types.GZIP]: () => require('./gzip'),
[Types.Snappy]: () => {
throw new KafkaJSNotImplemented('Snappy compression not implemented')
},
[Types.LZ4]: () => {
thro... | const { KafkaJSNotImplemented } = require('../../../errors')
const MESSAGE_CODEC_MASK = 0x3
const RECORD_BATCH_CODEC_MASK = 0x07
const Types = {
None: 0,
GZIP: 1,
Snappy: 2,
LZ4: 3,
}
const Codecs = {
[Types.GZIP]: () => require('./gzip'),
[Types.Snappy]: () => {
throw new KafkaJSNotImplemented('Snap... | Add support for Record Batch compression codec flag | Add support for Record Batch compression codec flag
| JavaScript | mit | tulios/kafkajs,tulios/kafkajs,tulios/kafkajs,tulios/kafkajs |
e0cde4d967ddd9e75d55fbf466f57b4f05e1e07b | chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js | chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var WALLPAPER_PICKER_WIDTH = 550;
var WALLPAPER_PICKER_HEIGHT = 420;
var wallpaperPickerWindow;
chrome.app.runtime.onLaunched.addListener(function()... | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var WALLPAPER_PICKER_WIDTH = 550;
var WALLPAPER_PICKER_HEIGHT = 420;
var wallpaperPickerWindow;
chrome.app.runtime.onLaunched.addListener(function()... | Disable resize of wallpaper picker | Disable resize of wallpaper picker
BUG=149937
Review URL: https://codereview.chromium.org/11411244
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@170467 0039d316-1c4b-4281-b951-d872f2087c98
| JavaScript | bsd-3-clause | dednal/chromium.src,hujiajie/pa-chromium,Jonekee/chromium.src,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,jaruba/chromium.src,timopulkkinen/BubbleFish,jaruba/chromium.src,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,Jonekee/chromium.src,zcbenz/cefode-chromium,Jonekee/chromium.src... |
12bb485ef15de677effa7218d5346d3008698dee | lit-config.js | lit-config.js | module.exports = {
"extends": "./index.js",
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"lit", "html"
],
"globals": {
"D2L": false
},
"rules": {
"strict": 0,
"lit/no-duplicate-template-bindings": 2,
"lit/no-legacy-template-syntax": 2,
"lit/no-template... | module.exports = {
"extends": "./index.js",
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"lit", "html"
],
"globals": {
"D2L": false
},
"rules": {
"strict": [2, "never"],
"lit/no-duplicate-template-bindings": 2,
"lit/no-legacy-template-syntax": 2,
"lit/... | Update strict to error if present since it is redundant in modules, and not really necessary in demo pages. | Update strict to error if present since it is redundant in modules, and not really necessary in demo pages.
| JavaScript | apache-2.0 | Brightspace/eslint-config-brightspace |
7b3f0423b7cf08b743a8244dd6b376bdedbf32f1 | www/lib/collections/photos.js | www/lib/collections/photos.js | Photo = function (doc) {
_.extend(this, doc);
};
_.extend(Photo.prototype, {
getImgTag: function (dimension) {
return {
'class': 'lazy',
'data-src': _.str.sprintf(
'%s/photos/%s/%s',
Meteor.settings.public.uri.cdn,
dimension,
this.filename
),
'data-src-retina': _.str.sprintf(
'%s/p... | Photo = function (doc) {
_.extend(this, doc);
};
_.extend(Photo.prototype, {
getImgTag: function (dimension) {
return {
'class': 'lazy',
'src': 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
'data-src': _.str.sprintf(
'%s/photos/%s/%s',
Meteor.settings.public.ur... | Use a transparent pixel to hold the height | Use a transparent pixel to hold the height
| JavaScript | mit | nburka/black-white |
0a811b387401255f9c8f5eda40d3e4e20ba6e9d7 | test/transform/noStrictTest.js | test/transform/noStrictTest.js | import createTestHelpers from '../createTestHelpers';
const {expectTransform, expectNoChange} = createTestHelpers(['no-strict']);
describe('Removal of "use strict"', () => {
it('should remove statement with "use strict" string', () => {
expectTransform('"use strict";').toReturn('');
expectTransform('\'use st... | import createTestHelpers from '../createTestHelpers';
const {expectTransform, expectNoChange} = createTestHelpers(['no-strict']);
describe('Removal of "use strict"', () => {
it('should remove statement with "use strict" string', () => {
expectTransform('"use strict";').toReturn('');
expectTransform('\'use st... | Split multiline tests to actual multiple lines | Split multiline tests to actual multiple lines
For better readability.
| JavaScript | mit | lebab/lebab,mohebifar/lebab,mohebifar/xto6 |
0bcc5afa1f15315173c60c666e8ba2c1b72731ae | ember/mirage/config.js | ember/mirage/config.js | export default function () {
this.passthrough('/translations/**');
this.get('/api/locale', { locale: 'en' });
}
| export default function () {
this.passthrough('/translations/**');
this.get('/api/locale', { locale: 'en' });
this.get('/api/notifications', { events: [] });
}
| Add basic `GET /api/notifications` route handler | mirage: Add basic `GET /api/notifications` route handler
| JavaScript | agpl-3.0 | skylines-project/skylines,skylines-project/skylines,skylines-project/skylines,skylines-project/skylines |
d01136d921ec73f2c09d9bb3a748684670a82db4 | src/read/elements/loading.js | src/read/elements/loading.js | 'use strict';
import React from 'react';
import ActivityIndicator from './pure/activityIndicator';
import ui from '../../ui';
class Loading extends React.Component {
static propTypes = {
dispatch: React.PropTypes.func.isRequired,
kind: React.PropTypes.oneOfType([
React.PropTypes.string,
React... | 'use strict';
import React from 'react';
import ActivityIndicator from './pure/activityIndicator';
import ui from '../../ui';
class Loading extends React.Component {
static propTypes = {
dispatch: React.PropTypes.func.isRequired,
kind: React.PropTypes.oneOfType([
React.PropTypes.string,
React... | Add missing prop validation for readId | Add missing prop validation for readId
| JavaScript | mit | netceteragroup/girders-elements |
6495cd006c6ab087f971981873ae7202d4fd73e6 | includes/js/main.js | includes/js/main.js | var mode = 0; //primary
function calc_mode() {
var modes = ["primary", "secondary", "tertiary"];
return modes[mode];
}
$(function() {
$(".add").button();
$(".edit").button();
$(".delete").button().click(function() {
var res = confirm("Are you sure you want to delete this item?");
if (res)
window.location.... | var mode = 0; //primary
function calc_mode() {
var modes = ["primary", "secondary", "tertiary"];
return modes[mode];
}
$(function() {
$(".add").button();
$(".edit").button();
$(".delete").button().click(function() {
var res = confirm("Are you sure you want to delete this item?");
if (res)
window.location.... | Add events handler on selected ingredients | Add events handler on selected ingredients
| JavaScript | mit | claw68/alchemy,claw68/alchemy,claw68/alchemy,claw68/alchemy |
77fa21457a7b503d9086b28b480baa8b96d0715f | src/commands/view/OpenAssets.js | src/commands/view/OpenAssets.js | export default {
run(editor, sender, opts = {}) {
const modal = editor.Modal;
const am = editor.AssetManager;
const config = am.getConfig();
const title = opts.modalTitle || editor.t('assetManager.modalTitle') || '';
const types = opts.types;
const accept = opts.accept;
am.setTarget(opts.... | export default {
run(editor, sender, opts = {}) {
const modal = editor.Modal;
const am = editor.AssetManager;
const config = am.getConfig();
const title = opts.modalTitle || editor.t('assetManager.modalTitle') || '';
const types = opts.types;
const accept = opts.accept;
am.setTarget(opts.... | Add stop command to openAssets | Add stop command to openAssets
| JavaScript | bsd-3-clause | artf/grapesjs,artf/grapesjs,artf/grapesjs |
167aa0bf00f03eba76a432f548885636d8a0b28d | .eslintrc.js | .eslintrc.js | module.exports = {
'root': true,
'parser': 'babel-eslint',
'extends': [
'airbnb',
'plugin:import/errors'
],
'rules': {
'space-before-function-paren': 0,
'comma-dangle': [2, 'never'],
'one-var': 0,
'one-var-declaration-per-line': 0,
'prefer-arrow-callback': 0,
'strict': 0,
... | module.exports = {
'root': true,
'parser': 'babel-eslint',
'extends': [
'airbnb',
'plugin:import/errors'
],
'rules': {
'space-before-function-paren': 0,
'comma-dangle': [2, 'never'],
'one-var': 0,
'one-var-declaration-per-line': 0,
'prefer-arrow-callback': 0,
'strict': 0,
... | Enforce that defaultProps sit next to statics | Enforce that defaultProps sit next to statics
| JavaScript | mit | NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet |
3fff4b7571affcbd95cee4bc8df03598019695a6 | .eslintrc.js | .eslintrc.js | module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: "module"
},
plugins: ["ember"],
extends: [
"eslint:recommended",
"plugin:ember/recommended",
"plugin:prettier/recommended"
],
env: {
browser: true
},
rules: {
"prettier/prettier": 2,
"ember/n... | module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: "module"
},
plugins: ["ember", "prettier"],
extends: [
"eslint:recommended",
"plugin:ember/recommended",
"plugin:prettier/recommended"
],
env: {
browser: true
},
rules: {
"prettier/prettier": 2,
... | Add prettier as eslint plugin | Add prettier as eslint plugin
| JavaScript | mit | adfinis-sygroup/ember-validated-form,adfinis-sygroup/ember-validated-form,adfinis-sygroup/ember-validated-form |
851ff5f6511117c9122e7f8b97797171d2372502 | example/Button.card.js | example/Button.card.js | import devcards from '../';
import React from 'react';
import Button from './Button';
var devcard = devcards.ns('buttons');
devcard(
'Buttons',
`
A simple display of bootstrap buttons.
* default
* primary
* success
* info
* warning
* danger
* link
`,
(
<div>
<Button kind="default">d... | import devcards from '../';
import React from 'react';
import Button from './Button';
var devcard = devcards.ns('buttons');
devcard(
'Buttons',
`
A simple display of bootstrap buttons.
* default
* primary
* success
* info
* warning
* danger
* link
`,
<div style={{textAlign: 'center'}}>
<B... | Align as an option isn't ideal, include inline style example instead | Align as an option isn't ideal, include inline style example instead
There are two ways to center align in CSS, neither work well to
integrate into the card system
1) text-align: center
this cascades into all children, and would force the consumer to
override text-align back to what they wanted on other elements
2) ... | JavaScript | mit | glenjamin/devboard,glenjamin/devboard,glenjamin/devboard |
10577cdf202b955fa855a31a6df961c37b016a73 | src/bot/accountUnlinked.js | src/bot/accountUnlinked.js | import { unlinkUser } from '../lib/postgres';
export default (bot) => {
return async (payload, reply) => {
const page_scoped_id = payload.sender.id;
await unlinkUser(page_scoped_id);
await reply({ text: 'You have successfully logged out' });
console.log(`Unlinked account -> ${page_scoped_id}`);
};... | import { unlinkUser } from '../lib/postgres';
export default (bot) => {
return async (payload, reply) => {
const page_scoped_id = payload.sender.id;
await unlinkUser(page_scoped_id);
await reply({ text: 'You have successfully logged out from EBudgie' });
console.log(`Unlinked account -> ${page_scope... | Change messega for unlinking account | Change messega for unlinking account
| JavaScript | mit | nikolay-radkov/ebudgie-server,nikolay-radkov/ebudgie-server |
83f761e1bafa07f1998bb845caa69c95d80a0235 | src/admin/redux/modules/letter.js | src/admin/redux/modules/letter.js | /* @flow */
import { FETCHED_MEMBER } from '../../../shared/redux/modules/member.js'
import { mergeAll, converge, unapply, compose, objOf, prop } from 'ramda'
import type { Action, Reducer } from 'redux'
type State = {}
const reducer: Reducer<State, Action> =
(state = { id: 0, address: [], name: '' }, { type, payl... | /* @flow */
import { FETCHED_MEMBER } from '../../../shared/redux/modules/member.js'
import { mergeAll, converge, unapply, compose, objOf, prop } from 'ramda'
import type { Action, Reducer } from 'redux'
type State = {}
const reducer: Reducer<State, Action> =
(state = { id: 0, address: [], name: '' }, { type, payl... | Fix bug that meant member details not displaying if no first name had been entered. | Fix bug that meant member details not displaying if no first name had been entered.
| JavaScript | mit | foundersandcoders/sail-back,foundersandcoders/sail-back |
11934adf1a17ae9bf549dfddfcc21f71eb28a2a2 | src/app/directives/configModal.js | src/app/directives/configModal.js | define([
'angular'
],
function (angular) {
'use strict';
angular
.module('kibana.directives')
.directive('configModal', function($modal,$q) {
return {
restrict: 'A',
link: function(scope, elem) {
// create a new modal. Can't reuse one modal unforunately as the directive w... | define([
'angular',
'underscore'
],
function (angular,_) {
'use strict';
angular
.module('kibana.directives')
.directive('configModal', function($modal,$q) {
return {
restrict: 'A',
link: function(scope, elem) {
// create a new modal. Can't reuse one modal unforunately ... | Fix saving of top level panel properties | Fix saving of top level panel properties
| JavaScript | agpl-3.0 | grafana/grafana,grafana/grafana,grafana/grafana,grafana/grafana,grafana/grafana,grafana/grafana,grafana/grafana |
3c0c8915e6a5590a8d6d0db65a90632bce985c6f | eloquent_js/chapter04/ch04_ex03.js | eloquent_js/chapter04/ch04_ex03.js | function arrayToList(array) {
let list = null;
for (let i = array.length - 1; i >= 0; --i) {
list = {value: array[i], rest: list};
}
return list;
}
function listToArray(list) {
let array = [];
for (let node = list; node; node = node.rest) {
array.push(node.value);
}
retu... | function arrayToList(arr) {
if (arr.length == 0) return null;
let list = null;
for (let i = arr.length - 1; i >= 0; --i) {
list = {value: arr[i], rest: list};
}
return list;
}
function listToArray(list) {
let arr = [];
for (let node = list; node; node = node.rest) {
arr.push(node.value)
}
return arr;
... | Add chapter 4, exercise 3 | Add chapter 4, exercise 3
| JavaScript | mit | bewuethr/ctci |
847f32fb3980cb624e516d8f3052388de5a8ec49 | server/import/import_scripts/category_mapping.js | server/import/import_scripts/category_mapping.js | module.exports = {
"Dagens bedrift": "PRESENTATIONS",
"Fest og moro": "NIGHTLIFE",
"Konsert": "MUSIC",
"Kurs og events": "PRESENTATIONS",
"Revy og teater": "PERFORMANCES",
"Foredrag": "PRESENTATIONS",
"Møte": "DEBATE",
"Happening": "NIGHTLIFE",
"Kurs": "OTHER",
"Show": "PERFORMAN... | module.exports = {
"Dagens bedrift": "PRESENTATIONS",
"Fest og moro": "NIGHTLIFE",
"Konsert": "MUSIC",
"Kurs og events": "PRESENTATIONS",
"Revy og teater": "PERFORMANCES",
"Foredrag": "PRESENTATIONS",
"Møte": "DEBATE",
"Happening": "NIGHTLIFE",
"Kurs": "OTHER",
"Show": "PERFORMAN... | Add category mapping for exhibitions | Add category mapping for exhibitions
Too many exhibition events from TRDEvents got the "other"-category
| JavaScript | apache-2.0 | Studentmediene/Barteguiden,Studentmediene/Barteguiden |
847fa26ac3e5b60e16d6c03c521ce29bdc709164 | lib/routes/index.js | lib/routes/index.js | function render(viewName, layoutPath) {
if (!layoutPath) {
return function (req, res) {
res.render(viewName);
};
}
else {
return function (req, res) {
res.render(viewName, { layout: layoutPath });
};
}
}
module.exports = {
render: render
};
| function render(viewName, layoutPath) {
return function (req, res) {
if (layoutPath) {
res.locals.layout = layoutPath;
}
res.render(viewName);
};
}
module.exports = {
render: render
};
| Change implementation of `render` route | Change implementation of `render` route
| JavaScript | bsd-3-clause | weigang992003/pure-css-chinese,jamesalley/pure-site,yahoo/pure-site,weigang992003/pure-css-chinese,jamesalley/pure-site,pandoraui/pure-site,yahoo/pure-site,chensy0203/pure-site |
ef93e13a9e22459c8151c36bae520ed80fdb1b5b | lib/server/index.js | lib/server/index.js | var path = require('path');
var url = require('url');
var compression = require('compression');
var express = require('express');
var ssr = require('../index');
var xhr = require('./xhr');
var proxy = require('./proxy');
module.exports = function (config) {
var app = express()
.use(compression())
.use(xhr());
... | var path = require('path');
var url = require('url');
var compression = require('compression');
var express = require('express');
var ssr = require('../index');
var xhr = require('./xhr');
var proxy = require('./proxy');
var doctype = '<!DOCTYPE html>';
module.exports = function (config) {
var app = express()
.us... | Add HTML5 doctype to all rendered pages. | Add HTML5 doctype to all rendered pages.
| JavaScript | mit | donejs/done-ssr,donejs/done-ssr |
8065830ff2163bf1178b204a5873b7d56b40a228 | src/scripts/commons/d3-utils.js | src/scripts/commons/d3-utils.js | // External
import * as d3 from 'd3';
export function mergeSelections (selections) {
// Create a new empty selection
const mergedSelection = d3.selectAll('.d3-list-graph-not-existent');
function pushSelection (selection) {
selection.each(function pushDomNode () {
mergedSelection[0].push(this);
});... | // External
import * as d3 from 'd3';
export function mergeSelections (selections) {
// Create a new empty selection
const mergedSelection = d3.selectAll('.d3-list-graph-not-existent');
for (let i = selections.length; i--;) {
mergedSelection._groups = mergedSelection._groups.concat(
selections[i]._gro... | Adjust selection merge method to D3 v4. | Adjust selection merge method to D3 v4.
| JavaScript | mit | flekschas/d3-list-graph,flekschas/d3-list-graph |
bb8eac7f6c3493a5fb0f644c92bc71229129101c | src/scheduler-assignment.js | src/scheduler-assignment.js | let scheduler = null
export function setScheduler (customScheduler) {
if (customScheduler) {
scheduler = customScheduler
} else {
scheduler = new DefaultScheduler()
}
}
export function getScheduler () {
return scheduler
}
class DefaultScheduler {
constructor () {
this.updateRequests = []
th... | let scheduler = null
export function setScheduler (customScheduler) {
scheduler = customScheduler
}
export function getScheduler () {
if (!scheduler) {
scheduler = new DefaultScheduler()
}
return scheduler
}
class DefaultScheduler {
constructor () {
this.updateRequests = []
this.frameRequested ... | Use the DefaultScheduler if none is assigned | Use the DefaultScheduler if none is assigned
Fixes #1 | JavaScript | mit | smashwilson/etch,atom/etch,lee-dohm/etch,nathansobo/etch |
a3a1990d95b3162ecd404610d176e2cb0bccde3b | web/app/store/MapTypes.js | web/app/store/MapTypes.js | /*
* Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
*
* 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 b... | /*
* Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
*
* 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 b... | Fix map types class formatting | Fix map types class formatting
| JavaScript | apache-2.0 | vipien/traccar,joseant/traccar-1,al3x1s/traccar,5of9/traccar,ninioe/traccar,tsmgeek/traccar,ninioe/traccar,jon-stumpf/traccar,renaudallard/traccar,5of9/traccar,tsmgeek/traccar,stalien/traccar_test,duke2906/traccar,jon-stumpf/traccar,orcoliver/traccar,stalien/traccar_test,AnshulJain1985/Roadcast-Tracker,ninioe/traccar,o... |
4284ec386be6b909362b28aaa2569f93b1a5e696 | t/lib/teamview_check_user.js | t/lib/teamview_check_user.js |
/*
* Exporst function that checks if given emails of users are shown
* on the Teamview page. And if so how they are rendered: as text or link.
*
* It does not check exact emails, just count numbers.
*
* */
'use strict';
var
By = require('selenium-webdriver').By,
expect = require('chai')... |
/*
* Exporst function that checks if given emails of users are shown
* on the Teamview page. And if so how they are rendered: as text or link.
*
* It does not check exact emails, just count numbers.
*
* */
'use strict';
var
By = require('selenium-webdriver').By,
expect = require('chai')... | Remove hardcoded localhost in one more place. | Remove hardcoded localhost in one more place.
| JavaScript | mit | timeoff-management/application,YulioTech/timeoff,YulioTech/timeoff,timeoff-management/application |
7065308e49623e1e54314d9f67fad82600aea00d | tests/unit/models/employee-test.js | tests/unit/models/employee-test.js | import {
moduleForModel,
test
} from 'ember-qunit';
moduleForModel('employee', {
// Specify the other units that are required for this test.
needs: []
});
test('it exists', function(assert) {
var model = this.subject();
// var store = this.store();
assert.ok(!!model);
});
| import DS from 'ember-data';
import Ember from 'ember';
import { test, moduleForModel } from 'ember-qunit';
//import startApp from '../../helpers/start-app';
//var App;
moduleForModel('employee', {
// Specify the other units that are required for this test.
needs: []//,
//setup: function(){
// App =... | Add simple test on employee relation | Add simple test on employee relation
| JavaScript | mit | Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry |
1aaa87f7e2fca83ad99cb4ef3e1dbe497e63a899 | js/models/project_specific_mixin.js | js/models/project_specific_mixin.js | "use strict";
var _ = require('underscore')
, Project = require('./project')
/*
* Mixin for models which require a project to be set.
*
* Looks for attribute, collection, and explicit passing in options. Will raise
* an error if no project is found, or if different projects are found.
*/
module.exports = {
c... | "use strict";
var _ = require('underscore')
, Project = require('./project')
/*
* Mixin for models which require a project to be set.
*
* Looks for attribute, collection, and explicit passing in options. Will raise
* an error if no project is found, or if different projects are found.
*/
module.exports = {
c... | Fix bug in project-specific backbone model mixin | Fix bug in project-specific backbone model mixin
| JavaScript | agpl-3.0 | editorsnotes/editorsnotes-renderer |
4ed0b226782d5b2c8c4ee79112a2735ddf6a8953 | test/specs/createOrUpdate.js | test/specs/createOrUpdate.js | 'use strict';
const assert = require('assert');
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
const dataSchema = new mongoose.Schema({
'contents': String
});
dataSchema.plugin(require('../../index'));
const dataModel = mongoose.model('data', dataSchema);
describe('createOrUpdate', ... | 'use strict';
const assert = require('assert');
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
const dataSchema = new mongoose.Schema({
'contents': String
});
dataSchema.plugin(require('../../index'));
const dataModel = mongoose.model('data', dataSchema);
describe('createOrUpdate', ... | Test against string version of ID. | Test against string version of ID.
| JavaScript | mit | neogeek/mongoose-create-or-update |
ec27e6fed4b91d6075c702aed69976ec19061eab | test/statici18n_test.js | test/statici18n_test.js | /*global after, before, describe, it*/
'use strict';
var assert = require('assert');
var grunt = require('grunt');
var path = require('path');
var sinon = require('sinon');
var statici18n = require('../tasks/statici18n');
statici18n(grunt);
describe('exists', function() {
after(function() {
grunt.log.warn.rest... | /*global after, before, describe, it*/
'use strict';
var assert = require('assert');
var grunt = require('grunt');
var path = require('path');
var sinon = require('sinon');
var statici18n = require('../tasks/statici18n');
statici18n(grunt);
describe('exists', function() {
after(function() {
grunt.log.warn.rest... | Test for a french file (fails) | Test for a french file (fails)
| JavaScript | mit | beck/grunt-static-i18n |
631e16f977c65dbd38a532323e10c48dc97b4f50 | rollup.config.umd.js | rollup.config.umd.js | import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import angular from 'rollup-plugin-angular';
import typescript from 'rollup-plugin-typescript';
var sass = require('node-sass');
import {nameLibrary,PATH_SRC,PATH_DIST} from './config-library.js';
export default {
entry: ... | import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import angular from 'rollup-plugin-angular';
import typescript from 'rollup-plugin-typescript';
var sass = require('node-sass');
import {nameLibrary,PATH_SRC,PATH_DIST} from './config-library.js';
export default {
input: ... | Change deprecated config for USM | Change deprecated config for USM | JavaScript | mit | Elecweb/emptytext,Elecweb/emptytext |
d76d4072f34e29310e724da392086932e08ed52b | test/analyzer-result.js | test/analyzer-result.js | import test from 'ava';
import 'babel-core/register';
import AnalyzerResult from '../src/lib/analyzer-result';
test('addMessage adds expected message', t => {
const testMessageType = 'test';
const testMessageText = 'test-message';
const result = new AnalyzerResult();
result.addMessage(testMessageType, testMe... | import test from 'ava';
import 'babel-core/register';
import AnalyzerResult from '../src/lib/analyzer-result';
test('addMessage adds expected message', t => {
const testMessageType = 'test';
const testMessageText = 'test-message';
const result = new AnalyzerResult();
result.addMessage(testMessageType, testMe... | Add tests to implement TODO comment | Add tests to implement TODO comment
| JavaScript | mit | ritterim/markdown-proofing |
3685283ef4bbff5121146798c16be605ea2a0e2d | packages/presentational-components/src/components/prompt.js | packages/presentational-components/src/components/prompt.js | // @flow
import * as React from "react";
import css from "styled-jsx/css";
const promptStyle = css`
.prompt {
font-family: monospace;
font-size: 12px;
line-height: 22px;
width: var(--prompt-width, 50px);
padding: 9px 0;
text-align: center;
color: var(--theme-cell-prompt-fg, black);
... | // @flow
import * as React from "react";
/**
* Generate what text goes inside the prompt based on the props to the prompt
*/
export function promptText(props: PromptProps): string {
if (props.running) {
return "[*]";
}
if (props.queued) {
return "[…]";
}
if (typeof props.counter === "number") {
... | Make <PromptBuffer> a special case of <Prompt> | Make <PromptBuffer> a special case of <Prompt>
| JavaScript | bsd-3-clause | nteract/nteract,rgbkrk/nteract,nteract/composition,jdfreder/nteract,jdfreder/nteract,nteract/composition,rgbkrk/nteract,rgbkrk/nteract,jdfreder/nteract,rgbkrk/nteract,rgbkrk/nteract,jdfreder/nteract,nteract/nteract,nteract/nteract,nteract/composition,nteract/nteract,nteract/nteract |
8d4782fdefdaa16fc4ae1c24500d910817a8d3d1 | src/models/Feed.js | src/models/Feed.js | const mongoose = require('mongoose')
const middleware = require('./middleware/Feed.js')
const path = require('path')
const fs = require('fs')
const packageVersion = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'))).version
const schema = new mongoose.Schema({
title: {
type: String,
... | const mongoose = require('mongoose')
const middleware = require('./middleware/Feed.js')
const path = require('path')
const fs = require('fs')
const packageVersion = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'))).version
const schema = new mongoose.Schema({
title: {
type: String,
... | Add enabled key, and if all other keys are empty use default vals | Add enabled key, and if all other keys are empty use default vals
| JavaScript | mit | synzen/Discord.RSS,synzen/Discord.RSS |
1a721d6b1bd32da9f48fb5f3dc0b26eee8bfd095 | test/__snapshots__/show.js | test/__snapshots__/show.js | #!/usr/bin/env node
var fs = require('fs')
var path = require('path')
var chalk = require('chalk')
function show (result) {
Object.keys(result).sort().reverse().forEach(file => {
var test = file.replace(/\.test\.js\.snap$/, '')
result[file].split('exports[`')
.filter(str => str.indexOf('// ') !== 0)
... | #!/usr/bin/env node
var fs = require('fs')
var path = require('path')
var chalk = require('chalk')
var filter = process.argv[2]
function show (result) {
Object.keys(result).sort().reverse().forEach(file => {
var test = file.replace(/\.test\.js\.snap$/, '')
result[file].split('exports[`')
.filter(str ... | Add filters to snapshot preview | Add filters to snapshot preview
| JavaScript | mit | logux/logux-server |
a95a786d9c0d5b643f2e6b1c51e55853d1750c74 | gulp/config.js | gulp/config.js | module.exports = {
// Autoprefixer
autoprefixer: {
// https://github.com/postcss/autoprefixer#browsers
browsers: [
'Explorer >= 10',
'ExplorerMobile >= 10',
'Firefox >= 30',
'Chrome >= 34',
'Safari >= 7',
'Opera >= 23',
'iOS >= 7',
'Android >= 4.4',
'Bla... | module.exports = {
// Autoprefixer
autoprefixer: {
// https://github.com/postcss/autoprefixer#browsers
browsers: [
'Explorer >= 10',
'ExplorerMobile >= 10',
'Firefox >= 30',
'Chrome >= 34',
'Safari >= 7',
'Opera >= 23',
'iOS >= 7',
'Android >= 4.4',
'Bla... | Revert remote origin to 'origin' for deploy github pages | Revert remote origin to 'origin' for deploy github pages
| JavaScript | mit | osr-megha/polymer-starter-kit,StartPolymer/polymer-starter-kit-old,StartPolymer/polymer-static-app,StartPolymer/polymer-starter-kit-old,osr-megha/polymer-starter-kit,StartPolymer/polymer-static-app |
eb78a8ff55ffb43880fbba8ff92254c3ddf630c7 | routes/trackOrder.js | routes/trackOrder.js | const utils = require('../lib/utils')
const challenges = require('../data/datacache').challenges
const db = require('../data/mongodb')
module.exports = function trackOrder () {
return (req, res) => {
const id = insecurity.sanitizeProcessExit(utils.trunc(decodeURIComponent(req.params.id), 40))
if (utils.notSo... | const utils = require('../lib/utils')
const insecurity = require('../lib/insecurity')
const challenges = require('../data/datacache').challenges
const db = require('../data/mongodb')
module.exports = function trackOrder () {
return (req, res) => {
const id = insecurity.sanitizeProcessExit(utils.trunc(decodeURICo... | Add missing import of insecurity lib | Add missing import of insecurity lib | JavaScript | mit | bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop |
b4cacf5ed3e4bd98a693cddb2ba48674add19cb6 | website/static/website/js/app.js | website/static/website/js/app.js | import React from "react";
import { Chance }from "chance";
import WriteMessage from "./components/WriteMessage";
import Messages from "./components/Messages";
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = { user: chance.name(), messages: [] }
}
compo... | import React from "react";
import { Chance }from "chance";
import WriteMessage from "./components/WriteMessage";
import Messages from "./components/Messages";
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = { user: chance.name(), messages: [], connected: fa... | Put a connected visual help | Put a connected visual help
| JavaScript | mit | Frky/moon,Frky/moon,Frky/moon,Frky/moon,Frky/moon |
a305be411f880fa1fdf5c931f562e605c2a208d3 | app/components/Button/index.js | app/components/Button/index.js | import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import './Button.scss';
export default class Button extends Component {
static propTypes = {
onClick: PropTypes.func,
type: PropTypes.oneOf(['button', 'submit', 'reset']),
kind: PropTypes.oneOf(['yes', 'no', 'subtle... | import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import './Button.scss';
export default class Button extends Component {
static propTypes = {
onClick: PropTypes.func,
type: PropTypes.oneOf(['button', 'submit', 'reset']),
kind: PropTypes.oneOf(['yes', 'no', 'subtle... | Improve semantics of submit button | :page_facing_up: Improve semantics of submit button
| JavaScript | mit | JasonEtco/flintcms,JasonEtco/flintcms |
0b1eecf180c79d6196d796ba786a46b1158abbbc | scripts/objects/2-cleaver.js | scripts/objects/2-cleaver.js | exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
});
}
},
remove: function (l10n) {
re... | exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
});
player.combat.addToDodgeMod({
na... | Add balancing for cleaver scripts. | Add balancing for cleaver scripts.
| JavaScript | mit | seanohue/ranviermud,seanohue/ranviermud,shawncplus/ranviermud |
e15b144af678fbbfabe6fac280d869d02bcfb2ce | app/reducers/studentProfile.js | app/reducers/studentProfile.js | const initialState = {
profile: { data: null },
name: { data: null },
image: { data: null },
barcode: { data: null }
}
function studentProfileReducer(state = initialState, action) {
const newState = { ...state }
switch (action.type) {
case 'SET_STUDENT_PROFILE':
newState.profile.data = action.profile
ret... | const initialState = {
profile: { data: null },
name: { data: null },
image: { data: null },
barcode: { data: null }
}
function studentProfileReducer(state = initialState, action) {
const newState = { ...state }
switch (action.type) {
case 'SET_STUDENT_PROFILE':
newState.profile.data = action.profile
ret... | Fix issue where data was not being cleared upon logout | Fix issue where data was not being cleared upon logout
| JavaScript | mit | UCSD/campus-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/campus-mobile |
0200a9c8123896848792b7f3150fa7a56aa07470 | app/support/DbAdapter/utils.js | app/support/DbAdapter/utils.js | import _ from 'lodash';
export const unexistedUID = '00000000-0000-0000-C000-000000000046';
export function initObject(classDef, attrs, id, params) {
return new classDef({ ...attrs, id, ...params });
}
export function prepareModelPayload(payload, namesMapping, valuesMapping) {
const result = {};
const keys = ... | import _ from 'lodash';
import pgFormat from 'pg-format';
import { List } from '../open-lists';
export const unexistedUID = '00000000-0000-0000-C000-000000000046';
export function initObject(classDef, attrs, id, params) {
return new classDef({ ...attrs, id, ...params });
}
export function prepareModelPayload(pay... | Add helpers functions to generate SQL for 'field [NOT] IN somelist' | Add helpers functions to generate SQL for 'field [NOT] IN somelist'
| JavaScript | mit | FreeFeed/freefeed-server,FreeFeed/freefeed-server |
e44c9d381503575c441d0de476690e9ba94a6cca | src/api/lib/adminRequired.js | src/api/lib/adminRequired.js | export default function authRequired(req, res, next) {
if (req.user.isAdmin) {
next();
} else {
res.status(403);
res.json({
id: 'AUTH_FORBIDDEN',
message: 'You need admin privilege to run this command.'
});
}
}
| export default function adminRequired(req, res, next) {
if (req.user && req.user.isAdmin) {
next();
} else {
res.status(403);
res.json({
id: 'AUTH_FORBIDDEN',
message: 'You need admin privilege to run this command.'
});
}
}
| Fix admin checking throwing error if not logged in | Fix admin checking throwing error if not logged in
| JavaScript | mit | yoo2001818/shellscripts |
e762c50fba4e25c6cff3152ab499c6ff310c95ee | src/components/UserVideos.js | src/components/UserVideos.js | import React from 'react'
import {connect} from 'react-redux'
import {Link} from 'react-router-dom'
import {compose} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './VideoPreviewsList'
const mapStateToProps = ({userVi... | import React from 'react'
import {connect} from 'react-redux'
import {compose, withHandlers, withProps} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
import {createVideo, VideoOwnerTypes} from '../actions/videos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './Vi... | Make a user create video button | Make a user create video button
| JavaScript | mit | mg4tv/mg4tv-web,mg4tv/mg4tv-web |
9af9fd4200ffe08681d42bb131b9559b52073f1b | src/components/katagroups.js | src/components/katagroups.js | import React from 'react';
import {default as KataGroupsData} from '../katagroups.js';
export default class KataGroupsComponent extends React.Component {
static propTypes = {
kataGroups: React.PropTypes.instanceOf(KataGroupsData).isRequired
};
render() {
const {kataGroups} = this.props;
return (
... | import React from 'react';
import {default as KataGroupsData} from '../katagroups.js';
export default class KataGroupsComponent extends React.Component {
static propTypes = {
kataGroups: React.PropTypes.instanceOf(KataGroupsData).isRequired
};
render() {
const {kataGroups} = this.props;
return (
... | Use the new `url` property. | Use the new `url` property. | JavaScript | mit | wolframkriesing/es6-react-workshop,wolframkriesing/es6-react-workshop |
d2dcc04cbcc2b6a19762c4f95e98476b935a29e4 | src/components/style-root.js | src/components/style-root.js | /* @flow */
import React, {Component, PropTypes} from 'react';
import Enhancer from '../enhancer';
import StyleKeeper from '../style-keeper';
import StyleSheet from './style-sheet';
function _getStyleKeeper(instance): StyleKeeper {
if (!instance._radiumStyleKeeper) {
const userAgent = (
instance.props.ra... | /* @flow */
import React, {Component, PropTypes} from 'react';
import Enhancer from '../enhancer';
import StyleKeeper from '../style-keeper';
import StyleSheet from './style-sheet';
function _getStyleKeeper(instance): StyleKeeper {
if (!instance._radiumStyleKeeper) {
const userAgent = (
instance.props.ra... | Stop passing radiumConfig prop to div | Stop passing radiumConfig prop to div
| JavaScript | mit | FormidableLabs/radium |
68ad2fe3afc0f674a8424ada83a397d699559bd8 | 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 ... | Remove last of the gem | Remove last of the gem
| JavaScript | mit | tonyedwardspz/westcornwallevents,tonyedwardspz/westcornwallevents,tonyedwardspz/westcornwallevents |
84a21f18b364bed6249002ff311900f240059b16 | app/assets/javascripts/inspections.js | app/assets/javascripts/inspections.js | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
$(function() {
return console.log($("span").length);
});
$(".status").hover((function() ... | $(function() {
console.log($("span").length);
});
$(".status").hover((function() {
console.log(this);
$(this).children(".details").show();
}), function() {
console.log("bob");
$(this).children(".details").hide();
});
| Fix for conversion from coffee->js | Fix for conversion from coffee->js
| JavaScript | mit | nomatteus/dinesafe,jbinto/dinesafe,jbinto/dinesafe-chrome-backend,nomatteus/dinesafe,nomatteus/dinesafe,jbinto/dinesafe-chrome-backend,nomatteus/dinesafe,jbinto/dinesafe,jbinto/dinesafe-chrome-backend,jbinto/dinesafe-chrome-backend,jbinto/dinesafe,jbinto/dinesafe |
e7933b56614eda1941811bb95e533fceb1eaf907 | app/components/chess-board-square.js | app/components/chess-board-square.js | import React from "react";
import classNames from "classnames";
import { selectPiece } from "store/actions";
class ChessBoardSquare extends React.Component {
constructor(props) {
super(props);
this.selectSquare = this.selectSquare.bind(this);
}
squareCoords() {
return { rank: this.props.rank, file... | import React from "react";
import classNames from "classnames";
import { selectPiece } from "store/actions";
class ChessBoardSquare extends React.Component {
constructor(props) {
super(props);
this.selectSquare = this.selectSquare.bind(this);
}
squareCoords() {
return { rank: this.props.rank, file... | Fix problem with null selectedSquare | Fix problem with null selectedSquare
| JavaScript | mit | danbee/chess,danbee/chess,danbee/chess |
cc38cd161bf98799a87039cfedea311e76b7ca3f | web/templates/javascript/Entry.js | web/templates/javascript/Entry.js | import Session from "./Session.js";
let session = new Session();
loadPlugins()
.then(() => session.connect());
async function loadPlugins()
{
let pluginEntryScripts = <%- JSON.stringify(entryScripts) %>;
let importPromises = [];
for(let entryScript of pluginEntryScripts) {
let importPromise = import(ent... | import Session from "./Session.js";
<% for(let i = 0; i < entryScripts.length; i++) { -%>
import { default as plugin<%- i %> } from "<%- entryScripts[i] %>";
<% } -%>
let session = new Session();
loadPlugins()
.then(() => session.connect());
async function loadPlugins()
{
<% for(let i = 0; i < entryScripts.length;... | Remove dynamic import in client source | Remove dynamic import in client source
| JavaScript | mit | ArthurCose/JoshDevelop,ArthurCose/JoshDevelop |
7499a6bfd2b91b04724f5c7bd0ad903de5a226ab | sashimi-webapp/test/e2e/specs/fileManager/create-file-folder.spec.js | sashimi-webapp/test/e2e/specs/fileManager/create-file-folder.spec.js | function createDoc(browser, docType) {
const devServer = browser.globals.devServerURL;
browser.url(`${devServer}/`);
browser.expect.element('#app').to.be.visible.before(5000);
browser.execute(() => {
const className = `.${docType}`;
const numDocs = document.querySelectorAll(className).length;
ret... | function createDoc(browser, docType) {
const devServer = browser.globals.devServerURL;
browser.url(`${devServer}/`);
browser.expect.element('#app').to.be.visible.before(5000);
browser.execute(() => {
const className = `.${docType}`;
const numDocs = document.querySelectorAll(className).length;
ret... | Add pause after button click to handle delays | Add pause after button click to handle delays
| JavaScript | mit | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note |
edda84fefd17426fcdf822fc3fb746f30047085c | lib/template/blocks.js | lib/template/blocks.js | var _ = require('lodash');
module.exports = {
// Return non-parsed html
// since blocks are by default non-parsable, a simple identity method works fine
html: _.identity,
// Highlight a code block
// This block can be replaced by plugins
code: function(blk) {
return {
html:... | var _ = require('lodash');
module.exports = {
// Return non-parsed html
// since blocks are by default non-parsable, a simple identity method works fine
html: _.identity,
// Highlight a code block
// This block can be replaced by plugins
code: function(blk) {
return {
html:... | Add block "markdown", "asciidoc" and "markup" | Add block "markdown", "asciidoc" and "markup"
| JavaScript | apache-2.0 | ryanswanson/gitbook,gencer/gitbook,tshoper/gitbook,gencer/gitbook,GitbookIO/gitbook,strawluffy/gitbook,tshoper/gitbook |
dec054ca7face3467e6beeafdac8772346e8f38c | api/routes/users.js | api/routes/users.js | import {Router} from 'express'
import models from '../models';
import tasks from './tasks'
export default () => {
let app = Router({mergeParams: true})
app.use('/:userId/tasks', tasks())
app.get('/', (req, res) => {
models.User.findAll({
attributes: ['id', 'email']
}).then((users) => {
res.send(users)
... | import {Router} from 'express'
import models from '../models';
import tasks from './tasks'
export default () => {
let app = Router({mergeParams: true})
app.use('/:userId/tasks', tasks())
app.get('/:id', (req, res) => {
models.User.find(req.params.id).then((users) => {
res.send(users)
})
})
app.get('/new... | Update user POST and GET routes | Update user POST and GET routes
| JavaScript | mit | taodav/MicroSerfs,taodav/MicroSerfs |
7e5bc4044748de2130564ded69d3bc3618274b8a | test/test-purge.js | test/test-purge.js | require('./harness').run();
var recvCount = 0;
var body = "hello world";
connection.addListener('ready', function () {
puts("connected to " + connection.serverProperties.product);
var e = connection.exchange('node-purge-fanout', {type: 'fanout'});
var q = connection.queue('node-purge-queue', function() {
q... | require('./harness').run();
var recvCount = 0;
var body = "hello world";
connection.addListener('ready', function () {
puts("connected to " + connection.serverProperties.product);
var e = connection.exchange('node-purge-fanout', {type: 'fanout', confirm: true});
var q = connection.queue('node-purge-queue', fun... | Fix race condition in purge test. | Fix race condition in purge test.
| JavaScript | mit | xebitstudios/node-amqp,albert-lacki/node-amqp,zkochan/node-amqp,postwait/node-amqp,zinic/node-amqp,postwait/node-amqp,xebitstudios/node-amqp,albert-lacki/node-amqp,zinic/node-amqp,zkochan/node-amqp,postwait/node-amqp,remind101/node-amqp,remind101/node-amqp,hinson0/node-amqp,seanahn/node-amqp,seanahn/node-amqp,segmentio... |
6831e4787d7fd5a19aef1733e3bb158cb82538dd | resources/framework/dropdown-nav.js | resources/framework/dropdown-nav.js | /* From w3schools */
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
$(function () {
$('.c-dropdown__btn').click(function (event) {
event.preventDefault();
$(this).nextAll(".c-dropdown__cont").toggleClass('c-dropdown__cont--hide');
});
});
// Cl... | /* From w3schools */
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
$(function () {
$('.c-site-nav').on('click', '.c-dropdown__btn', function (event) {
event.preventDefault();
$(this).nextAll(".c-dropdown__cont").toggleClass('c-dropdown__cont--hide'... | Fix nav issue when using mean menu | Fix nav issue when using mean menu
When the link only had a dropdown and didnt have a link itself, it wouldnt trigger the dropdown on mobile
| JavaScript | mit | solleer/framework,solleer/framework,solleer/framework |
0ad0b316bb699abb9fd554e9bfce32135ca9f421 | webpack.config.babel.js | webpack.config.babel.js | import path from 'path';
import webpack from 'webpack';
import CommonsChunkPlugin from 'webpack/lib/optimize/CommonsChunkPlugin';
const PROD = process.env.NODE_ENV || 0;
module.exports = {
devtool: PROD ? false : 'eval',
entry: {
app: './app/assets/scripts/App.js',
vendor: [
'picturefill',
'.... | import path from 'path';
import webpack from 'webpack';
import CommonsChunkPlugin from 'webpack/lib/optimize/CommonsChunkPlugin';
const PROD = process.env.NODE_ENV || 0;
module.exports = {
devtool: PROD ? false : 'eval-cheap-module-source-map',
entry: {
app: './app/assets/scripts/App.js',
vendor: [
... | Improve source maps for JS | Improve source maps for JS
| JavaScript | mit | trendyminds/pura,trendyminds/pura |
824bd9786602e1af2414438f01dfea9e26842001 | js/src/forum/addTagLabels.js | js/src/forum/addTagLabels.js | import { extend } from 'flarum/extend';
import DiscussionListItem from 'flarum/components/DiscussionListItem';
import DiscussionPage from 'flarum/components/DiscussionPage';
import DiscussionHero from 'flarum/components/DiscussionHero';
import tagsLabel from '../common/helpers/tagsLabel';
import sortTags from '../comm... | import { extend } from 'flarum/extend';
import DiscussionListItem from 'flarum/components/DiscussionListItem';
import DiscussionHero from 'flarum/components/DiscussionHero';
import tagsLabel from '../common/helpers/tagsLabel';
import sortTags from '../common/utils/sortTags';
export default function() {
// Add tag l... | Remove an obsolete method extension | Remove an obsolete method extension
This method hasn't existed in a while, and its purpose (including
the related tags when loading a discussion via API) has already
been achieved by extending the backend.
| JavaScript | mit | Luceos/flarum-tags,flarum/flarum-ext-tags,flarum/flarum-ext-tags,Luceos/flarum-tags |
0c727e568bf61fa89c43f13ed0f413062442297f | js/src/util/load-resource.js | js/src/util/load-resource.js | import req from 'superagent';
import {dispatch} from '../dispatcher';
import {Action} from '../actions';
import meta from '../meta';
const DIR_CONFIG='/resource/config/app/moe/somesim',
DIR_DOC='/resource/markdown/app/moe/somesim';
export default ()=>{
req
.get(DIR_CONFIG+'/somesim.json?='+meta.version)
.e... | import req from 'superagent';
import {dispatch} from '../dispatcher';
import {Action} from '../actions';
import meta from '../meta';
const DIR_CONFIG='/resource/config/app/moe/somesim',
DIR_DOC='/resource/markdown/app/moe/somesim';
export default ()=>{
req
.get(DIR_CONFIG+'/somesim.json?='+meta.version)
.e... | Change property to be access | Change property to be access
| JavaScript | mit | pocka/moe-somesim,pocka/moe-somesim,pocka/moe-somesim |
6b7d6db52e3aca121e8ae0d12bc752c290bbad5f | updater/entries.js | updater/entries.js | 'use strict';
const format = require('util').format;
const log = require('util').log;
const Promise = require('bluebird');
const db = require('../shared/db');
module.exports = {
insert: insertEntries,
delete: deleteEntries
};
function deleteEntries(distribution) {
return Promise.using(db(), function(cli... | 'use strict';
const format = require('util').format;
const log = require('util').log;
const Promise = require('bluebird');
const db = require('../shared/db');
module.exports = {
insert: insertEntries,
delete: deleteEntries
};
function deleteEntries(distribution) {
return Promise.using(db(), function(cli... | Use one query per source instead of a single query | Use one query per source instead of a single query
This makes the code much much simpler.
| JavaScript | mit | ralt/dpsv,ralt/dpsv |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.