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 |
|---|---|---|---|---|---|---|---|---|---|
f8840c309ff8d997ccc55c87b019b81eaca89bac | examples/shopping-cart/containers/CartContainer.js | examples/shopping-cart/containers/CartContainer.js | import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import { checkout } from '../actions/index'
import { getTotal, getCartProducts } from '../reducers/index'
import Cart from '../components/Cart'
class CartContainer extends Component {
render() {
const { products, total } = ... | import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import { checkout } from '../actions'
import { getTotal, getCartProducts } from '../reducers'
import Cart from '../components/Cart'
class CartContainer extends Component {
render() {
const { products, total } = this.props
... | Revert "be more explicit when importing files" | Revert "be more explicit when importing files"
| JavaScript | mit | tatsuhino/reactPractice,mjw56/redux,ellbee/redux,CompuIves/redux,tatsuhino/reactPractice,keyanzhang/redux,tappleby/redux,chentsulin/redux,camsong/redux,gaearon/redux,ptkach/redux,JoeStanton/redux,lifeiscontent/redux,jas-chen/redux,chentsulin/redux,lifeiscontent/redux,joaomilho/redux,Aweary/redux,mikekidder/redux,leoasi... |
84dce14cda92818454025defee82ff234687c2ea | src/sethosts.js | src/sethosts.js | var hostile = require('hostile');
var hosts = [
'databox.registry',
'databox-arbiter',
'databox.store'
];
var p = Promise.resolve();
hosts.forEach((host, i) => {
p = p.then(() => new Promise((resolve, reject) => {
// TODO: Are we sure they map to those IPs on Linux? Should precede with docker inspect?
var ip ... | var hostile = require('hostile');
var hosts = [
'databox.registry',
'databox-arbiter',
'databox.store'
];
var p = Promise.resolve();
hosts.forEach((host, i) => {
p = p.then(() => new Promise((resolve, reject) => {
// TODO: Are we sure they map to those IPs on Linux? Should precede with docker inspect?
var ip ... | Bring Linux and osx into alignment | Bring Linux and osx into alignment
| JavaScript | mit | yousefamar/databox-container-manager,me-box/databox,me-box/databox,me-box/databox-container-manager,pooyadav/databox,pooyadav/databox,me-box/databox-container-manager,me-box/databox-container-manager,yousefamar/databox-container-manager,yousefamar/databox-container-manager |
155154ea2c55127551c3f82a9e396540b14e2632 | stories/link.js | stories/link.js | import React from 'react';
import { storiesOf } from '@storybook/react';
import { boolean, select } from '@storybook/addon-knobs/react';
import { Link, TextDisplay } from '../components';
const colors = ['white', 'neutral', 'mint', 'teal', 'violet', 'ruby', 'gold', 'aqua'];
storiesOf('Links', module)
.addParameters... | import React from 'react';
import { storiesOf } from '@storybook/react';
import { boolean, select } from '@storybook/addon-knobs/react';
import { IconAddSmallOutline } from '@teamleader/ui-icons';
import { Link, TextDisplay } from '../components';
const elements = ['a', 'button'];
const colors = ['white', 'neutral', '... | Update & add stories to demo the new icon & iconPlacement props | Update & add stories to demo the new icon & iconPlacement props
| JavaScript | mit | teamleadercrm/teamleader-ui |
95d4b088ae1b4da5cb4a42d26c118a76e27f8d8e | gulpfile.js | gulpfile.js | 'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var sassLint = require('gulp-sass-lint');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
// testing
var mocha = require('gulp-mocha');
gulp.task('test', function() {
return gulp.src('tests/js/**/*.js', {r... | 'use strict';
var gulp = require('gulp');
// testing
var mocha = require('gulp-mocha');
gulp.task('test', function() {
return gulp.src('tests/js/**/*.js', {read: false})
.pipe(mocha({reporter: 'spec', useColors: true}))
});
gulp.task('default', ['test'], function() {
// place code for your default task... | Remove sass handling from gulp (handled by webpack) | Remove sass handling from gulp (handled by webpack)
| JavaScript | mit | molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec |
354dd7972ef3a88975c5a986a0d08f7ff0360b4b | gulpfile.js | gulpfile.js | var tsproject = require('tsproject');
var gulp = require('gulp');
var rjs = require('requirejs');
gulp.task('compile', function () {
tsproject.src('./')
.pipe(gulp.dest('./'));
});
gulp.task('bundle', function () {
rjs.optimize({
appDir: 'built/debug',
baseUrl: './',
dir: 'built... | var tsproject = require('tsproject');
var gulp = require('gulp');
var rjs = require('requirejs');
gulp.task('compile', function () {
return tsproject.src('./').pipe(gulp.dest('./'));
});
gulp.task('bundle', [ 'compile' ], function () {
return rjs.optimize({
appDir: 'built/debug',
baseUrl: './',... | Fix issue where bundle was happening before compile finished | Fix issue where bundle was happening before compile finished
| JavaScript | mit | Microsoft/vso-team-calendar,Microsoft/vso-team-calendar,Microsoft/vsts-team-calendar,Microsoft/vso-team-calendar,Microsoft/vsts-team-calendar,Microsoft/vsts-team-calendar |
29620067d654999f778616f2821b63ca82023ea9 | gulpfile.js | gulpfile.js | 'use strict';
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var htmlExtract = require('gulp-html-extract');
var stylelint = require('gulp-stylelint');
gulp.task('lint', ['lint:js', 'lint:html', 'lint:css']);
gulp.task('lint:js', function() {
return gulp.src([
'*.js',
'test/*.js'
])
.... | 'use strict';
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var htmlExtract = require('gulp-html-extract');
var stylelint = require('gulp-stylelint');
gulp.task('lint', ['lint:js', 'lint:html', 'lint:css']);
gulp.task('lint:js', function() {
return gulp.src([
'*.js',
'test/**/*.js'
])
... | Include subfolders of `demo` and `test` folders for linting | Include subfolders of `demo` and `test` folders for linting
| JavaScript | apache-2.0 | vaadin/vaadin-combo-box,vaadin/vaadin-combo-box |
8a7dc74b33d94e2fd05c5c25d64e6d068720ca37 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var jade = require('gulp-jade');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var minifyCSS = require('gulp-minify-css');
gulp.task('jade', function() {
var locals = {};
return gulp.src('templates/*.jade')
.pipe(jade({... | var gulp = require('gulp');
var jade = require('gulp-jade');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var minifyCSS = require('gulp-minify-css');
gulp.task('jade', function() {
var locals = {};
return gulp.src('templates/*.jade')
.pipe(jade({... | Fix ordering of gulp tasks | Fix ordering of gulp tasks
| JavaScript | agpl-3.0 | euank/esk.email-html,euank/esk.email-html |
4ae90598bff399d96449d7c22aaed9676937268d | addon/components/sl-pagination-info.js | addon/components/sl-pagination-info.js | import Ember from 'ember';
/**
* @module components
* @class sl-pagination-info
*/
export default Ember.Component.extend({
/**
* Class names for the root element
*
* @property {array} classNames
*/
classNames: [ 'sl-pagination-info' ],
/**
* HTML tag name for the root element
... | import Ember from 'ember';
/** @module sl-components/components/sl-pagination-info */
export default Ember.Component.extend({
/**
* HTML tag name for the root element
*
* @property {Ember.String} tagName
* @default "span"
*/
tagName: 'span',
/**
* Class names for the root e... | Refactor to follow style guides | Refactor to follow style guides
| JavaScript | mit | juwara0/sl-ember-components,azizpunjani/sl-ember-components,theoshu/sl-ember-components,alxyuu/sl-ember-components,Suven/sl-ember-components,azizpunjani/sl-ember-components,juwara0/sl-ember-components,SpikedKira/sl-ember-components,notmessenger/sl-ember-components,theoshu/sl-ember-components,Suven/sl-ember-components,s... |
78d0342589091c7cd135ac368df6748051167f9a | telegram_bot.js | telegram_bot.js | const TelegramBot = require('node-telegram-bot-api');
module.exports = class TelegramBot_ extends TelegramBot {
constructor(config) {
super(config.telegramBotToken, { polling: true });
}
}
| const TelegramBot = require('node-telegram-bot-api');
module.exports = class TelegramBot_ extends TelegramBot {
constructor(config) {
super(config.telegramBotToken, { polling: false });
}
}
| Disable polling messages on the telegram bot | Disable polling messages on the telegram bot
* Since the bot does not need to receive messages, disabling polling would
not affect the program.
| JavaScript | mit | dimotsai/pokemongo-notification |
7a794f61ff2ecc565d4be367a50c02c0f44e1f3e | tests/config.js | tests/config.js | module.exports = {
baseURL: 'http://localhost:2030',
browser: 'chrome'
}
| module.exports = {
baseURL: 'http://localhost:2030',
browser: 'firefox',
views: [ 'Verbose' ]
}
| Use Firefox by default and "Verbose" view | Use Firefox by default and "Verbose" view
| JavaScript | agpl-3.0 | openfisca/legislation-explorer |
154b8babc4f2593111c716374702b1cf0c422911 | test/phantom_hooks.js | test/phantom_hooks.js | module.exports = {
afterEnd: function(runner) {
var fs = require('fs');
var coverage = runner.page.evaluate(function() {
return window.__coverage__;
});
if (coverage) {
console.log('Writing coverage to coverage/coverage.json');
fs.write('coverage/coverage.json', JSON.stringify(cover... | /* eslint-disable no-console */
module.exports = {
afterEnd: function(runner) {
var fs = require('fs');
var coverage = runner.page.evaluate(function() {
return window.__coverage__;
});
if (coverage) {
console.log('Writing coverage to coverage/coverage.json');
fs.write('coverage/cov... | Allow console use in Phantom | Allow console use in Phantom
| JavaScript | bsd-2-clause | geekdenz/ol3,thomasmoelhave/ol3,fredj/ol3,oterral/ol3,stweil/openlayers,thomasmoelhave/ol3,openlayers/openlayers,mzur/ol3,fredj/ol3,tamarmot/ol3,kjelderg/ol3,fblackburn/ol3,NOAA-ORR-ERD/ol3,mzur/ol3,fblackburn/ol3,klokantech/ol3,planetlabs/ol3,geekdenz/openlayers,planetlabs/ol3,itayod/ol3,tschaub/ol3,alexbrault/ol3,gin... |
b9f1e2e128574eff2c8d399c34e1a1ea919e3d4a | routes/home.js | routes/home.js | 'use strict';
var renderComponent = require('../lib/component').render;
module.exports = function (route) {
route.name = 'home';
route.get(function (req, res) {
var splashExample = {
name : 'Annie',
numPhotos: 1000,
takenDate: Date.now()
};
var... | 'use strict';
var renderComponent = require('../lib/component').render;
module.exports = function (route) {
route.name = 'home';
route.get(function (req, res) {
var splashExample = {
name : 'Annie',
numPhotos: 1000,
takenDate: Date.now()
};
var... | Add comment around weird `lastMonth` in Home route | Add comment around weird `lastMonth` in Home route
| JavaScript | bsd-3-clause | okuryu/formatjs-site,ericf/formatjs-site,ericf/formatjs-site |
e488eb0093412aa3decb509c1d10bed3aff34249 | src/utils/debounce.js | src/utils/debounce.js | /*
* @flow
*/
export default function debounce(
fn: () => void,
delay: number = 250,
): () => void {
let timer = null;
return function() {
clearTimeout(timer);
timer = setTimeout(fn, delay);
};
}
| /*
* @flow
*/
export default function debounce(
fn: () => void,
delay: number = 250,
): () => void {
let timer: ?TimeoutID = null;
return function() {
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(fn, delay);
};
}
| Add check so clearTimeout passes flow | Add check so clearTimeout passes flow
| JavaScript | apache-2.0 | pinterest/bonsai,pinterest/bonsai,pinterest/bonsai |
d882ef87f4062946c1fea6528d0edd5169d5292a | test/validPassword.js | test/validPassword.js | const expect = require('chai').expect;
const validPassword = require('../lib/validPassword');
it('should return new password', function() {
let result = validPassword('old', 'new', 'new');
return result.then(function(pw) {
expect(pw).to.equal('new');
});
});
| const expect = require('chai').expect;
const validPassword = require('../lib/validPassword');
it('should return new password', function() {
return validPassword('old', 'new', 'new').then(function(pw) {
expect(pw).to.equal('new');
}).catch(function(err) {
throw new Error('was not supposed to fail');
});
}... | Add tests for failure conditions | Add tests for failure conditions
| JavaScript | apache-2.0 | mfinelli/cautious-ldap,mfinelli/cautious-ldap |
51955d22d1483cd5c4d2bc7e08857b0a13b613d3 | app/components/Search.js | app/components/Search.js | // import React, { Component } from 'react';
// import {
// StyleSheet,
// Text,
// View,
// Image,
// TouchableHighlight,
// Alert,
// TextInput,
// ScrollView,
// Switch,
// Animated
// } from 'react-native';
| import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Image,
TouchableHighlight,
Alert,
TextInput,
ScrollView,
Switch,
Animated
} from 'react-native';
| Remove commented code because it's the right thing to do. | Remove commented code because it's the right thing to do.
| JavaScript | mit | Casey1449/React-Native,Casey1449/React-Native,Casey1449/React-Native,Casey1449/React-Native,Casey1449/React-Native |
eb074fe8e4ed4489d2a5e07f3ea2f8ed655a9977 | applications/calendar/jest.config.js | applications/calendar/jest.config.js | module.exports = {
setupFilesAfterEnv: ['./rtl.setup.js'],
verbose: true,
moduleDirectories: ['<rootDir>/node_modules'],
transform: {
'^.+\\.(js|tsx?)$': '<rootDir>/jest.transform.js',
},
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
transformIgnorePat... | module.exports = {
setupFilesAfterEnv: ['./rtl.setup.js'],
verbose: true,
moduleDirectories: ['<rootDir>/node_modules', 'node_modules'],
transform: {
'^.+\\.(js|tsx?)$': '<rootDir>/jest.transform.js',
},
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
tr... | Fix test support in monorepo | Fix test support in monorepo
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
77a7809961c0488713b2d7537e1d29ffe084e256 | www/js/main.js | www/js/main.js | var cordova = require("cordova");
window.onload = action
var action = document.pesan.action = login();
var rs = ["Royal Progress", "RSUP Dr Cipto Mangunkusumo", "RSUP Fatmawati", "RSUP Persahabatan"]
function login() {
var nama = document.pesan.nama.value;
var valid = false;
var name = ["admin"];
}
| var cordova = require("cordova");
window.onload = action
var action = document.pesan.action = login();
var rs = ["Royal Progress", "RSUP Dr Cipto Mangunkusumo", "RSUP Fatmawati", "RSUP Persahabatan"]
function login() {
var nama = document.pesan.nama.value;
var valid = false;
var name = ["admin"];
for (var i = 0;... | Set valid as true if name is correct | Set valid as true if name is correct
| JavaScript | mit | mercysmart/cepatsembuh,mercysmart/cepatsembuh,christoga/cepatsembuh,christoga/cepatsembuh,cepatsembuh/cordova,christoga/cepatsembuh,cepatsembuh/cordova,cepatsembuh/cordova,christoga/cepatsembuh,mercysmart/cepatsembuh,cepatsembuh/cordova,mercysmart/cepatsembuh,christoga/cepatsembuh,cepatsembuh/cordova,mercysmart/cepatse... |
ea7a6da5a5a6f67df4705040720847204097d733 | app.js | app.js | 'use strict';
const http = require('http');
const path = require('path');
const url = require('url');
const auth = require('http-auth');
const HttpStatusCodes = require('http-status-codes');
const stream_file_to_bd = require('./lib/stream_file_to_bd');
const basic_auth = auth.basic({
realm: 'Vidya',
file: path.... | 'use strict';
const http = require('http');
const path = require('path');
const url = require('url');
const auth = require('http-auth');
const HttpStatusCodes = require('http-status-codes');
const stream_file_to_bd = require('./lib/stream_file_to_bd');
const basic_auth = auth.basic({
realm: 'Vidya',
file: path.... | Remove forward slashes on path.join call for htpasswd file | Remove forward slashes on path.join call for htpasswd file
| JavaScript | mit | vidya-org/vidya-journaler,vidya-org/vidya-journaler |
90dead849ade30b39090ea6cc92c8ae61c4693fb | cli.js | cli.js | #!/usr/bin/env node
var path = require('path');
/*
* NPM modules
*/
var program = require('commander');
var yaml = require("js-yaml");
var fs = require('fs-extra');
var _ = require('lodash');
/*
* App modules
*/
var html = require('./lib/html-validator.js');
var logger = require('./lib/utils/logger.js');
/*
*... | #!/usr/bin/env node
var path = require('path');
/*
* NPM modules
*/
var program = require('commander');
var yaml = require("js-yaml");
var fs = require('fs-extra');
var _ = require('lodash');
/*
* App modules
*/
var html = require('./lib/html-validator.js');
var logger = require('./lib/utils/logger.js');
/*
*... | Allow cache path to be overwritten on by commandline option | Allow cache path to be overwritten on by commandline option
| JavaScript | isc | Koded/HTMLValidator |
776f656d223b42d971f1053441b315f80da94ae2 | app/stack/log-drains/new/controller.js | app/stack/log-drains/new/controller.js | import Ember from "ember";
// We create an anchor since that is, afaik, the easiest way to parse a url in javascript
function parseUrl(url) {
let a = document.createElement('a');
a.href = url;
return a;
}
export default Ember.Controller.extend({
actions: {
setDrainFromDatabase(database) {
let connec... | import Ember from "ember";
// We create an anchor since that is, afaik, the easiest way to parse a url in javascript
function parseUrl(url) {
let a = document.createElement('a');
a.href = url;
a.hostWithoutPort = a.host.substring(0, a.host.lastIndexOf(':')); // Remove port
// Workaround for HTMLAnchorElement ... | Move the construction of user credentials into parseUrl(), and only construct username and password if they're undefined (which is currently the case with phantomjs. | Move the construction of user credentials into parseUrl(), and only construct username and password if they're undefined (which is currently the case with phantomjs.
| JavaScript | mit | aptible/dashboard.aptible.com,chasballew/dashboard.aptible.com,chasballew/dashboard.aptible.com,blakepettersson/dashboard.aptible.com,blakepettersson/dashboard.aptible.com,aptible/dashboard.aptible.com,chasballew/dashboard.aptible.com,aptible/dashboard.aptible.com,blakepettersson/dashboard.aptible.com |
2bba044cd41a122c80a704c4bb57e358ee7a7f7c | app/assets/javascripts/angular/common/models/drama-model.js | app/assets/javascripts/angular/common/models/drama-model.js | (function(){
'use strict';
angular
.module('secondLead')
.factory('DramaModel',['Restangular', function(Restangular) {
var baseDramas = Restangular.all('dramas');
return {
getAll: baseDramas.getList().$object,
getOne: function(dramaID) {
return Restangular.one('dramas', dramaID).g... | (function(){
'use strict';
angular
.module('secondLead')
.factory('DramaModel',['Restangular', function(Restangular) {
var baseDramas = Restangular.all('dramas');
return {
getAll: baseDramas.getList().$object,
getOne: function(dramaID) {
return Restangular.one('dramas', dramaID).g... | Add remove function to drama model | Add remove function to drama model
| JavaScript | mit | ac-adekunle/secondlead,ac-adekunle/secondlead,ac-adekunle/secondlead |
c6133c1e62f9218453095ca965914f070d343c97 | app/assets/javascripts/books.js | app/assets/javascripts/books.js | $(document).ready(function() {
$('#FontSize a').click(function() {
$('.content').css("font-size", this.dataset.size);
});
$('#FontFamily a').click(function(){
$('.content').css("font-family", this.innerHTML);
});
$('#Leading a').click(function(){
$('.content').css("line-height", this.dataset.spacing);
});... | var ready = function() {
$('#FontSize a').click(function() {
$('.content').css("font-size", this.dataset.size);
});
$('#FontFamily a').click(function(){
$('.content').css("font-family", this.innerHTML);
});
$('#Leading a').click(function(){
$('.content').css("line-height", this.dataset.spacing);
});
$('... | Fix bug where format links did not work | Fix bug where format links did not work
| JavaScript | mit | mk12/great-reads,mk12/great-reads,mk12/great-reads |
0373a7750a8a35521ad7afb854379434c9da7ad1 | rules/babel.js | rules/babel.js | 'use strict'
const _ = require('lodash')
const extendConfig = require('../lib/extendConfig')
const mainRules = require('./main')
const eslintConfigAirbnb = extendConfig({
extends: 'airbnb'
})
const migratedRules = {}
const migrateRuleNames = [
'array-bracket-spacing',
'arrow-parens',
'generator-star-spacing... | 'use strict'
const _ = require('lodash')
const extendConfig = require('../lib/extendConfig')
const mainRules = require('./main')
const eslintConfigAirbnb = extendConfig({
extends: 'eslint-config-airbnb'
})
const migratedRules = {}
const migrateRuleNames = [
'array-bracket-spacing',
'arrow-parens',
'generato... | Use full path for eslint-config-airbnb | Use full path for eslint-config-airbnb
| JavaScript | mit | foray1010/eslint-config-foray1010,foray1010/eslint-config-foray1010 |
d4b07339cc7dd9b29faae084e2f4a6f64d96c394 | client/src/components/VoteCounter.js | client/src/components/VoteCounter.js | import React, { PropTypes } from 'react';
import css from './VoteCounter.css';
const VoteCounter = ({ count, total, label }) => (
<div className={css.counter}>
<div className={css.label}>
{ label } <span className={css.count}>({ count } / { total })</span>
</div>
<div className={css.bar}>
<di... | import React, { PropTypes } from 'react';
import css from './VoteCounter.css';
const VoteCounter = ({ count, total, label }) => (
<div className={css.counter}>
<div className={css.label}>
{ label } <span className={css.count}>({ count } / { total })</span>
</div>
<div className={css.bar}>
<di... | Make progressbar 0% wide if no votes for that alternative | Make progressbar 0% wide if no votes for that alternative
| JavaScript | mit | dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta |
23e14e871f7d8120881a6fd0e46579eaf2047d73 | client/src/modules/plan/feed/feed.js | client/src/modules/plan/feed/feed.js | import angular from 'angular';
// components used by this module
// imports for this component
import template from './feed.html';
import './feed.css';
class FeedController {
constructor(PlanService) {
this.plan = {
title: 'Weekend Getaway',
description: 'Lets go out to the desert this weekensd and ... | import angular from 'angular';
// components used by this module
// imports for this component
import template from './feed.html';
import './feed.css';
class FeedController {
constructor() {
}
}
FeedController.$inject = [];
const FeedComponent = {
restrict: 'E',
bindings: {
plan: '<'
},
template: te... | Add plan binding and remove this.plan from constructor | Add plan binding and remove this.plan from constructor
| JavaScript | mit | awaywego/awaywego,awaywego/awaywego |
681ef474bf0db9276cf06b85ca2b2ffef2b26c4e | test/test-creation.js | test/test-creation.js | /*global describe, beforeEach, it*/
'use strict';
var path = require('path');
var helpers = require('yeoman-generator').test;
describe('Ionic Framework Generator', function () {
beforeEach(function (done) {
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
if (err) {
... | /*global describe, beforeEach, it*/
'use strict';
var path = require('path');
var helpers = require('yeoman-generator').test;
describe('Ionic Framework Generator', function () {
this.timeout(30000);
beforeEach(function (done) {
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
... | Set mocha test timeout for entire test, extended timeout to 30 seconds. | Set mocha test timeout for entire test, extended timeout to 30 seconds.
| JavaScript | mit | bja1011/generator-ionic,anhuisunfei/generator-ionic,AlexSwensen/generator-ionic,stonegithubs/generator-ionic,471685249/generator-ionic,yangcwGIT/generator-ionic,SidneyS/generator-ionic,diegonetto/generator-ionic,Ribeiro/generator-ionic,yshyee/generator-ionic,felquis/generator-ionic,JaKXz/generator-ionic,DiZyStudio/gene... |
cd596cd599032b1828eb1b30ee5a9e05dcc9fc6b | test/unit/nunjucks.js | test/unit/nunjucks.js | const nunjucks = require('nunjucks')
const jsdom = require('jsdom')
const { JSDOM } = jsdom
const tradeElementsFilters = require('~/config/nunjucks/trade-elements-filters')
const dataHubFilters = require('~/config/nunjucks/filters')
const filters = Object.assign({}, tradeElementsFilters, dataHubFilters)
nunjucks.con... | const nunjucks = require('nunjucks')
const jsdom = require('jsdom')
const { JSDOM } = jsdom
const tradeElementsFilters = require('~/config/nunjucks/trade-elements-filters')
const dataHubFilters = require('~/config/nunjucks/filters')
const filters = Object.assign({}, tradeElementsFilters, dataHubFilters)
nunjucks.con... | Set getAssetPath method stub in render function used in tests | Set getAssetPath method stub in render function used in tests
| JavaScript | mit | uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend |
b6d33d5d5c2e07b90ee0fbc53f21f13141795d6f | src/add_communication.js | src/add_communication.js | "use strict";
var Immutable = require('immutable')
const AUTHORS_BY_MSG_ID = {}
const EMPTY_ITEM_MAP = Immutable.Map({ total: 0, trend: 0 })
, inc = n => n + 1
, incCounts = counts => counts.update('total', inc).update('trend', inc)
, updateMapCounts = val => map => map.update(val, EMPTY_ITEM_MAP, incCou... | "use strict";
var Immutable = require('immutable')
const AUTHORS_BY_MSG_ID = {}
const EMPTY_ITEM_MAP = Immutable.Map({ total: 0, trend: 0 })
, inc = n => n + 1
, incCounts = counts => counts.update('total', inc).update('trend', inc)
, updateMapCounts = val => map => map.update(val, EMPTY_ITEM_MAP, incCou... | Fix case where there's no subject in an email | Fix case where there's no subject in an email
| JavaScript | agpl-3.0 | ptgolden/maelstrom,ptgolden/maelstrom |
37fc5de8b46b8e51bb6fb535f77576051b53b953 | writegif.js | writegif.js | var GifEncoder = require("gif-encoder")
var concat = require("terminus").concat
module.exports = writegif
// something with GifEncoder isn't correctly resetting the
// state of backpressure it seems like?
var hwm = 128 * 100 * 1024 // HUGE
// default = 10, 200 is maybe a bit smaller sometimes
var quality = 200
func... | var GifEncoder = require("gif-encoder")
var concat = require("terminus").concat
module.exports = writegif
// something with GifEncoder isn't correctly resetting the
// state of backpressure it seems like?
var hwm = 128 * 100 * 1024 // HUGE
function writegif(image, opts, callback) {
if (!callback) { callback = opts... | Allow quality to be configurable | Allow quality to be configurable
In images with few colors (such as a 4-color palette), a high value would remove most of the detail, resulting in a nearly flat/blank image. | JavaScript | mit | revisitors/writegif |
74b0ef45ca75f17b1eaad784e7f426508eb43a02 | server/utils/romanise.js | server/utils/romanise.js | const {firstItem} = require('./functionalHelpers');
module.exports = {romanise, romaniseLower};
const numerals = {
1: 'I',
4: 'IV',
5: 'V',
9: 'IX',
10: 'X',
40: 'XL',
50: 'L'
};
function romaniseLower(number) {
return romanise(number).toLowerCase();
}
function romanise(number) {
... | const {firstItem} = require('./functionalHelpers');
module.exports = {romanise, romaniseLower};
const conversions = {
1: 'I',
4: 'IV',
5: 'V',
9: 'IX',
10: 'X',
40: 'XL',
50: 'L'
};
const numerals = Object.entries(conversions).reverse();
function romaniseLower(number) {
return romani... | Use roman numerals for additional conditions | Use roman numerals for additional conditions
| JavaScript | mit | noms-digital-studio/licences,noms-digital-studio/licences,noms-digital-studio/licences |
c0729982b57d5ac90ab09c8f39d4b46851fa477d | src/changeThreadColor.js | src/changeThreadColor.js | "use strict";
var utils = require("../utils");
var log = require("npmlog");
module.exports = function(defaultFuncs, api, ctx) {
return function changeThreadColor(color, threadID, callback) {
var form = {
'color_choice' : color,
'thread_or_other_fbid' : threadID
};
defaultFuncs
.post("... | "use strict";
var utils = require("../utils");
var log = require("npmlog");
module.exports = function(defaultFuncs, api, ctx) {
return function changeThreadColor(color, threadID, callback) {
if(!callback) {
callback = function() {};
}
var form = {
'color_choice' : color,
'thread_or_oth... | Fix thread color parameter as optional | Fix thread color parameter as optional
| JavaScript | mit | GAMELASTER/facebook-chat-api,Schmavery/facebook-chat-api,ravkr/facebook-chat-api |
49d65be4a55557878c3f31ea6d0d0d7c322d890e | controllers/welcomeController.js | controllers/welcomeController.js | angular.module('dataGoMain')
.controller('WelcomeController', ['$scope', '$http', 'dataGoAPI', '$rootScope',function($scope, $http, dataGoAPI, $rootScope){
console.log('in HomeCtrl');
$scope.registerUser = registerUser;
$scope.loginEmail = '';
$scope.loginPassword = '';
$scop... | angular.module('dataGoMain')
.controller('WelcomeController', ['$scope', '$http', 'dataGoAPI', '$rootScope',function($scope, $http, dataGoAPI, $rootScope){
console.log('in HomeCtrl');
$scope.registerUser = registerUser;
$scope.loginEmail = '';
$scope.loginPassword = '';
$scop... | Allow new user AJAX call to accept HTTP status code instead of manual code | Allow new user AJAX call to accept HTTP status code instead of manual code
| JavaScript | mit | kylanhurt/larang-rebuild,kylanhurt/larang-rebuild,kylanhurt/larang-rebuild,kylanhurt/larang-rebuild,kylanhurt/larang-rebuild,kylanhurt/larang-rebuild |
406884153f0e0cbf89ecfef9bb80716993144c2e | js/coins.js | js/coins.js | (function($) {
var coins = ['btc', 'ltc', 'nmc', 'ppc'];
coins.forEach(function(coin) {
updateCoin(coin);
});
})(jQuery);
function updateCoin(coin) {
var baseUrl = 'https://btc-e.com/api/3/ticker/';
$.ajax({
type: 'GET',
url: baseUrl + coin + '_usd',
async: false,
contentType: "applicat... | (function($) {
updateCoins();
setInterval(updateCoins, 5000);
})(jQuery);
function updateCoins() {
['btc', 'ltc', 'nmc', 'ppc'].forEach(function(coin) {
updateCoin(coin);
});
};
function updateCoin(coin) {
var baseUrl = 'https://btc-e.com/api/3/ticker/';
$.ajax({
type: 'GET',
url: baseUrl + c... | Update every five seconds, fade it in. | Update every five seconds, fade it in.
| JavaScript | mit | chorks/cryptotracker.co,johnotander/cryptotracker.co,chorks/cryptotracker.co |
26c735ad18cbf5ea0d759efb7af336efffb460d7 | source/assets/js/trip.js | source/assets/js/trip.js | const resources_template = require("./templates/resources-simple.hbs");
/* parallax on blog posts with cover image */
var parallaxImage = document.getElementById('ParallaxImage');
var windowScrolled;
window.addEventListener('scroll', function windowScroll() {
windowScrolled = window.pageYOffset || document.document... | const resources_template = require("./templates/resources-simple.hbs");
/* parallax on blog posts with cover image */
var parallaxImage = document.getElementById('ParallaxImage');
var windowScrolled;
window.addEventListener('scroll', function windowScroll() {
windowScrolled = window.pageYOffset || document.document... | Add check for all states | Add check for all states
| JavaScript | mit | jdillard/personal-site,jdillard/personal-site,jdillard/personal-site,jdillard/personal-site |
02aebdfcfa37af18eb70fcf4cd7dd799c3cb8f30 | src/dropbox.js | src/dropbox.js | var DropboxBase = require('./dropbox-base');
var routes = require('./routes');
var Dropbox;
/**
* @class Dropbox
* @extends DropboxBase
* @classdesc The Dropbox SDK class that provides methods to read, write and
* create files or folders in a user's Dropbox.
* @arg {Object} options
* @arg {String} [options.acces... | var DropboxBase = require('./dropbox-base');
var routes = require('./routes');
var Dropbox;
/**
* @class Dropbox
* @extends DropboxBase
* @classdesc The Dropbox SDK class that provides methods to read, write and
* create files or folders in a user's Dropbox.
* @arg {Object} options
* @arg {String} [options.acces... | Remove hard coded route function | Remove hard coded route function
| JavaScript | mit | smarx/dropbox-sdk-js,smarx/dropbox-sdk-js,smarx/dropbox-sdk-js |
36da606092c93c31e6c6bc64eeacdfaa4198be44 | .eslintrc.js | .eslintrc.js | // See http://eslint.org/docs/
module.exports = {
env: {es6: true, commonjs: true},
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {jsx: true}
},
extends: ['eslint:recommended', 'google'],
plugins: ['react'],
rules: {
'max-len': ['error', 100],
'require-jsdoc': 'o... | // See http://eslint.org/docs/
module.exports = {
env: {es6: true, commonjs: true},
parserOptions: {
ecmaVersion: 2017,
ecmaFeatures: {jsx: true}
},
extends: ['eslint:recommended', 'google'],
plugins: ['react'],
rules: {
'max-len': ['error', 100],
'require-jsdoc':... | Update the ES version supported by ESLint | Update the ES version supported by ESLint
| JavaScript | mit | frosas/lag,frosas/lag,frosas/lag |
57e1963cd12f14ad7ab76792ed280b829fe6e461 | src/convert.js | src/convert.js | 'use strict';
var opts = {
prefix: '',
suffix: '',
suffixLastItem: true,
};
function objToValue(obj, opts) {
var keys = Object.keys(obj);
var fields = keys.map(function(key) {
var value = formatValue(obj[key]);
return opts.prefix + key + ":" + value;
});
var result = fields.join(opts.suffix + "... | 'use strict';
var opts = {
prefix: '',
suffix: '',
suffixLastItem: true,
};
function objToValue(obj, opts) {
var keys = Object.keys(obj);
var fields = keys.map(function(key) {
var value = formatValue(obj[key]);
return opts.prefix + key + ":" + value;
});
var result = fields.join(opts.suffix + "... | Add parentheses around all lists so that nested lists are supported (without them Sass throws an error). | Add parentheses around all lists so that nested lists are supported (without them Sass throws an error).
| JavaScript | mit | epegzz/sass-vars-loader,epegzz/sass-vars-loader,epegzz/sass-vars-loader |
a8140cbfe42ef3b7952fd4d3a4a22dc77f4ae9a3 | blueprints/ember-leaflet-draw/index.js | blueprints/ember-leaflet-draw/index.js | // /*jshint node:true*/
// module.exports = {
// description: 'add leaflet-draw assets, using bower',
//
// normalizeEntityName: function() {}, // no-op since we're just adding dependencies
//
// afterInstall: function() {
// return this.addBowerPackageToProject('leaflet-draw', '~0.4.9');
// }
// };
| /*jshint node:true*/
module.exports = {
description: 'add leaflet-draw assets, using npm',
normalizeEntityName: function() {}, // no-op since we're just adding dependencies
afterInstall: function() {
return this.addPackageToProject('leaflet-draw', '~0.4.9');
}
};
| Update blueprint to add npm package | Update blueprint to add npm package
| JavaScript | mit | StevenHeinrich/ember-leaflet-draw,StevenHeinrich/ember-leaflet-draw,StevenHeinrich/ember-leaflet-draw |
bc0211568aa9ce77b4156346cf70dc76348e923e | src/gutiBot.js | src/gutiBot.js | "use strict";
const slack = require('./utils/slackUtils');
const axios = require('axios');
function _ok(response) {
return response.status(200);
}
function respondOk(response) {
return _ok(response).end();
}
function respondWith(response, message) {
const payload = slack.outgoingWebhook.createResponse(message... | "use strict";
const slack = require('./utils/slackUtils');
const axios = require('axios');
function _ok(response) {
return response.status(200);
}
function _getIncomingWebhookUrl() {
return process.env.SLACK_INCOMING_WEBHOOK_URL;
}
function _getBotUserApiToken() {
return process.env.SLACK_BOT_USER_API_TOKEN;
... | Allow Gutibot to supply incoming hook url | Allow Gutibot to supply incoming hook url
| JavaScript | mit | awseward/silly-slacker,awseward/gutibot |
846949d03b2567c591fe284f7ef201de60324578 | src/js/math.js | src/js/math.js | import * as THREE from 'three';
export function randomPointOnSphere( vector = new THREE.Vector3() ) {
const theta = 2 * Math.PI * Math.random();
const u = 2 * Math.random() - 1;
const v = Math.sqrt( 1 - u * u );
return vector.set(
v * Math.cos( theta ),
v * Math.sin( theta ),
u
);
}
export func... | import * as THREE from 'three';
export function randomPointOnSphere( vector = new THREE.Vector3() ) {
const theta = 2 * Math.PI * Math.random();
const u = 2 * Math.random() - 1;
const v = Math.sqrt( 1 - u * u );
return vector.set(
v * Math.cos( theta ),
v * Math.sin( theta ),
u
);
}
export func... | Remove custom 1D lerp() function. | Remove custom 1D lerp() function.
THREE.Math.lerp() was added in three.js r82.
| JavaScript | mit | razh/flying-machines,razh/flying-machines |
415e6315f263345c3f06bcc3d33c6403fd1cfed3 | src/js/main.js | src/js/main.js | let dictionary = new Dictionary();
let httpRequest = new HttpRequest();
httpRequest.get(dictionary.randomUrl, function(o) {
console.log(o)
}); | let dictionary = new Dictionary();
let httpRequest = new HttpRequest();
//(Math.random() * (max - min) + min)
let interval = (Math.random() * (10000 - 5000)) + 5000;
window.setInterval(function() {
let url = dictionary.randomUrl;
httpRequest.get(url);
}, interval); | Set random 5-10 second interval | Set random 5-10 second interval
| JavaScript | mit | brat-corp/applesauce,brat-corp/applesauce |
9ff5270aa8c75a56df883a7b734156d2f8eded99 | client/src/store/rootReducer.js | client/src/store/rootReducer.js | import { reducer as formReducer } from 'redux-form';
import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import {
organization,
starredBoard,
notification,
modals,
board,
home
} from '../app/routes/home/modules/index';
import { signUp } from '../app/routes/signUp/module... | import { reducer as formReducer } from 'redux-form';
import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import {
organization,
starredBoard,
notification,
modals,
board,
home
} from '../app/routes/home/modules/index';
import { signUp } from '../app/routes/signUp/module... | Reset state when user logs out | Reset state when user logs out
| JavaScript | mit | Madmous/madClones,Madmous/madClones,Madmous/Trello-Clone,Madmous/madClones,Madmous/Trello-Clone,Madmous/Trello-Clone,Madmous/madClones |
b78fe2c8157e90cea5535189b63120f4608b75b9 | src/js/AppRouter.js | src/js/AppRouter.js | define([
"backbone",
"jquery",
"view/HomeView",
"collection/Presentation",
"view/PresentationView",
"model/Slide",
"view/SlideView"
], function (Backbone, $, HomeView, Presentation, PresentationView, Slide, SlideView) {
return Backbone.Router.extend({
routes: {
"home... | define([
"backbone",
"jquery",
"view/HomeView",
"collection/Presentation",
"view/PresentationView",
"model/Slide",
"view/SlideView"
], function (Backbone, $, HomeView, Presentation, PresentationView, Slide, SlideView) {
var presentation = new Presentation();
return Backbone.Router.... | Edit slides by finding them from the collection | Edit slides by finding them from the collection
| JavaScript | mit | pads/yap,pads/yap |
82a6130b3ca36cf474959ea882e3910d4135d283 | src/featureExtractors.js | src/featureExtractors.js | import rms from './extractors/rms';
import energy from './extractors/energy';
import spectralSlope from './extractors/spectralSlope';
import spectralCentroid from './extractors/spectralCentroid';
import spectralRolloff from './extractors/spectralRolloff';
import spectralFlatness from './extractors/spectralFlatness';
im... | import rms from './extractors/rms';
import energy from './extractors/energy';
import spectralSlope from './extractors/spectralSlope';
import spectralCentroid from './extractors/spectralCentroid';
import spectralRolloff from './extractors/spectralRolloff';
import spectralFlatness from './extractors/spectralFlatness';
im... | Modify export to allow importing selectively | Modify export to allow importing selectively
| JavaScript | mit | meyda/meyda,hughrawlinson/meyda,meyda/meyda,meyda/meyda |
0c5192362e234bb1d024ef9bbbe39ed3c605722a | adventure/res/js/sluggifyUI.js | adventure/res/js/sluggifyUI.js | var updatableSlug = true;
/* jQuery because BS brings it in; trivial to remove */
function sluggify(str) {
if (!str) {
return "";
}
/* we could check for the existence of a slug too */
return str.toLowerCase() /* no uppercase in slug */
.replace(/[^a-z0-9-]/g, "-") /* get rid of non-alp... | var updatableSlug = true;
/* jQuery because BS brings it in; trivial to remove */
function sluggify(str) {
if (!str) {
return "";
}
/* we could check for the existence of a slug too */
return str.toLowerCase() /* no uppercase in slug */
.replace(/[^a-z0-9-]/g, "-") /* get rid of non-alp... | Fix broken comment in slug function | Fix broken comment in slug function
| JavaScript | agpl-3.0 | WinWorldPC/adventure,WinWorldPC/adventure |
4dbb60abd9df648f4a963f6584f4090b39b8caa3 | lib/poet.js | lib/poet.js | var
fs = require('fs'),
_ = require('underscore'),
createTemplates = require('./poet/templates'),
createHelpers = require('./poet/helpers'),
routes = require('./poet/routes'),
methods = require('./poet/methods'),
utils = require('./poet/utils'),
method = utils.method;
function Poet (app, options) {
t... | var
fs = require('fs'),
_ = require('underscore'),
createTemplates = require('./poet/templates'),
createHelpers = require('./poet/helpers'),
routes = require('./poet/routes'),
methods = require('./poet/methods'),
utils = require('./poet/utils'),
method = utils.method;
function Poet (app, options) {
t... | Remove method that was vestigial from pre-1.0.0 release | Remove method that was vestigial from pre-1.0.0 release
| JavaScript | mit | Nayar/poet,r14r/fork_nodejs_poet,jhuang314/poet,jhuang314/poet,r14r/fork_nodejs_poet,jsantell/poet,Nayar/poet,jsantell/poet |
d90307b810d5a6952f969935b0b6275776c1e17a | app/assets/javascripts/ping.js | app/assets/javascripts/ping.js | var Pinger = {
};
// http://stackoverflow.com/a/573784
Pinger.getPing = function(target, callback) {
var start;
var client = Pinger.getClient(); // xmlhttprequest object
client.onreadystatechange = function() {
if (client.readyState >= 2) { // request received
lag_ms = Pinger.pingDone(start); //handle ... | var Pinger = {
seq: 0
};
// http://stackoverflow.com/a/573784
Pinger.getPing = function(target, callback) {
var start;
var client = Pinger.getClient(); // xmlhttprequest object
client.onreadystatechange = function() {
if (client.readyState >= 2) { // request received
lag_ms = Pinger.pingDone(start); ... | Use sequence number instead of timestamp to avoid cache | Use sequence number instead of timestamp to avoid cache
| JavaScript | mit | zunda/ping,zunda/ping,zunda/ping |
2f1f3e808af300a633a1435c425d2f23550e5211 | lib/ember-pusher/bindings.js | lib/ember-pusher/bindings.js | var global = (typeof window !== 'undefined') ? window : {},
Ember = global.Ember;
var Bindings = Ember.Mixin.create({
needs: 'pusher',
init: function() {
var pusherController, target;
this._super();
if(!this.PUSHER_SUBSCRIPTIONS) { return; }
pusherController = this.get('controllers.pusher');
... | var global = (typeof window !== 'undefined') ? window : {},
Ember = global.Ember;
var Bindings = Ember.Mixin.create({
needs: 'pusher',
init: function() {
var pusherController, target;
this._super();
if(!this.PUSHER_SUBSCRIPTIONS) { return; }
pusherController = this.get('controllers.pusher');
... | Fix improper grab of the pusher controller in unwire | Fix improper grab of the pusher controller in unwire
| JavaScript | mit | jamiebikies/ember-pusher,mmun/ember-pusher,mmun/ember-pusher,jamiebikies/ember-pusher |
415d3ab16903f58293aaa09cc1b465686cdd5332 | app/lib/process.js | app/lib/process.js | const Promise = require('bluebird')
const { exec } = require('child_process')
Promise.config({
cancellation: true,
})
class Process {
static execute (script, options = {}) {
return new Promise((resolve, reject, onCancel) => {
const cmd = exec(script, (error, stdout, stderr) => {
if (error) {
... | const Promise = require('bluebird')
const { exec } = require('child_process')
Promise.config({
cancellation: true,
})
class Process {
static execute (script, userOptions = {}) {
const options = Object.assign({}, {
cwd: process.cwd(),
env: process.env,
}, userOptions)
return new Promise((re... | Allow user scripts to execute in their directories. | Allow user scripts to execute in their directories.
| JavaScript | mit | tinytacoteam/zazu,tinytacoteam/zazu |
81cea94ac6192477a0750be60be5d225ab644ff2 | src/tedious.js | src/tedious.js | 'use strict';
module.exports.BulkLoad = require('./bulk-load');
module.exports.Connection = require('./connection');
module.exports.Request = require('./request');
module.exports.library = require('./library');
module.exports.TYPES = require('./data-type').typeByName;
module.exports.ISOLATION_LEVEL = require('./trans... | 'use strict';
module.exports.BulkLoad = require('./bulk-load');
module.exports.Connection = require('./connection');
module.exports.Request = require('./request');
module.exports.library = require('./library');
module.exports.ConnectionError = require('./errors').ConnectionError;
module.exports.RequestError = require... | Add ConnectionError and RequestError to module.exports | Add ConnectionError and RequestError to module.exports
| JavaScript | mit | tediousjs/tedious,tediousjs/tedious,pekim/tedious |
b2d5054e5810ab94b0f42eb582af05efd366e8cd | app/util/logger.js | app/util/logger.js | import { GOOGLE_ANALYTICS_ID } from '../AppSettings';
import { GoogleAnalyticsTracker } from 'react-native-google-analytics-bridge';
let tracker = new GoogleAnalyticsTracker(GOOGLE_ANALYTICS_ID);
/**
* A module containing logging helper functions
* @module util/logger
*/
module.exports = {
/**
* Send a log mes... | import { GOOGLE_ANALYTICS_ID } from '../AppSettings';
import { GoogleAnalyticsTracker } from 'react-native-google-analytics-bridge';
let tracker = new GoogleAnalyticsTracker(GOOGLE_ANALYTICS_ID);
/**
* A module containing logging helper functions
* @module util/logger
*/
module.exports = {
/**
* Send a log mes... | Add google event tracking capability | Add google event tracking capability
| JavaScript | mit | UCSD/campus-mobile,UCSD/now-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/now-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/campus-mobile |
0c0e961f1d9ff4f44f2c593971a5235418c09390 | index.js | index.js | var gulp = require('gulp');
var elixir = require('laravel-elixir');
var karma = require('karma').server;
var _ = require('underscore');
var gutils = require('gulp-util');
var task = elixir.Task;
function isTddOrWatchTask() {
return gutils.env._.indexOf('watch') > -1 || gutils.env._.indexOf('tdd') > -1;
}
elixir.... | var gulp = require('gulp');
var elixir = require('laravel-elixir');
var KarmaServer = require('karma').Server;
var _ = require('underscore');
var gutils = require('gulp-util');
var task = elixir.Task;
function isTddOrWatchTask() {
return gutils.env._.indexOf('watch') > -1 || gutils.env._.indexOf('tdd') > -1;
}
e... | Use Karma 0.14 style programmatic calling | Use Karma 0.14 style programmatic calling
Fixes https://github.com/olyckne/laravel-elixir-karma/issues/2
| JavaScript | mit | olyckne/laravel-elixir-karma |
af3fa380334d52add8e937753ef4d14fab219fb4 | index.js | index.js | /**
* ENVIRONMENT VARIABLES
* TOKEN_LIFE: Number of seconds before a token expires
* APP_TOKEN: Facebook app token
* APP_ID: Facebook app ID
* ADMIN_ID: Client ID for admin program
* ADMIN_SECRET: Client secret for admin program
*/
// Dependencies
var https = require('https')
, fs = require('fs')... | /**
* ENVIRONMENT VARIABLES
* TOKEN_LIFE: Number of seconds before a token expires
* APP_TOKEN: Facebook app token
* APP_ID: Facebook app ID
* ADMIN_ID: Client ID for admin program
* ADMIN_SECRET: Client secret for admin program
*/
// Dependencies
var https = require('https')
, fs = require('fs')... | Fix heroku using wrong port | Fix heroku using wrong port
| JavaScript | mit | justinsacbibit/omi,justinsacbibit/omi,justinsacbibit/omi |
48011046ae3904c2818b311e8cd0e474505a206c | index.js | index.js | 'use strict';
const express = require('express');
const moment = require('moment');
const app = express();
const port = process.argv[2] || 3000;
app.get('/:timestamp', (request, response) => {
const timestamp = request.params.timestamp;
let result = {};
if (moment.unix(timestamp).isValid()) {
result = {
... | 'use strict';
const express = require('express');
const moment = require('moment');
const app = express();
const port = process.argv[2] || 3000;
app.get('/:timestamp', (request, response) => {
const timestamp = request.params.timestamp;
let result = {};
if (moment.unix(timestamp).isValid()) {
result = {
... | Use express' response.json() method because it sets proper header automatically | Use express' response.json() method because it sets proper header automatically
| JavaScript | mit | NicholasAsimov/timestamp-microservice |
6e7940cee3cfb45526a12b24901bfef982b81eb8 | client/components/Nav.js | client/components/Nav.js | import React, { Component } from 'react'
import { Link, IndexLink } from 'react-router'
export class Nav extends Component {
constructor(props) {
super(props)
}
render() {
return (
<nav className="transparent haze-background wrap navbar navbar-default" role="navigation">
<div className="co... | import React, { Component } from 'react'
import { Link, IndexLink } from 'react-router'
export class Nav extends Component {
constructor(props) {
super(props)
}
render() {
return (
<nav className="transparent haze-background wrap navbar navbar-default" role="navigation">
<div className="co... | Update /signin link to /login | Update /signin link to /login
| JavaScript | mit | scrumptiousAmpersand/journey,scrumptiousAmpersand/journey |
16d5a32553342cdff499ca0bb96b767d9bbbcedf | index.js | index.js | 'use strict';
module.exports = function (deck/*, options*/) {
var options = Object(arguments[1]), root = options.root || '/'
, update, activateSlide;
activateSlide = function (index) {
if (index === deck.slide()) return;
deck.slide(index);
};
update = function (e) {
var id = location.pathname.slice(root... | 'use strict';
module.exports = function (deck/*, options*/) {
var options = arguments[1], root, update, activateSlide;
if (typeof options === 'string') {
root = options;
} else {
options = Object(options);
root = options.root || '/';
}
activateSlide = function (index) {
if (index === deck.slide()) retur... | Support `root` as direct argument | Support `root` as direct argument
| JavaScript | mit | medikoo/bespoke-history |
260424ef0d594941d700368ed40a9f749699b7c4 | test/buster.js | test/buster.js | var config = module.exports;
config["Node tests"] = {
environment: "node",
tests: ["test/*.js"]
};
| var config = module.exports;
config["Node tests"] = {
environment: "node",
tests: ["./*-test.js"]
};
| Update configuration file for new implicit root path | Update configuration file for new implicit root path
| JavaScript | bsd-3-clause | busterjs/buster-cli |
5a24e17fc6f172526d68428c4a40b0e59bc0fea9 | index.js | index.js | 'use strict';
var HOSTS = process.platform === 'win32'
? 'C:/Windows/System32/drivers/etc/hosts'
: '/etc/hosts'
var readFileSync = require('fs').readFileSync;
module.exports = function () {
return readFileSync(HOSTS, { encoding: 'utf8' })
.split(/\r?\n/)
.map(function(line){
// R.E from feross/hostile
v... | 'use strict';
var once = require('once');
var split = require('split');
var through = require('through');
var readFileSync = require('fs').readFileSync;
var createReadStream = require('fs').createReadStream;
var HOSTS = process.platform === 'win32' ?
'C:/Windows/System32/drivers/etc/hosts' : '/etc/hosts';
var massageI... | Return array of objs and using stream. | Return array of objs and using stream.
| JavaScript | mit | hemanth/get-hosts |
d26945e785f8b98776ff8e0c0e0bc6ecdf5fc81d | index.js | index.js | 'use strict';
var _ = require('underscore');
var config = require('./config');
var express = require('express');
var knox = require('knox');
var app = express();
// Configure knox.
app.s3 = knox.createClient({
key: config.accessKeyId,
secret: config.secretAccessKey,
bucket: config.bucket
});
// Don't waste by... | 'use strict';
var _ = require('underscore');
var config = require('./config');
var express = require('express');
var knox = require('knox');
var app = express();
// Configure knox.
app.s3 = knox.createClient({
key: config.accessKeyId,
secret: config.secretAccessKey,
bucket: config.bucket
});
// Don't waste by... | Remove Connect 3 deprecation warning | Remove Connect 3 deprecation warning
| JavaScript | mit | orgsync/servo |
4c92ec1ab4ee06effe7fab8a7ae59ba4a80e9dd4 | index.js | index.js | 'use strict';
const runner = require('toisu-middleware-runner');
const stacks = new WeakMap();
class Toisu {
constructor() {
stacks.set(this, []);
this.handleError = Toisu.defaultHandleError;
}
use(middleware) {
stacks.get(this).push(middleware);
return this;
}
get requestHandler() {
r... | 'use strict';
const runner = require('toisu-middleware-runner');
const stacks = new WeakMap();
class Toisu {
constructor() {
stacks.set(this, []);
this.handleError = Toisu.defaultHandleError;
}
use(middleware) {
stacks.get(this).push(middleware);
return this;
}
get requestHandler() {
r... | Use correct error status code. | Use correct error status code.
| JavaScript | mit | qubyte/toisu |
40a0ffde6c20f5201adac18671230c08c08b39d1 | index.js | index.js | "use strict";
module.exports = {
rules: {
"jquery-var-name": require("./lib/rules/jquery-var-name"),
"check-closure-globals": require("./lib/rules/check-closure-globals")
},
rulesConfig: {
"jquery-var-name": [2],
"check-closure-globals": [2]
}
};
| "use strict";
module.exports = {
rules: {
"jquery-var-name": require("./lib/rules/jquery-var-name"),
"check-closure-globals": require("./lib/rules/check-closure-globals")
},
rulesConfig: {
"jquery-var-name": [1],
"check-closure-globals": [1]
}
};
| Make default level a warning | Make default level a warning
| JavaScript | mit | theodoreb/eslint-plugin-drupal |
9b562aed4d0d8490f9f2a36d8cf3eac64d80eb61 | index.js | index.js | var VOWELS = /[aeiou]+/gi;
var WHITE_SPACE = /\s+/g;
var NOTHING = '';
function tokenize(str){
return str.split(WHITE_SPACE);
}
function replace(tokens){
return tokens.map(function(t){
return t.replace(VOWELS,NOTHING);
});
}
exports.parse = function parse(string, join){
if(typeof string !== 'string'){... | var VOWELS = /[aeiou]/gi;
var VOWELS_AND_SPACE = /[aeiou\s]/g;
exports.parse = function parse(string, join){
if(typeof string !== 'string'){
throw new TypeError('Expected a string as the first option');
}
join = join || false;
var replacer = VOWELS;
if (join) {
replacer = VOWELS_AND_SPACE;
}
... | Reduce amount of transformations by ~66% | Reduce amount of transformations by ~66%
| JavaScript | mit | lestoni/unvowel |
3c4a2e9a777e1d18f7886df57d616f5a9d69925c | tests/index.js | tests/index.js | // let referee = require('referee')
// let {assert} = referee
// let {beforeEach, afterEach} = window
//
// // assertions counting
// let expected = 0
// referee.add('expect', {
// assert: (exp) => {
// expected = exp
// return true
// }
// })
// beforeEach(() => {
// referee.count = 0
// })
// afterEach(... | // let referee = require('referee')
// let {assert} = referee
// let {beforeEach, afterEach} = window
//
// // assertions counting
// let expected = 0
// referee.add('expect', {
// assert: (exp) => {
// expected = exp
// return true
// }
// })
// beforeEach(() => {
// referee.count = 0
// })
// afterEach(... | Make tests pass in all browsers (co relies on global Promise) | Make tests pass in all browsers (co relies on global Promise)
| JavaScript | mit | QubitProducts/cherrytree,QubitProducts/cherrytree,nathanboktae/cherrytree,nathanboktae/cherrytree |
2b330e110da8849d5edd4258f6e65e266fd48073 | index.js | index.js | var fs = require('fs');
var _ = require('lodash');
var Datastore = require('nedb'),
db = new Datastore({ filename: './data/xkcd', autoload: true });
module.exports = function (words, callback) {
db.find({ word: { $in: words } }, function (err, docs) {
if (err) return callback(err);
if (!docs.length) {
ca... | var fs = require('fs');
var _ = require('lodash');
var Datastore = require('nedb'),
db = new Datastore({ filename: __dirname + '/data/xkcd', autoload: true });
module.exports = function (words, callback) {
db.find({ word: { $in: words } }, function (err, docs) {
if (err) return callback(err);
if (!docs.leng... | Use an absolute path to load the db file | Use an absolute path to load the db file
This makes it so that the module can also be used in other node projects even when xkcd-cli is contained within the `node_modules` of the depending package | JavaScript | mit | necccc/xkcd-cli |
fd6144bacd22dbf4d8b9e74ebb56835726d631d8 | index.js | index.js | 'use strict';
module.exports = {
name: 'ember-cli-stripe'
};
| 'use strict';
module.exports = {
name: 'ember-cli-stripe',
contentFor: function(type) {
if(type === 'body') {
return '<script src="https://checkout.stripe.com/checkout.js"></script>';
}
},
};
| Add content-for hook to add Stripe's checkout.js | Add content-for hook to add Stripe's checkout.js
| JavaScript | mit | vladucu/ember-cli-stripe,vladucu/ember-cli-stripe |
32c5de2ad9c490aa9ae9eb05745947f060fb1ea9 | www/js/main.js | www/js/main.js | window.onload = action
var action = document.pesan.action = login();
function login() {
var nama = document.pesan.nama.value;
var no-bpjs = document.pesan.no-bpjs.value;
var name = "Andre Christoga";
var bpjs-no = "";
if ((nama == name) && (no-bpjs == bpjs-no)) {
window.location.href = "rs.html";
};
else {
... | window.onload = action
var action = document.pesan.action = login();
function login() {
var nama = document.pesan.nama.value;
var no-bpjs = document.pesan.no-bpjs.value;
var name = "Andre Christoga";
var bpjs-no = "";
if ((nama == name) && (no-bpjs == bpjs-no)) {
window.location.href = "rs.html";
return true... | Return true if its true | Return true if its true
| JavaScript | mit | cepatsembuh/cordova,christoga/cepatsembuh,cepatsembuh/cordova,mercysmart/cepatsembuh,mercysmart/cepatsembuh,mercysmart/cepatsembuh,mercysmart/cepatsembuh,mercysmart/cepatsembuh,cepatsembuh/cordova,christoga/cepatsembuh,cepatsembuh/cordova,christoga/cepatsembuh,christoga/cepatsembuh,cepatsembuh/cordova,christoga/cepatse... |
27704f4330fd2307ce5013b34fdb8a0e7bde6b2a | config/env/production.js | config/env/production.js | 'use strict';
module.exports = {
db: 'mongodb://localhost/mean-prod',
app: {
name: 'MEAN - A Modern Stack - Production'
},
facebook: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://localhost:3000/auth/facebook/callback'
},
twitter: {
... | 'use strict';
module.exports = {
db: process.env.MONGOHQ_URL,
app: {
name: 'MEAN - A Modern Stack - Production'
},
facebook: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://localhost:3000/auth/facebook/callback'
},
twitter: {
client... | Use config property for db. | Use config property for db.
| JavaScript | mit | wombleton/hardholdr,wombleton/hardholdr |
360f33015fb0c4f7c33099b9b24cf6216f1adcc6 | src/helpers.js | src/helpers.js | import { flatten, groupBy, map, omit } from 'lodash';
import { plural } from 'pluralize';
export function populateByService(app, documents, idField, typeField, options) {
let types = groupBy(documents, typeField);
return Promise.all(
Object.keys(types).map((type) => {
let entries = types[type];
ret... | import fp from 'lodash/fp';
import { plural } from 'pluralize';
const populateList = (list, idField) => (data) => {
return fp.map((doc) => {
let item = data.find((item) => {
return String(doc[idField]) === String(item.id);
});
return item;
})(list);
};
const populateByService = (app, idField, ty... | Fix populateByService and make it functional | Fix populateByService and make it functional
| JavaScript | mit | PlayingIO/playing-content-services |
598bce8e87b46e4a65e70034fad397cfdb38907f | dist/angular-metrics-graphics.min.js | dist/angular-metrics-graphics.min.js | /* Compiled 2015-12-15 09:12:28 */
"use strict";angular.module("metricsgraphics",[]).directive("chart",function(){return{link:function(a,b){function c(a){for(var b="ABCDEFGHIJKLMNOPQRSTUVWXYZ",c="",d=0;a>d;d++){var e=Math.floor(Math.random()*b.length);c+=b.substring(e,e+1)}return"mg-chart-"+c}var d={baselines:[],descr... | /* Compiled 2015-12-15 09:12:13 */
"use strict";angular.module("metricsgraphics",[]).directive("chart",function(){return{link:function(a,b){function c(a){for(var b="ABCDEFGHIJKLMNOPQRSTUVWXYZ",c="",d=0;a>d;d++){var e=Math.floor(Math.random()*b.length);c+=b.substring(e,e+1)}return"mg-chart-"+c}var d={baselines:[],descr... | Add option to preprocess date fields for inline data. | Add option to preprocess date fields for inline data.
resolve #3
| JavaScript | mit | elmarquez/angular-metrics-graphics,elmarquez/angular-metrics-graphics |
50d1f0fd46066aa370aa7753d9102b2514a62caa | src/router/index.js | src/router/index.js | import Vue from 'vue'
import Router from 'vue-router'
import Hello from '@/components/Hello'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'Hello',
component: Hello
}
]
})
| import Vue from 'vue'
import Router from 'vue-router'
import Conversations from '@/components/Conversations.vue'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'conversations-list',
component: Conversations
}
]
})
| Update router to conversation list | Update router to conversation list
| JavaScript | apache-2.0 | Serubin/PulseClient,Serubin/PulseClient |
9ac734d489af8e44a64c535e688d4e7c8663f62b | src/hooks/use-moralis.js | src/hooks/use-moralis.js | let Moralis;
export function useMoralis() {
if (Moralis) return { Moralis };
// Moralis Initialization
if (typeof window !== `undefined`) {
Moralis = require('moralis');
Moralis.initialize('knjJS1n0Hf0vkWjluePnByHQKVgUNdujnbtPbMUD');
Moralis.serverURL = 'https://memk9nntn6p4.moralis.io:2053/server';
... | let Moralis;
export function useMoralis() {
if (Moralis) return { Moralis };
// Moralis Initialization
if (typeof window !== `undefined`) {
Moralis = require('moralis');
Moralis.initialize(process.env.MORALIS_APPLICATION_ID);
Moralis.serverURL = process.env.MORALIS_SERVER_ID;
}
return { Moralis };... | Switch back to env variables, troubleshoot with Fleek | Switch back to env variables, troubleshoot with Fleek
| JavaScript | mit | iammatthias/.com,iammatthias/.com,iammatthias/.com |
0ef21e977f51aeffa279442326785704a16347fe | src/supp_classes.js | src/supp_classes.js |
export class Date{
constructor(day, hour, min){
this.day = day;
this.hour = hour;
this.min = min;
}
toString(){
return ("date: " + this.day + "-- " + this.hour + ":" + this.min);
}
/*
if a < b : return -1
if a == b : return 0
if a > b ... |
export class Date{
constructor(day, hour, min){
this.day = day;
this.hour = hour;
this.min = min;
}
toString(){
return ("date: " + this.day + "-- " + this.hour + ":" + this.min);
}
/*
if a < b : return -1
if a == b : return 0
if a > b ... | Fix comparison for weekly limits | Fix comparison for weekly limits
| JavaScript | mit | bnan/dhroraryus,bnan/dhroraryus |
3620be72778c761dbd61e8549ccbbf15496ebc8f | server/static-seo-server.js | server/static-seo-server.js | "use strict";
var system = require("system");
if (system.args.length < 2) {
console.log("Missing arguments.");
phantom.exit();
}
var server = require("webserver").create();
var url = system.args[1];
var renderHtml = function(url, cb) {
var page = require("webpage").create();
var finished = false;
page.settings... | "use strict";
var system = require("system");
if (system.args.length < 2) {
console.log("Missing arguments.");
phantom.exit();
}
var url = system.args[1];
var renderHtml = function(url, cb) {
var page = require("webpage").create();
var finished = false;
page.settings.loadImages = false;
page.settings.localToRem... | Remove dead code in phantomjs server. | Remove dead code in phantomjs server.
| JavaScript | mit | zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io |
34f89e654a07a99216d666ea78e34916fa28df57 | src/components/Navbar.js | src/components/Navbar.js | import React, { Component } from 'react'
import { connect } from 'react-redux'
import LoginButton from './LoginButton'
import LogoutButton from './LogoutButton'
import { getIsAuthenticated } from '../selectors/user'
class Navbar extends Component {
render() {
return (
<nav className='navbar navbar-default'... | import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Nav, NavItem } from 'react-bootstrap'
import { Navbar as NavbarReactBootstrap } from 'react-bootstrap'
import LoginButton from './LoginButton'
import LogoutButton from './LogoutButton'
import { getIsAuthenticated } from '../selector... | Add organizations link in navbar | Add organizations link in navbar
| JavaScript | apache-2.0 | CovenantCollege/ChoirMasterClient,CovenantCollege/ChoirMasterClient |
384d069210bfecc66dcff065847e3b2d1af7779a | src/computers/constant_infinite_computer.js | src/computers/constant_infinite_computer.js | var InfiniteComputer = require('./infinite_computer.js');
class ConstantInfiniteComputer extends InfiniteComputer {
getTotalScrollableHeight(): number {
return this.heightData * this.numberOfChildren;
}
getDisplayIndexStart(windowTop: number): number {
return Math.floor(windowTop / this.heightData);
}... | /* @flow */
var InfiniteComputer = require('./infinite_computer.js');
class ConstantInfiniteComputer extends InfiniteComputer {
getTotalScrollableHeight()/* : number */ {
return this.heightData * this.numberOfChildren;
}
getDisplayIndexStart(windowTop/* : number */)/* : number */ {
return Math.floor(wi... | Add to one more file. | Add to one more file.
| JavaScript | bsd-3-clause | NordicSemiconductor/react-infinite,ahutchings/react-infinite,cesarandreu/react-infinite,pierregoutheraud/react-infinite,herojobs/react-infinite,beni55/react-infinite,NordicSemiconductor/react-infinite,amplii/react-infinite,noitakomentaja/react-infinite |
9b35d559517447e9ffb9f32468eb14f0b6c6b4da | src/main/webapp/js/hayabusa-shortcutkeys.js | src/main/webapp/js/hayabusa-shortcutkeys.js | //open command bar
Mousetrap.bindGlobal(['shift+up', 'ctrl+shift+.'], function(e) {
document.getElementById('light').style.display='block';
return false;
});
//close command bar
Mousetrap.bindGlobal(['shift+down', 'esc'], function(e) {
document.getElementById('light').style.display='none';
return false;
});
| //open command bar
Mousetrap.bindGlobal(['shift+up'], function(e) {
document.getElementById('light').style.display='block';
return false;
});
//close command bar
Mousetrap.bindGlobal(['shift+down', 'esc'], function(e) {
document.getElementById('light').style.display='none';
return false;
});
//open command ba... | Update again to show voice engine dialog for shortcutkeys | Update again to show voice engine dialog for shortcutkeys
| JavaScript | bsd-3-clause | blackboard/hayabusa,blackboard/hayabusa,blackboard/hayabusa |
b6198eacf719c91614f635b189a980afb97ffed2 | test/config.js | test/config.js | /*jslint sloppy: true */
module.exports = function (config) {
config.set({
basePath: '../',
frameworks: ['jasmine'],
browsers: ['Chrome', 'PhantomJS'],
autoWatch: true,
files: [
{pattern: 'bower_components/**/*.js', watched: false, server: true, included: true},
'lib/matrix.js',
... | /*jslint sloppy: true */
module.exports = function (config) {
config.set({
basePath: '../',
frameworks: ['jasmine'],
browsers: ['Chrome', 'PhantomJS'],
autoWatch: true,
files: [
{pattern: 'bower_components/**/*.js', watched: false, server: true, included: true},
'lib/matrix.js',
... | Add additional files to karma setup | Add additional files to karma setup
| JavaScript | mit | yetu/pocketry |
3fbe8a01d93b77b496a28229ffdf3792ebab22c1 | test/helper.js | test/helper.js | var browserify = require('browserify')
var cp = require('child_process')
var envify = require('envify/custom')
var fs = require('fs')
var once = require('once')
var path = require('path')
var CHROME = process.env.CHROME || '/Applications/Google\\ Chrome\\ Canary.app/Contents/MacOS/Google\\ Chrome\\ Canary'
var BUNDLE_... | var browserify = require('browserify')
var cp = require('child_process')
var envify = require('envify/custom')
var fs = require('fs')
var once = require('once')
var path = require('path')
var CHROME
if (process.env.CHROME) {
CHROME = process.env.CHROME
} else if (process.platform === 'win32') {
CHROME = '"%Program... | Add Chrome path for Windows | tests: Add Chrome path for Windows
| JavaScript | mit | feross/chrome-net,feross/chrome-net |
e7b58e5c5438ff630c00638714db087a691b002f | task/config.js | task/config.js | // config.js
var http2 = require('http2');
var path = require('./path');
module.exports = {
task: {
watch: {
exclude: /\.map$/
}
},
plugin: {
pug: {
pretty: '\t',
basedir: path.source.template
},
htmlmin: {
removeComments: true,
removeCommentsFromCDATA: true,
removeCDATASectionsFromCD... | // config.js
var path = require('./path');
module.exports = {
task: {
watch: {
exclude: /\.map$/
}
},
plugin: {
pug: {
pretty: '\t',
basedir: path.source.template
},
htmlmin: {
removeComments: true,
removeCommentsFromCDATA: true,
removeCDATASectionsFromCDATA: true,
collapseWhitespa... | Remove http2 usage on browser-sync | Remove http2 usage on browser-sync
| JavaScript | cc0-1.0 | thasmo/website |
e4d5ed7973c7c597f55ffa86a97cc1a072a4a92a | client/src/js/account/components/API/CreateInfo.js | client/src/js/account/components/API/CreateInfo.js | import React from "react";
import styled from "styled-components";
import { connect } from "react-redux";
import { Alert, Icon } from "../../../base";
const StyledCreateAPIKeyInfo = styled(Alert)`
display: flex;
margin-bottom: 5px;
i {
line-height: 20px;
}
p {
margin-left: 5px;
... | import React from "react";
import styled from "styled-components";
import { connect } from "react-redux";
import { Alert, Icon } from "../../../base";
const StyledCreateAPIKeyInfo = styled(Alert)`
display: flex;
margin-bottom: 5px;
i {
line-height: 20px;
}
p {
margin-left: 5px;
... | Fix spelling error in API key creation modal | Fix spelling error in API key creation modal
| JavaScript | mit | igboyes/virtool,virtool/virtool,virtool/virtool,igboyes/virtool |
a4c0dc926c6986cee7dd9f9b3156559fcad0be8d | test/eslint-test.js | test/eslint-test.js | const cp = require('child_process')
describe('eslint-test', function() {
it('eslint should pass', function() {
cp.execSync('npm run eslint')
})
}) | const cp = require('child_process')
describe('eslint-test', function() {
it('eslint should pass', process.env.MIGSI_SKIP_ESLINT ? undefined : function() {
cp.execSync('npm run eslint')
})
}) | Allow skipping eslint test with an environment variable | Allow skipping eslint test with an environment variable
This can be helpful when developing new tests, so that you do not need to be 100% compliant at all times
| JavaScript | mit | BaronaGroup/migsi,BaronaGroup/migsi |
1f3c9a469a96b8b80134a16f3843cda1a368f097 | src/style_manager/view/PropertyColorView.js | src/style_manager/view/PropertyColorView.js | import PropertyIntegerView from './PropertyIntegerView';
import InputColor from 'domain_abstract/ui/InputColor';
export default PropertyIntegerView.extend({
setValue(value, opts = {}) {
opts = { ...opts, silent: 1 };
this.inputInst.setValue(value, opts);
},
remove() {
PropertyIntegerView.prototype.r... | import PropertyIntegerView from './PropertyIntegerView';
import InputColor from 'domain_abstract/ui/InputColor';
export default PropertyIntegerView.extend({
setValue(value, opts = {}) {
opts = { ...opts, silent: 1 };
this.inputInst.setValue(value, opts);
},
remove() {
PropertyIntegerView.prototype.r... | Check if input exists before remove | Check if input exists before remove
| JavaScript | bsd-3-clause | artf/grapesjs,artf/grapesjs,artf/grapesjs |
739ba2e9ebfb12617d5ef1926702248274ced74b | test/runner.js | test/runner.js | var checkForDevFile = function (callback) {
var cwd = process.cwd();
var fs = require("fs");
var path = require("path");
var testFile = path.join(cwd, "lib", "modernizr-dev.js");
var remoteTestFile = "http://modernizr.com/downloads/modernizr-latest.js";
var http = require("http");
var file = fs.createWriteStr... | var checkForDevFile = function (callback) {
var cwd = process.cwd();
var fs = require("fs");
var path = require("path");
var testFile = path.join(cwd, "lib", "modernizr-dev.js");
var remoteTestFile = "http://modernizr.com/downloads/modernizr-latest.js";
var http = require("http");
var file = fs.createWriteStr... | Reset the Gruntfile after a test failure. | Reset the Gruntfile after a test failure. | JavaScript | mit | dailymotion/grunt-modernizr,mrawdon/grunt-modernizr,Irmiz/grunt-modernizr,Modernizr/grunt-modernizr,GrimaceOfDespair/grunt-modernizr,shadowmint/grunt-modernizr,grumpydev22/grunt-modernizr,bdaenen/grunt-modernizr,optimizely/grunt-modernizr,CastroIgnacio/grunt-modernizr,tobania/grunt-modernizr,virtualidentityag/grunt-mod... |
1b433b5b0e73838ecaa365f3fa5d4cb2f5edbff8 | aura-components/src/main/components/ui/image/imageController.js | aura-components/src/main/components/ui/image/imageController.js | /*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | /*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | Revert the ui:image cmp validity checking. @bug W-2533777@ | Revert the ui:image cmp validity checking.
@bug W-2533777@
| JavaScript | apache-2.0 | madmax983/aura,SalesforceSFDC/aura,madmax983/aura,DebalinaDey/AuraDevelopDeb,navyliu/aura,DebalinaDey/AuraDevelopDeb,TribeMedia/aura,SalesforceSFDC/aura,badlogicmanpreet/aura,navyliu/aura,badlogicmanpreet/aura,madmax983/aura,DebalinaDey/AuraDevelopDeb,lcnbala/aura,SalesforceSFDC/aura,TribeMedia/aura,DebalinaDey/AuraDev... |
f888316ee7907e94b30f32040a98c56ef2334649 | tasks/xcode.js | tasks/xcode.js | /*
* grunt-xcode
* https://github.com/matiassingers/grunt-xcode
*
* Copyright (c) 2014 Matias Singers
* Licensed under the MIT license.
*/
'use strict';
var Promise = require('bluebird');
var exec = Promise.promisify(require('child_process').exec);
String.prototype.format = function() {
var formatted = this... | /*
* grunt-xcode
* https://github.com/matiassingers/grunt-xcode
*
* Copyright (c) 2014 Matias Singers
* Licensed under the MIT license.
*/
'use strict';
var Promise = require('bluebird');
var exec = Promise.promisify(require('child_process').exec);
String.prototype.format = function() {
var formatted = this... | Create executeCommand and handleCommandError helper functions | Create executeCommand and handleCommandError helper functions
| JavaScript | mit | matiassingers/grunt-xcode |
9e1de3f52aaecc9532b3b3b0988a14aaf4ab713f | lib/global-admin/addon/cluster-templates/new/route.js | lib/global-admin/addon/cluster-templates/new/route.js | import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
access: service(),
clusterTemplates: service(),
model() {
return hash({
clusterTemplate: this.global... | import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
access: service(),
clusterTemplates: service(),
model() {
return hash({
clusterTemplate: this.global... | Change ct default revision name to v1 | Change ct default revision name to v1
https://github.com/rancher/rancher/issues/22162
| JavaScript | apache-2.0 | rancher/ui,westlywright/ui,vincent99/ui,westlywright/ui,rancher/ui,vincent99/ui,rancherio/ui,rancherio/ui,rancher/ui,westlywright/ui,vincent99/ui,rancherio/ui |
80ed34fea18a6311b4490b5998df69636a4e34a9 | lib/index.js | lib/index.js | var request = require('request');
var Scholarcheck = function(apiKey) {
this.apiUrl = "https://api.scholarcheck.io/api/v1/";
this.apiKey = apiKey || '';
};
Scholarcheck.prototype._apiCall = function(endpoint, callback) {
var options = {
url: this.apiUrl + endpoint,
headers: {
'Token': this.apiKey
... | var request = require('request');
var Scholarcheck = function(apiKey) {
this.apiUrl = "https://app.scholarcheck.io/api/v1/";
this.apiKey = apiKey || '';
};
Scholarcheck.prototype._apiCall = function(endpoint, callback) {
var options = {
url: this.apiUrl + endpoint,
headers: {
'Token': this.apiKey
... | Fix typo on API URL | Fix typo on API URL
| JavaScript | mit | caffeinewriter/node-scholarcheck,caffeinewriter/node-scholarcheck |
4f4e6454f6a498fbb1a13320c4bb66c6c9ba83ec | lib/index.js | lib/index.js | 'use strict';
var hash = require('./hash');
exports.escapeDiacritic = require('./escape_diacritic');
exports.escapeHTML = require('./escape_html');
exports.escapeRegExp = require('./escape_regexp');
exports.highlight = require('./highlight');
exports.htmlTag = require('./html_tag');
exports.Pattern = require('./patte... | 'use strict';
var hash = require('./hash');
exports.escapeDiacritic = require('./escape_diacritic');
exports.escapeHTML = require('./escape_html');
exports.escapeRegExp = require('./escape_regexp');
exports.highlight = require('./highlight');
exports.htmlTag = require('./html_tag');
exports.Pattern = require('./patte... | Fix camelCaseKeys is not exported | Fix camelCaseKeys is not exported
| JavaScript | mit | hexojs/hexo-util,hexojs/hexo-util |
11ceffc8dc5578dc089c52f3a0a80a35d31bae8c | lib/index.js | lib/index.js | 'use strict';
var configViewer = require('./configViewer');
var jQueryName = 'D2L.LP.Web.UI.Html.jQuery';
var vuiName = 'D2L.LP.Web.UI.Html.Vui';
module.exports.jquery = function( opts ) {
return configViewer.readConfig( jQueryName, opts )
.then( function( value ) {
return value.jqueryBaseLocation + 'jquery.j... | 'use strict';
var configViewer = require('./configViewer');
var jQueryName = 'D2L.LP.Web.UI.Html.jQuery';
var vuiName = 'D2L.LP.Web.UI.Html.Vui';
module.exports.jquery = function( opts ) {
return configViewer.readConfig( jQueryName, opts )
.then( function( value ) {
return value.jqueryBaseLocation + 'jquery.j... | Include CSS files in VUI loaded library. | Include CSS files in VUI loaded library.
| JavaScript | apache-2.0 | Brightspace/web-library-loader |
241548146e98b69e90809451b0b17942da296a58 | test/helper.js | test/helper.js | process.env.NODE_ENV = 'test';
require('sugar');
require('colors');
module.exports.chai = require('chai');
module.exports.chai.Assertion.includeStack = true;
module.exports.chai.use(require('chai-http'));
module.exports.async = require('async');
module.exports.debug = console.log;
// module.exports.longjohn = requ... | process.env.NODE_ENV = 'test';
process.setMaxListeners(process.env.MAX_LISTENERS || 0);
require('sugar');
require('colors');
module.exports.chai = require('chai');
module.exports.chai.Assertion.includeStack = true;
module.exports.chai.use(require('chai-http'));
module.exports.async = require('async');
module.expor... | Use `process.setMaxListeners(0)` for tests to avoid annoying warnings. | Use `process.setMaxListeners(0)` for tests to avoid annoying warnings. | JavaScript | mit | grimen/node-document-api |
25d859b3a2597ba00c988ed4a814452558e2c1b4 | foundation-ui/utils/ReactUtil.js | foundation-ui/utils/ReactUtil.js | import React from 'react';
const ReactUil = {
/**
* Wrap React elements
*
* @param {Array.<ReactElement>|ReactElement} elements
* @param {function|String} wrapper component
* @param {boolean} [alwaysWrap]
*
* @returns {ReactElement} wrapped react elements
*/
wrapElements(elements, wrapper ... | import React from 'react';
const ReactUil = {
/**
* Wrap React elements
*
* If elements is an array with a single element, it will not be wrapped
* unless alwaysWrap is true.
*
* @param {Array.<ReactElement>|ReactElement} elements
* @param {function|String} wrapper component
* @param {boolea... | Expand description to include single-element array behavior | Expand description to include single-element array behavior
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
4878fc74206e4cb01cd8874570f50f5fc2db903a | fixtures/users.js | fixtures/users.js | module.exports = [
{
"model": "User",
"data": {
"email": "test@abakus.no",
"name": "Test Bruker",
// Password: test
hash: '$2a$10$Gm09SZEHzdqx4eBV06nNheenfKpw3R1rXrMzmYfjX/.9UFPHnaAn6'
}
},
{
"model": "User",
"data": {
"email": "backup@abakus.no",
"name": "B... | module.exports = [
{
model: 'User',
data: {
email: 'test@abakus.no',
name: 'Test Bruker',
// Password: test
hash: '$2a$10$Gm09SZEHzdqx4eBV06nNheenfKpw3R1rXrMzmYfjX/.9UFPHnaAn6'
}
},
{
model: 'User',
data: {
e... | Fix linting errors in fixture | Fix linting errors in fixture
| JavaScript | mit | abakusbackup/abacash-api,abakusbackup/abacash-api |
077ab3f2110c6c2e5984484596209383c2df3c01 | flow-typed/npm/@storybook/addon-info_v3.x.x.js | flow-typed/npm/@storybook/addon-info_v3.x.x.js | import type { RenderFunction, Story } from '@storybook/react';
declare module '@storybook/addon-info' {
declare type Options = {
inline?: boolean,
header?: boolean,
source?: boolean,
propTables?: ?Array<React$Element<*>>,
maxPropsIntoLine?: number,
maxPropObjectKeys?: number,
maxPropArray... | import type { RenderFunction, Story } from '@storybook/react';
declare module '@storybook/addon-info' {
declare type Renderable = React$Element<any>;
declare type RenderFunction = () => Renderable;
declare type Options = {
text?: string | Renderable,
inline?: boolean,
header?: boolean,
source?: ... | Update Storybook info addon Flow types | Update Storybook info addon Flow types
| JavaScript | unlicense | pascalduez/react-module-boilerplate |
53e7dd095e1ae09b64b3cdadd6f961db22403098 | src/www/js/setup/seg_desktop_include.js | src/www/js/setup/seg_desktop_include.js | document.write('<script type="text/javascript" src="/janitor/admin/js/manipulator/v0_9_3-janitor/merged/seg_desktop.js"></script>');
document.write('<script type="text/javascript" src="/janitor/admin/js/manipulator/v0_9_3-janitor/src/beta-u-notifier.js"></script>');
document.write('<script type="text/javascript" src="/... | document.write('<script type="text/javascript" src="/janitor/admin/js/manipulator/v0_9_3-janitor/merged/seg_desktop.js"></script>');
document.write('<script type="text/javascript" src="/janitor/admin/js/manipulator/v0_9_3-janitor/src/beta-u-notifier.js"></script>');
document.write('<script type="text/javascript" src="/... | Update manipulator include for setup | Update manipulator include for setup
| JavaScript | mit | parentnode/janitor,parentnode/janitor,parentnode/janitor |
b621b1fadebcaec9a7c200aebad8c965cad328fc | src/client/app/app.react.js | src/client/app/app.react.js | import './app.styl';
import * as state from '../state';
import Component from '../components/component.react';
import Footer from './footer.react';
import Menu from './menu.react';
import React from 'react';
import persistState from './persiststate.react';
import {RouteHandler} from 'react-router';
// Remember to impo... | import './app.styl';
import * as state from '../state';
import Component from '../components/component.react';
import Footer from './footer.react';
import Menu from './menu.react';
import React from 'react';
import persistState from './persiststate.react';
import {RouteHandler} from 'react-router';
// Remember to impo... | Add link explaining why componentWillMount is used. | Add link explaining why componentWillMount is used.
| JavaScript | mit | aindre/este-example,AugustinLF/este,XeeD/test,amrsekilly/updatedEste,skallet/este,robinpokorny/este,AlesJiranek/este,syroegkin/mikora.eu,shawn-dsz/este,XeeD/este,AlesJiranek/este,youprofit/este,AugustinLF/este,laxplaer/este,christophediprima/este,este/este,zanj2006/este,puzzfuzz/othello-redux,Brainfock/este,skaldo/este... |
d9549a5a002c25e054e1b4bd1a377ff444fcb403 | src/data/historyEntry.js | src/data/historyEntry.js | import partial from 'lodash-es/partial'
import makeProto from '../wrap'
import { parseDate } from '../util'
import wrapMedia from './media'
import wrapRoom from './room'
import wrapUser from './user'
export default function wrapHistoryEntry (mp, raw) {
const entry = {
id: raw.id,
// wrapMedia expects a playl... | import partial from 'lodash-es/partial'
import makeProto from '../wrap'
import { parseDate } from '../util'
import wrapMedia from './media'
import wrapRoom from './room'
import wrapUser from './user'
export default function wrapHistoryEntry (mp, raw) {
const entry = {
id: raw.id,
// wrapMedia expects a playl... | Fix Media prop on HistoryEntries. | Fix Media prop on HistoryEntries.
| JavaScript | mit | goto-bus-stop/miniplug |
76df4116aaec99c285f9ab7bee45f253ce652b8d | lib/ModalFooter/examples/ModalFooterExample.js | lib/ModalFooter/examples/ModalFooterExample.js | /**
* Modal: With ModalFooter component
*/
/* eslint-disable */
import React from 'react';
import ModalFooter from '@folio/stripes-components/lib/ModalFooter';
import Button from '@folio/stripes-components/lib/Button';
import Modal from '@folio/stripes-components/lib/Modal';
export default () => {
const footer = ... | /**
* Modal: With ModalFooter component
*/
/* eslint-disable */
import React from 'react';
import ModalFooter from '../ModalFooter';
import Button from '../../Button';
import Modal from '../../Modal';
export default () => {
const footer = (
<ModalFooter
primaryButton={{
label: 'Save',
on... | Fix paths for ModalFooter story CSS | Fix paths for ModalFooter story CSS
| JavaScript | apache-2.0 | folio-org/stripes-components,folio-org/stripes-components |
b29eb395840f11f8a981040b2e75a9116f9def34 | time/client.js | time/client.js | (function () {
function adjust_all_times() {
$('time').each(function () {
var t = $(this);
var d = t.attr('datetime').replace(/-/g, '/'
).replace('T', ' ').replace('Z', ' GMT');
t.html(readable_time(new Date(d).getTime()));
});
}
adjust_all_times();
})();
| (function () {
function adjust_all_times() {
$('time').each(function () {
var date = date_from_time_el(this);
this.innerHTML = readable_time(date.getTime());
});
}
function date_from_time_el(el) {
var d = el.getAttribute('datetime').replace(/-/g, '/'
).replace('T', ' ').replace('Z', ' GMT');
return new Date... | Optimize adjust_all_times() and extract helper | Optimize adjust_all_times() and extract helper
| JavaScript | mit | vampiricwulf/ex-tanoshiine,reiclone/doushio,lalcmellkmal/doushio,reiclone/doushio,theGaggle/sleepingpizza,vampiricwulf/ex-tanoshiine,lalcmellkmal/doushio,alokal/meguca,alokal/meguca,lalcmellkmal/doushio,vampiricwulf/tanoshiine,theGaggle/sleepingpizza,vampiricwulf/tanoshiine,lalcmellkmal/doushio,alokal/meguca,reiclone/d... |
b9270fe41a91bf51f775f8fea818b4bdce222cb7 | logology-v12/src/www/js/app/views/lemmaList.js | logology-v12/src/www/js/app/views/lemmaList.js | "use strict";
import h from "yasmf-h";
import el from "$LIB/templates/el";
import L from "$APP/localization/localization";
import glyph from "$WIDGETS/glyph";
import list from "$WIDGETS/list";
import listItem from "$WIDGETS/listItem";
import listItemContents from "$WIDGETS/listItemContents";
import listItemActions fr... | "use strict";
import h from "yasmf-h";
import el from "$LIB/templates/el";
import L from "$APP/localization/localization";
import glyph from "$WIDGETS/glyph";
import list from "$WIDGETS/list";
import listItem from "$WIDGETS/listItem";
import listItemContents from "$WIDGETS/listItemContents";
import listItemActions fr... | Remove indicator; refactor actions to separate view | Remove indicator; refactor actions to separate view
| JavaScript | mit | kerrishotts/Mastering-PhoneGap-Code-Package,kerrishotts/Mastering-PhoneGap-Code-Package,kerrishotts/Mastering-PhoneGap-Code-Package,kerrishotts/Mastering-PhoneGap-Code-Package |
3ad8c63ebeb63d0739287888a717a14833b04b92 | modules/core/ui/test/shape-item-promise-handler.js | modules/core/ui/test/shape-item-promise-handler.js | // DecentCMS (c) 2014 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.
'use strict';
var expect = require('chai').expect;
describe('Shape Item Promise Handler', function() {
it('changes the promise shape into a content shape and runs a new rendering life cycle for the item', function(done) {
va... | // DecentCMS (c) 2014 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.
'use strict';
var expect = require('chai').expect;
describe('Shape Item Promise Handler', function() {
it('changes the promise shape into a content shape and runs a new rendering life cycle for the item', function(done) {
va... | Fix shape item promise handler test suite | Fix shape item promise handler test suite
| JavaScript | mit | DecentCMS/DecentCMS |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.