commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 624 | message stringlengths 15 4.7k | lang stringclasses 3
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
62b43e17c7f22f339b9d0e84792a63dbcaf6d83c | EPFL_People.user.js | EPFL_People.user.js | // ==UserScript==
// @name EPFL People
// @namespace none
// @description A script to improve browsing on people.epfl.ch
// @include http://people.epfl.ch/*
// @version 1
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @author EPFL-dojo
// ==... | // ==UserScript==
// @name EPFL People
// @namespace none
// @description A script to improve browsing on people.epfl.ch
// @include http://people.epfl.ch/*
// @version 1
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @author EPFL-dojo
// ==... | Save only one variable (dict) | Save only one variable (dict)
| JavaScript | unlicense | epfl-dojo/EPFL_People_UserScript |
c85b6344fcaaa605fb5aa58de659a0e5e042d1e3 | src/js/controller/about.js | src/js/controller/about.js | 'use strict';
var cfg = require('../app-config').config;
//
// Controller
//
var AboutCtrl = function($scope) {
$scope.state.about = {
toggle: function(to) {
$scope.state.lightbox = (to) ? 'about' : undefined;
}
};
//
// scope variables
//
$scope.version = cfg.a... | 'use strict';
var cfg = require('../app-config').config;
//
// Controller
//
var AboutCtrl = function($scope) {
$scope.state.about = {
toggle: function(to) {
$scope.state.lightbox = (to) ? 'about' : undefined;
}
};
//
// scope variables
//
$scope.version = cfg.a... | Add beta ta to version | Add beta ta to version
| JavaScript | mit | whiteout-io/mail-html5,kalatestimine/mail-html5,halitalf/mail-html5,sheafferusa/mail-html5,whiteout-io/mail,b-deng/mail-html5,dopry/mail-html5,dopry/mail-html5,kalatestimine/mail-html5,clochix/mail-html5,tanx/hoodiecrow,dopry/mail-html5,b-deng/mail-html5,whiteout-io/mail,dopry/mail-html5,halitalf/mail-html5,halitalf/ma... |
b36005ed996391dbf9502aaffbed6e0fc1297d28 | main.js | main.js | var app = require('app');
var BrowserWindow = require('browser-window');
var glob = require('glob');
var mainWindow = null;
// Require and setup each JS file in the main-process dir
glob('main-process/**/*.js', function (error, files) {
files.forEach(function (file) {
require('./' + file).setup();
});
});
ap... | var app = require('app');
var BrowserWindow = require('browser-window');
var glob = require('glob');
var mainWindow = null;
// Require and setup each JS file in the main-process dir
glob('main-process/**/*.js', function (error, files) {
files.forEach(function (file) {
require('./' + file).setup();
});
});
fu... | Handle OS X no window situation | Handle OS X no window situation
Same setup as quick start guide
| JavaScript | mit | PanCheng111/XDF_Personal_Analysis,electron/electron-api-demos,electron/electron-api-demos,electron/electron-api-demos,blep/electron-api-demos,blep/electron-api-demos,blep/electron-api-demos,blep/electron-api-demos,PanCheng111/XDF_Personal_Analysis,PanCheng111/XDF_Personal_Analysis |
9f5a15819d2f6503f33e5b27b0d30be239e5e72a | main.js | main.js | console.log("I'm ready");
| // Init the app after page loaded.
window.onload = initPage;
// The entry function.
function initPage() {
if (!canvasSupport()) { // If Canvas is not supported on the browser, do nothing but tell the user.
alert("Sorry, your browser does not support HTML5 Canvas");
return false;
}
drawScreen();
}
functi... | Make sure Canvas is supported on the browser | Make sure Canvas is supported on the browser
| JavaScript | mit | rainyjune/canvas-guesstheletter,rainyjune/canvas-guesstheletter |
b77e8e11e199428578ca8074a6367d9c740d1182 | {{cookiecutter.repo_name}}/webapp/webapp/webpack/config.dev.js | {{cookiecutter.repo_name}}/webapp/webapp/webpack/config.dev.js | /* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const makeConfig = require('./config.base');
// The app/ dir
const app_root = path.resolve(__dirname, '..');
const filenameTemplate = 'webapp/[name]';
const config = makeConfig({
filenameTemplate: filenameTemplate,
mode... | /* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const makeConfig = require('./config.base');
// The app/ dir
const app_root = path.resolve(__dirname, '..');
const filenameTemplate = 'webapp/[name]';
const config = makeConfig({
filenameTemplate: filenameTemplate,
mode... | Fix wrong public URL for static in webpack | Fix wrong public URL for static in webpack
After a recent change, `STATIC_URL` is now `assets` in the webapp.
The webpack config has not been updated though, and the frontend was trying an old URL.
| JavaScript | isc | thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template |
285c390eb811461d517f777a03167d9f44913af5 | views/components/touch-feedback.android.js | views/components/touch-feedback.android.js | import React from "react-native";
const {
TouchableNativeFeedback
} = React;
export default class TouchFeedback extends React.Component {
render() {
return (
<TouchableNativeFeedback {...this.props} background={TouchableNativeFeedback.Ripple(this.props.pressColor)}>
{this.props.children}
</TouchableNati... | import React from "react-native";
import VersionCodes from "../../modules/version-codes";
const {
TouchableNativeFeedback,
Platform
} = React;
export default class TouchFeedback extends React.Component {
render() {
return (
<TouchableNativeFeedback
{...this.props}
background={
Platform.Version >=... | Fix crash on Android 4.x | Fix crash on Android 4.x
| JavaScript | unknown | wesley1001/io.scrollback.neighborhoods,wesley1001/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods |
32c88d9541ed8b948d82c27e84d974d6340d3cb8 | views/controllers/room-title-controller.js | views/controllers/room-title-controller.js | import React from "react-native";
import RoomTitle from "../components/room-title";
import controller from "./controller";
const {
InteractionManager
} = React;
@controller
export default class RoomTitleController extends React.Component {
constructor(props) {
super(props);
const displayName = this.props.room.... | import React from "react-native";
import RoomTitle from "../components/room-title";
import controller from "./controller";
const {
InteractionManager
} = React;
@controller
export default class RoomTitleController extends React.Component {
constructor(props) {
super(props);
const displayName = this.props.room.... | Update room title on store change | Update room title on store change
| JavaScript | unknown | scrollback/io.scrollback.neighborhoods,wesley1001/io.scrollback.neighborhoods,wesley1001/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods |
5cb17c421ddbb9cc6ddf46b22db5255042c6f7d8 | www/static/js/jsfiddle-integration-babel.js | www/static/js/jsfiddle-integration-babel.js | // Do not delete or move this file.
// Many fiddles reference it so we have to keep it here.
(function() {
var tag = document.querySelector(
'script[type="application/javascript;version=1.7"]'
);
if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) {
alert('Bad JSFiddle configuration, ... | // Do not delete or move this file.
// Many fiddles reference it so we have to keep it here.
(function() {
var tag = document.querySelector(
'script[type="application/javascript;version=1.7"]'
);
if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) {
alert('Bad JSFiddle configuration, ... | Fix lint error in master | Fix lint error in master
| JavaScript | mit | apaatsio/react,pyitphyoaung/react,maxschmeling/react,krasimir/react,billfeller/react,empyrical/react,yangshun/react,ericyang321/react,aickin/react,brigand/react,jdlehman/react,VioletLife/react,mjackson/react,jorrit/react,mhhegazy/react,camsong/react,pyitphyoaung/react,pyitphyoaung/react,Simek/react,jzmq/react,acdlite/r... |
7d961ab16ca4db0bd91419cdfed8bb7f873ab36b | homeworks/dmitry.minchenko_wer1Kua/homework_2/script.js | homeworks/dmitry.minchenko_wer1Kua/homework_2/script.js | (function() {
let height = 15,
block = '#',
space = ' ';
if (height<2 || height>12) {
return console.log('Error! Height must be >= 2 and <= 12');
}
for (let i = 0; i < height; i++) {
console.log(space.repeat(height-i) + block.repeat(i+1) + space.repeat(2) + block.repeat... | (function() {
const HEIGHT = 15,
BLOCK = '#',
SPACE = ' ';
if (HEIGHT<2 || HEIGHT>12) {
return console.log('Error! Height must be >= 2 and <= 12');
}
for (let i = 0; i < HEIGHT; i++) {
console.log(SPACE.repeat(HEIGHT-i) + BLOCK.repeat(i+1) + SPACE.repeat(2) + BLOCK.repe... | Change to const instead of let | Change to const instead of let
| JavaScript | mit | MastersAcademy/js-course-2017,MastersAcademy/js-course-2017,MastersAcademy/js-course-2017 |
cf2fd636251dd9aeb60c224cfcbddf10dd65aea3 | frontend/cordova/app/hooks/after_platform_add/add_plugins.js | frontend/cordova/app/hooks/after_platform_add/add_plugins.js | #!/usr/bin/env node
//this hook installs all your plugins
var pluginlist = [
"https://github.com/driftyco/ionic-plugins-keyboard.git",
"cordova-plugin-vibration",
"cordova-plugin-media",
"https://github.com/apache/cordova-plugin-splashscreen.git",
"https://github.com/extendedmind/Calendar-PhoneGap... | #!/usr/bin/env node
//this hook installs all your plugins
var pluginlist = [
"https://github.com/driftyco/ionic-plugins-keyboard.git#v1.0.4",
"cordova-plugin-vibration",
"cordova-plugin-media",
"https://github.com/apache/cordova-plugin-splashscreen.git",
"https://github.com/extendedmind/Calendar-P... | Use specific version of Ionic Keyboard plugin | Use specific version of Ionic Keyboard plugin
| JavaScript | agpl-3.0 | extendedmind/extendedmind,ttiurani/extendedmind,extendedmind/extendedmind,extendedmind/extendedmind,ttiurani/extendedmind,extendedmind/extendedmind,extendedmind/extendedmind,ttiurani/extendedmind,extendedmind/extendedmind,extendedmind/extendedmind,ttiurani/extendedmind,ttiurani/extendedmind,ttiurani/extendedmind |
0a4d8a5b194a5c636b0aa6225dadd2ab9ff7e150 | parseFiles.js | parseFiles.js | var dir = require('node-dir');
dir.readFiles(__dirname, {
exclude: ['LICENSE', '.gitignore', '.DS_Store'],
excludeDir: ['node_modules', '.git']
}, function(err, content, next) {
if (err) throw err;
console.log('content:', content);
next();
},
function(err, files) {
... | var dir = require('node-dir');
dir.readFiles(__dirname, {
exclude: ['LICENSE', '.gitignore', '.DS_Store'],
excludeDir: ['node_modules', '.git']
}, function(err, content, next) {
if (err) throw err;
var digitalOceanToken = findDigitalOceanToken(String(content));
var awsToken ... | Add functionality to check for keys in commmit | Add functionality to check for keys in commmit
| JavaScript | mit | DevOps-HeadBangers/target-project-node |
53fd5fdf4afa38fd732728c283e9bc2277b7a5cb | index.js | index.js | const jsonMask = require('json-mask')
const badCode = code => code >= 300 || code < 200
module.exports = function (opt) {
opt = opt || {}
function partialResponse(obj, fields) {
if (!fields) return obj
return jsonMask(obj, fields)
}
function wrap(orig) {
return function (obj) {
const param... | const jsonMask = require('json-mask')
const badCode = code => code >= 300 || code < 200
module.exports = function (opt) {
opt = opt || {}
function partialResponse(obj, fields) {
if (!fields) return obj
return jsonMask(obj, fields)
}
function wrap(orig) {
return function (obj) {
const param... | Move badCode to the wrapping function | Move badCode to the wrapping function
This moves the badCode to the wrapping funciton as the status will
not be correct in the function where the middleware first gets
called.
| JavaScript | mit | nemtsov/express-partial-response |
4cfecfa2d4734c968ca6d3d1b65ec7e720f63081 | index.js | index.js | /**
* Created by tshen on 16/7/15.
*/
'use strict'
import {NativeModules} from 'react-native';
const NativeSimpleFetch = NativeModules.SimpleFetch;
const fetch = function (url, options) {
const params = {
url: url,
method: options.method ? options.method.toUpperCase() : 'GET',
headers: o... | /**
* Created by tshen on 16/7/15.
*/
'use strict'
import {NativeModules} from 'react-native';
const NativeSimpleFetch = NativeModules.SimpleFetch;
const fetch = function (url, options) {
const params = {
url: url,
method: options.method ? options.method.toUpperCase() : 'GET',
headers: o... | Fix bug. Remove console logs. | Fix bug. Remove console logs.
| JavaScript | mit | liaoyuan-io/react-native-simple-fetch |
7b50be2427d450460b9b8c8ae8be6c81743bbf48 | index.js | index.js | /* jshint node: true */
'use strict';
// var path = require('path');
module.exports = {
name: 'ember-power-select',
contentFor: function(type, config) {
if (config.environment !== 'test' && type === 'body-footer') {
return '<div id="ember-power-select-wormhole"></div>';
}
},
included: function(... | /* jshint node: true */
'use strict';
// var path = require('path');
module.exports = {
name: 'ember-power-select',
contentFor: function(type, config) {
if (config.environment !== 'test' && type === 'body-footer') {
return '<div id="ember-power-select-wormhole"></div>';
}
},
included: function(... | Include precompiled styles automatically for non-sass users | Include precompiled styles automatically for non-sass users
| JavaScript | mit | cibernox/ember-power-select,esbanarango/ember-power-select,chrisgame/ember-power-select,esbanarango/ember-power-select,cibernox/ember-power-select,Dremora/ember-power-select,chrisgame/ember-power-select,cibernox/ember-power-select,Dremora/ember-power-select,cibernox/ember-power-select,esbanarango/ember-power-select |
429aa690a42e8f0f9282ca4a63bff052e45ea25e | packages/accounts-meetup/meetup_client.js | packages/accounts-meetup/meetup_client.js | (function () {
Meteor.loginWithMeetup = function (options, callback) {
// support both (options, callback) and (callback).
if (!callback && typeof options === 'function') {
callback = options;
options = {};
}
var config = Accounts.loginServiceConfiguration.findOne({service: 'meetup'});
... | (function () {
Meteor.loginWithMeetup = function (options, callback) {
// support both (options, callback) and (callback).
if (!callback && typeof options === 'function') {
callback = options;
options = {};
}
var config = Accounts.loginServiceConfiguration.findOne({service: 'meetup'});
... | Tweak the height of the popup box. Meetup varies the height of their box based on which permissions are requested. | Tweak the height of the popup box. Meetup varies the height of their box based on which permissions are requested. | JavaScript | mit | aldeed/meteor,sunny-g/meteor,pjump/meteor,shmiko/meteor,esteedqueen/meteor,wmkcc/meteor,framewr/meteor,Profab/meteor,ndarilek/meteor,steedos/meteor,allanalexandre/meteor,daltonrenaldo/meteor,Jonekee/meteor,vjau/meteor,Jeremy017/meteor,devgrok/meteor,jdivy/meteor,allanalexandre/meteor,Prithvi-A/meteor,joannekoong/meteor... |
5317b7fb100af66af865bcd82ed32c2dc3a1643c | index.js | index.js | var elixir = require('laravel-elixir');
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
var notify = require('gulp-notify');
var _ = require('underscore');
var utilities = require('laravel-elixir/ingredients/helpers/utilities');
/*
|-------------------... | var elixir = require('laravel-elixir');
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
var notify = require('gulp-notify');
var _ = require('underscore');
var utilities = require('laravel-elixir/ingredients/commands/utilities');
/*
|------------------... | Fix utilities path from helpers to commands | Fix utilities path from helpers to commands
| JavaScript | mit | waldemarfm/laravel-elixir-imagemin,nathanmac/laravel-elixir-imagemin |
e5b7f40ea0e1751213048b3d50e49dc36438c3e3 | website/src/app/project/experiments/experiment/components/notes/mc-experiment-notes.component.js | website/src/app/project/experiments/experiment/components/notes/mc-experiment-notes.component.js | angular.module('materialscommons').component('mcExperimentNotes', {
templateUrl: 'app/project/experiments/experiment/components/notes/mc-experiment-notes.html',
bindings: {
experiment: '='
}
});
| angular.module('materialscommons').component('mcExperimentNotes', {
templateUrl: 'app/project/experiments/experiment/components/notes/mc-experiment-notes.html',
controller: MCExperimentNotesComponentController,
bindings: {
experiment: '='
}
});
class MCExperimentNotesComponentController {
/... | Add controller (to be filled out). | Add controller (to be filled out).
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
a91e08c79733eac0ff55f16840bbefc39adb6aa8 | index.js | index.js | const vm = require('vm')
module.exports = class Guards {
constructor () {
this.guardRegex = /[^=<>!']=[^=]/
this.templateRegex = /[^|]\|[^|]/
this.optionsVM = {
displayErrors: true,
filename: 'guards'
}
}
getStack () {
const origin = Error.prepareStackTrace
const error = ne... | class Guards {
constructor () {
this.guardRegex = /[^=<>!']=[^=]/
this.templateRegex = /[^|]\|[^|]/
}
buildPredicate (constants, guard) {
return new Function(
'',
[
`const { ${this.destructureProps(constants)} } = ${JSON.stringify(constants)}`,
`return ${guard}`
].j... | Drop v8 vm for native implementation, update tests accordingly :rocket:. | Drop v8 vm for native implementation, update tests accordingly :rocket:.
- Implements and closes #1 by @edmulraney.
- Better performance & browser support.
| JavaScript | mit | yamafaktory/pattern-guard |
e3a2c979b160201b53cb38660733f495be2b449a | index.js | index.js | 'use strict';
var extend = require('extend');
var express = require('express');
var bodyParser = require('body-parser');
var router = express.Router();
var defaults = {
loginEndpoint: '/login',
logoutEndpoint: '/logout',
idField: 'email',
passwordField: 'password'
};
module.exports = function (options) {
o... | 'use strict';
var extend = require('extend');
var express = require('express');
var bodyParser = require('body-parser');
var bcrypt = require('bcrypt');
var router = express.Router();
var defaults = {
loginEndpoint: '/login',
logoutEndpoint: '/logout',
idField: 'email',
passwordField: 'password',
passwordHa... | Add getUser and validatePassword to login | Add getUser and validatePassword to login
| JavaScript | isc | knownasilya/just-auth |
a3fd89525c5eb04e8bdcc5289fbe1e907d038821 | src/plugins/plugin-shim.js | src/plugins/plugin-shim.js | /**
* Add shim config for configuring the dependencies and exports for
* older, traditional "browser globals" scripts that do not use define()
* to declare the dependencies and set a module value.
*/
(function(seajs, global) {
// seajs.config({
// alias: {
// "jquery": {
// src: "lib/jquery.js",
//... | /**
* Add shim config for configuring the dependencies and exports for
* older, traditional "browser globals" scripts that do not use define()
* to declare the dependencies and set a module value.
*/
(function(seajs, global) {
// seajs.config({
// alias: {
// "jquery": {
// src: "lib/jquery.js",
//... | Fix the bug when src key is undefined,the shim plugin do not work. | Fix the bug when src key is undefined,the shim plugin do not work.
When an alias item, the 'src' key is not defined, the code do not work
well with the exports value.
| JavaScript | mit | moccen/seajs,Lyfme/seajs,coolyhx/seajs,zaoli/seajs,baiduoduo/seajs,twoubt/seajs,tonny-zhang/seajs,mosoft521/seajs,wenber/seajs,miusuncle/seajs,yern/seajs,Gatsbyy/seajs,imcys/seajs,angelLYK/seajs,kuier/seajs,MrZhengliang/seajs,twoubt/seajs,JeffLi1993/seajs,lianggaolin/seajs,yern/seajs,uestcNaldo/seajs,121595113/seajs,ue... |
d54150b9a86c3cc0a08376e3b1cf9c223a7c0096 | index.js | index.js | ;(_ => {
'use strict';
var tagContent = 'router2-content';
function matchHash() {
var containers = document.querySelectorAll(`${tagContent}:not([hidden])`);
var container;
for (var i = 0; i < containers.length; i++) {
containers[i].hidden = true;
}
var hash = window.location.hash.slice... | ;(_ => {
'use strict';
var tagContent = 'router2-content';
function matchHash(parent, hash) {
var containers;
var container;
var _hash = hash || window.location.hash;
if (!parent) {
containers = document.querySelectorAll(`${tagContent}:not([hidden])`);
for (var i = 0; i < containers.... | Complete the test for case 3 | Complete the test for case 3
| JavaScript | isc | m3co/router3,m3co/router3 |
4840f0296869dc9e78856cf577d766e3ce3ccabe | index.js | index.js | 'use strict';
var server = require('./lib/server/')();
var config = require('config');
function ngrokIsAvailable() {
try {
require.resolve('ngrok');
return true;
} catch (e) {
return false;
}
}
if (config.isValid()) {
var port = config.get("port") || 8080;
server.listen(port, function () {
c... | 'use strict';
var server = require('./lib/server/')();
var config = require('config');
function ngrokIsAvailable() {
try {
require.resolve('ngrok');
return true;
} catch (e) {
return false;
}
}
/**
* Make sure to configuration is valid before attempting to start the server.
*/
if (!config.isValid(... | Rearrange code to reduce nesting as requested by PR comment. | Rearrange code to reduce nesting as requested by PR comment.
| JavaScript | mit | syjulian/Frontier,codeforhuntsville/Frontier |
8aca8785d53d7c0568020a128df8e4fcb7865d2b | index.js | index.js | 'use strict';
require('whatwg-fetch');
const path = require('path'),
querystring = require('querystring').parse;
const registry = 'http://npm-registry.herokuapp.com';
const query = querystring(window.location.search.slice(1)).q;
if (query) {
window.fetch(path.join(registry, query))
.then((response) => ... | 'use strict';
require('whatwg-fetch');
const url = require('url'),
querystring = require('querystring').parse;
const registry = 'http://npm-registry.herokuapp.com';
const query = querystring(window.location.search.slice(1)).q;
if (query) {
window.fetch(url.resolve(registry, query))
.then((response) => ... | Use url.resolve to get the url | Use url.resolve to get the url
| JavaScript | mit | npmdocs/www |
349a44df9340accdccbf829317dce9e359442e8c | service.js | service.js | var find = require('reactor/find'),
serializer = require('./serializer'),
url = require('url');
function say () {
var all = [].slice.call(arguments),
filtered = all.filter(function (argument) { return argument !== say });
console.log.apply(console, filtered);
if (filtered.length != all.length) proc... | var find = require('reactor/find'),
serializer = require('./serializer'),
url = require('url');
function say () {
var all = [].slice.call(arguments),
filtered = all.filter(function (argument) { return argument !== say });
console.log.apply(console, filtered);
if (filtered.length != all.length) proc... | Add `request` and `response` to context. | Add `request` and `response` to context.
Add `request` and `response` to context in the service.
Closes #106.
| JavaScript | mit | bigeasy/stencil,bigeasy/stencil,bigeasy/stencil |
5afa8d8796312b693964d133e626f23f3ba3a67c | src/main.js | src/main.js | import React from 'react';
import App from './App';
import config from './config';
var mountNode = document.getElementById('main');
React.render(<App config={config.params} />, mountNode); | import React from 'react';
import App from './App';
var mountNode = document.getElementById('main');
const config = {
name: window.GROUP_NAME,
description: window.GROUP_DESCRIPTION,
rootUrl: window.ROOT_URL,
formContact: window.FORM_CONTACT,
headerMenuLinks: window.HEADER_MENU_LINKS,
twitterUsername: ... | Use global variables instead of configuration file (no need to recompile the JS code to see the changes) | Use global variables instead of configuration file (no need to recompile the JS code to see the changes)
| JavaScript | apache-2.0 | naltaki/naltaki-front,naltaki/naltaki-front |
5570a14c93b71af910e89fc4f2a6f8d7435451ed | src/main.js | src/main.js | import electron from 'electron';
import path from 'path';
import Menu from './remote/Menu';
import config from './config';
const app = electron.app;
// Report crashes to our server.
// electron.CrashReporter.start();
// Keep a global reference of the window object, if you don't, the window will
// be closed automa... | import electron from 'electron';
import path from 'path';
import process from 'process';
import Menu from './remote/Menu';
import config from './config';
const app = electron.app;
// Report crashes to our server.
// electron.CrashReporter.start();
// Keep a global reference of the window object, if you don't, the ... | Call process.exit() when all windows are closed | [XDE] Call process.exit() when all windows are closed
| JavaScript | mit | exponentjs/xde,exponentjs/xde |
1d0bbe6b09e8c2beeb4cf4cb9c9c20944f194275 | index.js | index.js | var Promise = require('bluebird');
var mapObj = require('map-obj');
var assign = require('object-assign');
function FileWebpackPlugin(files) {
this.files = files || {};
}
FileWebpackPlugin.prototype.apply = function(compiler) {
var self = this;
compiler.plugin('emit', function(compiler, done) {
var data = {... | var Promise = require('bluebird');
var mapObj = require('map-obj');
var assign = require('object-assign');
function FileWebpackPlugin(files) {
this.files = files || {};
}
FileWebpackPlugin.prototype.apply = function(compiler) {
var self = this;
compiler.plugin('emit', function(compiler, done) {
var data = {... | Use Bluebird's nodeify to handle resulting promise | Use Bluebird's nodeify to handle resulting promise | JavaScript | mit | markdalgleish/file-webpack-plugin |
a84c9a76cbb4b65bf6c8a4f3483025a509bfab76 | src/api/mqttPublishMessage.js | src/api/mqttPublishMessage.js | const apiPutMqttMessage = {
schema: {
summary: 'Retrieve a list of all keys present in the specified namespace.',
description: '',
body: {
type: 'object',
properties: {
topic: {
type: 'string',
description: 'Name... | const apiPutMqttMessage = {
schema: {
summary: 'Publish a message to a MQTT topic.',
description: '',
body: {
type: 'object',
properties: {
topic: {
type: 'string',
description: 'Topic to which message should be ... | Fix incorrect text for MQTT publish | docs: Fix incorrect text for MQTT publish
Fixes #262
| JavaScript | mit | mountaindude/butler |
42f0f66acdef27a58599d59f72c6b8ae784975ab | src/blocks/scratch3_motion.js | src/blocks/scratch3_motion.js | function Scratch3MotionBlocks(runtime) {
/**
* The runtime instantiating this block package.
* @type {Runtime}
*/
this.runtime = runtime;
}
/**
* Retrieve the block primitives implemented by this package.
* @return {Object.<string, Function>} Mapping of opcode to Function.
*/
Scratch3MotionBl... | var MathUtil = require('../util/math-util');
function Scratch3MotionBlocks(runtime) {
/**
* The runtime instantiating this block package.
* @type {Runtime}
*/
this.runtime = runtime;
}
/**
* Retrieve the block primitives implemented by this package.
* @return {Object.<string, Function>} Mappi... | Implement move steps, turn right, turn left, point in direction | Implement move steps, turn right, turn left, point in direction
| JavaScript | bsd-3-clause | TheBrokenRail/scratch-vm,LLK/scratch-vm,LLK/scratch-vm,LLK/scratch-vm,TheBrokenRail/scratch-vm |
ff95f103ac755324d36b4d3a60a61ad8014e9ce9 | src/web3.js | src/web3.js | import Web3 from 'web3';
const web3 = new Web3();
export default web3;
export const initWeb3 = (web3) => {
if (window.web3) {
web3.setProvider(window.web3.currentProvider);
} else {
web3.setProvider(new Web3.providers.HttpProvider('https://mainnet.infura.io/'));
}
window.web3 = web3;
}
| import Web3 from 'web3';
const web3 = new Web3();
export default web3;
export const initWeb3 = (web3) => {
if (window.web3) {
web3.setProvider(window.web3.currentProvider);
} else {
web3.setProvider(new Web3.providers.HttpProvider('https://mainnet.infura.io/Tl5m5gSA2IY0XJe9BWrS'));
}
window.web3 = we... | Add api key... will have to remove eventually | Add api key... will have to remove eventually
| JavaScript | mit | nanexcool/feeds,nanexcool/feeds |
d3296125920a838a56c68ca2da1e9f9b4216bc03 | preTest.js | preTest.js | //makes the bdd interface available (describe, it before, after, etc
if(Meteor.settings.public.mocha_setup_args) {
mocha.setup(Meteor.settings.public.mocha_setup_args);
} else {
mocha.setup("bdd");
}
| //makes the bdd interface available (describe, it before, after, etc
if(Meteor.settings && Meteor.settings.public.mocha_setup_args) {
mocha.setup(Meteor.settings.public.mocha_setup_args);
} else {
mocha.setup("bdd");
}
| Fix for when Mocha.settings are not available | Fix for when Mocha.settings are not available
| JavaScript | mit | kelbongoo/meteor-mocha-web,abernix/meteor-mocha-web,mad-eye/meteor-mocha-web,mad-eye/meteor-mocha-web,kelbongoo/meteor-mocha-web,abernix/meteor-mocha-web |
ba64925e6c6b07b42f8a28b9a141e1ada42c3550 | src/components/MainNav/Breadcrumbs/Breadcrumbs.js | src/components/MainNav/Breadcrumbs/Breadcrumbs.js | import React from 'react';
import css from './Breadcrumbs.css';
const propTypes = {
links: React.PropTypes.array,
};
function Breadcrumbs(props) {
const links = props.links.map((link, i) => {
const linkElem = <li key={`breadcrumb_${i}`}><a href={link.path}>{link.label}</a></li>;
const dividerElem = <li ke... | import React from 'react';
import css from './Breadcrumbs.css';
const propTypes = {
links: React.PropTypes.array,
};
function Breadcrumbs(props) {
const links = props.links.map((link, i) => {
// eslint-disable-next-line react/no-array-index-key
const linkElem = <li key={`breadcrumb_${i}`}><a href={link.pa... | Add eslint-disable-next-line comments to get rid of excessively pedantic react/no-array-index-key errors. | Add eslint-disable-next-line comments to get rid of excessively pedantic react/no-array-index-key errors.
| JavaScript | apache-2.0 | folio-org/stripes-core,folio-org/stripes-core,folio-org/stripes-core |
470c616cf598fb14842d8326d6fe416952b79d8a | test/common.js | test/common.js | 'use strict';
const hookModule = require("../src/");
class TallyHook extends hookModule.Hook {
preProcess(thing) {
thing.preTally = thing.preTally + 1;
return true;
}
postProcess(thing) {
thing.postTally = thing.postTally + 1;
}
}
module.exports = {
TallyHook
};
| 'use strict';
const hookModule = require("../src/");
class TallyHook extends hookModule.Hook {
preProcess(thing) {
thing.preTally = thing.preTally + 1;
return true;
}
postProcess(thing) {
thing.postTally = thing.postTally + 1;
}
}
class DelayableHook extends hookModule.Hook {
constructor(optio... | Add a DelayedHook test class. | Add a DelayedHook test class.
| JavaScript | mit | StevenBlack/hooks-and-anchors |
e49fd692e1281f91164d216708befd81a1a3c102 | test/simple.js | test/simple.js | var test = require("tape")
var crypto = require('crypto')
var cryptoB = require('../')
var assert = require('assert')
function assertSame (fn) {
test(fn.name, function (t) {
fn(crypto, function (err, expected) {
fn(cryptoB, function (err, actual) {
t.equal(actual, expected)
t.end()
}... | var test = require("tape")
var crypto = require('crypto')
var cryptoB = require('../')
function assertSame (fn) {
test(fn.name, function (t) {
t.plan(1)
fn(crypto, function (err, expected) {
fn(cryptoB, function (err, actual) {
t.equal(actual, expected)
t.end()
})
})
})
}
... | Use tape for asserts to better detect callbacks not being fired | Use tape for asserts to better detect callbacks not being fired | JavaScript | mit | crypto-browserify/crypto-browserify,crypto-browserify/crypto-browserify |
4da17d2e30b07b73de2a5d7b548ca8ed4b9bc4f2 | src/utils/hex-generator.js | src/utils/hex-generator.js | const hexWidth = 50;
const hexPadding = 2;
export default ({ width, height, columns, rows, renderSector }) => {
const hexWidthUnit = hexWidth / 4;
const hexHeight = (Math.sqrt(3) / 2) * hexWidth;
const hexHeightUnit = hexHeight / 2;
const hexArray = [];
let isWithinHeight = true;
let isWithinWidth = true;
... | const defaultHexWidth = 50;
const hexPadding = 2;
export default ({ width, height, columns, rows, renderSector }) => {
const scaledWidth = Math.min(height / (rows + 4), width / (columns + 4));
const horizHexOffset = Math.ceil((((width / scaledWidth) / (Math.sqrt(3) / 2)) - columns) / 2);
const vertHexOffset = Ma... | Put the sector in the middle of the hex grid (very crude) | Put the sector in the middle of the hex grid (very crude)
| JavaScript | mit | mpigsley/sectors-without-number,mpigsley/sectors-without-number |
31663486624635748d6f2202504b0a187a102fcd | RcmBrightCoveLib/public/keep-aspect-ratio.js | RcmBrightCoveLib/public/keep-aspect-ratio.js | /**
* This script keeps the height set on elements with regard to their
* width for a given aspect ratio. Great for "display:block" elements
*
* Example usage:
*
* <div data-keep-aspect-ratio="16:9">
*
* Author: Rod McNew
* License: BSD
*/
new function () {
var setHeights = function () {
$.each($(... | /**
* This script keeps the height set on elements with regard to their
* width for a given aspect ratio. Great for "display:block" elements
*
* Example usage:
*
* <div data-keep-aspect-ratio="16:9">
*
* Author: Rod McNew
* License: BSD
*/
new function () {
var setHeights = function () {
$.each($(... | Fix for brightcove player when orintation is changed | Fix for brightcove player when orintation is changed
| JavaScript | bsd-3-clause | jerv13/RcmPlugins,jerv13/RcmPlugins,bjanish/RcmPlugins,jerv13/RcmPlugins,innaDa/RcmPlugins,innaDa/RcmPlugins,innaDa/RcmPlugins,bjanish/RcmPlugins,bjanish/RcmPlugins |
c57a584a3bc781db629ae15dd2912f62992f98f3 | Resources/private/js/sylius-auto-complete.js | Resources/private/js/sylius-auto-complete.js | /*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
(function ( $ ) {
'use strict';
$.fn.extend({
autoComplete: function () {
var el... | /*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
(function ( $ ) {
'use strict';
$.fn.extend({
autoComplete: function () {
var el... | Use collection instead of array in all transformers, also use map method | [Resource][Core] Use collection instead of array in all transformers, also use map method
| JavaScript | mit | Sylius/SyliusUiBundle,Sylius/SyliusUiBundle |
62b292ddf6a6fb71097c5cfa527b625366c46a3f | src/components/slide/index.js | src/components/slide/index.js | import React, { Component, PropTypes } from 'react';
require('./slide.scss');
class Slide extends Component {
render() {
return (
<div className="slide">
<header className="slide__header">
<h1 className="slide__title">{this.props.title}</h1>
... | import React, { Component, PropTypes } from 'react';
require('./slide.scss');
class Slide extends Component {
constructor(props) {
super(props);
this.isViewable = this.isViewable.bind(this);
}
isViewable() {
return this.props.current === +this.props.order;
}
render() {
... | Make slide viewable based on current and order | feature: Make slide viewable based on current and order
A slide will be viewable only if the current property matches
the order property.
| JavaScript | mit | leadiv/react-slides,leadiv/react-slides |
daed42ff845baa2abf1e0fd180d7fb0eb2a13b3d | lib/cli/file-set-pipeline/log.js | lib/cli/file-set-pipeline/log.js | /**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:cli:log
* @fileoverview Log a file context on successful completion.
*/
'use strict';
/*
* Dependencies.
*/
var report = require('vfile-reporter');
/**
* Output diagnostics to stdout(4) or stderr(4).
*
* @param {CLI}... | /**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:cli:log
* @fileoverview Log a file context on successful completion.
*/
'use strict';
/*
* Dependencies.
*/
var report = require('vfile-reporter');
/**
* Output diagnostics to stdout(4) or stderr(4).
*
* @param {CLI}... | Move all info output of mdast(1) to stderr(4) | Move all info output of mdast(1) to stderr(4)
This changes moves all reporting output, even when not including
failure messages, from stout(4) to stderr(4).
Thus, when piping only stdout(4) from mdast(1) into a file, only
the markdown is written.
Closes GH-47.
| JavaScript | mit | ulrikaugustsson/mdast,eush77/remark,chcokr/mdast,ulrikaugustsson/mdast,yukkurisinai/mdast,tanzania82/remarks,yukkurisinai/mdast,wooorm/remark,chcokr/mdast,eush77/remark |
a7f6773184b6a08d6fcc62ed82e331e114f731b8 | static/js/json_selector.js | static/js/json_selector.js | // ===================================================
// DOM Outline with event handlers
// ===================================================
$(function(){
var $selector_box = $("#selector");
var selector_val = "";
var DomOutlineHandlers = {
'click': function(e){
selector_val = $(e).... | // ===================================================
// DOM Outline with event handlers
// ===================================================
$(function(){
var $selector_box = $("#selector");
var selector_val = "";
var DomOutlineHandlers = {
'click': function(e){
selector_val = $(e).... | Use .attr instead of .data to get json selector. Prevents evaluation of [x] as array | Use .attr instead of .data to get json selector. Prevents evaluation of [x] as array
| JavaScript | mit | joequery/JSON-Selector-Generator,joequery/JSON-Selector-Generator,joequery/JSON-Selector-Generator |
38c8a46baee9cd61571cf26ba9c3942a98f3ce92 | src/js/stores/ArrangeStore.js | src/js/stores/ArrangeStore.js | import { action, computed } from 'mobx'
import { moveTabs, tabComparator } from '../libs'
export default class ArrangeStore {
constructor (store) {
this.store = store
}
@computed
get urlTabMap () {
return this.store.windowStore.tabs.reduce((acc, tab) => {
const { url } = tab
acc[url] = acc... | import { action, computed } from 'mobx'
import { moveTabs, tabComparator } from '../libs'
const urlPattern = /.*:\/\/[^/]*/
const getDomain = (url) => {
const matches = url.match(urlPattern)
if (matches) {
return matches[0]
}
return url
}
export default class ArrangeStore {
constructor (store) {
thi... | Update sortTabs to group tabs by domain then sort in window | Update sortTabs to group tabs by domain then sort in window
| JavaScript | mit | xcv58/Tab-Manager-v2,xcv58/Tab-Manager-v2,xcv58/Tab-Manager-v2,xcv58/Tab-Manager-v2 |
bdca4d4b6b04ad011a25fd913ec4c7ed2ed04b1d | react/components/Onboarding/components/UI/CTAButton/index.js | react/components/Onboarding/components/UI/CTAButton/index.js | import theme from 'react/styles/theme';
import GenericButton from 'react/components/UI/GenericButton';
import styled from 'styled-components';
const CTAButton = styled(GenericButton).attrs({
f: 6,
})`
margin-top: ${theme.space[6]}
`;
export default CTAButton;
| import GenericButton from 'react/components/UI/GenericButton';
import styled from 'styled-components';
const CTAButton = styled(GenericButton).attrs({
f: 6
})`
margin-top: ${x => x.theme.space[6]}
`;
export default CTAButton;
| Use theme propeties in CTAButton styled component | Use theme propeties in CTAButton styled component
| JavaScript | mit | aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell |
07bffcd4d825b86dbd3386c2f3866f770671c6cb | src/lib/units/day-of-month.js | src/lib/units/day-of-month.js | import { makeGetSet } from '../moment/get-set';
import { addFormatToken } from '../format/format';
import { addUnitAlias } from './aliases';
import { addUnitPriority } from './priorities';
import { addRegexToken, match1to2, match2 } from '../parse/regex';
import { addParseToken } from '../parse/token';
import { DATE } ... | import { makeGetSet } from '../moment/get-set';
import { addFormatToken } from '../format/format';
import { addUnitAlias } from './aliases';
import { addUnitPriority } from './priorities';
import { addRegexToken, match1to2, match2 } from '../parse/regex';
import { addParseToken } from '../parse/token';
import { DATE } ... | Add fallback for old name ordinalParse | Add fallback for old name ordinalParse
| JavaScript | mit | PKRoma/moment,Oire/moment,julionc/moment,OtkurBiz/moment,ze-pequeno/moment,julionc/moment,OtkurBiz/moment,moment/moment,joelmheim/moment,xkxx/moment,monoblaine/moment,ze-pequeno/moment,moment/moment,Oire/moment,OtkurBiz/moment,xkxx/moment,monoblaine/moment,xkxx/moment,PKRoma/moment,joelmheim/moment,calebcauthon/moment,... |
06b9ff1d0759d289ae70fbd9717cf8129e3485bc | pages/home/index.js | pages/home/index.js | /**
* React Static Boilerplate
* https://github.com/kriasoft/react-static-boilerplate
*
* Copyright © 2015-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React, { PropTypes }... | /**
* React Static Boilerplate
* https://github.com/kriasoft/react-static-boilerplate
*
* Copyright © 2015-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React, { PropTypes }... | Fix React warning on the home page (add key attribute to list items) | Fix React warning on the home page (add key attribute to list items)
| JavaScript | mit | raffidil/garnanain,koistya/react-static-boilerplate,jamesrf/weddingwebsite,kyoyadmoon/fuzzy-hw1,gadflying/profileSite,RyanGosden/react-poll,srossross-tableau/hackathon,kyoyadmoon/fuzzy-hw1,leo60228/HouseRuler,jamesrf/weddingwebsite,gadflying/profileSite,leo60228/HouseRuler,RyanGosden/react-poll,kriasoft/react-static-bo... |
5afa1a697da48fb473d0e19fe6e5dbfc6913ca75 | src/common/analytics/index.js | src/common/analytics/index.js | /**
* Dependencies.
*/
let NullAnalytics = require('./NullAnalytics');
let Tracker = require('./Tracker');
/**
* Constants.
*/
const ANALYTICS_KEY = process.env.ANALYTICS_KEY;
/**
* Locals.
*/
let enableAnalytics = window.ProductHuntAnalytics && ANALYTICS_KEY;
let ProductHuntAnalytics = enableAnalytics ? win... | /**
* Dependencies.
*/
let NullAnalytics = require('./NullAnalytics');
let Tracker = require('./Tracker');
/**
* Constants.
*/
const ANALYTICS_KEY = process.env.ANALYTICS_KEY;
/**
* Locals.
*
* Note(andreasklinger): window.ProductHuntAnalytics gets set by a custom built of the analytics.js
* To recreate t... | Add note to explain where the custom name comes from | Add note to explain where the custom name comes from | JavaScript | isc | producthunt/producthunt-chrome-extension,producthunt/producthunt-chrome-extension |
998601c34ba9537fa6230232379c1efad84e17bb | routes/new.js | routes/new.js | // This route will save the given url into the database
// returning its "shorter" version
var router = require('express').Router();
var isValid = require('valid-url').isWebUri;
router.get('/http://:url', function(req, res) {
var json = {};
json.original = 'http://' + req.params.url;
json.shorter = getShor... | // This route will save the given url into the database
// returning its "shorter" version
var router = require('express').Router();
var isValid = require('valid-url').isWebUri;
// Using GET parameters in place of something like "/:url", because
// with this last solution the server is fooled by the "http" in the
// m... | Reduce code duplication using GET params | Reduce code duplication using GET params
Replaced the two routes, one for http and another one for https, using
GET parameter ?url=
| JavaScript | mit | clobrano/fcc-url-shortener-microservice,clobrano/fcc-url-shortener-microservice |
ede5962c9926c8a852ccbc307e3a970ede4d6954 | build/server.js | build/server.js | console.time('Starting server');
require('promise-helpers');
var fs = require('fs');
var path = require('path');
var express = require('express');
var app = express();
/**
* Serve static files such as css, js, images
*/
app.use('/images', express.static('dist/assets/images'));
app.use('/javascripts', express.static... | console.time('Starting server');
require('promise-helpers');
var fs = require('fs');
var path = require('path');
var express = require('express');
var app = express();
/**
* Serve static files such as css, js, images
*/
app.use('/images', express.static('dist/assets/images'));
app.use('/javascripts', express.static... | Fix broken path to css caused by previous commit | Fix broken path to css caused by previous commit
| JavaScript | mit | LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements |
92dfcaa6e03959bc6b88701d8f269c0e344bad76 | src/actions.js | src/actions.js | import assign from 'object-assign';
import { store } from './helpers';
export const MENU_SHOW = 'REACT_CONTEXTMENU_SHOW';
export const MENU_HIDE = 'REACT_CONTEXTMENU_HIDE';
export function dispatchGlobalEvent(eventName, opts, target = window) {
// Compatibale with IE
// @see http://stackoverflow.com/questions/2... | import assign from 'object-assign';
import { store } from './helpers';
export const MENU_SHOW = 'REACT_CONTEXTMENU_SHOW';
export const MENU_HIDE = 'REACT_CONTEXTMENU_HIDE';
export function dispatchGlobalEvent(eventName, opts, target = window) {
// Compatibale with IE
// @see http://stackoverflow.com/questions/2... | Fix for IE11 custom event | Fix for IE11 custom event
| JavaScript | mit | codeart1st/react-contextmenu,vkbansal/react-contextmenu,vkbansal/react-contextmenu,codeart1st/react-contextmenu,danbovey/react-contextmenu,danbovey/react-contextmenu |
8712432a2c9d555ecdbae0b9c549f6554dd9be6d | assets/materialize/js/init.js | assets/materialize/js/init.js | (function($){
$(function(){
$('.button-collapse').sideNav();
}); // end of document ready
})(jQuery); // end of jQuery name space
// Keep one tab expanded while editing profile
$('li div.collapsible-header').on('click',function(e){
if($(this).parents('li').hasClass('active')){
e.stopPropagation();
}
... | (function($){
$(function(){
$('.button-collapse').sideNav();
}); // end of document ready
})(jQuery); // end of jQuery name space
// Keep one tab expanded while editing profile
/*$('li div.collapsible-header').on('click',function(e){
if($(this).parents('li').hasClass('active')){
e.stopPropagation();
... | Allow collapse all accordion tabs in profileeditor | Allow collapse all accordion tabs in profileeditor
| JavaScript | mit | VoodooWorks/profile-cms,VoodooWorks/profile-cms,VoodooWorks/profile-cms |
4e7eaa000c897c36ed6cdbea6e5e53d49b2b2a76 | src/components/pages/PatientsSummary/header/PTCustomCheckbox.js | src/components/pages/PatientsSummary/header/PTCustomCheckbox.js | import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Col } from 'react-bootstrap';
const PTCustomCheckbox = ({ title, name, isChecked, disabled = false, onChange }) => {
const toggleCheckbox = () => !disabled && onChange(name);
return <Col xs={6} sm={4}>
... | import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Col } from 'react-bootstrap';
const PTCustomCheckbox = ({ title, name, isChecked, disabled = false, onChange }) => {
const toggleCheckbox = () => !disabled && onChange(name);
return <Col xs={6} sm={4}>
... | Fix checkboxes for Patient Summary. | Fix checkboxes for Patient Summary.
| JavaScript | apache-2.0 | PulseTile/PulseTile-React,PulseTile/PulseTile-React,PulseTile/PulseTile-React |
f0e7098f88d7ceeae02ba60bb484f4cfa266bce7 | src/plugins.js | src/plugins.js | /* @flow */
export const inMemory = (data : Object, transition : Function) => {
let rootState = data;
const read = () => rootState;
const write = (fn : Function) => {
const oldState = read();
const newState = fn(oldState);
transition(oldState, newState);
rootState = newState;
return read();
... | /* @flow */
export const inMemory = (initial : Object, transition : Function) => {
let rootState = initial;
const read = () => rootState;
const write = (fn : Function) => {
const oldState = read();
const newState = fn(oldState);
transition(oldState, newState);
rootState = newState;
return rea... | Rename data prop to initial | Rename data prop to initial
| JavaScript | mit | jameshopkins/atom-store,jameshopkins/atom-store |
6505b754bc31ce4062d1a4c2eecc172636dbba64 | src/components/Node.js | src/components/Node.js | import React, { PropTypes } from 'react';
import { StyleSheet, css } from 'aphrodite';
const styles = StyleSheet.create({
node: {
cursor: 'move',
},
});
const renderState = (state, index) => (
<text key={state} x="5" y={37 + (18 * index)}>
<tspan>{state}</tspan>
<tspan x="155" textAnchor="end">99.9<... | import React, { PropTypes } from 'react';
import { StyleSheet, css } from 'aphrodite';
const styles = StyleSheet.create({
node: {
cursor: 'move',
userSelect: 'none',
},
});
const renderState = (state, index) => (
<text key={state} x="5" y={37 + (18 * index)}>
<tspan>{state}</tspan>
<tspan x="155... | Fix selecting node text when moving | Fix selecting node text when moving
| JavaScript | mit | fhelwanger/bayesjs-editor,fhelwanger/bayesjs-editor |
bbf64c4d45fc83b5143951f79f2a9c25d757cd65 | addon/components/outside-click/component.js | addon/components/outside-click/component.js |
import Ember from 'ember'
import layout from './template'
import PropTypeMixin, { PropTypes } from 'ember-prop-types'
const { K } = Ember
export default Ember.Component.extend(PropTypeMixin, {
layout,
propTypes: {
onOutsideClick: PropTypes.func
},
getDefaultProps() {
return { onOutsideClick: K }
... |
import Ember from 'ember'
import layout from './template'
import PropTypeMixin, { PropTypes } from 'ember-prop-types'
const { K } = Ember
export default Ember.Component.extend(PropTypeMixin, {
layout,
propTypes: {
onOutsideClick: PropTypes.func
},
getDefaultProps() {
return { onOutsideClick: K }
... | Move destroy checks just before set | Move destroy checks just before set | JavaScript | mit | nucleartide/ember-outside-click,nucleartide/ember-outside-click |
ec5e284f43cd890a2d24f775f77f0fc5f3810dfc | src/App.js | src/App.js | import React from 'react';
import './App.css';
import logo from './logo.png';
export default function App() {
return (
<div>
<h1>
Welcome to
<img src={logo} className="App--logo" alt="React logo" />
React
</h1>
<p>
To get started, edit <code>src/App.js</code> and... | import React from 'react';
import './App.css';
import logo from './logo.png';
export default function App() {
return (
<div>
<h1>
Welcome to <img src={logo} className="App--logo" alt="logo" /> React
</h1>
<p>
To get started, edit <code>src/App.js</code> and save to reload.
... | Make it fit in one line | Make it fit in one line
| JavaScript | bsd-3-clause | emvu/create-react-app,HelpfulHuman/helpful-react-scripts,Timer/create-react-app,christiantinauer/create-react-app,yosharepoint/react-scripts-ts-sp,powerreviews/create-react-app,CodingZeal/create-react-app,lolaent/create-react-app,xiaohu-developer/create-react-app,HelpfulHuman/helpful-react-scripts,andyeskridge/create-r... |
e96df96e13e47ab983fbdbcf58bd00ebd0ff9e5b | public/js/layout.js | public/js/layout.js |
var fixedWidth = 220;
var minWidth = 660;
var fixedPadding = 100;
function layoutWidth()
{
var wWidth = $(window).width();
var bodyPadding = Math.max(Math.floor(wWidth / fixedWidth)-3, 1) * 100;
if ($(".container").length)
{
var width = wWidth - bodyPadding;
var newWidth = Math.floor(w... |
var fixedWidth = 220;
var minWidth = 660;
var fixedPadding = 100;
var delayResize = null;
function layoutWidth()
{
var wWidth = $(window).width();
var bodyPadding = Math.max(Math.floor(wWidth / fixedWidth)-3, 1) * 100;
if ($(".container").length)
{
var width = wWidth - bodyPadding;
var... | Add timeout when resizing container (prevent close multicall that can cause performance issue) | Add timeout when resizing container (prevent close multicall that can cause performance issue)
| JavaScript | mit | hernantas/MangaReader,hernantas/MangaReader,hernantas/MangaReader |
3fd410806d1f9cc2f922efde78539671306bd739 | server/app.js | server/app.js | Meteor.startup(function () {
Tiqs._ensureIndex({text: 1});
});
Meteor.methods({
associateTags: function(text, tags) {
Tiqs.upsert({text: text}, {$addToSet: {tags: {$each: tags}}});
_.each(tags, function(tag) {
Tiqs.upsert({text: tag}, {$addToSet: {tags: text}});
});
}
});
| Meteor.startup(function () {
Tiqs._ensureIndex({text: 1});
});
Meteor.methods({
associateTags: function(text, tags) {
Tiqs.upsert({text: text},
{$addToSet: {tags: {$each: tags}},
$setOnInsert: {createdAt: Date.now()}
}
);
_.each(tags, function(tag) {
Tiqs.upsert({text: tag},
... | Add createdAt field to Tiqs collection | Add createdAt field to Tiqs collection
| JavaScript | mit | imiric/tiq-web,imiric/tiq-web |
f0a2fefc7eced759ad5c639c85df44194c3a89f8 | rules/temporary-hrdata.js | rules/temporary-hrdata.js | function (user, context, callback) {
// This is a rule to specifically allow access to _HRData for specific ClientIDs
// _HRData comes from WorkDay, through LDAP Connector
// Ideally the RPs who need this data should request it directly from WorkDay, so this is a work-around.
// Applications that are ALLOWED t... | function (user, context, callback) {
// This is a rule to specifically allow access to _HRData for specific ClientIDs
// _HRData comes from WorkDay, through LDAP Connector
// Ideally the RPs who need this data should request it directly from WorkDay, so this is a work-around.
// Applications that are ALLOWED t... | Add pto app to hrdata rule | Add pto app to hrdata rule
this will allow the pto app to get manager info and no longer need an LDAP connection | JavaScript | mpl-2.0 | mozilla-iam/auth0-deploy,jdow/auth0-deploy,jdow/auth0-deploy,mozilla-iam/auth0-deploy |
2f61e76a50034cd06611bf0086d57deeaf61a2dd | schema/me/save_artwork.js | schema/me/save_artwork.js | import gravity from '../../lib/loaders/gravity';
import { GraphQLString, GraphQLBoolean } from 'graphql';
import { mutationWithClientMutationId } from 'graphql-relay';
import { artworkFields } from '../artwork/index';
export default mutationWithClientMutationId({
name: 'SaveArtwork',
decription: 'Save (or remove) ... | import gravity from '../../lib/loaders/gravity';
import { GraphQLString, GraphQLBoolean } from 'graphql';
import { mutationWithClientMutationId } from 'graphql-relay';
import { ArtworkType } from '../artwork/index';
export default mutationWithClientMutationId({
name: 'SaveArtwork',
decription: 'Save (or remove) an... | Return artwork node instead of fields | Return artwork node instead of fields
| JavaScript | mit | mzikherman/metaphysics-1,craigspaeth/metaphysics,artsy/metaphysics,craigspaeth/metaphysics,artsy/metaphysics,mzikherman/metaphysics-1,artsy/metaphysics,mzikherman/metaphysics-1,broskoski/metaphysics,mzikherman/metaphysics-1 |
27e1d21c375b16697c4ca4eef0f6c14193262797 | test/DropdownAlert-test.js | test/DropdownAlert-test.js | const React = require('react')
const should = require('should')
const { shallow } = require('enzyme')
const { expect } = require('chai')
import DropdownAlert from '../DropdownAlert'
import {
View,
Text,
StyleSheet,
TouchableHighlight,
Animated,
Modal,
StatusBar,
Image
} from "react-native"
describe('D... | const React = require('react')
const should = require('should')
const { shallow } = require('enzyme')
const { expect } = require('chai')
import DropdownAlert from '../DropdownAlert'
import {
View,
Text,
StyleSheet,
TouchableHighlight,
Animated,
Modal,
StatusBar,
Image
} from "react-native"
describe('D... | Add sub components test; Add dismiss test | Add sub components test; Add dismiss test
| JavaScript | mit | testshallpass/react-native-dropdownalert,testshallpass/react-native-dropdownalert,shotozuro/react-native-dropdownalert,devBrian/react-native-dropdownalert,devBrian/react-native-dropdownalert,shotozuro/react-native-dropdownalert,shotozuro/react-native-dropdownalert,devBrian/react-native-dropdownalert,testshallpass/react... |
9f26f41123b6fcda8ade34325161d8d433f4ec61 | test/unit/api/component.js | test/unit/api/component.js | import { Component } from '../../../src';
describe('api/Component', () => {
if (!classStaticsInheritance()) {
return;
}
describe('property getters', () => {
it('observedAttributes', () => {
class Test extends Component {
static get observedAttributes() {
return ['test'];
... | import { Component } from '../../../src';
import { classStaticsInheritance } from '../lib/support';
describe('api/Component', () => {
if (!classStaticsInheritance()) {
return;
}
describe('property getters', () => {
it('observedAttributes', () => {
class Test extends Component {
static get ... | Fix test by adding a missing import. | test: Fix test by adding a missing import.
| JavaScript | mit | skatejs/skatejs,skatejs/skatejs,skatejs/skatejs,chrisdarroch/skatejs,chrisdarroch/skatejs |
cb04c26b0819fe742c80bc8f05ce3af3c32823e3 | lib/node_modules/@stdlib/fs/read-file/examples/index.js | lib/node_modules/@stdlib/fs/read-file/examples/index.js | 'use strict';
var readFile = require( './../lib' );
// Sync //
var file = readFile.sync( __filename, 'utf8' );
// returns <string>
console.log( file instanceof Error );
// => false
file = readFile.sync( 'beepboop', {
'encoding': 'utf8'
});
// returns <Error>
console.log( file instanceof Error );
// => true
// ... | 'use strict';
var readFile = require( './../lib' );
// Sync //
var file = readFile.sync( __filename, 'utf8' );
// returns <string>
console.log( file instanceof Error );
// => false
file = readFile.sync( 'beepboop', {
'encoding': 'utf8'
});
// returns <Error>
console.log( file instanceof Error );
// => true
// ... | Remove extra trailing empty lines | Remove extra trailing empty lines
| JavaScript | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib |
ea22ee1596e2f9d93ce01349f06a3c99143f21bb | test/absUrl.js | test/absUrl.js | var should = require('chai').should();
var LocationUtil = require('../src/location-util.js').LocationUtil;
describe('#absUrl', function () {
it('should get full URL', function () {
var l = new LocationUtil('http://example.com:8080/foo?bar=buz#frag');
l.absUrl().should.equal('http://example.com:80... | var should = require('chai').should();
var LocationUtil = require('../src/location-util.js').LocationUtil;
describe('#absUrl', function () {
it('should get full URL', function () {
var l = new LocationUtil('http://example.com:8080/foo?bar=buz#frag');
l.absUrl().should.equal('http://example.com:80... | Add some test cases that are in doc | Add some test cases that are in doc
| JavaScript | mit | moznion/location-util |
56efaa7f095ffef29decbb0942f37f24851b4847 | js/DataObjectPreviewer.js | js/DataObjectPreviewer.js |
(function($) {
$.entwine('ss', function($){
$('.ss-gridfield-orderable tbody .handle').entwine({
onmousedown: function () {
this.closest('tbody').addClass('ss-gridfield-sorting');
},
onmouseup: function () {
this.closest('tbody').removeClass('ss-gridfield-sorting');
}
});
$('.dataobjectprevi... |
(function($) {
function getDocumentHeight(doc) {
return Math.max(
doc.documentElement.clientHeight,
doc.body.scrollHeight, doc.documentElement.scrollHeight,
doc.body.offsetHeight, doc.documentElement.offsetHeight);
}
$.entwine('ss', function($){
$('.ss-gridfield-orderable tbody .handle').entwine({
... | Use a cross-browser compatible method of determining document height | Use a cross-browser compatible method of determining document height
The automatic setting of height for the preview iframe stopped working in
Chrome. This change fixes this.
| JavaScript | mit | heyday/silverstripe-dataobjectpreview,heyday/silverstripe-dataobjectpreview |
cadc76aaac836b8a13fd0c6da5b36b70d8c54ad7 | example/examples/HLSSource.js | example/examples/HLSSource.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Hls from 'hls.js';
const propTypes = {
src: PropTypes.string.isRequired,
type: PropTypes.string,
video: PropTypes.object,
};
export default class HLSSource extends Component {
constructor(props, context) {
super(props, co... | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Hls from 'hls.js';
const propTypes = {
src: PropTypes.string.isRequired,
type: PropTypes.string,
video: PropTypes.object,
};
export default class HLSSource extends Component {
constructor(props, context) {
super(props, co... | Destroy HLS source before component unmount | Destroy HLS source before component unmount
| JavaScript | mit | video-react/video-react,video-react/video-react |
a60b407bf182c852b9d6e841e1f0511fb770411b | client/templates/course/sidebar/section/add-lesson/add-lesson.js | client/templates/course/sidebar/section/add-lesson/add-lesson.js | Template.sectionAddLesson.events({
'click .add-lesson-button': function (event, template) {
// Get lesson name
var lessonName = template.find(".lesson-name").value;
// Create temporary lesson object
var lessonObject = {'name': lessonName};
// Add lesson to database,
... | Template.sectionAddLesson.events({
'click .add-lesson-button': function (event, template) {
// Get lesson name
var lessonName = template.find(".lesson-name").value;
// Create temporary lesson object
var lessonObject = {'name': lessonName};
// Add lesson to database,
... | Clear lesson field on add. | Clear lesson field on add.
| JavaScript | agpl-3.0 | Crowducate/crowducate-platform,Crowducate/crowducate-platform,Crowducate/crowducate-next,Crowducate/crowducate-next,KshirsagarNaidu/bodhiprocessor,KshirsagarNaidu/bodhiprocessor |
ef773f16dbaf0d2ef922f061d50fb1462c98036b | tests/index.js | tests/index.js | /**
* Check If Image Path Exists
*/
var http = require('http'),
url = 'http://sirocco.accuweather.com/adc_images2/english/feature/400x300/worstwx.jpg'
;
http.get(url, function(response) {
if (response.statusCode == '200') return;
throw new Error(response.statusCode);
}).on('error', function(error) {
throw error;... | /**
* Check If Image Path Exists
*/
var http = require('http'),
url = 'http://sirocco.accuweather.com/adc_images2/english/feature/400x300/worstwx.jpg'
;
http.get(url, function(response) {
if (response.statusCode == '200') process.exit(0);
throw new Error(response.statusCode);
}).on('error', function(error) {
thr... | Use process.exit to make test faster | Use process.exit to make test faster
| JavaScript | apache-2.0 | matthewspencer/worstweather |
995d2be6e56ba2b2f1b44e1e0f05c56d842da448 | src/components/candidatethumbnail/CandidateThumbnail.js | src/components/candidatethumbnail/CandidateThumbnail.js | import React from 'react';
import { Image } from 'react-bootstrap'
import CandidateCounter from './CandidateCounter'
import styles from './candidatethumbnail.css'
export default class CandidateThumbnail extends React.Component {
render() {
return (
<div className="col-lg-4 col-md-4 col-sm-12 col-xs-1... | import React from 'react';
import { Image } from 'react-bootstrap'
import { Route } from 'react-router-dom'
import CandidateCounter from './CandidateCounter'
import styles from './candidatethumbnail.css'
export default class CandidateThumbnail extends React.Component {
render() {
return (
<Route render=... | Add link from candidate thumbnail to candidate detail page | Add link from candidate thumbnail to candidate detail page
| JavaScript | mit | imrenagi/rojak-web-frontend,imrenagi/rojak-web-frontend |
ed0df4c15952d3b00ca0de3b01cc4697ee6e9570 | app/react/data/exclude_images.js | app/react/data/exclude_images.js | module.exports = [
'https://upload.wikimedia.org/wikipedia/en/e/e7/Cscr-featured.svg',
'.webm',
'https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg',
'https://upload.wikimedia.org/wikipedia/en/f/fd/Portal-puzzle.svg',
'https://upload.wikimedia.org/wikipedia/en/4/48/Folder_Hexagonal_Icon.svg',
'... | module.exports = [
'https://upload.wikimedia.org/wikipedia/en/e/e7/Cscr-featured.svg',
'.webm',
'https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg',
'https://upload.wikimedia.org/wikipedia/en/f/fd/Portal-puzzle.svg',
'https://upload.wikimedia.org/wikipedia/en/4/48/Folder_Hexagonal_Icon.svg',
'... | Revert "Added new exclude image" | Revert "Added new exclude image"
This reverts commit cbc4520fcc0b6744113bee40ee21571eb787ea25.
| JavaScript | mit | WikiEducationFoundation/Wiki-Playlist,WikiEducationFoundation/Wiki-Playlist,WikiEducationFoundation/Wiki-Playlist |
317f7ca114f80cf2c4d995938b9f262b50fa02fb | app/scenes/SearchScreen/index.js | app/scenes/SearchScreen/index.js | import React, { Component } from 'react';
import { View } from 'react-native';
import RepoSearchBar from './components/RepoSearchBar';
import RepoSearchButton from './components/RepoSearchButton';
import RepoList from './components/RepoList';
export default class SearchScreen extends Component {
constructor(props) {... | import React, { Component } from 'react';
import { View } from 'react-native';
import RepoSearchBar from './components/RepoSearchBar';
import RepoSearchButton from './components/RepoSearchButton';
import RepoList from './components/RepoList';
export default class SearchScreen extends Component {
constructor(props) {... | Add helper functions to change screen states | Add helper functions to change screen states
| JavaScript | mit | msanatan/GitHubProjects,msanatan/GitHubProjects,msanatan/GitHubProjects |
4036b9f7009c65aa1889b80ddbb81f2ad95dc873 | src/handler_adaptor.js | src/handler_adaptor.js | define(['lib/def', 'handler'], function(Def, Handler) {
var HandlerAdaptor = Def.type(Handler, function(handler) {
Handler.call(this);
this.def_prop('handler', handler);
});
HandlerAdaptor.def_method(function on_message(msg, cont) {
if (this.handler.match(msg))
return msg.respond(this.handler.... | define(['lib/def', 'handler'], function(Def, Handler) {
var HandlerAdaptor = Def.type(Handler, function(handler) {
this.constructor.__super__.call(this);
this.def_prop('handler', handler);
});
HandlerAdaptor.def_method(function on_message(msg, cont) {
if (this.handler.match(msg))
return msg.re... | Refactor constructor to take advantage of __super__ member. | Refactor constructor to take advantage of __super__ member.
| JavaScript | mit | bassettmb/slack-bot-dev |
2b82c65e398a66d3dc23f0fdf366549e5565219f | src/main/webapp/resources/js/utilities/url-utilities.js | src/main/webapp/resources/js/utilities/url-utilities.js | /**
* Since IRIDA can be served within a container, all requests need to have
* the correct base url. This will add, if required, the base url.
*
* NOTE: THIS ONLY NEEDS TO BE CALLED FOR LINKS, ASYNCHRONOUS REQUESTS WILL
* BE AUTOMATICALLY HANDLED.
*
* @param {string} url
* @return {string|*}
*/
export functi... | /**
* Since IRIDA can be served within a container, all requests need to have
* the correct base url. This will add, if required, the base url.
*
* NOTE: THIS ONLY NEEDS TO BE CALLED FOR LINKS, ASYNCHRONOUS REQUESTS WILL
* BE AUTOMATICALLY HANDLED.
*
* @param {string} url
* @return {string|*}
*/
export functi... | Check to see if the url has the context path first. | Check to see if the url has the context path first.
| JavaScript | apache-2.0 | phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida |
ff2bb7a079a88eb9a60061de9f4481cee1141889 | spec/specs.js | spec/specs.js | describe('pingPong', function() {
it("is true for a number that is divisible by 3", function() {
expect(pingPong(6)).to.equal(true);
});
it("is true for a number that is divisible by 5", function() {
expect(pingPong(10)).to.equal(true);
});
});
| describe('pingPong', function() {
it("is true for a number that is divisible by 3", function() {
expect(pingPong(6)).to.equal(true);
});
it("is true for a number that is divisible by 5", function() {
expect(pingPong(10)).to.equal(true);
});
it("is true for a number that is divisible by 15", function... | Add an additional spec test for userNumbers divisible by 15 | Add an additional spec test for userNumbers divisible by 15
| JavaScript | mit | kcmdouglas/pingpong,kcmdouglas/pingpong |
1dde5df3c6fdfe555f7258d1a697735bc6f3b7a8 | src/App.js | src/App.js | import React from 'react';
import {
HashRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
import ComponentsPage from './pages/Components';
import ContentPage from './pages/Content';
import UtilsPage from './pages/Utils';
function App() {
return (
<Router>
<div className=... | import React from 'react';
import {
HashRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
import ComponentsPage from './pages/Components';
import ContentPage from './pages/Content';
import UtilsPage from './pages/Utils';
function App() {
return (
<Router>
<div className=... | Add link to GH repo | Add link to GH repo
| JavaScript | mit | FindawayWorld/gateway,FindawayWorld/gateway |
3a6dafd545da6f7ccb271915eb1b9a5f76cfe277 | src/App.js | src/App.js | import React from 'react';
import { BrowserRouter, Match, Miss } from 'react-router'
import Header from './components/Header';
import CTA from './components/CTA';
import Footer from './components/Footer';
import routes from './config/routes';
import FourOhFour from './components/404';
const App = () => (
// <Browser... | import React from 'react';
import { BrowserRouter, Match, Miss } from 'react-router'
import Header from './components/Header';
import CTA from './components/CTA';
import Footer from './components/Footer';
import routes from './config/routes';
import FourOhFour from './components/404';
const App = () => (
// <Browser... | Fix index as key anti pattern | Fix index as key anti pattern
| JavaScript | mit | emyarod/afw,emyarod/afw |
1ebfc2f9d228811b45955e1d7ddd1f61407a3809 | src/App.js | src/App.js | import React from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import Home from './Home';
const App = () => (
<React.Fragment>
<Router>
<Route exact path="/" component={Home} />
</Router>
</React.Fragment>
);
export default App;
| import React from 'react';
import CssBaseline from '@material-ui/core/CssBaseline';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import Home from './Home';
const App = () => (
<React.Fragment>
<CssBaseline />
<Router>
<Route exact path="/" component={Home} />
</Router>
</Rea... | Use CssNormalize to normalize padding/margin for entire app | Use CssNormalize to normalize padding/margin
for entire app
| JavaScript | mit | jasongforbes/jforbes.io,jasongforbes/jforbes.io,jasongforbes/jforbes.io |
22d63bf978e351a22515248600a8cd7a1d56a07d | src/pages/home/page.js | src/pages/home/page.js | import React from 'react';
import ReactDom from 'react-dom';
import { Link } from 'react-router';
import _ from 'lodash';
import client from '../../common/store/Contentful';
import marked from 'marked';
import styles from "./style.css";
export default class HomePage extends React.Component {
constructor(props) {
... | import React from 'react';
import ReactDom from 'react-dom';
import { Link } from 'react-router';
import _ from 'lodash';
import client from '../../common/store/Contentful';
import marked from 'marked';
import styles from "./style.css";
export default class HomePage extends React.Component {
constructor(props) {
... | Remove my dumb logging statement | Remove my dumb logging statement | JavaScript | mit | mhgbrown/typography-karaoke,mhgbrown/typography-karaoke |
1f79c994d96907273b45b36fe1cbf06340e71c41 | src/cli.js | src/cli.js | #!/usr/bin/env node
import yargs from 'yargs';
import path from 'path';
import fs from 'fs';
import * as pose from '.';
import actions from './actions';
const opts = yargs
.usage('$ pose <action> [options]')
.help('help')
.epilog(actions.trim())
.options({
name: {
alias: ['as'],
default: path.basename(proce... | #!/usr/bin/env node
import yargs from 'yargs';
import path from 'path';
import fs from 'fs';
import * as pose from '.';
import actions from './actions';
const opts = yargs
.usage('$ pose <action> [options]')
.help('help')
.epilog(actions.trim())
.options({
name: {
alias: ['as'],
default: path.basename(proce... | Remove -e in favor of --from | Remove -e in favor of --from
| JavaScript | mit | seanc/pose |
5d3474ab83dcf9931ee480fbe7d1119642e7355f | test/conf/karma-sauce.conf.js | test/conf/karma-sauce.conf.js | module.exports = function(config) {
var commonConfig = (require("./karma-common.conf"))(config);
var customLaunchers = {
sl_chrome: {
base: "SauceLabs",
browserName: "chrome",
platform: "Windows 8.1"
},
sl_firefox: {
base: "SauceLabs",
... | module.exports = function(config) {
var commonConfig = (require("./karma-common.conf"))(config);
var customLaunchers = {
sl_chrome: {
base: "SauceLabs",
browserName: "chrome",
platform: "Windows 8.1"
},
sl_firefox: {
base: "SauceLabs",
... | Use beta version of Firefox (supports vertical writing-mode) in tests on Sauce Labs | Use beta version of Firefox (supports vertical writing-mode) in tests on Sauce Labs
| JavaScript | apache-2.0 | kuad9/vivliostyle.js_study,vivliostyle/vivliostyle.js,nulltask/vivliostyle.js,vivliostyle/vivliostyle.js,kuad9/vivliostyle.js_study,vivliostyle/vivliostyle.js,nulltask/vivliostyle.js,kuad9/vivliostyle.js_study,nulltask/vivliostyle.js,vivliostyle/vivliostyle.js,kuad9/vivliostyle.js_study,nulltask/vivliostyle.js |
8e4e5ef743051f64d41e6e3e027faf6daaf10b89 | test/showdir-href-encoding.js | test/showdir-href-encoding.js | var test = require('tap').test,
ecstatic = require('../lib/ecstatic'),
http = require('http'),
request = require('request'),
path = require('path');
var root = __dirname + '/public',
baseDir = 'base';
test('url encoding in href', function (t) {
var port = Math.floor(Math.random() * ((1<<16) - 1e... | var test = require('tap').test,
ecstatic = require('../lib/ecstatic'),
http = require('http'),
request = require('request'),
path = require('path');
var root = __dirname + '/public',
baseDir = 'base';
test('url encoding in href', function (t) {
var port = Math.floor(Math.random() * ((1<<16) - 1e... | Fix test broken by encodeURIComponent change | Fix test broken by encodeURIComponent change
| JavaScript | mit | mk-pmb/node-ecstatic,krikx/node-ecstatic,mk-pmb/node-ecstatic,jfhbrook/node-ecstatic,dotnetCarpenter/node-ecstatic,mk-pmb/node-ecstatic,dotnetCarpenter/node-ecstatic,krikx/node-ecstatic,dotnetCarpenter/node-ecstatic,ngs/node-ecstatic,jfhbrook/node-ecstatic,ngs/node-ecstatic,jfhbrook/node-ecstatic |
f4c10acf35c802049cb59fec2af813766821c83f | src/String.js | src/String.js | /**
* Has Vowels
*
* hasVowel tests if the String calling the function has a vowels
*
* @param {void}
* @return {Boolean} returns true or false indicating if the string
* has a vowel or not
*/
String.prototype.hasVowels = function() {
var inputString = this;
return /[aeiou]/gi.test(inputString);
};
/... | /**
* Has Vowels
*
* hasVowel tests if the String calling the function has a vowels
*
* @param {void}
* @return {Boolean} returns true or false indicating if the string
* has a vowel or not
*/
String.prototype.hasVowels = function() {
var inputString = this;
return /[aeiou]/gi.test(inputString);
};
/... | Implement ucFirst() to pass test | Implement ucFirst() to pass test
| JavaScript | mit | andela-oolutola/string-class,andela-oolutola/string-class |
242dff01801b14ea10df218d0d967e9afef2b144 | app/assets/javascripts/displayMap.js | app/assets/javascripts/displayMap.js | function initMap() {
var map;
var $business_object;
var biz_loc_collection;
var i;
$business_object = $('#businesses').data('url');
biz_loc_collection = [];
for (i = 0; i < $business_object.length; ++i) {
biz_loc_collection.push({ lat: $business_object[i].latitude, lng: $business_object[i].longitude}... | function initMap() {
var map;
var $business_object;
var biz_loc_collection;
var i;
$business_object = $('#businesses').data('url');
biz_loc_collection = [];
for (i = 0; i < $business_object.length; ++i) {
biz_loc_collection.push({ lat: $business_object[i].latitude, lng: $business_object[i].longitude}... | Fix the marker bouncing function. | Fix the marker bouncing function.
| JavaScript | mit | DBC-Huskies/flight-app,DBC-Huskies/flight-app,DBC-Huskies/flight-app |
a59413dc688077d0f1c4d8ae26fce464b837faa6 | src/scripts/scripts.js | src/scripts/scripts.js | $(document).foundation();
$('a.disabled').click(function(e) {
e.preventDefault();
});
// Show shadow when content slides under the page header
$(document).ready(function() {
var $content = $('#site-body .content');
var $header = $('#page-head .inner');
if ($header.length > 0) {
$content.css('margin-top'... | $(document).foundation();
$('a.disabled').click(function(e) {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
});
// Show shadow when content slides under the page header
$(document).ready(function() {
var $content = $('#site-body .content');
var $header = $('#page-head .inner');
... | Implement fake form submits and confirmation buttons | Implement fake form submits and confirmation buttons
| JavaScript | bsd-3-clause | flipside-org/aw-datacollection,flipside-org/aw-datacollection,flipside-org/aw-datacollection |
8dc0bd8327a0acef05a611fa57a7b256951db69f | lib/util/spawn-promise.js | lib/util/spawn-promise.js | 'use babel'
import {getPath} from 'consistent-path'
import {BufferedProcess} from 'atom'
export default (command, args, cwd = null) => new Promise((resolve, reject) => {
let output = null
const stdout = (_output) => output = _output
const exit = (code) => {
if (code !== 0) {
reject(new Error('Exit sta... | 'use babel'
import getPath from 'consistent-path'
import {BufferedProcess} from 'atom'
export default (command, args, cwd = null) => new Promise((resolve, reject) => {
let output = null
const stdout = (_output) => output = _output
const exit = (code) => {
if (code !== 0) {
reject(new Error('Exit statu... | Update consistent-path import for 2.x | Update consistent-path import for 2.x
| JavaScript | mit | timdp/atom-npm-helper |
ba8371191ca468d1648e83324455d24a314725f8 | src/portal.js | src/portal.js | import { Component } from 'react';
import PropTypes from 'prop-types';
import ReactDom from 'react-dom';
class Portal extends Component {
componentWillMount() {
this.popup = document.createElement('div');
document.body.appendChild(this.popup);
this.renderLayer();
}
componentDidUpdate() {
this.re... | import { Component } from 'react';
import PropTypes from 'prop-types';
import ReactDom from 'react-dom';
const useCreatePortal = typeof ReactDom.unstable_createPortal === 'function';
class Portal extends Component {
componentWillMount() {
this.popup = document.createElement('div');
document.body.appendChild... | Add support for new React Core (v16) | Add support for new React Core (v16)
Old react (v15) still working | JavaScript | mit | pradel/react-minimalist-portal |
9cadbca18e044b0b20b7a3316c7007eb1540711b | test/builder/graphql/query.js | test/builder/graphql/query.js | import {parse, Source} from 'graphql';
import {createSpecBuilderClass} from './base';
import {RepositoryBuilder} from './repository';
import {PullRequestBuilder} from './pr';
class SearchResultItemBuilder {
static resolve() { return this; }
constructor(...args) {
this.args = args;
this._value = null;
... | import {parse, Source} from 'graphql';
import {createSpecBuilderClass} from './base';
import {RepositoryBuilder} from './repository';
import {PullRequestBuilder} from './pr';
class SearchResultItemBuilder {
static resolve() { return this; }
constructor(...args) {
this.args = args;
this._value = null;
... | Build a GraphQL response with errors reported | Build a GraphQL response with errors reported
| JavaScript | mit | atom/github,atom/github,atom/github |
ab050e711d90495e23b8b887df2a3dc58dae6ba3 | app/src/App.test.js | app/src/App.test.js | import React from 'react';
import { mount, shallow } from 'enzyme';
import App from './App';
import TimeTable from 'timetablescreen';
describe('App', () => {
beforeEach( () => {
Object.defineProperty(window.location, 'href', {
writable: true,
value: 'localhost:3000/kara'
});
});
it('renders without crash... | import React from 'react';
import { mount, shallow } from 'enzyme';
import App from './App';
import TimeTable from 'timetablescreen';
describe('App', () => {
beforeEach( () => {
Object.defineProperty(window.location, 'href', {
writable: true,
value: 'localhost:3000/kara'
});
});
it('renders without crash... | Test that there are errors instead of exact number | Test that there are errors instead of exact number
| JavaScript | mit | kangasta/timetablescreen,kangasta/timetablescreen |
2561471eea20a9d1ca762d402ba538661cfd2f64 | module/Connector.js | module/Connector.js | const mysql = require('mysql')
const qBuilder = require('./QueryBuilder')
let query = ''
let params = []
module.exports = (dbSetting) => {
let connection = mysql.createConnection({
host: dbSetting.hostname,
user: dbSetting.username,
password: dbSetting.password,
database: dbSetting.database
})
... | const mysql = require('mysql')
const qBuilder = require('./QueryBuilder')
let _query = ''
let _params = []
module.exports = (dbSetting) => {
let connection = mysql.createConnection({
host: dbSetting.hostname,
user: dbSetting.username,
password: dbSetting.password,
database: dbSetting.database
})
... | Add few functions and connect to query builder | Add few functions and connect to query builder
| JavaScript | mit | evelikov92/mysql-qbuilder |
0f3c7f95b03b5e6b3b731158185ae12078c9b606 | web/test/bootstrap.test.js | web/test/bootstrap.test.js | var Sails = require('sails');
before(function (done) {
Sails.lift({
//config
}, function (err, sails) {
if (err) return done(err);
// load fixtures, etc
done (err, sails);
});
});
after(function (done) {
Sails.lower(done);
}); | var Sails = require('sails');
before(function (done) {
this.timeout(5 * 1000);
Sails.lift({
//config
}, function (err, sails) {
if (err) return done(err);
// load fixtures, etc
done (err, sails);
});
});
after(function (done) {
Sails.lower(done);
}); | Allow sails lift to take longer than 2 seconds | Allow sails lift to take longer than 2 seconds
| JavaScript | apache-2.0 | section-io-gists/vclfiddle,vclfiddle/vclfiddle,vclfiddle/vclfiddle,vclfiddle/vclfiddle,vclfiddle/vclfiddle,section-io-gists/vclfiddle,section-io-gists/vclfiddle,section-io-gists/vclfiddle |
d2d68cb5ff8982f897b2805f57b73724def65208 | feder/main/static/init_map.js | feder/main/static/init_map.js | (function($) {
$("#pl_map path").on("click", function() {
document.location.pathname = $(this).data("href")
});
$('[data-toggle="tooltip"]').tooltip({'container': 'body'});
})(jQuery); | (function($) {
$("#pl_map path").on("click", function() {
document.location.pathname = $(this).data("href")
});
})(jQuery); | Remove unused tooltip initialization code | Remove unused tooltip initialization code
| JavaScript | mit | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder |
63d2829207a9968412fb332371774f3c1ca00601 | src/config.js | src/config.js | var _ = require('underscore');
var fs = require('fs');
function Config(filePath) {
var data = this.parse(filePath);
this.validate(data);
return Object.freeze(data);
}
Config.prototype.parse = function(filePath) {
var content = fs.readFileSync(filePath, {
encoding: 'utf8'
});
return JSON.parse(content)... | var _ = require('underscore');
var fs = require('fs');
/**
* @param {String|Object} filePath. If param is a String then it is treated as a file path to a config file.
* If param is an Object then it is treated as a parsed config file.
* @constructor
*/
function Config(filePath) {
var data;
if (_.isObject(fileP... | Allow to pass hash instead of filepath to Config. | Allow to pass hash instead of filepath to Config.
| JavaScript | mit | vogdb/pulsar-rest-api-client-node,cargomedia/pulsar-rest-api-client-node |
5609d591ab892348b17f0bccef800dcd46ca431f | test/index.js | test/index.js | GLOBAL.projRequire = function (module) {
return require('../' + module);
};
| GLOBAL.projRequire = function (module) {
return require('../' + module);
};
const log = projRequire('lib');
const tc = require('test-console');
const test = require('tape');
| Add imports to test suite | Add imports to test suite
| JavaScript | mit | cuvva/cuvva-log-sentry-node,TheTree/branch,TheTree/branch,TheTree/branch |
c50035bb85a86aa7adb292ef74385388c391912c | test/index.js | test/index.js | require('./unit/index');
require('./test_multiple_payloads');
require('./test_misc');
require('./test_loop');
require('./test_capture');
require('./test_arrivals');
require('./test_reuse');
require('./test_loop');
require('./test_probability');
require('./test_if');
//require('./test_worker_http');
//require('./test_e... | require('./unit/index');
require('./test_multiple_payloads');
require('./test_misc');
require('./test_loop');
require('./test_capture');
require('./test_arrivals');
require('./test_reuse');
require('./test_loop');
require('./test_probability');
require('./test_if');
require('./ws/test_options');
//require('./test_wor... | Include WS TLS test in the test suite | Include WS TLS test in the test suite
| JavaScript | mpl-2.0 | hassy/artillery,erikerikson/artillery-core,shoreditch-ops/artillery-core,shoreditch-ops/artillery,hassy/artillery-core,erikerikson/artillery-core,shoreditch-ops/artillery-core,shoreditch-ops/artillery,hassy/artillery,shoreditch-ops/artillery,hassy/artillery-core,hassy/artillery |
58b4a325f06e178c398d96513f5ac7bd69ad0b1e | src/export.js | src/export.js | 'use strict'
/**
* @class Elastic
*/
var Elastic = {
klass : klass,
domain: {
Layout : LayoutDomain,
View : ViewDomain,
Compontnt: ComponentDomain
},
exception: {
Runtime : RuntimeException,
Logic : LogicException
},
util: {
History : History,
Router : Router,
... | 'use strict'
/**
* @class Elastic
*/
var Elastic = {
// like OOP
klass : klass,
// shorthand
Layout : LayoutDomain,
View : ViewDomain,
Component: ComponentDomain,
// classes
domain: {
Layout : LayoutDomain,
View : ViewDomain,
Compontnt: ComponentDomain
},
exception: {
... | Add Domain class's shorthand name | Add Domain class's shorthand name
| JavaScript | mit | ahomu/Elastic |
8b6b89e438c963ed0f3cb563cdfd60b6c0d0a7e0 | shared/util/set-notifications.js | shared/util/set-notifications.js | /* @flow */
import engine from '../engine'
import {notifyCtlSetNotificationsRpc} from '../constants/types/flow-types'
type NotificationChannels = {
session?: true,
users?: true,
kbfs?: true,
tracking?: true,
favorites?: true,
paperkeys?: true,
keyfamily?: true,
service?: true,
chat?: true,
}
let ch... | /* @flow */
import engine from '../engine'
import {notifyCtlSetNotificationsRpc} from '../constants/types/flow-types'
type NotificationChannels = {
chat?: true,
favorites?: true,
kbfs?: true,
keyfamily?: true,
paperkeys?: true,
pgp?: true,
service?: true,
session?: true,
tracking?: true,
users?: t... | Add pgp to notification channels | Add pgp to notification channels
| JavaScript | bsd-3-clause | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client |
66b31b6659968968d3354fb5d114c77b72aac6af | test/mouse.js | test/mouse.js | var test = require('tape');
var robot = require('..');
var lastKnownPos, currentPos;
test('Get the initial mouse position.', function(t)
{
t.plan(3);
t.ok(lastKnownPos = robot.getMousePos(), 'successfully retrieved mouse position.');
t.ok(lastKnownPos.x !== undefined, 'mousepos.x is a valid value.');
t.ok(lastKno... | var test = require('tape');
var robot = require('..');
var lastKnownPos, currentPos;
//Increase delay to help test reliability.
robot.setMouseDelay(100);
test('Get the initial mouse position.', function(t)
{
t.plan(3);
t.ok(lastKnownPos = robot.getMousePos(), 'successfully retrieved mouse position.');
t.ok(lastKn... | Increase delay to help test reliability. | Increase delay to help test reliability.
| JavaScript | mit | hristoterezov/robotjs,BHamrick1/robotjs,BHamrick1/robotjs,hristoterezov/robotjs,hristoterezov/robotjs,hristoterezov/robotjs,octalmage/robotjs,BHamrick1/robotjs,octalmage/robotjs,BHamrick1/robotjs,octalmage/robotjs,octalmage/robotjs |
6fad96e50890876712c69221a0cc372a2533a4ed | assets/js/googlesitekit/constants.js | assets/js/googlesitekit/constants.js | /**
* Core constants.
*
* 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/licenses/LICENSE-2.0
*
* Unle... | /**
* Core constants.
*
* 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/licenses/LICENSE-2.0
*
* Unle... | Change VIEW_CONTEXT_WP_DASHBOARD to camel case. | Change VIEW_CONTEXT_WP_DASHBOARD to camel case.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp |
932c3d27364eb4cfb09189f90afb92c8bfeaa07c | src/server.js | src/server.js | /*
* Initialize the Restify server.
*/
var restify = require('restify');
var config = require('./config');
var routes = require('./routes');
var log = require('./logging').getLogger();
exports.create = function () {
var server = restify.createServer();
server.pre(restify.pre.sanitizePath());
server.name = c... | /*
* Initialize the Restify server.
*/
var restify = require('restify');
var config = require('./config');
var routes = require('./routes');
var log = require('./logging').getLogger();
exports.create = function () {
var server = restify.createServer();
server.server.setTimeout(600000);
server.pre(restify.pr... | Set a nice, generous timeout on requests. | Set a nice, generous timeout on requests.
| JavaScript | mit | deconst/content-service,deconst/content-service |
3bfcbc3ce266e873e43b8faf15d7b9ca87e6a094 | src/server.js | src/server.js | import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
import bodyParser from "body-parser"
import mongoose, { Schema } from "mongoose"
import schema from "./graphql"
import Item from "./db/item"
// Constants
const CONFIG = requi... | import bodyParser from "body-parser"
import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
import mongoose from "mongoose"
import schema from "./graphql"
import Item from "./db/item"
import Update from "./db/update"
// Constants... | Add mongoose debugging and move models to context | Add mongoose debugging and move models to context
| JavaScript | mit | DevNebulae/ads-pt-api |
b4dddaee7e2f449d65302009eb90c0ff608f6029 | jasmine/src/inverted-index.js | jasmine/src/inverted-index.js | var fs = require('fs');
function Index(){
'use strict'
this.createIndex = function(filePath){
fs.readFile(filePath , function doneReading(err, fileContents){
console.log(fileContents.toString());
})
}
}
var indexObj =new Index();
indexObj.createIndex('../books.json');
| Create an index object that points to a JSON file | Create an index object that points to a JSON file
| JavaScript | mit | andela-jwarugu/checkpoint-1,andela-jwarugu/checkpoint-1 | |
86f7ec4efb24be276590df7c2304065a1b81027a | lib/response.js | lib/response.js | "use strict";
var Response = function(error, res) {
res = res || {};
this.raw = res.body;
this.headers = res.headers;
this.status = res.statusCode || 500;
if (error) {
this._error = { error: (res.body || "Unknown error: empty response") };
} else {
if (res.headers["content-type... | "use strict";
var Response = function(error, res) {
res = res || {};
this.raw = res.body;
this.headers = res.headers;
this.status = res.statusCode || 500;
if (error) {
this._error = { error: (res.body || "Unknown error: empty response") };
} else {
if (res.headers["content-type... | Use String.prototype.startsWith() instead of includes() for checking the content type | Use String.prototype.startsWith() instead of includes() for checking the content type
| JavaScript | mit | skazska/m2x-nodejs,attm2x/m2x-nodejs |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.