commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
fa09a1300bb527ad8c804e06bc33edc1b9213ea4 | test/integration-test.js | test/integration-test.js | var injection = require('../services/injection.js');
var Q = require('q');
var mongoose = require('mongoose');
module.exports = function (test, fixtureName, testFn) {
var dbUrl = 'mongodb://localhost:27017/' + fixtureName;
var cleanUp = function () {
return Q.nbind(mongoose.connect, mongoose)(dbUrl).t... | var injection = require('../services/injection.js');
var Q = require('q');
var mongoose = require('mongoose');
module.exports = function (test, fixtureName, testFn) {
var dbUrl = 'mongodb://localhost:27017/' + fixtureName;
var cleanUp = function () {
return Q.nbind(mongoose.connect, mongoose)(dbUrl).t... | Fix endless execution of integration tests | Fix endless execution of integration tests
| JavaScript | mit | allcount/allcountjs,chikh/allcountjs,chikh/allcountjs,allcount/allcountjs |
11c5510b06900c328ff61101bbf11cabf00419c4 | tests/e2e/jest.config.js | tests/e2e/jest.config.js | const path = require( 'path' );
module.exports = {
preset: 'jest-puppeteer',
setupFilesAfterEnv: [
'<rootDir>/config/bootstrap.js',
'@wordpress/jest-console',
'expect-puppeteer',
],
testMatch: [
'<rootDir>/**/*.test.js',
'<rootDir>/specs/**/__tests__/**/*.js',
'<rootDir>/specs/**/?(*.)(spec|test).js',
... | const path = require( 'path' );
module.exports = {
preset: 'jest-puppeteer',
setupFilesAfterEnv: [
'<rootDir>/config/bootstrap.js',
'@wordpress/jest-console',
'expect-puppeteer',
],
testMatch: [
'<rootDir>/**/*.test.js',
'<rootDir>/specs/**/__tests__/**/*.js',
'<rootDir>/specs/**/?(*.)(spec|test).js',
... | Add verbose option to E2E tests. | Add verbose option to E2E tests.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp |
fee641c22a50f685055139a8abb34a6a6159378e | src/js/index.js | src/js/index.js | require("../scss/index.scss");
var React = require('react');
var Locale = require('grommet/utils/Locale');
var Cabler = require('./components/Cabler');
var locale = Locale.getCurrentLocale();
var localeData;
try {
localeData = Locale.getLocaleData(require('../messages/' + locale));
} catch (e) {
localeData = Loca... | require("../scss/index.scss");
var React = require('react');
var ReactDOM = require('react-dom');
var Locale = require('grommet/utils/Locale');
var Cabler = require('./components/Cabler');
var locale = Locale.getCurrentLocale();
var localeData;
try {
localeData = Locale.getLocaleData(require('../messages/' + locale... | Use react-dom package for rendering application | Use react-dom package for rendering application
| JavaScript | apache-2.0 | grommet/grommet-cabler,grommet/grommet-cabler |
dadee563a1ea459c588b1507a4a98078e20d0dc6 | javascript/cucumber-blanket.js | javascript/cucumber-blanket.js | (function (){
/* ADAPTER
*
* This blanket.js adapter is designed to autostart coverage
* immediately. The other side of this is handled from Cucumber
*
* Required blanket commands:
* blanket.setupCoverage(); // Do it ASAP
* blanket.onTestStart(); // Do it ASAP
* blanket.onTestDone(); // After ... | (function (){
/* ADAPTER
*
* This blanket.js adapter is designed to autostart coverage
* immediately. The other side of this is handled from Cucumber
*
* Required blanket commands:
* blanket.setupCoverage(); // Do it ASAP
* blanket.onTestStart(); // Do it ASAP
* blanket.onTestDone(); // After ... | Update javascript blanket adapter to include sources data. | Update javascript blanket adapter to include sources data. | JavaScript | mit | vemperor/capybara-blanket,kfatehi/cucumber-blanket,kfatehi/cucumber-blanket,keyvanfatehi/cucumber-blanket,keyvanfatehi/cucumber-blanket |
a37ea675122ca7da96a84090aa86f7e7eaa038d4 | src/lib/get-costume-url.js | src/lib/get-costume-url.js | import storage from './storage';
import {SVGRenderer} from 'scratch-svg-renderer';
// Contains 'font-family', but doesn't only contain 'font-family="none"'
const HAS_FONT_REGEXP = 'font-family(?!="none")';
const getCostumeUrl = (function () {
let cachedAssetId;
let cachedUrl;
return function (asset) {
... | import storage from './storage';
import {inlineSvgFonts} from 'scratch-svg-renderer';
// Contains 'font-family', but doesn't only contain 'font-family="none"'
const HAS_FONT_REGEXP = 'font-family(?!="none")';
const getCostumeUrl = (function () {
let cachedAssetId;
let cachedUrl;
return function (asset) {... | Use fontInliner instead of entire SVGRenderer for showing costume tiles. | Use fontInliner instead of entire SVGRenderer for showing costume tiles.
The fontInliner from the scratch-svg-renderer was changed recently to work entirely on strings, so we can use that instead of parsing/loading/possibly drawing/stringifying the entire SVG.
This does not address the size-1 cache issue where the c... | JavaScript | bsd-3-clause | LLK/scratch-gui,LLK/scratch-gui |
69772952eaa4bbde2a35fc767ac5f496e1c57e99 | src/filter.js | src/filter.js | function hide_covers() {
// Remove covers
$(".mix_element div.cover").remove()
// Add class so cards can be restyled
$(".mix_card.half_card").addClass("ext-coverless_card")
// Remove covers on track page
$("#cover_art").remove()
// Remove covers in the sidebar of a track page
$(".card.s... | function hide_covers() {
// Remove covers
$(".mix_element div.cover").remove()
// Add class so cards can be restyled
$(".mix_card.half_card").addClass("ext-coverless_card")
// Remove covers on track page
$("#cover_art").remove()
// Remove covers in the sidebar of a track page
$(".card.s... | Use MutationObserver API to catch dom updates | Use MutationObserver API to catch dom updates
| JavaScript | mit | pbhavsar/8tracks-Filter |
63625631eafd8b8d68bcc213243f8105d76269dd | src/js/app.js | src/js/app.js | // JS Goes here - ES6 supported
if (window.netlifyIdentity) {
window.netlifyIdentity.on('login', () => {
document.location.href = '/admin/';
});
}
| // JS Goes here - ES6 supported
if (window.netlifyIdentity && !window.netlifyIdentity.currentUser()) {
window.netlifyIdentity.on('login', () => {
document.location.href = '/admin/';
});
}
| Fix issue with always redirecting to /admin when logged in | Fix issue with always redirecting to /admin when logged in
| JavaScript | mit | netlify-templates/one-click-hugo-cms,chromicant/blog,doudigit/doudigit.github.io,netlify-templates/one-click-hugo-cms,chromicant/blog,doudigit/doudigit.github.io |
b2648c0b5fa32934d24b271fdb050d11d0484c21 | src/index.js | src/index.js | /**
* Detects if only the primary button has been clicked in mouse events.
* @param {MouseEvent} e Event instance (or Event-like, i.e. `SyntheticEvent`)
* @return {Boolean}
*/
export const isPrimaryClick = e =>
!(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) &&
(("button" in e && e.button === 0) || ("button... | /**
* Detects if only the primary button has been clicked in mouse events.
* @param {MouseEvent} e Event instance (or Event-like, i.e. `SyntheticEvent`)
* @return {Boolean}
*/
export const isPrimaryClick = e =>
!(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) &&
(("button" in e && e.button === 0) || ("button... | Update onPrimaryClick to pass down multiple args | Update onPrimaryClick to pass down multiple args
| JavaScript | mit | jacobbuck/primary-click |
d54e3be13f374f3aa9b2f1e24bc476e7aadbfbcb | src/index.js | src/index.js | require('Common');
var win = new Window();
application.exitAfterWindowsClose = true;
win.visible = true;
win.title = "Hi Tint World!";
var webview = new WebView(); // Create a new webview for HTML.
win.appendChild(webview); // attach the webview to the window.
// position the webview 0 pixels from all the window's e... | require('Common');
var win = new Window();
var toolbar = new Toolbar();
application.exitAfterWindowsClose = true;
win.visible = true;
win.title = "Hi Tint World!";
btn = new Button();
btn.image = 'back';
toolbar.appendChild( btn );
win.toolbar = toolbar;
var webview = new WebView(); // Create a new webview for HTM... | Add toolbar with back button | Add toolbar with back button
| JavaScript | mit | niaxi/hello-tint,niaxi/hello-tint |
0c28f538d9382d85c69ecb06a208ae1b0874b29c | src/index.js | src/index.js | /**
* Created by thram on 21/01/17.
*/
import forEach from "lodash/forEach";
import assign from "lodash/assign";
import isArray from "lodash/isArray";
import {observe, state, removeObserver} from "thrux";
export const connect = (stateKey, ReactComponent) => {
class ThruxComponent extends ReactComponent {
obse... | /**
* Created by thram on 21/01/17.
*/
import forEach from "lodash/forEach";
import assign from "lodash/assign";
import isArray from "lodash/isArray";
import {observe, state, removeObserver} from "thrux";
export const connect = (stateKey, ReactComponent) => {
class ThruxComponent extends ReactComponent {
obse... | Check first if the componentDidMount and componentWillUnmount are defined | fix(mount): Check first if the componentDidMount and componentWillUnmount are defined
| JavaScript | mit | Thram/react-thrux |
f563f24c06d6de9401aa7d43fea0d5319bf5df0e | src/index.js | src/index.js | #! /usr/bin/env node
import chalk from 'chalk';
import console from 'console';
import gitAuthorStats from './git-author-stats';
gitAuthorStats().forEach((gitAuthorStat) => {
const author = chalk.bold(gitAuthorStat.author);
const commits = `${gitAuthorStat.commits} commits`;
const added = chalk.green(`${gitAuth... | #! /usr/bin/env node
import { bold, green, red } from 'chalk';
import console from 'console';
import gitAuthorStats from './git-author-stats';
gitAuthorStats().forEach((gitAuthorStat) => {
const {
author,
commits,
added,
removed,
} = gitAuthorStat;
const gitAuthorText = [
`${commits} commi... | Refactor Git author text writing | Refactor Git author text writing
| JavaScript | mit | caedes/git-author-stats |
af6776fc87f7a18c18355f40e58364e5ca3237b7 | components/base/Footer.js | components/base/Footer.js | import React from 'react'
class Footer extends React.PureComponent {
render () {
return <footer className='container row'>
<p className='col-xs-12'>
Copyright 2017 Junyoung Choi. <a href='https://github.com/CarbonStack/carbonstack' target='_blank'>Source code of Carbonstack</a> is publish... | import React from 'react'
class Footer extends React.PureComponent {
render () {
return <footer>
<p>
Copyright 2017 Junyoung Choi. <a href='https://github.com/CarbonStack/carbonstack' target='_blank'>Source code of Carbonstack</a> is published under MIT.
</p>
<style jsx>{`
... | Fix stye bug of footer again | Fix stye bug of footer again
| JavaScript | mit | CarbonStack/carbonstack |
08cad5105b71b10b063af27ed256bc4ab7571896 | src/index.js | src/index.js | import _ from './utils';
export default {
has: (value = {}, conditions = {}) => {
if (!_.isObject(conditions)) return false;
if (_.isArray(value)) return !!_.find(value, conditions);
if (_.isObject(value)) return !!_.find(value.transitions, conditions);
return false;
},
find: (value = {}, condit... | import _ from './utils';
function getTransitions(value) {
if (_.isArray(value)) return value;
if (_.isObject(value)) return value.transitions;
}
export default {
has: (value = {}, conditions = {}) => {
return !!_.find(getTransitions(value), conditions);
},
find: (value = {}, conditions = {}) => {
r... | Trim code a little more | Trim code a little more
| JavaScript | mit | smizell/hf |
f47b43cee6bbd40a6879f5ce09eb2612c83496f9 | src/index.js | src/index.js | import AtomControl from './components/AtomControl';
import CardControl from './components/CardControl';
import { classToDOMCard } from './utils/classToCard';
import Container, { EMPTY_MOBILEDOC } from './components/Container';
import DropWrapper from './components/DropWrapper';
import Editor from './components/Editor';... | import AtomControl from './components/AtomControl';
import CardControl from './components/CardControl';
import { classToDOMCard } from './utils/classToCard';
import Container, { EMPTY_MOBILEDOC } from './components/Container';
import Editor from './components/Editor';
import LinkControl from './components/LinkControl';... | Remove drop wrapper from exports | Remove drop wrapper from exports
| JavaScript | bsd-3-clause | upworthy/react-mobiledoc-editor |
7390f356615c375960ebf49bca2001a1fee43788 | lib/dasher.js | lib/dasher.js | var url = require('url')
var dashButton = require('node-dash-button');
var request = require('request')
function DasherButton(button) {
var options = {headers: button.headers, body: button.body, json: button.json}
this.dashButton = dashButton(button.address, button.interface)
this.dashButton.on("detected", fun... | var url = require('url')
var dashButton = require('node-dash-button');
var request = require('request')
function DasherButton(button) {
var options = {headers: button.headers, body: button.body, json: button.json}
this.dashButton = dashButton(button.address, button.interface)
this.dashButton.on("detected", fun... | Add check for nil response | Add check for nil response
The app was erroring on missing statusCode when no response
was received. This allows the app not to crash if the url
doesn't respond.
| JavaScript | mit | maddox/dasher,maddox/dasher |
f234cf043c80a66e742862cff36218fa04589398 | src/index.js | src/index.js | 'use strict';
import AssetLoader from './assetloader';
import Input from './input';
import Loop from './loop';
import Log from './log';
import Timer from './timer';
import Math from './math';
export default {
AssetLoader,
Input,
Loop,
Log,
Timer,
Math
};
| 'use strict';
import AssetLoader from './assetloader';
import Input from './input';
import Loop from './loop';
import Log from './log';
import Timer from './timer';
import Math from './math';
import Types from './types';
export default {
AssetLoader,
Input,
Loop,
Log,
Timer,
Math
};
| Add types to be exported | Add types to be exported
| JavaScript | unknown | freezedev/gamebox,gamebricks/gamebricks,freezedev/gamebox,gamebricks/gamebricks,maxwerr/gamebox |
4aa75606353bd190240cbfd559eb291a891a7432 | src/ui/app.js | src/ui/app.js | angular.module('proxtop', ['ngMaterial', 'ui.router', 'angular-progress-arc', 'pascalprecht.translate'])
.config(['$stateProvider', '$urlRouterProvider', '$translateProvider', function($stateProvider, $urlRouterProvider, $translateProvider) {
$urlRouterProvider.otherwise('/');
$translateProvider.use... | angular.module('proxtop', ['ngMaterial', 'ui.router', 'angular-progress-arc', 'pascalprecht.translate'])
.config(['$stateProvider', '$urlRouterProvider', '$translateProvider', function($stateProvider, $urlRouterProvider, $translateProvider) {
$urlRouterProvider.otherwise('/');
$translateProvider.use... | Fix missing dependency when using ng-translate | Fix missing dependency when using ng-translate
| JavaScript | mit | kumpelblase2/proxtop,kumpelblase2/proxtop,kumpelblase2/proxtop,kumpelblase2/proxtop |
cbb27012bb0c8ffc338d92b2cf3ef4449a65e4a4 | src/config.js | src/config.js | const config = Object.assign({
development: {
api: {
trade_events: {
host: 'https://intrasearch.govwizely.com/v1/trade_events',
},
},
},
production: {
api: {
trade_events: {
host: 'https://intrasearch.export.gov/v1/trade_events',
},
},
},
});
export defau... | import assign from 'object-assign';
const config = assign({
development: {
api: {
trade_events: {
host: 'https://intrasearch.govwizely.com/v1/trade_events',
},
},
},
production: {
api: {
trade_events: {
host: 'https://intrasearch.export.gov/v1/trade_events',
},... | Use object-assign instead of Object.assign | Use object-assign instead of Object.assign
| JavaScript | mit | GovWizely/trade-event-search-app,GovWizely/trade-event-search-app |
8295d27a906f850cefd86321d212162cba7ef296 | local-cli/wrong-react-native.js | local-cli/wrong-react-native.js | #!/usr/bin/env node
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same direc... | #!/usr/bin/env node
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same direc... | Fix usage of react-native cli inside package.json scripts | Fix usage of react-native cli inside package.json scripts
Summary:
IIRC we made `wrong-react-native` to warn people in case they installed `react-native` globally (instead of `react-native-cli` what the guide suggests). To do that we added `bin` entry to React Native's `package.json` that points to `local-cli/wrong-re... | JavaScript | bsd-3-clause | CodeLinkIO/react-native,imjerrybao/react-native,shrutic123/react-native,tszajna0/react-native,gitim/react-native,DanielMSchmidt/react-native,jadbox/react-native,ndejesus1227/react-native,tsjing/react-native,exponent/react-native,naoufal/react-native,martinbigio/react-native,mironiasty/react-native,browniefed/react-nati... |
1aac1de738fdef73676948be8e4d5d8fc18eb27c | caspy/static/js/api.js | caspy/static/js/api.js | (function(){
var mod = angular.module('caspy.api', ['ngResource', 'caspy.server']);
mod.config(['$resourceProvider',
function($resourceProvider) {
$resourceProvider.defaults.stripTrailingSlashes = false;
}]
);
mod.factory('caspyAPI',
['$q', '$http', '$resource', 'Constants',
function($q, $htt... | (function(){
var mod = angular.module('caspy.api', ['ngResource', 'caspy.server']);
mod.config(['$resourceProvider',
function($resourceProvider) {
$resourceProvider.defaults.stripTrailingSlashes = false;
}]
);
mod.factory('caspyAPI',
['$q', '$http', '$resource', 'Constants',
function($q, $htt... | Put higher level functions first | Put higher level functions first
| JavaScript | bsd-3-clause | altaurog/django-caspy,altaurog/django-caspy,altaurog/django-caspy |
cb754daf342cdea42225efca3834966bd5328fba | src/footer.js | src/footer.js | /*
backgrid
http://github.com/wyuenho/backgrid
Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
Licensed under the MIT @license.
*/
/**
A Footer is a generic class that only defines a default tag `tfoot` and
number of required parameters in the initializer.
@abstract
@class Backgrid.Footer
... | /*
backgrid
http://github.com/wyuenho/backgrid
Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
Licensed under the MIT @license.
*/
/**
A Footer is a generic class that only defines a default tag `tfoot` and
number of required parameters in the initializer.
@abstract
@class Backgrid.Footer
... | Remove extraneous parent reference from Footer | Remove extraneous parent reference from Footer
| JavaScript | mit | goodwall/backgrid,blackducksoftware/backgrid,wyuenho/backgrid,wyuenho/backgrid,digideskio/backgrid,qferr/backgrid,bryce-gibson/backgrid,aboieriu/backgrid,ludoo0d0a/backgrid,bryce-gibson/backgrid,blackducksoftware/backgrid,aboieriu/backgrid,digideskio/backgrid,Acquisio/backgrid,kirill-zhirnov/backgrid,crealytics/backgri... |
8d46d03dd81046fb1e9821ab5e3c4c85e7eba747 | lib/modules/storage/class_static_methods/is_secured.js | lib/modules/storage/class_static_methods/is_secured.js | function isSecured(operation) {
if (_.has(this.schema.secured, operation)) {
return this.schema.secured[operation];
}
else {
return this.schema.secured.common || false;
}
};
export default isSecured; | import _ from 'lodash';
function isSecured(operation) {
if (_.has(this.schema.secured, operation)) {
return this.schema.secured[operation];
}
else {
return this.schema.secured.common || false;
}
};
export default isSecured; | Fix lack of loads import | Fix lack of loads import
| JavaScript | mit | jagi/meteor-astronomy |
f6397f79ef1471f87aa113a4dc4bab900e07935c | lib/routes.js | lib/routes.js | var addFollowers = require('./follow');
var checkAuth = require('./check_auth');
var checkPrivilege = require('./privilege_check');
var githubOAuth = require('./github_oauth');
var users = require('./db').get('users');
module.exports = function(app) {
app.get('/me', checkAuth, function(req, res) {
checkPrivileg... | var addFollowers = require('./follow');
var checkAuth = require('./check_auth');
var checkPrivilege = require('./privilege_check');
var githubOAuth = require('./github_oauth');
var users = require('./db').get('users');
module.exports = function(app) {
app.get('/me', checkAuth, function(req, res) {
checkPrivileg... | Add privilege check on follow button | Add privilege check on follow button
| JavaScript | mit | simplyianm/ghfollowers,legoboy0215/ghfollowers,simplyianm/ghfollowers,legoboy0215/ghfollowers |
3bed3dbca37e1e2072581ae8fc1a532c63c1afd7 | js/plugins/EncryptedInsightStorage.js | js/plugins/EncryptedInsightStorage.js | var cryptoUtil = require('../util/crypto');
var InsightStorage = require('./InsightStorage');
var inherits = require('inherits');
function EncryptedInsightStorage(config) {
InsightStorage.apply(this, [config]);
}
inherits(EncryptedInsightStorage, InsightStorage);
EncryptedInsightStorage.prototype.getItem = function... | var cryptoUtil = require('../util/crypto');
var InsightStorage = require('./InsightStorage');
var inherits = require('inherits');
function EncryptedInsightStorage(config) {
InsightStorage.apply(this, [config]);
}
inherits(EncryptedInsightStorage, InsightStorage);
EncryptedInsightStorage.prototype.getItem = function... | Use the same kdf for Insight Storage | Use the same kdf for Insight Storage
| JavaScript | mit | LedgerHQ/copay,troggy/unicoisa,Bitcoin-com/Wallet,BitGo/copay,wallclockbuilder/copay,msalcala11/copay,cmgustavo/copay,BitGo/copay,Kirvx/copay,DigiByte-Team/copay,mpolci/copay,Neurosploit/copay,payloadtech/wallet,mzpolini/copay,mpolci/copay,wallclockbuilder/copay,wallclockbuilder/copay,ObsidianCryptoVault/copay,fr34k8/c... |
197b667ca677c5961c9c1d116fb86032bd2ef861 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | //= require jquery
$(function() {
$('.login-trello').click(function() {
Trello.authorize({
type: "redirect",
name: "Reportrello",
scope: {
read: true,
write: true
}
});
});
}) | //= require jquery
$(function() {
$('.login-trello').click(function() {
Reportrello.authorize();
});
Reportrello = {
authorize: function() {
var self = this
Trello.authorize({
type: 'popup',
name: 'Reportrello',
fragment: 'postmessage',
scope: {
rea... | Add JS to authentication and get user information by token | Add JS to authentication and get user information by token
| JavaScript | mit | SauloSilva/reportrello,SauloSilva/reportrello,SauloSilva/reportrello |
3578177e3e10ebb0c5c0403b2df13fa472c70edb | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | Enable JavaScript code of bootstrap | Enable JavaScript code of bootstrap
| JavaScript | mit | eqot/petroglyph3,eqot/petroglyph3 |
9716b2cd82d4f4a778f798b88838a5685db2b7ea | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
/... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
/... | Enable rails-ujs to make working REST methods on link by js | Enable rails-ujs to make working REST methods on link by js
| JavaScript | mit | gadzorg/gram2_api_server,gadzorg/gram2_api_server,gadzorg/gram2_api_server |
700f316c0ca9aa873181111752ba99b0f17a1d35 | src-es6/test/classTest.js | src-es6/test/classTest.js | import test from 'tape'
import { Vector, Polygon, Rectangle, Circle, ShapeEventEmitter } from '..'
test('Polygon#contains', t => {
t.plan(5)
//Disable warning about missing 'new'. That's what we are testing
/*jshint -W064 */
/*eslint-disable new-cap */
t.throws(()=> Polygon(), TypeError)
t.throws(()=> Rect... | import test from 'tape'
import { Vector, Polygon, Rectangle, Circle, ShapeEventEmitter } from '..'
test('Classtest', t => {
t.plan(5)
//Disable warning about missing 'new'. That's what we are testing
/*jshint -W064 */
/*eslint-disable new-cap */
t.throws(()=> Polygon(), TypeError)
t.throws(()=> Rectangle()... | Fix name for the classtest | Fix name for the classtest
| JavaScript | mit | tillarnold/shapes |
1cf21242ccd82a54bf1b0da0f61184065f3bd765 | WebContent/js/moe-list.js | WebContent/js/moe-list.js | /* Cached Variables *******************************************************************************/
var context = sessionStorage.getItem('context');
var rowThumbnails = document.querySelector('.row-thumbnails');
/* Initialization *********************************************************************************/
rowTh... | /* Cached Variables *******************************************************************************/
var context = sessionStorage.getItem('context');
var rowThumbnails = document.querySelector('.row-thumbnails');
/* Initialization *********************************************************************************/
rowTh... | Change nodelist.foreach to a normal for loop | Change nodelist.foreach to a normal for loop
This should bring much greater browser compatibility the the nodelist foreach allowing it to work on all the major browser vendors.
Fixes #95 | JavaScript | mit | NYPD/moe-sounds,NYPD/moe-sounds |
0a5d4a96c4f656ff2aa154274dc19cfa3f4d3d17 | openstack_dashboard/static/fiware/contextualHelp.js | openstack_dashboard/static/fiware/contextualHelp.js | $( document ).ready(function () {
$('.contextual-help').click(function (){
$(this).find('i').toggleClass('active');
});
$('body').click(function (e) {
$('[data-toggle="popover"]').each(function () {
//the 'is' for buttons that trigger popups
//the 'has' for icons within a button that triggers ... | $( document ).ready(function () {
$('.contextual-help').click(function (){
$(this).find('i').toggleClass('active');
});
$('body').click(function (e) {
$('[data-toggle="popover"].contextual-help').each(function () {
//the 'is' for buttons that trigger popups
//the 'has' for icons within a butto... | Improve usability of contextual-help popovers | Improve usability of contextual-help popovers
| JavaScript | apache-2.0 | ging/horizon,ging/horizon,ging/horizon,ging/horizon |
f4ac2aad1922930d4c27d4841e5665714a509a14 | src/command-line/index.js | src/command-line/index.js | var program = require("commander");
var pkg = require("../../package.json");
var fs = require("fs");
var mkdirp = require("mkdirp");
var Helper = require("../helper");
program.version(pkg.version, "-v, --version");
program.option("");
program.option(" --home <path>" , "home path");
require("./start");
require("./c... | var program = require("commander");
var pkg = require("../../package.json");
var fs = require("fs");
var mkdirp = require("mkdirp");
var Helper = require("../helper");
program.version(pkg.version, "-v, --version");
program.option("");
program.option(" --home <path>" , "home path");
var argv = program.parseOptions(... | Fix loading config before HOME variable is set | Fix loading config before HOME variable is set
| JavaScript | mit | realies/lounge,ScoutLink/lounge,realies/lounge,rockhouse/lounge,rockhouse/lounge,FryDay/lounge,williamboman/lounge,rockhouse/lounge,sebastiencs/lounge,sebastiencs/lounge,libertysoft3/lounge-autoconnect,metsjeesus/lounge,FryDay/lounge,williamboman/lounge,williamboman/lounge,metsjeesus/lounge,ScoutLink/lounge,sebastiencs... |
2135e956f28bafdfe11786d3157f52ea05bccf33 | config/env/production.js | config/env/production.js | 'use strict';
module.exports = {
db: 'mongodb://localhost/mean',
app: {
name: 'MEAN - A Modern Stack - Production'
},
facebook: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://localhost:3000/auth/facebook/callback'
},
twitter: {
cli... | 'use strict';
module.exports = {
app: {
name: 'MEAN - A Modern Stack - Production'
},
facebook: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://localhost:3000/auth/facebook/callback'
},
twitter: {
clientID: 'CONSUMER_KEY',
clien... | Use MONGOHQ_URL for database connection in prod | Use MONGOHQ_URL for database connection in prod
| JavaScript | bsd-2-clause | asm-products/barrtr,asm-products/barrtr |
f6f3afda12313c5093774b47b62fa79789efccc0 | dev/_/components/js/sourceModel.js | dev/_/components/js/sourceModel.js | // Source Model
AV.source = Backbone.Model.extend({
url: 'php/redirect.php/source',
defaults: {
name: '',
type: 'raw',
contentType: 'txt',
data: ''
},
});
// Source Model Tests
// test_source = new AV.source({
// name: 'The Wind and the Rain',
// type: 'raw',
// contentType: 'txt',
// data:... | // Source Model
AV.Source = Backbone.Model.extend({
url: 'php/redirect.php/source',
defaults: {
name: '',
type: 'raw',
contentType: 'txt',
data: ''
},
});
// Source Model Tests
// test_Source = new AV.Source({
// name: 'The Wind and the Rain',
// type: 'raw',
// contentType: 'txt',
// data:... | Add some tests, they're commented out right now. Things work! | Add some tests, they're commented out right now. Things work!
| JavaScript | bsd-3-clause | Swarthmore/juxtaphor,Swarthmore/juxtaphor |
625fc78ee616baedf64aa37357403b4b72c7363c | src/js/select2/i18n/th.js | src/js/select2/i18n/th.js | define(function () {
// Thai
return {
inputTooLong: function (args) {
var overChars = args.input.length - args.maximum;
var message = 'โปรดลบออก ' + overChars + ' ตัวอักษร';
return message;
},
inputTooShort: function (args) {
var remainingChars = args.minimum - args.input.lengt... | define(function () {
// Thai
return {
errorLoading: function () {
return 'ไม่สามารถค้นข้อมูลได้';
},
inputTooLong: function (args) {
var overChars = args.input.length - args.maximum;
var message = 'โปรดลบออก ' + overChars + ' ตัวอักษร';
return message;
},
inputTooShort:... | Add errorLoading translation of Thai language. | Add errorLoading translation of Thai language.
This closes https://github.com/select2/select2/pull/4521.
| JavaScript | mit | bottomline/select2,select2/select2,ZaArsProgger/select2,inway/select2,ZaArsProgger/select2,iestruch/select2,inway/select2,bottomline/select2,iestruch/select2,select2/select2 |
263e6691ad0cda4c2adaee1aca584316fedcf382 | test/index.js | test/index.js | var assert = require('assert')
var mongo = require('../')
var db = mongo('mongodb://read:read@ds031617.mongolab.com:31617/esdiscuss')
before(function (done) {
this.timeout(10000)
db._get(done)
})
describe('read only operation', function () {
it('db.getCollectionNames', function (done) {
db.getCollectionName... | var assert = require('assert')
var mongo = require('../')
var db = mongo('mongodb://read:read@ds031617.mongolab.com:31617/esdiscuss')
before(function (done) {
this.timeout(10000)
db._get(done)
})
describe('read only operation', function () {
it('db.getCollectionNames', function (done) {
db.getCollectionName... | Add test case for `count` method | Add test case for `count` method
| JavaScript | mit | then/mongod,then/then-mongo |
74632c81aa309e7d4cfab2bc4fb80effd49da773 | test/index.js | test/index.js | 'use strict';
var test = require('tape');
var isError = require('../index.js');
test('isError is a function', function t(assert) {
assert.equal(typeof isError, 'function');
assert.end();
});
test('returns true for error', function t(assert) {
assert.equal(isError(new Error('foo')), true);
assert.equ... | 'use strict';
var test = require('tape');
var vm = require('vm');
var isError = require('../index.js');
test('isError is a function', function t(assert) {
assert.equal(typeof isError, 'function');
assert.end();
});
test('returns true for error', function t(assert) {
assert.equal(isError(new Error('foo')... | Add breaking tests for foreign/inherited errors | Add breaking tests for foreign/inherited errors
| JavaScript | mit | Raynos/is-error |
ce11c728c6aba22c377c9abd563aebc03df71964 | core/client/views/settings/tags/settings-menu.js | core/client/views/settings/tags/settings-menu.js | var TagsSettingsMenuView = Ember.View.extend({
saveText: Ember.computed('controller.model.isNew', function () {
return this.get('controller.model.isNew') ?
'Add Tag' :
'Save Tag';
}),
// This observer loads and resets the uploader whenever the active tag changes,
// ensu... | var TagsSettingsMenuView = Ember.View.extend({
saveText: Ember.computed('controller.model.isNew', function () {
return this.get('controller.model.isNew') ?
'Add Tag' :
'Save Tag';
}),
// This observer loads and resets the uploader whenever the active tag changes,
// ensu... | Reset upload component on tag switch | Reset upload component on tag switch
Closes #4755
| JavaScript | mit | sangcu/Ghost,thinq4yourself/Unmistakable-Blog,JohnONolan/Ghost,ThorstenHans/Ghost,optikalefx/Ghost,wemakeweb/Ghost,jomahoney/Ghost,lanffy/Ghost,tidyui/Ghost,rollokb/Ghost,shrimpy/Ghost,fredeerock/atlabghost,ClarkGH/Ghost,letsjustfixit/Ghost,UsmanJ/Ghost,rito/Ghost,TribeMedia/Ghost,BlueHatbRit/Ghost,e10/Ghost,NovaDevelo... |
9d75d13fcca1105093170e6b98d1e690fc9cbd29 | system-test/env.js | system-test/env.js | const expect = require('chai').expect;
const version = process.env.QB_VERSION;
describe('check compiler version inside docker', function () {
it('should have the same version', async () => {
const exec = require('child_process').exec;
let options = {
timeout: 60000,
killSig... | const expect = require('chai').expect;
const version = process.env.QB_VERSION;
describe('check compiler version inside docker', function () {
it('should have the same version', async () => {
const exec = require('child_process').exec;
let options = {
timeout: 60000,
killSig... | Add a test for std-versions script | Add a test for std-versions script
| JavaScript | bsd-2-clause | FredTingaud/quick-bench-back-end,FredTingaud/quick-bench-back-end,FredTingaud/quick-bench-back-end |
210babd039054adf81522da01f55b10b5e0dc06f | tests/dev.js | tests/dev.js | var f_ = require('../index.js');
var TaskList = require('./TaskList');
var f_config = {
functionFlow: ['getSource', 'writeSource', 'notify'], // REQUIRED
resetOnRetryAll: true,
toLog: ['all'],
desc: 'Test taskList',
maxRetries: {
all: 2
}
};
TaskList = f_.augment(TaskList, f_config);
var runSingle = fun... | var f_ = require('../index.js');
var TaskList = require('./TaskList');
var f_config = {
/**
* `start` method is not given here, since we call it manualy
* This is just a matter of personal taste, I do not like auto starts!
*/
functionFlow: ['getSource', 'writeSource', 'notify'], // REQUIRED
resetOnRetryAll... | Comment about start method not being present in functionFlow | Comment about start method not being present in functionFlow
| JavaScript | mit | opensoars/f_ |
e34ec4cde226f760dc21926e9f2fb504fdb7fdb5 | src/Drivers/Cache/index.js | src/Drivers/Cache/index.js | 'use strict'
/**
* Abstract base class that ensures required public methods are implemented by
* inheriting classes.
*
* @example
*
* class BloomFilterCache extends Cache {
* constructor() {
* super()
* }
*
* get(key) {}
* put(key, value, milliseconds) {}
* increment(key) {}
* incrementEx... | 'use strict'
/**
* Abstract base class that ensures required public methods are implemented by
* inheriting classes.
*
* @example
*
* class BloomFilterCache extends Cache {
* constructor() {
* super()
* }
*
* get(key) {}
* put(key, value, milliseconds) {}
* increment(key) {}
* incrementEx... | Mark secondsToExpiration as abstract method | Mark secondsToExpiration as abstract method
| JavaScript | mit | masasron/adonis-throttle,masasron/adonis-throttle |
3f5e236d5a23f13e8f683a550d31ff44080ecb01 | transforms.js | transforms.js | /**
* Module dependencies
*/
var accounting = require('accounting')
, util = require('util')
, currency = require('currency-symbol-map');
/**
* formatPrice - format currency code and price nicely
* @param {Object} value
* @returns {String} formatted price
* @note Value is expected to be of the form:
* {
... | /**
* Module dependencies
*/
var accounting = require('accounting')
, util = require('util')
, currency = require('currency-symbol-map');
/**
* formatPrice - format currency code and price nicely
* @param {Object} value
* @returns {String} formatted price
* @note Value is expected to be of the form:
* {
... | Format prices differently for germany | Format prices differently for germany
| JavaScript | mit | urgeiolabs/aws-price |
351e1eb2093ff4cfb87f17f6bcfccb95f0f589f0 | source/assets/javascripts/locastyle/_toggle-text.js | source/assets/javascripts/locastyle/_toggle-text.js | var locastyle = locastyle || {};
locastyle.toggleText = (function() {
'use strict';
var config = {
trigger: '[data-ls-module=toggleText]',
triggerChange: 'toggleText:change'
};
function eventHandler(el, target, text) {
el.trigger(config.triggerChange, [target, text]);
}
function bindToggle(e... | var locastyle = locastyle || {};
locastyle.toggleText = (function() {
'use strict';
var config = {
trigger: '[data-ls-module=toggleText]',
triggerChange: 'toggleText:change'
};
function eventHandler(el, target, text) {
el.trigger(config.triggerChange, [target, text]);
}
function bindToggle(e... | Remove stop propagation from toggle text module | Remove stop propagation from toggle text module
| JavaScript | mit | locaweb/locawebstyle,deividmarques/locawebstyle,deividmarques/locawebstyle,deividmarques/locawebstyle,locaweb/locawebstyle,locaweb/locawebstyle |
c090cf03c81639622df3f7d3b0414aea926d95a3 | bonfires/sum-all-odd-fibonacci-numbers/logic.js | bonfires/sum-all-odd-fibonacci-numbers/logic.js | /* Bonfire: Sum All Odd Fibonacci Numbers */
function sumFibs(num) {
var f1 = 1;
var f2 = 1;
function fib(){
}
return num;
}
sumFibs(4); | /* Bonfire: Sum All Odd Fibonacci Numbers */
function sumFibs(num) {
var tmp = num;
while (num > 2){
}
return num;
}
sumFibs(4);
| Edit Fibonacci project in Bonfires Directory | Edit Fibonacci project in Bonfires Directory
| JavaScript | mit | witblacktype/freeCodeCamp_projects,witblacktype/freeCodeCamp_projects |
069d6ac19107f126cc71b37dad5d8d0821d3c249 | app/controllers/stream.js | app/controllers/stream.js | import Ember from 'ember';
import ENV from 'plenario-explorer/config/environment';
export default Ember.Controller.extend({
modelArrived: Ember.observer('model', function() {
const nodeList = this.get('model.nodes');
const nodeTuples = nodeList.map(node => {
return [node.properties.id, node.properties]... | import Ember from 'ember';
// import ENV from 'plenario-explorer/config/environment';
export default Ember.Controller.extend({
modelArrived: Ember.observer('model', function() {
const nodeList = this.get('model.nodes');
const nodeTuples = nodeList.map(node => {
return [node.properties.id, node.properti... | Set default node as first returned from API | Set default node as first returned from API
| JavaScript | mit | UrbanCCD-UChicago/plenario-explorer,UrbanCCD-UChicago/plenario-explorer,UrbanCCD-UChicago/plenario-explorer |
c8edf1a27fe1a9142793a071b079d079138c6851 | schema/sorts/fair_sorts.js | schema/sorts/fair_sorts.js | import { GraphQLEnumType } from 'graphql';
export default {
type: new GraphQLEnumType({
name: 'FairSorts',
values: {
created_at_asc: {
value: 'created_at',
},
created_at_desc: {
value: '-created_at',
},
start_at_asc: {
value: 'start_at',
},
st... | import { GraphQLEnumType } from 'graphql';
export default {
type: new GraphQLEnumType({
name: 'FairSorts',
values: {
CREATED_AT_ASC: {
value: 'created_at',
},
CREATED_AT_DESC: {
value: '-created_at',
},
START_AT_ASC: {
value: 'start_at',
},
ST... | Use uppercase for fair sort enum | Use uppercase for fair sort enum
| JavaScript | mit | artsy/metaphysics,broskoski/metaphysics,artsy/metaphysics,mzikherman/metaphysics-1,mzikherman/metaphysics-1,craigspaeth/metaphysics,1aurabrown/metaphysics,mzikherman/metaphysics-1,mzikherman/metaphysics-1,artsy/metaphysics,craigspaeth/metaphysics |
50b994a3873b14b50a28660547ea7d4a36e4d429 | config/pathresolver.js | config/pathresolver.js | /*jslint node: true */
const pathresolver = require('angular-filemanager-nodejs-bridge').pathresolver;
const path = require('path');
pathresolver.baseDir = function(req) {
if(!req.user || !req.user.username || !Array.isArray(req.user.global_roles)) {
throw new Error("No valid user!");
}
// Admin users can ... | /*jslint node: true */
const pathresolver = require('angular-filemanager-nodejs-bridge').pathresolver;
const path = require('path');
const fs = require('fs.extra');
pathresolver.baseDir = function(req) {
if(!req.user || !req.user.username || !Array.isArray(req.user.global_roles)) {
throw new Error("No valid use... | Create user directories if they do not exist | Create user directories if they do not exist
| JavaScript | agpl-3.0 | fkoester/purring-flamingo,fkoester/purring-flamingo |
c8ac6f48aae5a473f712231bbad389f9b788cfc7 | discord-client/src/bot.js | discord-client/src/bot.js | const Discord = require('discord.js');
const { ChannelProcessor } = require('./channelProcessor');
const {discordApiToken } = require('./secrets.js');
const client = new Discord.Client();
const channelProcessorMap = {};
client.on('ready', () => {
console.log('Bot is ready');
});
client.on('message', (message) => {... | const Discord = require('discord.js');
const { ChannelProcessor } = require('./channelProcessor');
const {discordApiToken } = require('./secrets.js');
const client = new Discord.Client();
const channelProcessorMap = {};
client.on('ready', () => {
console.log('Bot is ready');
});
client.on('message', (message) => {... | Add console logging upon haiku trigger | Add console logging upon haiku trigger
| JavaScript | mit | bumblepie/haikubot |
cc472a3d07b2803c9e3b4cb80624d1c312d519f7 | test/fetch.js | test/fetch.js | 'use strict';
var http = require('http');
var assert = require('assertive');
var fetch = require('../lib/fetch');
describe('fetch', function() {
var server;
before('start echo server', function(done) {
server = http.createServer(function(req, res) {
res.writeHead(200, {
'Content-Type': 'appli... | 'use strict';
var http = require('http');
var assert = require('assertive');
var fetch = require('../lib/fetch');
describe('fetch', function() {
var server;
before('start echo server', function(done) {
server = http.createServer(function(req, res) {
var chunks = [];
req.on('data', function(chun... | Add test for empty body | Add test for empty body
| JavaScript | bsd-3-clause | jkrems/srv-gofer |
f8339c53d8b89ebb913088be19954ad8d0c44517 | src/providers/sh/index.js | src/providers/sh/index.js | module.exports = {
title: 'now.sh',
subcommands: new Set([
'login',
'deploy',
'ls',
'list',
'alias',
'scale',
'certs',
'dns',
'domains',
'rm',
'remove',
'whoami',
'secrets',
'logs',
'upgrade',
'teams',
'switch'
]),
get deploy() {
return req... | const mainCommands = new Set([
'help',
'list',
'remove',
'alias',
'domains',
'dns',
'certs',
'secrets',
'billing',
'upgrade',
'teams',
'logs',
'scale',
'logout',
'whoami'
])
const aliases = {
list: ['ls'],
remove: ['rm'],
alias: ['ln', 'aliases'],
domains: ['domain'],
certs: ['c... | Support for all aliases added | Support for all aliases added
| JavaScript | apache-2.0 | zeit/now-cli,zeit/now-cli,zeit/now-cli,zeit/now-cli,zeit/now-cli,zeit/now-cli,zeit/now-cli |
d1709007440080cc4b1ced6dbebe0096164f15fb | model/file.js | model/file.js | 'use strict';
var memoize = require('memoizee/plain')
, validDb = require('dbjs/valid-dbjs')
, defineFile = require('dbjs-ext/object/file')
, defineJpegFile = require('dbjs-ext/object/file/image-file/jpeg-file')
, docMimeTypes = require('../utils/microsoft-word-doc-mime-types');
module.exp... | 'use strict';
var memoize = require('memoizee/plain')
, validDb = require('dbjs/valid-dbjs')
, defineFile = require('dbjs-ext/object/file')
, defineJpegFile = require('dbjs-ext/object/file/image-file/jpeg-file')
, docMimeTypes = require('../utils/microsoft-word-doc-mime-types');
module.exp... | Add File methods for proper JSON snapshots | Add File methods for proper JSON snapshots
| JavaScript | mit | egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations |
85db50188bcf660bdf83fc09c0c50eed9f0433c4 | test/index.js | test/index.js | 'use strict';
var assert = require('assert');
var chromedriver = require('chromedriver');
var browser = require('../');
chromedriver.start();
browser.remote('http://localhost:9515/').timeout('60s').operationTimeout('20s');
after(function () {
chromedriver.stop();
});
var getHeadingText = browser.async(function* (b... | 'use strict';
var assert = require('assert');
var chromedriver = require('chromedriver');
var browser = require('../');
var LOCAL = !process.env.CI;
if (LOCAL) {
chromedriver.start();
browser.remote('http://localhost:9515/').timeout('60s').operationTimeout('5s');
after(function () {
chromedriver.stop();
... | Support CI using sauce labs | Support CI using sauce labs
| JavaScript | mit | ForbesLindesay/selenium-mocha |
67ad246f902b2c04a426d16d5fe877ffa1fee5d0 | tests/integration/angular-meteor-session-spec.js | tests/integration/angular-meteor-session-spec.js | describe('$meteorSession service', function () {
var $meteorSession,
$rootScope,
$scope;
beforeEach(angular.mock.module('angular-meteor'));
beforeEach(angular.mock.inject(function(_$meteorSession_, _$rootScope_) {
$meteorSession = _$meteorSession_;
$rootScope = _$rootScope_;
$scope = $ro... | describe('$meteorSession service', function () {
var $meteorSession,
$rootScope,
$scope;
beforeEach(angular.mock.module('angular-meteor'));
beforeEach(angular.mock.inject(function(_$meteorSession_, _$rootScope_) {
$meteorSession = _$meteorSession_;
$rootScope = _$rootScope_;
$scope = $ro... | Add test for $meteorSession service to support scope variable nested property | Add test for $meteorSession service to support scope variable nested property
| JavaScript | mit | IgorMinar/angular-meteor,omer72/angular-meteor,IgorMinar/angular-meteor,zhoulvming/angular-meteor,dszczyt/angular-meteor,craigmcdonald/angular-meteor,divramod/angular-meteor,aleksander351/angular-meteor,thomkaufmann/angular-meteor,Urigo/angular-meteor,Unavi/angular-meteor,manhtuongbkhn/angular-meteor,dszczyt/angular-me... |
67567c4809789b1896b470c621085125450cf845 | src/renderer/ui/components/generic/PlatformSpecific.js | src/renderer/ui/components/generic/PlatformSpecific.js | import { Component, PropTypes } from 'react';
import os from 'os';
import semver from 'semver';
export const semverValidator = (props, propName, componentName) => {
if (props[propName]) {
return semver.validRange(props[propName]) ? null : new Error(`${propName} in ${componentName} is not a valid semver string`);... | import { Component, PropTypes } from 'react';
import os from 'os';
import semver from 'semver';
const parsedOSVersion = semver.parse(os.release());
const osVersion = `${parsedOSVersion.major}.${parsedOSVersion.minor}.${parsedOSVersion.patch}`;
export const semverValidator = (props, propName, componentName) => {
if ... | Fix version tests on linux | Fix version tests on linux
| JavaScript | mit | petuhovskiy/Google-Play-Music-Desktop-Player-UNOFFICIAL-,petuhovskiy/Google-Play-Music-Desktop-Player-UNOFFICIAL-,petuhovskiy/Google-Play-Music-Desktop-Player-UNOFFICIAL- |
0aad07073773a20898d950c649a7fa74b22497fc | Emix.Web/ngApp/emixApp.js | Emix.Web/ngApp/emixApp.js | angular.module('emixApp',
['ngRoute',
'emixApp.controllers',
'emixApp.directives',
'emixApp.services',
'mgcrea.ngStrap',
'ngMorris',
//'ngGoogleMap'
'pascalprecht.translate'
])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/das... | angular.module('emixApp',
['ngRoute',
'ngCookies',
'emixApp.controllers',
'emixApp.directives',
'emixApp.services',
'mgcrea.ngStrap',
'ngMorris',
'pascalprecht.translate'
])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/dashbo... | Allow translator plugin to store selected language in sessionStorage/cookie and remember the settings | Allow translator plugin to store selected language in sessionStorage/cookie and remember the settings
| JavaScript | mit | sierrodc/ASP.NET-MVC-AngularJs-Seed,sierrodc/ASP.NET-MVC-AngularJs-Seed,sierrodc/ASP.NET-MVC-AngularJs-Seed |
05975f56e6561e789dfb8fedaf4954cc751c787c | src/common.js | src/common.js | function findByIds(items, ids) {
return ids
.map((id) => {
return items.find((item) => item.id === id)
})
.filter((item) => item)
}
function findOneById(items, id) {
return items.find((item) => item.id === id)
}
function findOneByAliases(items, aliases) {
if (Array.isArray(aliases)) {
retu... | function findByIds(items, ids) {
return ids
.map((id) => {
return items.find((item) => item.id === id)
})
.filter((item) => item)
}
function findOneById(items, id) {
return items.find((item) => item.id === id)
}
function findOneByAliases(items, aliases) {
if (Array.isArray(aliases)) {
retu... | Add findOneByName for usage with nested names | Add findOneByName for usage with nested names
| JavaScript | isc | alex-shnayder/comanche |
10c8e31cfd598b8f736ba7cdc9d280b607b30042 | src/config.js | src/config.js | import * as FrontendPrefsOptions from './utils/frontend-preferences-options';
const config = {
api:{
host: 'http://localhost:3000',
sentinel: null // keep always last
},
auth: {
cookieDomain: 'localhost',
tokenPrefix: 'freefeed_',
userStorageKey: 'USER_KEY',
sentinel: null // keep always ... | import * as FrontendPrefsOptions from './utils/frontend-preferences-options';
const config = {
api:{
host: 'http://localhost:3000',
sentinel: null // keep always last
},
auth: {
cookieDomain: 'localhost',
tokenPrefix: 'freefeed_',
userStorageKey: 'USER_KEY',
sentinel: null // keep always ... | Change default value of displayname setting | Change default value of displayname setting
New default is: "Display name + username"
| JavaScript | mit | davidmz/freefeed-react-client,FreeFeed/freefeed-react-client,kadmil/freefeed-react-client,kadmil/freefeed-react-client,davidmz/freefeed-react-client,davidmz/freefeed-react-client,FreeFeed/freefeed-react-client,FreeFeed/freefeed-react-client,kadmil/freefeed-react-client |
6d22dabca3b69a06fb8f3fdc11469b6da7641bfd | src/config.js | src/config.js | // = Server config =============================================================
export const port = 3000
export const enableGraphiQL = true;
export const logFile = 'store.log'
// = App config ================================================================
| // = Server config =============================================================
export const port = process.env.PORT || 3000
export const enableGraphiQL = true;
export const logFile = 'store.log'
// = App config ================================================================
| Add ability to define port as environment variable | Add ability to define port as environment variable
| JavaScript | mit | jukkah/comicstor |
30f2923409e548ccc4626278509ae158bae6d5e0 | web_clients/javascript_mvc/www/js/test/test-main.js | web_clients/javascript_mvc/www/js/test/test-main.js | var allTestFiles = [];
var TEST_REGEXP = /_test\.js$/i;
var pathToModule = function(path) {
return path.replace(/^\/base\/js\//, '..\/').replace(/\.js$/, '');
};
Object.keys(window.__karma__.files).forEach(function(file) {
if (TEST_REGEXP.test(file)) {
// Normalize paths to RequireJS module names.
allTest... | (function() {
'use strict';
var test_files, coverage_files;
function pathToModule(path) {
return path.replace(/^\/base\/js\//, '..\/').replace(/\.js$/, '');
};
// Configure require's paths
require.config({
baseUrl: '/base/js/vendor',
paths: {
jquery: 'jquery/jquery-2.1.1.min',
squire: 'squire/Squi... | Include all client files for coverage reporting | Include all client files for coverage reporting
Also: clean up test-main a bit from its original copypasta.
| JavaScript | mit | xaroth8088/tournament-of-lulz,xaroth8088/tournament-of-lulz,xaroth8088/tournament-of-lulz,xaroth8088/tournament-of-lulz |
84e2ef62b1faff132d69ad3384be68fb364d86c9 | src/string.js | src/string.js | // =================================================================================================
// Core.js | String Functions
// (c) 2014 Mathigon / Philipp Legner
// =================================================================================================
(function() {
M.extend(String.prototype, {
... | // =================================================================================================
// Core.js | String Functions
// (c) 2014 Mathigon / Philipp Legner
// =================================================================================================
(function() {
M.extend(String.prototype, {
... | Fix String endsWith prototype shadowing | Fix String endsWith prototype shadowing
| JavaScript | mit | Mathigon/core.js |
a8d74088d41f2bb83336dc242d512193e743385a | components/home/events.js | components/home/events.js | import React from 'react'
import PropTypes from 'prop-types'
import Link from 'next/link'
import { translate } from 'react-i18next'
import Section from './section'
const Events = ({ t }) => (
<Section title={t('eventsSectionTitle')}>
<Link href='/events'>
<a>{t('eventsLink')}</a>
</Link>
<style j... | import React from 'react'
import PropTypes from 'prop-types'
import { translate } from 'react-i18next'
import Link from '../link'
import Section from './section'
const Events = ({ t }) => (
<Section title={t('eventsSectionTitle')}>
<Link href='/events'>
<a>{t('eventsLink')}</a>
</Link>
<style jsx... | Fix link to event page | Fix link to event page
| JavaScript | mit | sgmap/inspire,sgmap/inspire |
cf4e0ba45bb8da2f44ea3eccee25f38b69479f45 | controllers/submission.js | controllers/submission.js | const Submission = require('../models/Submission');
const moment = require('moment');
/**
* GET /submissions
*/
exports.getSubmissions = (req, res) => {
const page = parseInt(req.query && req.query.page) || 0;
Submission
.find()
.sort({ _id: -1 })
.populate('user')
.populate('language')
.skip(500 * pag... | const Submission = require('../models/Submission');
const User = require('../models/User');
const moment = require('moment');
const Promise = require('bluebird');
/**
* GET /submissions
*/
exports.getSubmissions = (req, res) => {
Promise.try(() => {
if (req.query.author) {
return User.findOne({ email: `$... | Add author and status parameter | Add author and status parameter
| JavaScript | mit | hakatashi/esolang-battle,hakatashi/esolang-battle,hakatashi/esolang-battle |
221ed0e89bf69a169d1110788e0be3e2d10c49f0 | lib/node_modules/@stdlib/buffer/from-array/lib/index.js | lib/node_modules/@stdlib/buffer/from-array/lib/index.js | 'use strict';
/**
* Allocate a buffer using an octet array.
*
* @module @stdlib/buffer/from-array
*
* @example
* var array2buffer = require( '@stdlib/type/buffer/from-array' );
*
* var buf = array2buffer( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*/
// MODULES //
var hasFrom = require( './has_from.js' );
// MAIN //
... | 'use strict';
/**
* Allocate a buffer using an octet array.
*
* @module @stdlib/buffer/from-array
*
* @example
* var array2buffer = require( '@stdlib/type/buffer/from-array' );
*
* var buf = array2buffer( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*/
// MODULES //
var hasFrom = require( './has_from.js' );
var main = re... | Refactor to avoid dynamic module resolution | Refactor to avoid dynamic module resolution
| 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 |
3ac7f2a8044ad8febe16541e9b3683cf00fd1ae0 | components/search/result/thumbnail.js | components/search/result/thumbnail.js | import React from 'react'
import PropTypes from 'prop-types'
import { translate } from 'react-i18next'
import { GEODATA_API_URL } from '@env'
const Thumbnail = ({ recordId, thumbnails, t }) => {
const hasThumbnail = thumbnails && thumbnails.length > 0
const thumbnail = hasThumbnail
? `${GEODATA_API_URL}/recor... | import React from 'react'
import PropTypes from 'prop-types'
import { translate } from 'react-i18next'
import { GEODATA_API_URL } from '@env'
const Thumbnail = ({ recordId, thumbnails, t }) => {
const hasThumbnail = thumbnails && thumbnails.length > 0
const thumbnail = hasThumbnail
? `${GEODATA_API_URL}/recor... | Fix search result image sizes | Fix search result image sizes
| JavaScript | mit | sgmap/inspire,sgmap/inspire |
5591b4615ec9e88f448ad2a9f777c85e659bd0a0 | server/helpers/helpers.js | server/helpers/helpers.js | const handleError = (err, res) => {
switch (err.code) {
case 401:
return res.status(401).send(err.message);
case 404:
return res.status(404).send(err.message);
default:
return res.status(400).send(err);
}
};
const handleSuccess = (code, body, res) => {
switch (code) {
case 201:
... | const handleError = (err, res) => {
switch (err.code) {
case 401:
return res.status(401).json(err.message);
case 404:
return res.status(404).json(err.message);
default:
return res.status(400).json(err);
}
};
const handleSuccess = (code, body, res) => {
switch (code) {
case 201:
... | Refactor the helper methods to use json method instead of send method | Refactor the helper methods to use json method instead of send method
| JavaScript | mit | johadi10/PostIt,johadi10/PostIt |
c6335c604a1495d2526f6f395e429e065f9317af | test/endpoints/account.js | test/endpoints/account.js | 'use strict';
var assert = require('assert');
var sinon = require('sinon');
var Account = require('../../lib/endpoints/account');
var Request = require('../../lib/request');
describe('endpoints/account', function () {
describe('changePassword', function () {
it('should set the request URL', function () {... | 'use strict';
const assert = require('assert');
const sinon = require('sinon');
const Account = require('../../lib/endpoints/account');
const Request = require('../../lib/request');
describe('endpoints/account', () => {
describe('changePassword', () => {
it('should set the request URL', () => {
... | Rewrite Account tests to ES2015 | Rewrite Account tests to ES2015
| JavaScript | mit | jwilsson/glesys-api-node |
a151d88b94ee726f0450b93df5ede04124a81ded | packages/rendering/addon/-private/meta-for-field.js | packages/rendering/addon/-private/meta-for-field.js | export default function metaForField(content, fieldName) {
if (!content) { return; }
try {
return content.constructor.metaForProperty(fieldName);
} catch (err) {
return;
}
}
| import { camelize } from "@ember/string";
export default function metaForField(content, fieldName) {
if (!content) { return; }
fieldName = camelize(fieldName);
try {
return content.constructor.metaForProperty(fieldName);
} catch (err) {
return;
}
}
| Fix field editors not appearing for field names that contain dashes | Fix field editors not appearing for field names that contain dashes
| JavaScript | mit | cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack |
8c8c3ef0efabbcf07ead714b3fb79f1f7ed81a41 | test/spec/test_captcha.js | test/spec/test_captcha.js | defaultConf = {
height: 100,
width: 300,
fingerprintLength: 20
};
describe("The constructor is supposed a proper Captcha object", function() {
it('Constructor Captcha exists', function(){
expect(Captcha).toBeDefined();
});
var captcha = new Captcha();
it("Captcha object is not null"... | defaultConf = {
height: 100,
width: 300,
fingerprintLength: 20
};
describe("The constructor is supposed a proper Captcha object", function() {
it('Constructor Captcha exists', function(){
expect(Captcha).toBeDefined();
});
var captcha = new Captcha();
it("Captcha object is not null"... | Add one more test and it fails | Add one more test and it fails
| JavaScript | mit | sonjahohlfeld/Captcha-Generator,sonjahohlfeld/Captcha-Generator |
02ee190d7383336953c7dde6d3e4f50285a7d113 | src/interface/common/Ad.js | src/interface/common/Ad.js | import React from 'react';
import PropTypes from 'prop-types';
class Ad extends React.PureComponent {
static propTypes = {
style: PropTypes.object,
};
componentDidMount() {
(window.adsbygoogle = window.adsbygoogle || []).push({});
}
render() {
const { style, ...others } = this.props;
const... | import React from 'react';
import PropTypes from 'prop-types';
class Ad extends React.PureComponent {
static propTypes = {
style: PropTypes.object,
};
componentDidMount() {
try {
(window.adsbygoogle = window.adsbygoogle || []).push({});
} catch (err) {
// "adsbygoogle.push() error: No sl... | Fix crash caused by google adsense | Fix crash caused by google adsense
| JavaScript | agpl-3.0 | WoWAnalyzer/WoWAnalyzer,anom0ly/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,fyruna/WoWAnalyzer,fyruna/WoWAnalyzer,ronaldpereira/WoWAnalyzer,anom0ly/WoWAnalyzer,sMteX/WoWAnalyzer,anom0ly/WoWAnalyzer,Juko8/WoWAnalyzer,ronaldpereira/WoWAnalyzer,yajinni/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,Juko8/WoWAnalyzer,ronaldpereira/WoWAnalyze... |
a96f3a13dc3a80d18ca7bc2fec5268c453c24533 | src/react-chayns-personfinder/utils/normalizeOutput.js | src/react-chayns-personfinder/utils/normalizeOutput.js | export default function normalizeOutput(type, value) {
return {
type,
name: value.name,
firstName: value.firstName,
lastName: value.lastName,
personId: value.personId,
userId: value.userId,
siteId: value.siteId,
locationId: value.locationId,
is... | import {
FRIEND_RELATION,
LOCATION_RELATION,
PERSON_RELATION,
PERSON_UNRELATED,
} from '../constants/relationTypes';
export default function normalizeOutput(type, value) {
const newType = (type === PERSON_RELATION || type === PERSON_UNRELATED || type === FRIEND_RELATION) ? PERSON_RELATION : LOCATIO... | Add normalization of type to prevent wrong types | :bug: Add normalization of type to prevent wrong types
| JavaScript | mit | TobitSoftware/chayns-components,TobitSoftware/chayns-components,TobitSoftware/chayns-components |
046b77894ef1df26a411ae2ca808936d920632c9 | to.etc.domui/src/resources/themes/domui/style.props.js | to.etc.domui/src/resources/themes/domui/style.props.js | /*
* "domui" stylesheet properties.
*/
font_family='Verdana, Geneva, "DejaVu Sans", sans-serif';
font_size="11px";
hdr_font_size="14px";
fixed_font_family='Courier New, Courier, monospace';
fixed_font_size="11px";
defaultbutton_height=23;
window_title_font_size='15px';
| /*
* "blue" stylesheet properties.
*/
font_family='Verdana, Geneva, "DejaVu Sans", sans-serif';
//font_family='Verdana, Tahoma, helvetica, sans-serif';
font_size="11px";
hdr_font_size="14px";
fixed_font_family='Courier New, Courier, monospace';
fixed_font_size="11px";
//special_font = "Verdana, Tahoma, helvetica, s... | Make both style properties equal | Make both style properties equal | JavaScript | lgpl-2.1 | fjalvingh/domui,fjalvingh/domui,fjalvingh/domui,fjalvingh/domui,fjalvingh/domui,fjalvingh/domui,fjalvingh/domui |
f5484310a9e52d1c7786d111486882dd94959a98 | src/website/app/demos/Flex/components/Flex.js | src/website/app/demos/Flex/components/Flex.js | /* @flow */
import { createStyledComponent, pxToEm } from '../../../../../library/styles';
import _Flex from '../../../../../library/Flex';
type Props = {
gutterWidth?: number | string,
theme: Object
};
export const containerStyles = ({
gutterWidth: propGutterSize,
theme
}: Props) => {
const gutterWidth = p... | /* @flow */
import { createStyledComponent, pxToEm } from '../../../../../library/styles';
import _Flex from '../../../../../library/Flex';
type Props = {
gutterWidth?: number | string,
theme: Object
};
export const containerStyles = ({
gutterWidth: propGutterSize,
theme
}: Props) => {
const gutterWidth = p... | Fix display issue with Layout examples | chore(website): Fix display issue with Layout examples
| JavaScript | apache-2.0 | mineral-ui/mineral-ui,mineral-ui/mineral-ui |
979bf24a28e95f6975fde020b002426eafe5f3e6 | static/js/activity-23andme-complete-import.js | static/js/activity-23andme-complete-import.js | $(function () {
var params = {'data_type': '23andme_names'};
$.ajax({
'type': 'GET',
'url': '/json-data/',
'data': params,
'success': function(data) {
if (data.profiles && data.profiles.length > 0) {
for (var i = 0; i < data.profiles.length; i++) {
... | $(function () {
var params = {'data_type': '23andme_names'};
$.ajax({
'type': 'GET',
'url': '/json-data/',
'data': params,
'success': function(data) {
if (data.profiles && data.profiles.length > 0) {
for (var i = 0; i < data.profiles.length; i++) {
var radioElem = $('<input ... | Fix JS to use 2-space tabs | Fix JS to use 2-space tabs
| JavaScript | mit | PersonalGenomesOrg/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans |
0100ebf9a24675a16ec200caf894af862196589c | d3/js/wgaPipeline.js | d3/js/wgaPipeline.js | /**
* Creates an object of type wgaPipeline for drawing whole genome alignment visualizations
* @author Markus Ankenbrand <markus.ankenbrand@uni-wuerzburg.de>
* @constructor
* @param {Object} svg - jQuery object containing a svg DOM element. Visualizations will be drawn on this svg. Size may be changed by object m... | /**
* Creates an object of type wgaPipeline for drawing whole genome alignment visualizations
* @author Markus Ankenbrand <markus.ankenbrand@uni-wuerzburg.de>
* @constructor
* @param {Object} svg - jQuery object containing a svg DOM element. Visualizations will be drawn on this svg. Size may be changed by object m... | Test for existence of setData method passes | Test for existence of setData method passes
| JavaScript | mit | BioInf-Wuerzburg/AliTV,BioInf-Wuerzburg/AliTV,AliTVTeam/AliTV,BioInf-Wuerzburg/AliTV,BioInf-Wuerzburg/AliTV,BioInf-Wuerzburg/AliTV,BioInf-Wuerzburg/AliTV,AliTVTeam/AliTV |
c74647dae08d8d5f55a3d68de956a37b1fccec0e | assets/main.js | assets/main.js | function do_command(item, command, val) {
var data = {};
data[item] = command;
if (val != undefined) {
data["value"] = val;
}
$.get("/CMD", data);
}
function do_scene(scene, action) {
$.get("/api/scene/" + scene + "/command/" + (action?action:""));
}
$(function() {
$(".command").each(fun... | function do_command(item, command, val) {
var data = {};
if (val != undefined) {
data["val"] = val;
}
$.get("/api/item/" + item + "/command/" + command, data);
}
function do_scene(scene, action) {
$.get("/api/scene/" + scene + "/command/" + (action?action:""));
}
$(function() {
$(".command")... | Update javascript to use native API | Update javascript to use native API
| JavaScript | mit | idiotic/idiotic-webui,idiotic/idiotic-webui,idiotic/idiotic-webui |
3bc142f44ebd589227eec3660c72640fdfa7a238 | bl/pipeline.js | bl/pipeline.js | var TaskScheduler = require("./task").TaskScheduler;
var colors = require("colors");
exports.execute = function(initialStep, context, cb) {
var completedSteps = 0;
var estimatedSteps = initialStep.remaining;
var scheduler = new TaskScheduler({
maxConcurrency: 5,
mode: "lifo"
}, cb);
scheduler.schedule(execu... | var TaskScheduler = require("./task").TaskScheduler;
var colors = require("colors");
exports.execute = function(initialStep, context, cb) {
var completedSteps = 0;
var estimatedSteps = initialStep.remaining;
var scheduler = new TaskScheduler({
maxConcurrency: 5,
mode: "lifo"
}, cb);
scheduler.schedule(execu... | Add current date to polling log messages. | Add current date to polling log messages.
| JavaScript | mit | aaubry/feed-reader,aaubry/feed-reader |
56e784e7e966ccff9ba29b658ebd31406a868987 | lib/paymaya/core/HttpConnection.js | lib/paymaya/core/HttpConnection.js | module.exports = HttpConnection;
var request = require('requestretry');
var HttpConfig = require("./HttpConfig");
var PaymayaApiError = require("./PaymayaApiError");
function HttpConnection(httpConfig) {
this._httpConfig = httpConfig;
};
HttpConnection.prototype = {
/* PUBLIC FUNCTIONS */
execute: function(data,... | module.exports = HttpConnection;
var request = require('requestretry');
var HttpConfig = require("./HttpConfig");
var PaymayaApiError = require("./PaymayaApiError");
function HttpConnection(httpConfig) {
this._httpConfig = httpConfig;
};
HttpConnection.prototype = {
/* PUBLIC FUNCTIONS */
execute: function(data,... | Modify displaying of error message | Modify displaying of error message
| JavaScript | mit | PayMaya/PayMaya-Node-SDK |
bb85a90b6941c8f6d20b2cc6e15359d7daf9b461 | src/authentication/sessions.js | src/authentication/sessions.js | 'use strict';
export default {
setup,
};
/**
* Module dependencies.
*/
import SequelizeStore from 'koa-generic-session-sequelize';
import session from 'koa-generic-session';
/**
* Prepares session middleware and methods without attaching to the stack
*
* @param {Object} router
* @param {Object} settings
* ... | 'use strict';
export default {
setup,
};
/**
* Module dependencies.
*/
import SequelizeStore from 'koa-generic-session-sequelize';
import convert from 'koa-convert';
import session from 'koa-generic-session';
/**
* Prepares session middleware and methods without attaching to the stack
*
* @param {Object} set... | Add missing file from last commit | Add missing file from last commit
| JavaScript | mit | HiFaraz/identity-desk |
1e2aa246a558447455dba80c4f49e5f9cdbb00c7 | test/read-only-parallel.js | test/read-only-parallel.js | const test = require('tape')
const BorrowState = require('../lib/module.js')
const sleep50ms = require('./sleep.js')
const countTo = require('./count-to.js')
;[true, false].forEach((unsafe) => {
test(`read-only-parallel (${unsafe ? 'un' : ''}safe)`, (t) => {
t.plan(3)
t.timeoutAfter(100)
let myState = n... | const test = require('tape')
const BorrowState = require('../lib/module.js')
const sleep50ms = require('./sleep.js')
const countTo = require('./count-to.js')
;[true, false].forEach((unsafe) => {
test(`read-only-parallel (${unsafe ? 'un' : ''}safe)`, (t) => {
t.plan(6)
t.timeoutAfter(100)
let myState = n... | Make sure to count up test additions | Make sure to count up test additions
| JavaScript | isc | jamescostian/borrow-state |
b948a9b149394932a0d3bf8a957a8792e23510ae | front_end/.eslintrc.js | front_end/.eslintrc.js | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const path = require('path');
const rulesDirPlugin = require('eslint-plugin-rulesdir');
rulesDirPlugin.RULES_DIR = path.join(__dirname, '..', 'scripts', '... | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const path = require('path');
const rulesDirPlugin = require('eslint-plugin-rulesdir');
rulesDirPlugin.RULES_DIR = path.join(__dirname, '..', 'scripts', '... | Enforce camelCase for private and protected class members | Enforce camelCase for private and protected class members
This encodes some of the TypeScript style guides about identifiers
https://google.github.io/styleguide/tsguide.html#identifiers
(in particular the rules our codebase already adheres to).
The automatic enforcement will save time during code reviews.
The current... | JavaScript | bsd-3-clause | ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend |
c7329c1c5347ca2f453c41aeb0f479edc4050187 | app/assets/javascripts/hyrax/browse_everything.js | app/assets/javascripts/hyrax/browse_everything.js | //= require jquery.treetable
//= require browse_everything/behavior
// Show the files in the queue
Blacklight.onLoad( function() {
// We need to check this because https://github.com/samvera/browse-everything/issues/169
if ($('#browse-btn').length > 0) {
$('#browse-btn').browseEverything()
.done(function(d... | //= require jquery.treetable
//= require browse_everything/behavior
// Show the files in the queue
function showBrowseEverythingFiles() {
// We need to check this because https://github.com/samvera/browse-everything/issues/169
if ($('#browse-btn').length > 0) {
$('#browse-btn').browseEverything()
.done(fun... | Fix loading of browse-everything done event | Fix loading of browse-everything done event
Avoids situations where the prototype browseEverything() function has not been defined yet.
| JavaScript | apache-2.0 | samvera/hyrax,samvera/hyrax,samvera/hyrax,samvera/hyrax |
443a4ae12198f757370e95cf9e2de12aae9f710f | app/assets/javascripts/pages/new/new.component.js | app/assets/javascripts/pages/new/new.component.js | (function(){
'use strict'
const New = {
templateUrl: 'pages/new/new.html'
// templateUrl: 'components/bookmarks/bookmark-search.html',
// controller: 'NewController'
// controllerAs: 'model'
}
angular
.module("shareMark")
.component("new", New);
}());
| (function(){
'use strict'
const New = {
templateUrl: 'pages/new/new.html',
controller: 'NewController',
controllerAs: 'model'
}
angular
.module("shareMark")
.component("new", New);
}());
| Update NewComponent to use NewController | Update NewComponent to use NewController
| JavaScript | mit | Dom-Mc/shareMark,Dom-Mc/shareMark,Dom-Mc/shareMark |
17e546f1a58744f7fe2f4e80147f6df2a203a2ee | esbuild/frappe-html.js | esbuild/frappe-html.js | module.exports = {
name: "frappe-html",
setup(build) {
let path = require("path");
let fs = require("fs/promises");
build.onResolve({ filter: /\.html$/ }, (args) => {
return {
path: path.join(args.resolveDir, args.path),
namespace: "frappe-html",
};
});
build.onLoad({ filter: /.*/, namespace... | module.exports = {
name: "frappe-html",
setup(build) {
let path = require("path");
let fs = require("fs/promises");
build.onResolve({ filter: /\.html$/ }, (args) => {
return {
path: path.join(args.resolveDir, args.path),
namespace: "frappe-html",
};
});
build.onLoad({ filter: /.*/, namespace... | Revert "fix: allow backtick in HTML templates as well" | Revert "fix: allow backtick in HTML templates as well"
This reverts commit 2f96458bcb6dfe8b8db4ef0101036b09bfa7c5f5.
| JavaScript | mit | StrellaGroup/frappe,StrellaGroup/frappe,frappe/frappe,frappe/frappe,StrellaGroup/frappe,frappe/frappe |
7f009627bc82b67f34f93430152da71767be0029 | packages/rear-system-package/config/app-paths.js | packages/rear-system-package/config/app-paths.js | const fs = require('fs');
const path = require('path');
const resolveApp = require('rear-core/resolve-app');
const ownNodeModules = fs.realpathSync(
path.join(__dirname, '..', 'node_modules')
);
const AppPaths = {
ownNodeModules,
root: resolveApp('src'),
appIndexJs: resolveApp('src', 'index.js'),
// TODO: r... | const fs = require('fs');
const path = require('path');
const resolveApp = require('rear-core/resolve-app');
let ownNodeModules;
try {
// Since this package is also used to build other packages
// in this repo, we need to make sure its dependencies
// are available when is symlinked by lerna.
// Normally, mod... | Fix an issue that prevented modules to be resolved | Fix an issue that prevented modules to be resolved
rear-system-package's config/app-paths.js was trying to resolve
node_modules from inside the dependency. This is needed when
rear-system-package is symlinked. Normally node_modules paths should
be resolved from the app's node_modules.
| JavaScript | mit | erremauro/rear,rearjs/rear |
314b2f1b8350b64e29824257cef48f142d4c152f | test/index.js | test/index.js | 'use strict';
const chai = require('chai');
const plate = require('../index');
const expect = chai.expect;
describe('Those postal codes', function() {
it('should be valid', function() {
expect(plate.validate('10188')).to.be.true;
expect(plate.validate('49080')).to.be.true;
});
});
describe('Those posta... | 'use strict';
const chai = require('chai');
const postalCode = require('../index');
const expect = chai.expect;
describe('Those postal codes', function() {
it('should be valid', function() {
expect(postalCode.validate('10188')).to.be.true;
expect(postalCode.validate('49080')).to.be.true;
});
});
descri... | Fix wrong naming in tests | Fix wrong naming in tests
| JavaScript | mit | alefteris/greece-postal-code |
b77fd67ee02329bd25fe224689dcd8434262c282 | src/finders/JumpPointFinder.js | src/finders/JumpPointFinder.js | /**
* @author aniero / https://github.com/aniero
*/
var DiagonalMovement = require('../core/DiagonalMovement');
var JPFNeverMoveDiagonally = require('./JPFNeverMoveDiagonally');
var JPFAlwaysMoveDiagonally = require('./JPFAlwaysMoveDiagonally');
var JPFMoveDiagonallyIfNoObstacles = require('./JPFMoveDiagonallyIfNoObs... | /**
* @author aniero / https://github.com/aniero
*/
var DiagonalMovement = require('../core/DiagonalMovement');
var JPFNeverMoveDiagonally = require('./JPFNeverMoveDiagonally');
var JPFAlwaysMoveDiagonally = require('./JPFAlwaysMoveDiagonally');
var JPFMoveDiagonallyIfNoObstacles = require('./JPFMoveDiagonallyIfNoObs... | Fix exception on missing options object | Fix exception on missing options object
If the JumpPointFinder constructor was not passed the options object there
was a ReferenceError.
| JavaScript | bsd-3-clause | radify/PathFinding.js,radify/PathFinding.js |
9edb7717b460685efaff9b2974daa9b776bd2921 | share/spice/urban_dictionary/urban_dictionary.js | share/spice/urban_dictionary/urban_dictionary.js | // `ddg_spice_urban_dictionary` is a callback function that gets
// "urban dictionary cool" or "urban dictionary ROTFL."
// Note: This plugin can display adult content and profanity.
function ddg_spice_urban_dictionary(response) {
"use strict";
if (!(response || response.response.result_type === "exact"
... | // `ddg_spice_urban_dictionary` is a callback function that gets
// "urban dictionary cool" or "urban dictionary ROTFL."
// Note: This plugin can display adult content and profanity.
function ddg_spice_urban_dictionary(response) {
"use strict";
if (!(response || response.response.result_type === "exact"
||... | Fix whitespace tabs-versus-spaces conflict in Urban_dictionary Spice. | Fix whitespace tabs-versus-spaces conflict in Urban_dictionary Spice.
| JavaScript | apache-2.0 | alexandernext/zeroclickinfo-spice,rubinovitz/zeroclickinfo-spice,ppant/zeroclickinfo-spice,TomBebbington/zeroclickinfo-spice,Dwaligon/zeroclickinfo-spice,bibliotechy/zeroclickinfo-spice,ScreapDK/zeroclickinfo-spice,cylgom/zeroclickinfo-spice,tagawa/zeroclickinfo-spice,bibliotechy/zeroclickinfo-spice,samskeller/zeroclic... |
7888270cc70a99be1c0fc20945a9684d66a69134 | examples/client/app.js | examples/client/app.js | angular.module('MyApp', ['ngResource', 'ngMessages', 'ngRoute', 'ngAuth', 'mgcrea.ngStrap'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/home.html',
controller: 'HomeCtrl'
})
.when('/login', {
templateUrl: 'views/l... | angular.module('MyApp', ['ngResource', 'ngMessages', 'ngRoute', 'ngAuth', 'mgcrea.ngStrap'])
.config(['$routeProvider', 'AuthProvider', function($routeProvider, AuthProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/home.html',
controller: 'HomeCtrl'
})
.when('/login', {... | Move AuthProvider into first config block | Move AuthProvider into first config block
| JavaScript | mit | hsr-ba-fs15-dat/satellizer,gshireesh/satellizer,bnicart/satellizer,jskrzypek/satellizer,jskrzypek/satellizer,johan--/satellizer,vebin/satellizer,TechyTimo/CoderHunt,celrenheit/satellizer,maciekrb/satellizer,maciekrb/satellizer,david300/satellizer,ELAPAKAHARI/satellizer,gregoriusxu/satellizer,maciekrb/satellizer,rick447... |
1771ab50f1a5d3dbe06871a26bdfa31882e393ac | test/setup.js | test/setup.js | // From https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md
var jsdom = require('jsdom').jsdom;
var exposedProperties = ['window', 'navigator', 'document'];
global.document = jsdom('');
global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
if (typeof global[p... | // From https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md
var jsdom = require('jsdom').jsdom;
var exposedProperties = ['window', 'navigator', 'document'];
global.document = jsdom('');
global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
if (typeof global[p... | Add mocks for menu tests | Add mocks for menu tests
| JavaScript | bsd-3-clause | jdetle/nteract,jdfreder/nteract,jdetle/nteract,nteract/nteract,0u812/nteract,0u812/nteract,nteract/nteract,captainsafia/nteract,temogen/nteract,jdetle/nteract,nteract/composition,rgbkrk/nteract,nteract/nteract,0u812/nteract,captainsafia/nteract,nteract/composition,temogen/nteract,rgbkrk/nteract,rgbkrk/nteract,captainsa... |
662828ef56046bc7830718ef897a4ebbefd50278 | examples/utils/embedly.js | examples/utils/embedly.js | // @flow
const getJSON = (
endpoint: string,
data: ?{},
successCallback: ({
url: string,
title: string,
author_name: string,
thumbnail_url: string,
}) => void,
) => {
const request = new XMLHttpRequest();
request.open("GET", endpoint, true);
request.setRequestHeader("Content-Type", "appli... | // @flow
type Embed = {
url: string,
title: string,
author_name: string,
thumbnail_url: string,
html: string,
};
const getJSON = (
endpoint: string,
data: ?{},
successCallback: (embed: Embed) => void,
) => {
const request = new XMLHttpRequest();
request.open("GET", endpoint, true);
request.setRe... | Support retrieving embed HTML in Embedly integration | Support retrieving embed HTML in Embedly integration
| JavaScript | mit | springload/draftail,springload/draftail,springload/draftail,springload/draftail |
05c19987d3f569aa892d50755c757a6356e4a9f1 | environments/react/v15.js | environments/react/v15.js | /**
* Js-coding-standards
*
* @author Robert Rossmann <rr.rossmann@me.com>
* @copyright 2016 STRV
* @license http://choosealicense.com/licenses/bsd-3-clause BSD-3-Clause License
*/
'use strict'
module.exports = {
extends: [
'./recommended.js',
'./accessibility.js',
],
rules: {
'o... | /**
* Js-coding-standards
*
* @author Robert Rossmann <rr.rossmann@me.com>
* @copyright 2016 STRV
* @license http://choosealicense.com/licenses/bsd-3-clause BSD-3-Clause License
*/
'use strict'
module.exports = {
extends: [
'./recommended.js',
'./accessibility.js',
],
rules: {
'o... | Fix console still being turned off for react env | Fix console still being turned off for react env
| JavaScript | bsd-3-clause | strvcom/js-coding-standards,strvcom/eslint-config-javascript,strvcom/eslint-config-javascript |
d607447c7a4ee04fd559ba44f4fbb07ad42b8453 | src/components/Counter.js | src/components/Counter.js | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import * as counterActions from '../actions/counterActions';
import { dispatch } from '../store';
@connect(state => ({
counter: state.counter,
}))
export class Counter extends Component {
static propTypes = {
counter: PropT... | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import * as counterActions from '../actions/counterActions';
import { dispatch } from '../store';
@connect(state => ({
counter: state.counter,
}))
export class Counter extends Component {
static propTypes = {
counter: PropT... | Add defaultProps and initial state. | Add defaultProps and initial state.
| JavaScript | mit | autozimu/react-hot-boilerplate,autozimu/react-hot-boilerplate |
8999a66c88e56bc769bded0fe1ec17e0360682b5 | src/core/cb.main/main.js | src/core/cb.main/main.js | function setup(options, imports, register) {
// Import
var server = imports.server.http;
var port = imports.server.port;
var watch = imports.watch;
var workspace = imports.workspace;
var logger = imports.logger.namespace("codebox");
// Start server
server.listen(port);
server.on('l... | function setup(options, imports, register) {
// Import
var server = imports.server.http;
var port = imports.server.port;
var watch = imports.watch;
var workspace = imports.workspace;
var logger = imports.logger.namespace("codebox");
// Start server
server.listen(port);
server.on('l... | Change init of watch and server | Change init of watch and server
| JavaScript | apache-2.0 | rajthilakmca/codebox,code-box/codebox,code-box/codebox,fly19890211/codebox,etopian/codebox,nobutakaoshiro/codebox,indykish/codebox,Ckai1991/codebox,fly19890211/codebox,CodeboxIDE/codebox,lcamilo15/codebox,kustomzone/codebox,lcamilo15/codebox,ronoaldo/codebox,ronoaldo/codebox,listepo/codebox,rajthilakmca/codebox,indykis... |
68bb8489b6fe7b2466159b2e5b9e08c21c466588 | src/button.js | src/button.js | const React = require('react');
const classNames = require('classnames');
class Button extends React.Component {
render() {
const {
className,
children,
type,
...props
} = this.props;
const buttonClassNames = classNames({
btn: true,
'btn-sm': this.props.size === 'smal... | const React = require('react');
const classNames = require('classnames');
class Button extends React.Component {
render() {
const {
className,
children,
theme,
...props
} = this.props;
const buttonClassNames = classNames({
btn: true,
'btn-sm': this.props.size === 'sma... | Change `type` prop to `theme` | Change `type` prop to `theme`
| JavaScript | mit | Opstarts/opstarts-ui |
b41e1a78f7ac0fa996b290391273cd70d6375193 | test/components/control.js | test/components/control.js | import React from 'react/addons';
let find = React.addons.TestUtils.findRenderedDOMComponentWithTag;
let render = React.addons.TestUtils.renderIntoDocument;
let Control = reqmod('components/control');
/**
* Control components are those little icon based buttons, which can be toggled
* active.
*/
describe('compo... | import React from 'react/addons';
let find = React.addons.TestUtils.findRenderedDOMComponentWithTag;
let render = React.addons.TestUtils.renderIntoDocument;
let Control = reqmod('components/control');
// Since we don't want React warnings about some deprecated stuff being spammed
// in our test run, we disable the... | Add an override to console.warn for testing to suppress React warnings. | Add an override to console.warn for testing to suppress React warnings.
| JavaScript | mit | melonmanchan/teamboard-client-react,JanKuukkanen/Oauth-client-react,JanKuukkanen/Oauth-client-react,N4SJAMK/teamboard-client-react,tanelih/teamboard-client-react,melonmanchan/teamboard-client-react,santtusulander/teamboard-client-react,N4SJAMK/teamboard-client-react,santtusulander/teamboard-client-react,nikolauska/team... |
fd876469738834dc91e5ce179e2ccd9bc18ab37a | ui/app/serializers/node.js | ui/app/serializers/node.js | import { assign } from '@ember/polyfills';
import { inject as service } from '@ember/service';
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
config: service(),
attrs: {
isDraining: 'Drain',
httpAddr: 'HTTPAddr',
},
normalize(modelClass, hash) {
/... | import { assign } from '@ember/polyfills';
import { inject as service } from '@ember/service';
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
config: service(),
attrs: {
isDraining: 'Drain',
httpAddr: 'HTTPAddr',
},
normalize(modelClass, hash) {
/... | Fix a bug where the NodeListStub API response would override existing HostVolumes in the store | Fix a bug where the NodeListStub API response would override existing HostVolumes in the store
| JavaScript | mpl-2.0 | hashicorp/nomad,hashicorp/nomad,dvusboy/nomad,burdandrei/nomad,burdandrei/nomad,dvusboy/nomad,hashicorp/nomad,hashicorp/nomad,hashicorp/nomad,hashicorp/nomad,burdandrei/nomad,burdandrei/nomad,burdandrei/nomad,dvusboy/nomad,dvusboy/nomad,dvusboy/nomad,dvusboy/nomad,burdandrei/nomad,dvusboy/nomad,burdandrei/nomad |
0b9bed076bac3f942e904a5e8388880af515ced0 | api/db/user.js | api/db/user.js | 'use strict'
module.exports = function (sequelize, DataTypes) {
let User = sequelize.define('User', {
id: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: DataTypes.UUIDV4
},
email: {
type: DataTypes.STRING,
allowNull: false
},
password: {
type: DataType... | 'use strict'
module.exports = function (sequelize, DataTypes) {
let User = sequelize.define('User', {
id: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: DataTypes.UUIDV4
},
email: {
type: DataTypes.STRING,
allowNull: false
},
password: {
type: DataType... | Use literal function for citext array default value, not string | Use literal function for citext array default value, not string
| JavaScript | bsd-3-clause | FuelRats/api.fuelrats.com,FuelRats/api.fuelrats.com,FuelRats/api.fuelrats.com |
ed6eed2c1f589c179cb57d9386f29cbfdbf1fc37 | packages/rocketchat-ui-sidenav/client/sidebarItem.js | packages/rocketchat-ui-sidenav/client/sidebarItem.js | /* globals menu */
Template.sidebarItem.helpers({
canLeave() {
const roomData = Session.get(`roomData${ this.rid }`);
if (!roomData) { return false; }
if (((roomData.cl != null) && !roomData.cl) || (roomData.t === 'd')) {
return false;
} else {
return true;
}
}
});
Template.sidebarItem.events({
'... | /* globals menu popover */
Template.sidebarItem.helpers({
canLeave() {
const roomData = Session.get(`roomData${ this.rid }`);
if (!roomData) { return false; }
if (((roomData.cl != null) && !roomData.cl) || (roomData.t === 'd')) {
return false;
} else {
return true;
}
}
});
Template.sidebarItem.eve... | Add leave and hide buttons again | Add leave and hide buttons again | JavaScript | mit | NexFive/DrustChat,NexFive/DrustChat,NexFive/DrustChat,NexFive/DrustChat |
461893aac3ec8cd55caa2946b015891a9daff0cc | lib/engine/buildDigest.js | lib/engine/buildDigest.js | const _ = require('lodash'),
fstate = require('../util/fstate'),
digest = require('../util/digest'),
hashcache = require('../util/hashcache'),
log = require('../util/log')
;
function buildDigest(buildDir, cb) {
fstate(buildDir, { includeDirectories: true }, (err, files) => {
if (err) return cb(err);
... | const _ = require('lodash'),
fstate = require('../util/fstate'),
digest = require('../util/digest'),
hashcache = require('../util/hashcache'),
log = require('../util/log')
;
function buildDigest(buildDir, cb) {
fstate(buildDir, (err, files) => {
if (err) return cb(err);
const buildId = digest(_.m... | Exclude directories from build digest. | Exclude directories from build digest.
| JavaScript | mit | Iceroad/martinet,Iceroad/martinet,Iceroad/martinet |
de04f9e1f50dc38e70cb4b47271829042dc9b301 | client/reducers/index.js | client/reducers/index.js | import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import { reducer as formReducer } from 'redux-form';
import auth from './userSignUp';
import login from './login';
import book from './book';
import favorites from './favorites';
import profile from './profile';
import { books,... | import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import { reducer as formReducer } from 'redux-form';
import auth from './userSignUp';
import login from './login';
import book from './book';
import favorites from './favorites';
import profile from './profile';
import addBook ... | Add addBook reducer to root reducer | Add addBook reducer to root reducer
| JavaScript | mit | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books |
a7af375c66552df8a73f945679b1ff01f95c6f36 | client/webpack.common.js | client/webpack.common.js | const path = require('path');
const cleanWebPackPlugin = require('clean-webpack-plugin');
module.exports = {
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/',
},
plugins: [
new cleanWebPackPlugin(['dist']),
],
module: {
rules: [
{
... | const path = require('path');
const cleanWebPackPlugin = require('clean-webpack-plugin');
module.exports = {
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/',
},
plugins: [
new cleanWebPackPlugin(['dist']),
],
module: {
rules: [
{
... | Set up hot module replacement for react components | Set up hot module replacement for react components
| JavaScript | mit | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.