commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 624 | message stringlengths 15 4.7k | lang stringclasses 3
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
93c7fafada259af365e9f98a2d9a139f528052ae | config/dev.js | config/dev.js | // Rollup plugins.
import babel from 'rollup-plugin-babel'
import cjs from 'rollup-plugin-commonjs'
import globals from 'rollup-plugin-node-globals'
import replace from 'rollup-plugin-replace'
import resolve from 'rollup-plugin-node-resolve'
export default {
dest: 'build/app.js',
entry: 'src/index.js',
format: '... | // Rollup plugins.
import babel from 'rollup-plugin-babel'
import cjs from 'rollup-plugin-commonjs'
import globals from 'rollup-plugin-node-globals'
import replace from 'rollup-plugin-replace'
import resolve from 'rollup-plugin-node-resolve'
export default {
dest: 'build/app.js',
entry: 'src/index.js',
format: '... | Include create-react-class in Rollup configuration :newspaper:. | Include create-react-class in Rollup configuration :newspaper:.
| JavaScript | mit | yamafaktory/babel-react-rollup-starter,yamafaktory/babel-react-rollup-starter |
a65fae011bce4e2ca9a920b51a0fc681ee21c178 | components/hoc/with-errors.js | components/hoc/with-errors.js | import React from 'react'
import PropTypes from 'prop-types'
import hoist from 'hoist-non-react-statics'
import ErrorPage from '../../pages/_error'
export default Page => {
const Extended = hoist(class extends React.Component {
static propTypes = {
error: PropTypes.object
}
static defaultProps = ... | import React from 'react'
import PropTypes from 'prop-types'
import hoist from 'hoist-non-react-statics'
import ErrorPage from '../../pages/_error'
export default Page => {
const Extended = hoist(class extends React.Component {
static propTypes = {
error: PropTypes.object
}
static defaultProps = ... | Set server statusCode on error | Set server statusCode on error
| JavaScript | mit | sgmap/inspire,sgmap/inspire |
29211d88af3f1820293637f23680a4f24656c32e | src/models/send-to-api.js | src/models/send-to-api.js | 'use strict';
const { addOauthHeader } = require('@clevercloud/client/cjs/oauth.node.js');
const { prefixUrl } = require('@clevercloud/client/cjs/prefix-url.js');
const { request } = require('@clevercloud/client/cjs/request.request.js');
const { conf, loadOAuthConf } = require('../models/configuration.js');
async fun... | 'use strict';
const { addOauthHeader } = require('@clevercloud/client/cjs/oauth.node.js');
const { prefixUrl } = require('@clevercloud/client/cjs/prefix-url.js');
const { request } = require('@clevercloud/client/cjs/request.superagent.js');
const { conf, loadOAuthConf } = require('../models/configuration.js');
async ... | Use @clevercloud/client superagent helper instead of request | Use @clevercloud/client superagent helper instead of request
| JavaScript | apache-2.0 | CleverCloud/clever-tools,CleverCloud/clever-tools,CleverCloud/clever-tools |
106c51e36add35f2b98bcf940c98363e707d2acb | public/javascripts/labelingGuidePanelResize.js | public/javascripts/labelingGuidePanelResize.js | function checkWindowSize(){
var w = document.documentElement.clientWidth;
var panel = document.getElementById("help-panel");
if (w < 978) {
panel.style.position = "static";
panel.style.width = "auto";
} else if (w >= 978 && w < 1184) {
panel.style.position = "fixed";
pane... | function checkWindowSize(){
var w = document.documentElement.clientWidth;
var panel = document.getElementById("help-panel");
if (w < 978) {
panel.style.position = "static";
panel.style.width = "auto";
} else if (w >= 978 && w < 1184) {
panel.style.position = "fixed";
pane... | Add newline to end of file | Add newline to end of file
| JavaScript | mit | ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage |
870c1e1c0b1fa98430331689da51fb15c563895a | test/unitSpecs/commonSpec.js | test/unitSpecs/commonSpec.js | /**
* Created by rgwozdz on 8/15/15.
*/
var moduleUnderTest = require("../../app/common.js")
var assert = require('chai').assert;
var equal = require('deep-equal');
describe('common.js module', function() {
describe('parseQueryOptions', function () {
it('should return expected Object with properties and... | /**
* Created by rgwozdz on 8/15/15.
*/
var moduleUnderTest = require("../../app/common.js")
var assert = require('chai').assert;
var equal = require('deep-equal');
describe('common.js module', function() {
describe('parseQueryOptions', function () {
it('should return expected Object with properties and... | Adjust unit test expected result. | Adjust unit test expected result.
| JavaScript | apache-2.0 | Cadasta/cadasta-api,Cadasta/cadasta-api,Cadasta/cadasta-api |
d6a80dc1d374a88d771c3bd7aad0cad91c67bd03 | core/server/api/sandstorm.js | core/server/api/sandstorm.js | // # Sandstorm API
// RESTful API for the Sandstorm resource
var capnp = require('capnp'),
url = require('url'),
sandstorm;
var HackSession = capnp.importSystem("hack-session.capnp");
var publicIdPromise;
var initPromise = function () {
if (!publicIdPromise) {
var connection =... | // # Sandstorm API
// RESTful API for the Sandstorm resource
var capnp = require('capnp'),
url = require('url'),
_ = require('lodash'),
sandstorm;
var HackSession = capnp.importSystem("hack-session.capnp");
var publicIdPromise;
var initPromise = function () {
if (!pub... | Fix bug in returning autoUrl for Sandstorm | Fix bug in returning autoUrl for Sandstorm
| JavaScript | mit | jparyani/GhostSS,jparyani/GhostSS,jparyani/GhostSS |
f95b32c8678ca2814dca9b502a7bb592fb287c24 | web/static/js/reducers/idea.js | web/static/js/reducers/idea.js | const idea = (state = [], action) => {
switch (action.type) {
case "SET_IDEAS":
return action.ideas
case "ADD_IDEA":
return [...state, action.idea]
case "UPDATE_IDEA":
return state.map(idea => {
return (idea.id === action.ideaId) ? Object.assign({}, idea, action.newAttributes) : ... | const idea = (state = [], action) => {
switch (action.type) {
case "SET_IDEAS":
return action.ideas
case "ADD_IDEA":
return [...state, action.idea]
case "UPDATE_IDEA":
return state.map(idea => {
return (idea.id === action.ideaId) ? { ...idea, ...action.newAttributes } : idea
... | Use spread operator rather than Object.assign | Use spread operator rather than Object.assign
| JavaScript | mit | stride-nyc/remote_retro,samdec11/remote_retro,stride-nyc/remote_retro,stride-nyc/remote_retro,tnewell5/remote_retro,tnewell5/remote_retro |
34049a1d776a4bb7c9b397fee63da30faa2bc30b | api/actions/boardgames/loadFromBGG.js | api/actions/boardgames/loadFromBGG.js | import request from 'request';
import { parseString } from 'xml2js';
export default function loadFromBGG(req) {
return new Promise((resolve, reject) => {
request({
url: `http://www.boardgamegeek.com/xmlapi2/search?query=${req.query.q}&type=boardgame`,
timeout: 10000
}, (error, response, body) => ... | import request from 'request';
import { parseString } from 'xml2js';
export default function loadFromBGG(req) {
return new Promise((resolve, reject) => {
request({
url: `http://www.boardgamegeek.com/xmlapi2/search?query=${req.query.q}&type=boardgame`,
timeout: 10000
}, (error, response, body) => ... | Comment out sorting function for now | Comment out sorting function for now
| JavaScript | mit | fuczak/pipsy |
35ad895d4885e3caf9cc7c3073c78bd2c13ad32d | samples/VanillaJSTestApp/app/b2c/authConfig.js | samples/VanillaJSTestApp/app/b2c/authConfig.js | // Config object to be passed to Msal on creation
const msalConfig = {
auth: {
clientId: "e760cab2-b9a1-4c0d-86fb-ff7084abd902",
authority: "https://fabrikamb2c.b2clogin.com/fabrikamb2c.onmicrosoft.com/b2c_1_susi",
knownAuthorities: ["fabrikamb2c.b2clogin.com"]
},
cache: {
ca... | // Config object to be passed to Msal on creation
const msalConfig = {
auth: {
clientId: "5dac5d6d-225c-4a98-a5e4-e29c82c0c4c9",
authority: "https://public.msidlabb2c.com/tfp/cpimtestpartners.onmicrosoft.com/b2c_1_signupsignin_userflow",
knownAuthorities: ["public.msidlabb2c.com"]
},
... | Update with lab app registration | Update with lab app registration
| JavaScript | mit | AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication... |
109da2da9a35318d59060400833d4378c7622b6f | app/assets/javascripts/application.js | app/assets/javascripts/application.js | /* global $ */
/* global GOVUK */
// Warn about using the kit in production
if (
window.sessionStorage && window.sessionStorage.getItem('prototypeWarning') !== 'false' &&
window.console && window.console.info
) {
window.console.info('GOV.UK Prototype Kit - do not use for production')
window.sessionStorage.setI... | /* global $ */
/* global GOVUK */
// Warn about using the kit in production
if (window.console && window.console.info) {
window.console.info('GOV.UK Prototype Kit - do not use for production')
}
$(document).ready(function () {
// Use GOV.UK shim-links-with-button-role.js to trigger a link styled to look like a bu... | Fix JS error in Safari’s Private Browsing mode | Fix JS error in Safari’s Private Browsing mode
Safari in Private Browsing mode sets a session storage quota of 0 which means that attempts to write to it result in a QuotaExceededError being thrown, breaking JavaScript on the rest of the page.
The existing code is flawed in that it sets `prototypeWarning` to true but... | JavaScript | mit | dwpdigitaltech/hrt-prototype,gavinwye/govuk_prototype_kit,dwpdigitaltech/hrt-prototype,joelanman/govuk_prototype_kit,benjeffreys/hmcts-idam-proto,joelanman/govuk_prototype_kit,benjeffreys/hmcts-idam-proto,alphagov/govuk_prototype_kit,alphagov/govuk_prototype_kit,hannalaakso/accessible-timeout-warning,joelanman/govuk_pr... |
3d782cc9f93ae645ef9eb4f8fafbf57117aa111c | lib/init.js | lib/init.js | var _ = require('lodash');
module.exports = function(grunt) {
var module = {};
module.domain = function() {
return process.env.GRUNT_DRUPAL_DOMAIN || grunt.config('config.domain') || require('os').hostname();
};
// Ensure a default URL for the project.
module.siteUrls = function() {
return grunt.co... | var _ = require('lodash');
module.exports = function(grunt) {
var module = {};
module.domain = function() {
return process.env.GRUNT_DRUPAL_DOMAIN || grunt.config('config.domain') || require('os').hostname();
};
// Ensure a default URL for the project.
module.siteUrls = function() {
return grunt.co... | Remove stray variable breaking defaultUrl calculation. | Remove stray variable breaking defaultUrl calculation.
| JavaScript | mit | AndBicScadMedia/grunt-drupal-tasks,EvanLovely/grunt-drupal-tasks,phase2/grunt-drupal-tasks,EvanLovely/grunt-drupal-tasks,AndBicScadMedia/grunt-drupal-tasks,phase2/grunt-drupal-tasks,EvanLovely/grunt-drupal-tasks,phase2/grunt-drupal-tasks,AndBicScadMedia/grunt-drupal-tasks,AndBicScadMedia/grunt-drupal-tasks,EvanLovely/g... |
980fc6cfc3702645eafd18dc46d9a399ca7fb3ad | lib/mime.js | lib/mime.js | /*!
* YUI Mocha
* Copyright 2011 Yahoo! Inc.
* Licensed under the BSD license.
*/
/**
* @module mime
*/
/**
* File extension to MIME type map.
*
* Used by `serve.js` when streaming files from disk.
*
* @property contentTypes
* @type object
*/
this.contentTypes = {
"css": "text/css",
"html": "text/htm... | /*!
* YUI Mocha
* Copyright 2011 Yahoo! Inc.
* Licensed under the BSD license.
*/
/**
* @module mime
*/
/**
* File extension to MIME type map.
*
* Used by `serve.js` when streaming files from disk.
*
* @property contentTypes
* @type object
*/
this.contentTypes = {
"css": "text/css",
"html": "text/htm... | Use same .xml MIME type as rgrove/combohandler. | Use same .xml MIME type as rgrove/combohandler.
| JavaScript | bsd-3-clause | reid/onyx,reid/onyx |
1b3faf12cf97bc2a534c941a59ac026ab49e0565 | src/numbers.js | src/numbers.js | 'use strict';
/**
*
* @param {integer } digit
* @returns {string} Returns Nepali converted string of given digit or numbers.
* @example
*
* numbers(2090873)
* // => २०९०८७३
*
* numbers()
* // => false
*
*/
function numbers (digit) {
if(!digit) {
console.log("@numbers: Yuck, got nothin... | 'use strict';
/**
*
* @param {integer } digit
* @returns {string} Returns Nepali converted string of given digit or numbers.
* @example
*
* numbers(2090873)
* // => २०९०८७३
*
* numbers()
* // => false
*
*/
function numbers (digit) {
const isdigit = parseInt(digit, 10);
if(typeof isdigit !... | Check typeof of given value | Check typeof of given value
| JavaScript | mit | shekhardesigner/NepaliDateConverter |
452ff1c3ce7ae04695f640b8b4e642f724d6be55 | lib/util.js | lib/util.js | 'use strict';
/**
* Retrieve a localized configuration value or the default if the localization
* is unavailable.
*
* @param {String} configuration value
* @param {String} language
* @param {Object} Hexo configuration object
* @param {String} Hexo locals object
* @returns {*} localized or default configuratio... | 'use strict';
/**
* Retrieve a localized configuration value or the default if the localization
* is unavailable.
*
* @param {String} configuration value
* @param {String} language
* @param {Object} Hexo configuration object
* @param {String} Hexo locals object
* @returns {*} localized or default configuratio... | Check for undefined localized values | Check for undefined localized values
Fixes #2.
| JavaScript | mit | ahaasler/hexo-multilingual |
3984d6e214a81837361a3a65a405b84344b54120 | app/modules/main/directives/Header.js | app/modules/main/directives/Header.js | 'use strict';
header.$inject = ['$rootScope', '$state', 'AuthService'];
function header($rootScope, $state, AuthService) {
return {
name: 'header',
template: require('./templates/header.html'),
scope: true,
link: function link(scope) {
scope.toggled = false;
... | 'use strict';
header.$inject = ['$rootScope', '$state', 'AuthService'];
function header($rootScope, $state, AuthService) {
return {
name: 'header',
template: require('./templates/header.html'),
scope: true,
link: function link(scope) {
scope.toggled = false;
... | Set logout button to reload state if current state is 'home' | Set logout button to reload state if current state is 'home'
| JavaScript | mit | zdizzle6717/hapi-angular-stack,zdizzle6717/hapi-angular-stack |
1ef82c281c5df2ded7dd4f1954fc0beb34e53899 | tasks/sismd.js | tasks/sismd.js | /* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
marked.setOptions({
breaks : true,
highlight: function(code, lang) {
var result = hljs.highlight(lang, co... | /* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
var renderer = new marked.Renderer();
var oldLink = renderer.link;
renderer.link = function(href, title, text) {
if (... | Fix a bug in documentation generation | Fix a bug in documentation generation
| JavaScript | bsd-3-clause | sis-cmdb/sis-ui,sis-cmdb/sis-ui |
ad25532c3601d23df11a23b8295cfc753a79e2ec | spec/javascripts/fixtures/educatorsViewJson.js | spec/javascripts/fixtures/educatorsViewJson.js | export default {
"id": 101,
"email": "hugo@demo.studentinsights.org",
"admin": false,
"full_name": "Teacher, Hugo",
"staff_type": null,
"schoolwide_access": false,
"grade_level_access": [],
"restricted_to_sped_students": false,
"restricted_to_english_language_learners": false,
"can_view_restricted_n... | export default {
"id": 101,
"email": "hugo@demo.studentinsights.org",
"admin": false,
"full_name": "Teacher, Hugo",
"staff_type": null,
"schoolwide_access": false,
"grade_level_access": [],
"restricted_to_sped_students": false,
"restricted_to_english_language_learners": false,
"can_view_restricted_n... | Fix lint error in JS fixture | Fix lint error in JS fixture
| JavaScript | mit | studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights |
cbec8ddeaa98e7510e2616f18f64df8340dd97e0 | src/item-button.js | src/item-button.js | import { select } from 'd3';
import Item from './item';
export default class ButtonItem extends Item {
constructor() {
super();
this._root
.classed('button', true)
.styles({
'background': '#FFF',
'cursor': 'pointer',
'height': '3em',
'justify-content': 'center'
... | import Item from './item';
export default class ButtonItem extends Item {
constructor() {
super();
this._root
.classed('button', true)
.styles({
'background': '#FFF',
'cursor': 'pointer',
'height': '3em',
'justify-content': 'center',
'padding': '0.5em 0'
... | Add padding to button item | Add padding to button item
| JavaScript | mit | scola84/node-d3-list |
e0b595bb8e631c29add7d486db9dc84285bab3f3 | public/js/admin.js | public/js/admin.js | window.admin = {};
$(document).ready(function() {
$("#admin-feedback").on("tabOpened", function() {
window.api.get("admin/feedback/getList", function(resp) {
$("#admin-feedback-list").text("");
for (var feedbackIndex in resp.feedback) {
var feedbackItem = resp.feedback[feedbackIndex];
var $feedbackLi ... | window.admin = {};
$(document).ready(function() {
$("#admin-feedback").on("tabOpened", function() {
window.api.get("admin/feedback/getList", function(resp) {
$("#admin-feedback-list").text("");
for (var feedbackIndex in resp.feedback) {
var feedbackItem = resp.feedback[feedbackIndex];
var $feedbackLi ... | Add username to feedback entries | Add username to feedback entries | JavaScript | mit | MyHomeworkSpace/MyHomeworkSpace,PlanHubMe/PlanHub,MyHomeworkSpace/MyHomeworkSpace,PlanHubMe/PlanHub,MyHomeworkSpace/MyHomeworkSpace |
44d11c878d7085b3ec320041f3182156497be91b | src/tests/setup.js | src/tests/setup.js | import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import 'jest-enzyme'; // better matchers
Enzyme.configure({
adapter: new Adapter(),
});
| import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import 'jest-enzyme'; // better matchers
Enzyme.configure({
adapter: new Adapter(),
});
if (process.env.CI) {
// Hide all console output
console.log = jest.fn();
console.warn = jest.fn();
console.error = jest.fn();
}
| Disable console output in Travis | Disable console output in Travis
| JavaScript | agpl-3.0 | sMteX/WoWAnalyzer,fyruna/WoWAnalyzer,enragednuke/WoWAnalyzer,ronaldpereira/WoWAnalyzer,anom0ly/WoWAnalyzer,sMteX/WoWAnalyzer,Juko8/WoWAnalyzer,hasseboulen/WoWAnalyzer,FaideWW/WoWAnalyzer,yajinni/WoWAnalyzer,Juko8/WoWAnalyzer,hasseboulen/WoWAnalyzer,Juko8/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,sMteX/WoWAnalyzer,ronaldperei... |
22098b256358982f8a845b05242465db33edd008 | src/utils/fetch.js | src/utils/fetch.js | /**
* Fetch module.
* @module base/utils/fetch
*/
import fetchJsonP from 'fetch-jsonp'
export var defaultOptions = {
credentials: 'same-origin'
}
export var defaultJsonpOptions = {
timeout: 5000,
jsonpCallback: 'callback',
jsonpCallbackFunction: null
}
export function checkStatus(response) {
if (respon... | /**
* Fetch module.
* @module base/utils/fetch
*/
import fetchJsonP from 'fetch-jsonp'
export var defaultOptions = {
credentials: 'same-origin',
headers: {
'http_x_requested_with': 'fetch'
}
}
export var defaultJsonpOptions = {
timeout: 5000,
jsonpCallback: 'callback',
jsonpCallbackFunction: null
... | Send http_x_requested_with header to be able to check for ajax request | Send http_x_requested_with header to be able to check for ajax request
| JavaScript | mit | Goldinteractive/js-base,Goldinteractive/js-base |
36dfe83249242444a747a2c97c1febce3b0c173b | lib/job.js | lib/job.js | var events = require('events');
var util = require('util');
module.exports = Job;
function Job(collection, data) {
this.collection = collection;
if(data){
data.__proto__ = JobData.prototype; //Convert plain object to JobData type
this.data = data;
} else {
this.data = new JobData()... | var events = require('events');
var util = require('util');
module.exports = Job;
function Job(collection, data) {
this.collection = collection;
if(data){
data.__proto__ = JobData.prototype; //Convert plain object to JobData type
this.data = data;
} else {
this.data = new JobData()... | Use toString instead of toHexString | Use toString instead of toHexString
| JavaScript | mit | trsouz/monq,dhritzkiv/monq,dioscouri/nodejs-monq,arifsetiawan/monq,saintedlama/monq,Santinell/monq,deployable/monq,scttnlsn/monq |
a0bfebc24d8eec171cbca7696a3823c388b543c1 | src/components/Activity.js | src/components/Activity.js | import React, { Component, PropTypes } from 'react';
import moment from 'moment';
class Activity extends Component {
render() {
const { timestamp, activity, deleteActivity } = this.props;
return (
<div className="row row--middle">
<div className="col--2">
<p>{moment(+timestamp).form... | import React, { Component, PropTypes } from 'react';
import moment from 'moment';
class Activity extends Component {
render() {
const { timestamp, activity, deleteActivity } = this.props;
return (
<div className="row row--middle">
<div className="col--4">
<p>
{activity.d... | Remove date string from activity | Remove date string from activity
| JavaScript | mit | mknudsen01/today,mknudsen01/today |
9a26b6c509419f91726a4b31c93931540ddd33f0 | src/components/GameList.js | src/components/GameList.js | import React from 'react';
import '../styles/games.css';
export default class GameList extends React.Component {
constructor(props) {
super(props);
this.state = {games: []};
}
componentWillReceiveProps(nextProps) {
let games = [];
nextProps.games.forEach(game => {
... | import React from 'react';
import '../styles/games.css';
export default class GameList extends React.Component {
constructor(props) {
super(props);
this.state = {games: []};
}
componentWillReceiveProps(nextProps) {
let games = [];
nextProps.games.forEach(game => {
... | Call onSelect event when a game is clicked. | Call onSelect event when a game is clicked.
| JavaScript | mit | Julzso23/player.me-one-click-share,Julzso23/player.me-one-click-share |
2e0235e8495dd47dcbf15fd2bd6e012d5d615054 | bin/codeclimate.js | bin/codeclimate.js | #!/usr/bin/env node
var Formatter = require("../formatter");
var client = require('../http_client');
process.stdin.resume();
process.stdin.setEncoding("utf8");
var input = "";
process.stdin.on("data", function(chunk) {
input += chunk;
});
process.stdin.on("end", function() {
formatter = new Formatter... | #!/usr/bin/env node
var Formatter = require("../formatter");
var client = require('../http_client');
process.stdin.resume();
process.stdin.setEncoding("utf8");
var input = "";
process.stdin.on("data", function(chunk) {
input += chunk;
});
process.stdin.on("end", function() {
formatter = new Formatter... | Add ability to print to stdout instead of POSTing | Add ability to print to stdout instead of POSTing
| JavaScript | mit | kyroskoh/javascript-test-reporter,therebelbeta/javascript-test-reporter,codeclimate/javascript-test-reporter,buildkite/javascript-test-reporter |
6b701f707390938a069ab5742a15668e5c03f91d | src/custom-rx-operators.js | src/custom-rx-operators.js | import {Observable, Disposable} from 'rx';
Observable.prototype.subUnsub = function(onSub=null, onUnsub=null) {
return Observable.create((subj) => {
if (onSub) onSub();
let d = this.subscribe(subj);
return Disposable.create(() => {
if (onUnsub) onUnsub();
d.dispose();
});
});
};
... | import {Observable, Disposable} from 'rx';
Observable.prototype.subUnsub = function(onSub=null, onUnsub=null) {
return Observable.create((subj) => {
if (onSub) onSub();
let d = this.subscribe(subj);
return Disposable.create(() => {
if (onUnsub) onUnsub();
d.dispose();
});
});
};
... | Add an operator to delay failures | Add an operator to delay failures
| JavaScript | mit | surf-build/surf,surf-build/surf,surf-build/surf,surf-build/surf |
18a6a22170a2f0d4adb304351cd2c073942586b1 | reporters/tap.js | reporters/tap.js | /**
* Results formatter for --format=tap
*
* @see http://podwiki.hexten.net/TAP/TAP.html?page=TAP
* @see https://github.com/isaacs/node-tap
*/
var Producer = require('tap').Producer;
module.exports = function(results) {
// public API
return {
render: function() {
var metrics = results.getMetricsNames(),
... | /**
* Results formatter for --format=tap
*
* @see http://podwiki.hexten.net/TAP/TAP.html?page=TAP
* @see https://github.com/isaacs/node-tap
*/
var Producer = require('tap').Producer;
module.exports = function(results) {
// public API
return {
render: function() {
var metrics = results.getMetricsNames(),
... | Format YAMLish properly to make it work in Jenkins | Format YAMLish properly to make it work in Jenkins
| JavaScript | bsd-2-clause | william-p/phantomas,ingoclaro/phantomas,william-p/phantomas,gmetais/phantomas,ingoclaro/phantomas,william-p/phantomas,macbre/phantomas,ingoclaro/phantomas,macbre/phantomas,gmetais/phantomas,gmetais/phantomas,macbre/phantomas |
0d1917939110865a62136dc6d66fac5749574881 | app/controllers/application.js | app/controllers/application.js | import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service(),
isExpanded: true,
isNotLogin: Ember.computed('this.currentPath', function() {
if (this.currentPath !== 'login') {
return true;
} else {
return false;
}
})... | import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service(),
isExpanded: true,
isNotLogin: Ember.computed('currentPath', function() {
return this.get('currentPath') !== 'login';
}),
sizeContainer: function() {
var winWidth = Ember.$(window).wi... | Fix display artifact that prevented sidebar from showing after login, until page was refreshed | Fix display artifact that prevented sidebar from showing after login, until page was refreshed
[#LEI-294]
| JavaScript | apache-2.0 | abought/experimenter,abought/experimenter |
268db5ed4558028c630c3b03bcd9b5cd4a578686 | app/js/services.js | app/js/services.js | (function() {
'use strict';
/* Services */
angular.module('myApp.services', [])
// put your services here!
// .service('serviceName', ['dependency', function(dependency) {}]);
.service('messageList', ['fbutil', function(fbutil) {
return fbutil.syncArray('messages', {limit: 10, endAt... | (function() {
'use strict';
/* Services */
angular.module('myApp.services', [])
// put your services here!
// .service('serviceName', ['dependency', function(dependency) {}]);
.factory('messageList', ['fbutil', function(fbutil) {
return fbutil.syncArray('messages', {limit: 10, endAt... | Switch service with factory (it's not a Class called with new) | Switch service with factory (it's not a Class called with new)
| JavaScript | mit | birdwell/Fantasy-Football,kmarwah/Seed,rawrsome/angularfire-seed,harish-myaccount/vigilante,russellf9/diary,u910328/Coding-Parrot-2.1,timothy-clifford/dashshelf,snowpeame/snowpeas,JonBergman/angularfire-seed,morganric/wildfirio,morganric/wildfirio,robotnoises/angularfire-seed,pmconnolly80/angularfire-seed,dialectica/an... |
319871c7b722c2a540ba48c9fe0fdfe07df9fef5 | app/assets/javascripts/sw.js | app/assets/javascripts/sw.js | console.log('Started', self);
self.addEventListener('install', function(event) {
self.skipWaiting();
console.log('Installed', event);
});
self.addEventListener('activate', function(event) {
console.log('Activated', event);
});
self.addEventListener('push', function(event) {
if (event.data) {
var json = even... | console.log('Started', self);
self.addEventListener('install', function(event) {
self.skipWaiting();
console.log('Installed', event);
});
self.addEventListener('activate', function(event) {
console.log('Activated', event);
});
self.addEventListener('push', function(event) {
if (event.data) {
var json = even... | Add ability to launch arb url from push | Add ability to launch arb url from push
| JavaScript | mit | coreyja/glassy-collections,coreyja/glassy-collections,coreyja/glassy-collections |
f9faf808f414ae53d372fe3ad5b4c6ca9b6e86c9 | src/webroot/js/fancybox.js | src/webroot/js/fancybox.js | /**
* Call the fancybox for displaying organism details in a lightbox
*/
$(".fancybox").fancybox({
maxWidth: 1000,
maxHeight: 800
}); | /**
* Call the fancybox for displaying organism details in a lightbox
*/
$(".fancybox").fancybox({
minWidth: 1000,
maxWidth: 1000,
maxHeight: 800,
minHeight: 800
}); | Set size of fancy box | Set size of fancy box
| JavaScript | mit | molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec |
88207533c117a9ccc89f0d0b0e4a74fb97b6c821 | scripts/offsets.js | scripts/offsets.js | 'use strict';
const exec = require('child_process').execSync;
const ios = require('./contours-ios.json');
const web = require('./contours-web.json');
const fs = require('fs');
var offsets = {};
for (let font in web) {
const offset = {
x: web[font].x - ios[font].x,
y: web[font].y - ios[font].y
... | "use strict";
const exec = require("child_process").execSync;
const ios = require("./contours-ios.json");
const web = require("./contours-web.json");
const fs = require("fs");
var offsets = {};
for (let font in web) {
const offset = {
x: web[font].x - ios[font].x,
y: web[font].y - ios[font].y,
... | Update script to add top inset | Update script to add top inset
| JavaScript | mit | ninjaprox/TextContour,ninjaprox/TextContour,ninjaprox/TextContour,ninjaprox/TextContour |
f486e827dbfa258cbb051fd0ba08da86940ba066 | test/tests-test.js | test/tests-test.js | var buster = require("buster");
var firestarter = require('../')();
buster.testCase('Test testing framework', {
'Test' : function(){
'use strict';
assert(firestarter.config.testValue);
}
}); | var buster = require("buster");
var firestarter = require('../')();
buster.testCase('Test testing framework', {
'Test' : function(){
'use strict';
assert(!firestarter.config.testValue);
}
}); | Test of Travis failing build | Test of Travis failing build
| JavaScript | mit | davewilliamson/firestarter |
0c0fa72464530d3a9896a18d9b752626835dc1b2 | ui/src/registrator/PrihlaskyDohlasky/Platby/NovaPlatbaInputContainer.js | ui/src/registrator/PrihlaskyDohlasky/Platby/NovaPlatbaInputContainer.js | import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import InputContainer from '../Input/InputContainer';
import { inputChanged } from './PlatbyActions';
import {
formatValue,
inputOptions,
inputValid,
isInputEnabled,
isInputVisible
} from './platbyReducer';
const mapStateToProps = (st... | import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import InputContainer from '../Input/InputContainer';
import { inputChanged } from './PlatbyActions';
import {
formatValue,
inputOptions,
inputValid,
isInputEnabled,
isInputVisible
} from './platbyReducer';
const mapStateToProps = (st... | Unify component name and filename. | Unify component name and filename.
| JavaScript | mit | ivosh/jcm2018,ivosh/jcm2018,ivosh/jcm2018 |
4ed6fd92ad2f2b3b4088842d544e2154c4302b49 | src/rules/accessible-emoji.js | src/rules/accessible-emoji.js | /**
* @fileoverview Enforce emojis are wrapped in <span> and provide screenreader access.
* @author Ethan Cohen
*/
// ----------------------------------------------------------------------------
// Rule Definition
// ----------------------------------------------------------------------------
import emojiRegex fro... | /**
* @fileoverview Enforce emojis are wrapped in <span> and provide screenreader access.
* @author Ethan Cohen
*/
// ----------------------------------------------------------------------------
// Rule Definition
// ----------------------------------------------------------------------------
import emojiRegex fro... | Return just a boolean from find | Return just a boolean from find
| JavaScript | mit | evcohen/eslint-plugin-jsx-a11y,jessebeach/eslint-plugin-jsx-a11y |
0d56522d9ae59d9d62c6787421cfcc4daf489a92 | src/util/define-properties.js | src/util/define-properties.js | export default function (obj, props) {
Object.keys(props).forEach(function (name) {
const desc = Object.getOwnPropertyDescriptor(obj, name);
if (!desc || desc.configurable) {
Object.defineProperty(obj, name, props[name]);
}
});
} | export default function (obj, props) {
Object.keys(props).forEach(function (name) {
const prop = props[name];
const descrptor = Object.getOwnPropertyDescriptor(obj, name);
const isDinosaurBrowser = name !== 'arguments' && name !== 'caller' && 'value' in prop;
const isConfigurable = !descrptor || descr... | Make defining properties more robust for opera 12 or any browser that thinks things are non-configurable. | Make defining properties more robust for opera 12 or any browser that thinks things are non-configurable.
| JavaScript | mit | chrisdarroch/skatejs,skatejs/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs |
117802c072678f1eab4fd12474b22e3d12226678 | GitEventChecker/routes/index.js | GitEventChecker/routes/index.js | var express = require('express'),
router = express.Router(),
net = require('net'),
fs = require('fs'),
socketPath = '/tmp/haproxy';
/* GET home page. */
router.post('/', function(req, res) {
// console.log(req.body);
// you can get commit information from request body
var client = net.createConnection(socketP... | var express = require('express'),
router = express.Router(),
net = require('net'),
fs = require('fs'),
socketPath = '/tmp/haproxy';
/* GET home page. */
router.post('/', function(req, res) {
// console.log(req.body);
// you can get commit information from request body
var client = net.createConnection(socketP... | Change command result receive part | Change command result receive part
| JavaScript | mit | PontoServerSide/LiveUpdater |
65b9ec6e02399db66b51a4a15f3c52fe2ee04b9a | src/app/main/main.controller.js | src/app/main/main.controller.js | class MainController {
constructor(_, $scope, $state, $log, SocketService) {
'ngInject';
this._ = _;
this.$log = $log;
this.$state = $state;
this.$scope = $scope;
this.SocketService = SocketService;
this.name = '';
this.password = '';
this.errorMessage = '';
this.processing = ... | class MainController {
constructor(_, $scope, $state, $log, SocketService) {
'ngInject';
this._ = _;
this.$log = $log;
this.$state = $state;
this.$scope = $scope;
this.SocketService = SocketService;
this.name = '';
this.password = '';
this.errorMessage = '';
this.processing = ... | Save game_id when joining game | Save game_id when joining game
| JavaScript | mit | hendryl/Famous-Places-Mobile,hendryl/Famous-Places-Mobile |
b42d2aa652b987865d3a6f55f601b98f21a76137 | lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/size/legend-size-types.js | lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/size/legend-size-types.js | var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carous... | var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
var styleHelper = require('builder/helpers/style');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('bui... | Refactor bubble legend compatibility rules with styles for clarity | Refactor bubble legend compatibility rules with styles for clarity
| JavaScript | bsd-3-clause | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb |
86e0ecae9697c9a7a10eddff320fb3679f5b22a2 | lib/api/search.js | lib/api/search.js | function select(database, options, callback) {
var results = [];
database.command('select', options, function(error, data) {
if (error) {
callback(error);
} else {
var columnNames = [];
var i, j;
for (j = 0; j < data[0][1].length; j++) {
columnNames[j] = data[0][1][j][0];
... | var resolver = require('../resolver');
function select(database, options, callback) {
var results = [];
database.command('select', options, function(error, data) {
if (error) {
callback(error);
} else {
var columnNames = [];
var i, j;
for (j = 0; j < data[0][1].length; j++) {
... | Use resolver to resolve the table name | Use resolver to resolve the table name
| JavaScript | mit | groonga/gcs,groonga/gcs |
52c04555ff2c5c7e4f41eaa3cd422e9d386dfdee | lib/index.js | lib/index.js |
var math = require('mathjs');
var ERROR_RESPONSE = 'I can\'t calculate that!';
module.exports = function(argv, response) {
var respBody;
try {
var expression = argv.slice(1).join('');
respBody = math.eval(expression).toString();
} catch(e) {
console.error(e);
respBody = ERROR_RESPONSE;
}
... |
var math = require('mathjs');
var ERROR_RESPONSE = 'I can\'t calculate that!';
module.exports = function(argv, response) {
var respBody = ERROR_RESPONSE;
try {
var expression = argv.slice(1).join('');
var result = math.eval(expression);
if (typeof result === 'function') {
console.error('Someh... | Check for weird function results | Check for weird function results
| JavaScript | mit | elvinyung/scalk |
e2ede78fcf2076a40835909e9c5e01a76fdf1424 | js/markdown-toc.js | js/markdown-toc.js | /**
* User: powerumc
* Date: 2014. 5. 18.
*/
$(function() {
$(function () {
$.ajax({
url: "Requirements.md",
type: "GET",
success: function (data) {
var html = marked(data);
$("#preview").html(html);
var toc = $("#toc").tocify({
context: "#preview",
selectors: "h1, h2, h3, h4, h5... | /**
* User: powerumc
* Date: 2014. 5. 18.
*/
$(function() {
$(function () {
$.ajax({
url: "Requirements.md",
type: "GET",
success: function (data) {
var html = marked(data);
$("#preview").html(html);
var toc = $("#toc").tocify({
context: "#preview",
selectors: "h1, h2, h3, h4",
... | Remove h5, h6 from tocify configuration parameters | Remove h5, h6 from tocify configuration parameters
| JavaScript | mit | ernstki/TeamMachine-Docs,ernstki/TeamMachine-Docs,ernstki/TeamMachine-Docs |
71b158d08ea4ba715d3054da430c93e91dfcedbf | lib/index.js | lib/index.js | "use strict";
// Dependencies
const readJson = require("r-json")
, writeJson = require("w-json")
, mapO = require("map-o")
, ul = require("ul")
, findValue = require("find-value")
;
/**
* packy
* Sets the default fields in the package.json file.
*
* @name packy
* @function
* @param {String} ... | "use strict";
// Dependencies
const readJson = require("r-json")
, writeJson = require("w-json")
, mapO = require("map-o")
, ul = require("ul")
, findValue = require("find-value")
;
/**
* packy
* Sets the default fields in the package.json file.
*
* @name packy
* @function
* @param {String} ... | Send the data in the functions | Send the data in the functions
| JavaScript | mit | IonicaBizau/packy |
3b53fc0ff2a2ecb022f35926d37a1a0f140ae640 | lib/utils.js | lib/utils.js | 'use strict';
module.exports = {
getAuthorizedAclMethods,
};
function getAuthorizedAclMethods(Model) {
let authorizedMethods = [];
let acls = Model.definition.settings.acls || [];
acls.forEach((acl) => {
if (acl.permission === 'ALLOW' && acl.property) {
if (!Array.isArray(acl.property)) {
a... | 'use strict';
module.exports = {
getAuthorizedAclMethods,
};
function getAuthorizedAclMethods(Model) {
let authorizedMethods = [];
let acls = Model.settings.acls || [];
acls.forEach((acl) => {
if (acl.permission === 'ALLOW' && acl.property) {
if (!Array.isArray(acl.property)) {
acl.property... | Use Model.settings.acls to get the acls | Use Model.settings.acls to get the acls
Use `Model.settings.acls` to get the acls instead of `Model.definition.settings.acl`. `Model.definition` is an artifact created by datasource-juggler, but it wouldn't exists if you just use `loopback.createModel()`. | JavaScript | mit | devsu/loopback-setup-remote-methods-mixin |
ff5f0558be982d50aa74991051b676ec4c263482 | src/main/webapp/resources/js/pages/samples/edit.js | src/main/webapp/resources/js/pages/samples/edit.js | $(document).ready(function(){
/**
* Serialize metadata to json for submission
*/
$("#edit-form").submit(function(){
var metadata = {};
$("#other-metadata").find(".metadata-entry").each(function(){
var entry = $(this);
var key = entry.find(".metadata-key").val();... | $(document).ready(function(){
/**
* Serialize metadata to json for submission
*/
$("#edit-form").submit(function(){
var metadata = {};
$("#other-metadata").find(".metadata-entry").each(function(){
var entry = $(this);
var key = entry.find(".metadata-key").val();... | Check to see if there is actually metadata to add. | Check to see if there is actually metadata to add.
| JavaScript | apache-2.0 | phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida |
494ecc627106cb7f9532f88db97b5d2f45fa23dc | src/main/webapp/components/BuilderDataTable.js | src/main/webapp/components/BuilderDataTable.js | import * as React from 'react';
const HEADERS = ['no', 'text', 'log'];
/**
* Table responsible for storing the data for a builder.
*
* @param {Object[]} props.buildSteps - The build steps for a given builder.
* @param {string} props.buildSteps[].step_number - The relative order of the build step.
* @param {strin... | import * as React from 'react';
import {getFields} from './utils/getFields';
// The target fields to be extracted from each build step
// and displayed on each row.
const BUILD_STEP_FIELDS = ['step_number', 'text', 'logs'];
// Headers to display at the top of the table.
const HEADERS = ['no.', 'text', 'log'];
/**
*... | Read build step fields from array, Update comments | Read build step fields from array, Update comments
| JavaScript | apache-2.0 | googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020 |
a658a63b42244b826fbe2daee2b7509749681623 | src/dialog-action-directives.js | src/dialog-action-directives.js | function dialogClose() {
return {
restrict: 'EA',
require: '^dialog',
scope: {
returnValue: '=?return'
},
link(scope, element, attrs, dialog) {
element.on('click', function() {
scope.$apply(() => {
dialog.close(scope... | function dialogClose() {
return {
restrict: 'EA',
require: '^dialog',
scope: {
returnValue: '=?return'
},
link(scope, element, attrs, dialog) {
element.on('click', function() {
scope.$apply(() => {
dialog.close(scope... | Fix injection in show dialog button directive | Fix injection in show dialog button directive
| JavaScript | mit | olympicsoftware/oly-dialog,olympicsoftware/oly-dialog |
5bbc62fe150789c63b557fab36b56781ba329f0b | app/components/Feed/context.js | app/components/Feed/context.js | // @flow
import React from 'react';
import { Link } from 'react-router';
import type { AggregatedActivity } from './types';
export function lookupContext(
aggregatedActivity: AggregatedActivity,
key: string
) {
return aggregatedActivity.context[key];
}
export const contextRender = {
'users.user': (context: Ob... | // @flow
import React from 'react';
import { Link } from 'react-router';
import type { AggregatedActivity } from './types';
export function lookupContext(
aggregatedActivity: AggregatedActivity,
key: string
) {
return aggregatedActivity.context[key];
}
export const contextRender = {
'users.user': (context: Ob... | Add support for notifications on gallery.gallerypicture | Add support for notifications on gallery.gallerypicture
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp |
c0002c7f3a62e90b62e9f821b4f13c80bdbae324 | chat.js | chat.js | var chat = angular.module('chat', ['btford.socket-io']);
var channel = new Channel('hellas');
var me = null;
chat.factory('chatServer', function (socketFactory) {
var url = '/';
if (location.port != '') {
url = ':' + location.port + '/';
}
return socketFactory({ioSocket: io.connect(url)})
});... | var chat = angular.module('chat', ['btford.socket-io']);
var channel = new Channel('hellas');
var me = null;
chat.factory('chatServer', function (socketFactory) {
var url = '/';
if (location.port != '') {
url = ':' + location.port + '/';
}
return socketFactory({ioSocket: io.connect(url)})
});... | Join channel and register on reconnect | Join channel and register on reconnect
| JavaScript | mit | gtklocker/ting,odyvarv/ting-1,odyvarv/ting-1,sirodoht/ting,gtklocker/ting,odyvarv/ting-1,dionyziz/ting,dionyziz/ting,mbalamat/ting,sirodoht/ting,sirodoht/ting,mbalamat/ting,mbalamat/ting,dionyziz/ting,gtklocker/ting,VitSalis/ting,gtklocker/ting,dionyziz/ting,sirodoht/ting,VitSalis/ting,VitSalis/ting,odyvarv/ting-1,VitS... |
3f855c3b1e7b0a6ce546fa9e422fd478a5eb1f1c | modules/recent-activity/server/controllers/recent-activity.controller.js | modules/recent-activity/server/controllers/recent-activity.controller.js | 'use strict';
// =========================================================================
//
// Controller for orgs
//
// =========================================================================
var path = require('path');
var DBModel = require (path.resolve('./modules/core/server/controllers/core.dbmodel.... | 'use strict';
// =========================================================================
//
// Controller for orgs
//
// =========================================================================
var path = require('path');
var DBModel = require (path.resolve('./modules/core/server/controllers/core.dbmodel.... | Fix news & announcements to be reverse sorted. | Fix news & announcements to be reverse sorted.
| JavaScript | apache-2.0 | logancodes/esm-server,logancodes/esm-server,logancodes/esm-server |
9d1ce946bb52111a738fac77d1512f0c4127f4c3 | src/pages/page-2.js | src/pages/page-2.js | import React from "react"
import Link from "gatsby-link"
import Helmet from "react-helmet"
export default class Index extends React.Component {
render() {
return (
<div>
<h1>Hi people</h1>
<p>Welcome to page 2</p>
<Link to="/">Go back to the homepage</Link>
</div>
)
}
}
| import React from "react"
import Link from "gatsby-link"
import Helmet from "react-helmet"
export default class Page2 extends React.Component {
render() {
return (
<div>
<h1>Hi people</h1>
<p>Welcome to page 2</p>
<Link to="/">Go back to the homepage</Link>
</div>
)
}
}
| Use more sensible class name | Use more sensible class name
| JavaScript | mit | TasGuerciMaia/tasguercimaia.github.io,benruehl/gatsby-kruemelkiste |
b2a119f8d4685e96a2bf338ab1a933b9bba13b27 | unit/poller/index.js | unit/poller/index.js | var mqtt = require('mqtt');
var SensorTag = require('sensortag');
var client = mqtt.connect('mqtt://tree:tree@m11.cloudmqtt.com:19539');
client.on('connect', function () {
client.publish('sensor', "foo");
SensorTag.discoverAll(function (sensorTag) {
console.log('Sensor found: ' + sensorTag);
sensorTag.connectAn... | var mqtt = require('mqtt');
var SensorTag = require('sensortag');
var client = mqtt.connect('mqtt://tree:tree@m11.cloudmqtt.com:19539');
client.on('connect', function () {
SensorTag.discoverAll(function (sensorTag) {
console.log('Sensor found: ' + sensorTag);
sensorTag.connectAndSetUp(function (error) {
if (e... | Send temperature, humidity to server | Send temperature, humidity to server
| JavaScript | mit | jphacks/KB_12,jphacks/KB_12,jphacks/KB_12,jphacks/KB_12,mikoim/mori,mikoim/mori,jphacks/KB_12,mikoim/mori,mikoim/mori,mikoim/mori |
da5e854055509992103561f5134dea0ef094bec9 | test/components/Posts.spec.js | test/components/Posts.spec.js | import { expect } from 'chai';
import { shallow } from 'enzyme';
import React from 'react';
import Posts from '../../src/js/components/Posts';
import PostPreview from '../../src/js/components/PostPreview';
describe('<Posts/>', () => {
const posts = [
{ id: 0, title: 'First Post' },
{ id: 1, title: 'Second Po... | import { expect } from 'chai';
import { shallow, mount } from 'enzyme';
import React from 'react';
import { MemoryRouter as Router } from 'react-router-dom';
import Posts from '../../src/js/components/Posts';
import PostPreview from '../../src/js/components/PostPreview';
describe('<Posts/>', () => {
const posts = [
... | Test passing tag to <Posts> | Test passing tag to <Posts>
| JavaScript | mit | slavapavlutin/pavlutin-node,slavapavlutin/pavlutin-node |
37eae0ebce6e466319ac991a2b810b7a260ffb7d | src/views/Browse.js | src/views/Browse.js | import React from 'react';
import { connect } from 'react-redux';
import { fetchRecipes, setSearchTerm } from '../actions/';
import Header from '../components/Header';
import SearchHeader from '../components/SearchHeader';
import Card from '../components/Card';
class Browse extends React.Component {
constructor(prop... | import React from 'react';
import { connect } from 'react-redux';
import { fetchRecipes, setSearchTerm } from '../actions/';
import Header from '../components/Header';
import SearchHeader from '../components/SearchHeader';
import Card from '../components/Card';
class Browse extends React.Component {
constructor(prop... | Change the browse page layout temporarily | Change the browse page layout temporarily
| JavaScript | mit | hihuz/meny,hihuz/meny |
930326fafe7a14b472fece345572c184de542a6e | lib/auths/index.js | lib/auths/index.js | const gatherResources = require('../utils/gatherResources')
const auth = [
'options',
'token'
]
module.exports = gatherResources(auth, __dirname)
| const gatherResources = require('../utils/gatherResources')
const auth = [
'options',
'token',
'oauth2',
'couchdb'
]
module.exports = gatherResources(auth, __dirname)
| Include oauth2 and couchdb auth in `integreat.auths()` | Include oauth2 and couchdb auth in `integreat.auths()`
| JavaScript | isc | kjellmorten/integreat |
1563437daf745c6ba5dcc3b732241c7a9b9c523b | transformers/lib/child_proc.js | transformers/lib/child_proc.js | var spawn = require('child_process').spawn;
var which = require('which');
module.exports.transformer = childProcTransformer;
module.exports.transform = childProcTransform;
function childProcTransformer(prog, transformer) {
var cmd = which.sync(prog);
if (!cmd) return noopTransformer;
return subTransformer... | var spawn = require('child_process').spawn;
var _which = require('which');
function which (prog) {
try {
return _which.sync(prog);
} catch (err) {
if (err.message === 'not found: ' + prog) {
return null;
} else {
throw err;
}
}
}
module.exports.trans... | Correct which to not through... | Correct which to not through...
...this was the whole point of it.
| JavaScript | mit | jcorbin/lesspipe.js |
098185af723d83e2ace531d0644b1cda414d8bcd | lib/tasks/serve.js | lib/tasks/serve.js | 'use strict';
module.exports = function(gulp, $, config, _) {
var proxyTarget = _.get(config, 'proxy.url', config.consts.proxy.url);
var proxyPrefixes = _.get(config, 'proxy.prefixes', config.consts.proxy.prefixes);
var proxy = $.httpProxy.createProxyServer({
target: proxyTarget
});
function isProxiedPrefix... | 'use strict';
module.exports = function(gulp, $, config, _) {
var proxyTarget = _.get(config, 'proxy.url', config.consts.proxy.url);
var proxyPrefixes = _.get(config, 'proxy.prefixes', config.consts.proxy.prefixes);
var proxy = $.httpProxy.createProxyServer({
target: proxyTarget
});
function isProxiedPrefix... | Set middleware function to be definable | Set middleware function to be definable
| JavaScript | mit | akullpp/akGulp,akullpp/myGulp |
2223e83d7ea673bad92f89df32da4ee72bdac360 | backend/src/routes/users/index.js | backend/src/routes/users/index.js | const express = require('express')
const ERRORS = require('../../errors')
const User = require('../../models/User')
const utils = require('../../utils')
const router = express.Router()
router.post('/', register)
function register(req, res, next) {
const { body: { username, password } } = req
if (!username || !... | const express = require('express')
const ERRORS = require('../../errors')
const User = require('../../models/User')
const utils = require('../../utils')
const router = express.Router()
/*
* Endpoint: [POST] /users
* Header:
* <None>
* Body: {username, password}
* Response:
* 201 (JSON) The created user with... | Add meta-comments + backbone of authenticate method | Add meta-comments + backbone of authenticate method
| JavaScript | mit | 14Plumes/Hexode,KtorZ/Hexode,KtorZ/Hexode,14Plumes/Hexode,KtorZ/Hexode,14Plumes/Hexode |
3b3f61946d2c8bc79fbccc171035612293209c58 | functions/strings/hex2bin.js | functions/strings/hex2bin.js | function hex2bin(s) {
// discuss at: http://phpjs.org/functions/hex2bin/
// original by: Dumitru Uzun (http://duzun.me)
// example 1: bin2hex('44696d61');
// returns 1: 'Dima'
// example 2: bin2hex('00');
// returns 2: '\x00'
var ret = [], i = 0, l;
s += '';
for ( l = s.length ; i < l; i+=... | function hex2bin(s) {
// discuss at: http://phpjs.org/functions/hex2bin/
// original by: Dumitru Uzun (http://duzun.me)
// example 1: bin2hex('44696d61');
// returns 1: 'Dima'
// example 2: bin2hex('00');
// returns 2: '\x00'
// example 3: bin2hex('2f1q')
// returns 3: false
var ret = []... | Return FALSE if non-hex char detected | Return FALSE if non-hex char detected
Return FALSE if non-hex char detected - same behaviour as PHP version of hex2bin(). | JavaScript | mit | revanthpobala/phpjs,praveenscience/phpjs,strrife/phpjs,davidgruebl/phpjs,w35l3y/phpjs,VicAMMON/phpjs,Mazbaul/phpjs,J2TeaM/phpjs,cigraphics/phpjs,praveenscience/phpjs,janschoenherr/phpjs,VicAMMON/phpjs,ajenkul/phpjs,cigraphics/phpjs,VicAMMON/phpjs,ajenkul/phpjs,mojaray2k/phpjs,imshibaji/phpjs,Mazbaul/phpjs,FlorinDragota... |
805a979307583490d89197c8a82e7ba9fcae27ce | client/common/actions/index.js | client/common/actions/index.js | import types from '../constants/ActionTypes'
import utils from '../../shared/utils'
function replaceUserInfo(userInfo) {
return {
type: types.REPLACE_USER_INFO,
userInfo
}
}
function clearUserInfo() {
return {type: types.CLEAR_USER_INFO}
}
function fetchUserInfo() {
return dispatch =>... | import types from '../constants/ActionTypes'
import utils from '../../shared/utils'
function replaceUserInfo(userInfo) {
return {
type: types.REPLACE_USER_INFO,
userInfo
}
}
function clearUserInfo() {
return {type: types.CLEAR_USER_INFO}
}
function fetchUserInfo() {
return dispatch =>... | Update action fetchUserInfo ajax type to get | Update action fetchUserInfo ajax type to get
| JavaScript | mit | qiuye1027/screenInteraction,qiuye1027/screenInteraction,chikara-chan/react-isomorphic-boilerplate,chikara-chan/react-isomorphic-boilerplate |
3480bf8a6de2c0dd46b7b5e0a1e2a968ae4e603c | client/js/util/eventemitter.js | client/js/util/eventemitter.js | 'use strict';
/**
* @constructor
*/
function EventEmitter() {
this.eventHandlers = {};
}
EventEmitter.prototype.emit = function(event) {
if (!this.eventHandlers[event]) {
return;
}
var argsOut = [];
for (var i = 1; i < arguments.length; ++i) {
argsOut.push(arguments[i]);
}
for (var j = 0; j < ... | 'use strict';
/**
* @constructor
*/
function EventEmitter() {
this.eventHandlers = {};
}
EventEmitter.prototype.emit = function(event) {
if (!this.eventHandlers[event]) {
return;
}
var argsOut = [];
for (var i = 1; i < arguments.length; ++i) {
argsOut.push(arguments[i]);
}
for (var j = 0; j ... | Make addEventListener return this for function chaining. | Make addEventListener return this for function chaining.
| JavaScript | agpl-3.0 | exjam/rosebrowser,exjam/rosebrowser,brett19/rosebrowser,brett19/rosebrowser |
b7d6033ada80ac9979c084cc357e2c541a05ee62 | server/config/config.units.js | server/config/config.units.js | var units = {
datacenter: {
unitName: 'adminsys',
unitStats: {
attack: 10,
security: 50,
power: 5
}
},
personal_computer: {
unitName: 'zombie_computer',
unitStats: {
attack: 50,
security: 0,
power... | var units = {
datacenter: {
unitStats: {
name: 'SysAdmin',
attack: 0,
security: 25,
power: 500,
price: 2000
}
},
personal_computer: {
unitStats: {
name: 'Zombie computer',
attack: 10,
secu... | Change unit object format (server side) | Change unit object format (server side)
| JavaScript | mit | romain-grelet/HackersWars,romain-grelet/HackersWars |
0fc62a076bf8d9afb215c386688ef35cc4b8e559 | server/res/strings/english.js | server/res/strings/english.js | module.exports = {
'responses': {
'GREET': 'Hello! How are you doing today :\)',
'HELP': 'I can help you with a bunch of things around your house.\n\n'
+ 'You can check in on your security cameras, ask me the temperature, and much more!\n'
+ 'I will also notify you during events such as a visitor ... | module.exports = {
'responses': {
'GREET': 'Hello! How are you doing today :\)',
'HELP': 'I can help you with a bunch of things around your house.\n\n'
+ 'You can check in on your security cameras, ask me the temperature, and much more!\n'
+ 'I will also notify you during events such as a visitor ... | Add "is it" as option to ask for temperature | Add "is it" as option to ask for temperature
| JavaScript | mit | Eaton-Software/messenger-home |
1d7da8b90ffc9d685a247e426c696d85b38201c4 | assets/js/racer.js | assets/js/racer.js | function Game(){
this.$track = $('#racetrack');
this.finishLine = this.$track.width() - 54;
}
function Player(id){
this.player = $('.player')[id - 1];
this.position = 10;
}
Player.prototype.move = function(){
this.position += 20;
};
Player.prototype.updatePosition = function(){
$player = $(this.player);
... | function Game(){
this.$track = $('#racetrack');
this.finishLine = this.$track.width() - 54;
}
function Player(id){
this.player = $('.player')[id - 1];
this.position = 10;
}
Player.prototype.move = function(){
this.position += 20;
};
Player.prototype.updatePosition = function(){
$player = $(this.player);
... | Create checkWinner Function that alerts when a player has reached the finish line | Create checkWinner Function that alerts when a player has reached the finish line
| JavaScript | mit | SputterPuttRedux/basic-javascript-racer,SputterPuttRedux/basic-javascript-racer |
0c467864aa4bac65bae58116b150020a074d091f | admin/client/App/sagas/index.js | admin/client/App/sagas/index.js | import { takeLatest, delay } from 'redux-saga';
import { fork, select, put, take } from 'redux-saga/effects';
import * as actions from '../screens/List/constants';
import updateParams from './updateParams';
import { loadItems } from '../screens/List/actions';
/**
* Load the items
*/
function * loadTheItems () {
yi... | import { takeLatest, delay } from 'redux-saga';
import { fork, select, put, take } from 'redux-saga/effects';
import * as actions from '../screens/List/constants';
import updateParams from './updateParams';
import { loadItems } from '../screens/List/actions';
/**
* Load the items
*/
function * loadTheItems () {
yi... | Fix list not loading on second open | Fix list not loading on second open
Closes #3369
| JavaScript | mit | danielmahon/keystone,benkroeger/keystone,linhanyang/keystone,naustudio/keystone,Pop-Code/keystone,naustudio/keystone,danielmahon/keystone,trentmillar/keystone,jstockwin/keystone,matthewstyers/keystone,ONode/keystone,w01fgang/keystone,alobodig/keystone,frontyard/keystone,jstockwin/keystone,trentmillar/keystone,vokal/key... |
6c4bab22ae449af235ea33499061113a140b7595 | src/eorzea-time.js | src/eorzea-time.js | import padStart from './polyfill/padStart';
const THREE_MINUTES = 3 * 60 * 1000;
const privateDateProperty = typeof Symbol !== 'function' ?
Symbol('privateDateProperty') : '_privateDateProperty';
function computeEorzeaDate(date) {
const eorzeaTime = new Date();
const unixTime = Math.floor(date.getTime() * 1440 ... | import padStart from './polyfill/padStart';
const THREE_MINUTES = 3 * 60 * 1000;
const privateDateProperty = typeof Symbol === 'function' ?
Symbol('privateDateProperty') : '_privateDateProperty';
function computeEorzeaDate(date) {
const eorzeaTime = new Date();
const unixTime = Math.floor(date.getTime() * 1440 ... | Fix a presence check of Symbol function | :bug: Fix a presence check of Symbol function | JavaScript | mit | flowercartelet/eorzea-time |
3934fbf1024d52b8b8429a5d073b7b8526521d25 | src/hello-world.js | src/hello-world.js | // ./src/hello-world.js
var console = require('gulp-messenger');
console.success('Hello World!'); | // ./src/hello-world.js
var console = require('gulp-messenger');
console.success('Hello World!');
console.log('This is added in master branch') | Create merge conflict in master branch | Create merge conflict in master branch
| JavaScript | mit | mikeerickson/gitflow |
f658e382b0974c53edc828efac5d4f182fbd3c08 | app/assets/javascripts/users.js | app/assets/javascripts/users.js | $( ".users-show, .users-sample" ).ready( function() {
$( "#stats-area" ).tabs({
// Ajax request stuff, mostly pulled from jQuery UI's docs.
beforeLoad: function( event, ui ) {
// There's no need to do a fresh Ajax request each time the tab
// is clicked. If the tab has been loaded already, skip t... | $( ".users-show, .users-sample" ).ready( function() {
$( "#stats-area" ).tabs({
// Ajax request stuff, mostly pulled from jQuery UI's docs.
beforeLoad: function( event, ui ) {
// There's no need to do a fresh Ajax request each time the tab
// is clicked. If the tab has been loaded already (or is ... | Load Topics in background when stats page opens | Load Topics in background when stats page opens
| JavaScript | mit | steve-mcclellan/j-scorer,steve-mcclellan/j-scorer,steve-mcclellan/j-scorer |
3a4aae6cfb1f664afd8943a1a49d3de0062eb2b9 | app/js/helpers.js | app/js/helpers.js | function filter(arr) {
var filteredArray = [], prev;
arr.sort();
for (var i = 0; i < arr.length; i++) {
if (arr[i] !== prev) {
filteredArray.push(arr[i]);
}
prev = arr[i];
}
return filteredArray
}
function rarefy(pattern) {
arr = [];
matches = [];
merged = [];
str = text.doc;
elem... | function filter(arr) {
var filteredArray = [], prev;
arr.sort();
for (var i = 0; i < arr.length; i++) {
if (arr[i] !== prev) {
filteredArray.push(arr[i]);
}
prev = arr[i];
}
return filteredArray
}
function rarefyXMLTextContent(pattern) {
arr = [];
matches = [];
merged = [];
str = te... | Rename helper methods for clarity | Rename helper methods for clarity
| JavaScript | mit | bdfinlayson/annotation-tool,bdfinlayson/annotation-tool |
bcb666e596c694f432340e780aff05530b0df40a | src/series/line.js | src/series/line.js | (function(d3, fc) {
'use strict';
fc.series.line = function() {
// convenience functions that return the x & y screen coords for a given point
var x = function(d) { return line.xScale.value(line.xValue.value(d)); };
var y = function(d) { return line.yScale.value(line.yValue.value(d)); ... | (function(d3, fc) {
'use strict';
fc.series.line = function() {
// convenience functions that return the x & y screen coords for a given point
var x = function(d) { return line.xScale.value(line.xValue.value(d)); };
var y = function(d) { return line.yScale.value(line.yValue.value(d)); ... | Add interpolation support to the Line series component | Add interpolation support to the Line series component
| JavaScript | mit | alisd23/d3fc-d3v4,bjedrzejewski/d3fc,fxcebx/d3fc,djmiley/d3fc,fxcebx/d3fc,janakerman/d3-financial-components,alisd23/d3fc-d3v4,djmiley/d3fc,fxcebx/d3fc,bjedrzejewski/d3fc,janakerman/d3-financial-components,djmiley/d3fc,bjedrzejewski/d3fc,alisd23/d3fc-d3v4 |
f54167b6ce911acd2a4ecd05db25f11558ed870f | IoradWebWidget/scripts/app.js | IoradWebWidget/scripts/app.js | if (ioradWebWidget.util.common.isFreshdeskKnowledgebase()) {
ioradWebWidget.freshdesk.runApp(jQuery, window);
}
if (ioradWebWidget.util.common.isDeskKnowledgebase()) {
ioradWebWidget.desk.runApp(jQuery, window);
}
| //if (ioradWebWidget.util.common.isFreshdeskKnowledgebase()) {
// ioradWebWidget.freshdesk.runApp(jQuery, window);
//}
ioradWebWidget.freshdesk.runApp(jQuery, window); | Make freshdesk widget run on customized domain support portals. | Make freshdesk widget run on customized domain support portals.
| JavaScript | mit | iorad/integrations,iorad/integrations,iorad/integrations |
2aecea32c53f551069b43ac6e2e9da3831a9b667 | client/packages/settings-dashboard-extension-worona/src/dashboard/reducers/index.js | client/packages/settings-dashboard-extension-worona/src/dashboard/reducers/index.js | import { isDev, getDevelopmentPackages } from 'worona-deps';
import { map } from 'lodash';
import { combineReducers } from 'redux';
import * as deps from '../deps';
const env = isDev ? 'dev' : 'prod';
const mapPkg = pkg => ({ ...pkg, main: pkg.cdn && pkg.cdn.dashboard[env].main.file });
const create = collection => c... | import { isDev, getDevelopmentPackages } from 'worona-deps';
import { map } from 'lodash';
import { combineReducers } from 'redux';
import * as deps from '../deps';
const env = isDev ? 'dev' : 'prod';
const mapPkg = pkg => ({ ...pkg, main: pkg.cdn && pkg.cdn.dashboard[env].main.file });
const createSetting = collecti... | Remove mapPkg from settings collections. | Remove mapPkg from settings collections.
| JavaScript | mit | worona/worona-dashboard,worona/worona-dashboard,worona/worona,worona/worona,worona/worona-core,worona/worona,worona/worona-core |
d0e3a74be246e9b43189d1c2d3a39fce357a146d | src/states/Game.js | src/states/Game.js | /* globals __DEV__ */
import Phaser from 'phaser'
import Mushroom from '../sprites/Ship'
export default class extends Phaser.State {
init () {}
preload () {}
create () {
game.physics.startSystem(Phaser.Physics.ARCADE)
// Set up game input.
game.cursors = game.input.keyboard.createCursorKeys()
g... | /* globals __DEV__ */
import Phaser from 'phaser'
import Ship from '../sprites/Ship'
export default class extends Phaser.State {
init () {}
preload () {}
create () {
game.physics.startSystem(Phaser.Physics.ARCADE)
// Set up game input.
game.cursors = game.input.keyboard.createCursorKeys()
game.... | Rename mushroom to ship / player | Rename mushroom to ship / player
| JavaScript | mit | killer-robots/killer-robots,killer-robots/killer-robots |
f1aa082977ee0679cfa1e96d3fa3a2e3fdefa8fe | src/actions/sessionActions.js | src/actions/sessionActions.js | import fetch from 'isomorphic-fetch'
export function signUpUser(register, history) {
return(dispatch) => {
const options = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
user: {
first_name: register.name,
email: register.em... | import fetch from 'isomorphic-fetch'
export function signUpUser(register, history) {
return(dispatch) => {
const options = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
user: {
first_name: register.name,
email: register.em... | Change jwt storage from session to local | Change jwt storage from session to local
| JavaScript | mit | snsavage/timer-react,snsavage/timer-react |
b3f449dace39b99aca7046b4eddc9dd7ae81c141 | bin/generators/scopes/create.js | bin/generators/scopes/create.js | const eg = require('../../eg');
module.exports = class extends eg.Generator {
constructor (args, opts) {
super(args, opts);
this.configureCommand({
command: 'create [options] <scope..>',
desc: 'Create a scope',
builder: yargs =>
yargs
.usage(`Usage: $0 ${process.argv[2]} c... | const eg = require('../../eg');
module.exports = class extends eg.Generator {
constructor (args, opts) {
super(args, opts);
this.configureCommand({
command: 'create [options] <scope..>',
desc: 'Create a scope',
builder: yargs =>
yargs
.usage(`Usage: $0 ${process.argv[2]} c... | Print the returned error message. | Print the returned error message.
| JavaScript | apache-2.0 | ExpressGateway/express-gateway |
943282e096fe7a36e035fccd069eb8f843b686b0 | src/animate.js | src/animate.js | // A bit of pseudo-code
//
// tickModel
// var dt
// for each canvas
// canvasParticles = canvasParticles.filterOut(particlesOutsideOrTimeout)
//
// for each particle in canvasParticles
// tick(particle)
//
// for each startOptions
// var newParticles = createParticles(imageUrls, startOptions, dt)
// ... | // Animate: call model update and view render at each animation frame.
//
var tickState = require('./tickState')
var render = require('./view/render')
// To indicate if started.
// Maybe to pause the animation in the future.
var running = false
// number, unix timestamp milliseconds of most recent frame.
var past = n... | Replace pseudo-code sketch with accurate comment | Replace pseudo-code sketch with accurate comment
| JavaScript | mit | axelpale/sprinkler |
6e1b30ca8028d016fc2a566141f6cabbe1acaaa4 | .stylelintrc.js | .stylelintrc.js | const declarationBlockPropertiesOrder = require(`./.csscomb.json`)[`sort-order`][0];
module.exports = {
extends: `stylelint-config-modularis`,
rules: {
'declaration-block-properties-order': declarationBlockPropertiesOrder,
'no-indistinguishable-colors': [true, { threshold: 1 }],
'string-no-newline': fa... | const declarationBlockPropertiesOrder = require(`./.csscomb.json`)[`sort-order`][0];
module.exports = {
extends: `stylelint-config-modularis`,
rules: {
'declaration-block-properties-order': declarationBlockPropertiesOrder,
'no-indistinguishable-colors': [true, { threshold: 1 }],
'string-no-newline': nu... | Use null instead of false to override the string-no-newline setting from the modularis stylelint config. | Use null instead of false to override the string-no-newline setting from the modularis stylelint config.
| JavaScript | mit | avalanchesass/avalanche-website,avalanchesass/avalanche-website |
88f0989207c048b60a72cca136bc5d912c77ebd3 | src/App.js | src/App.js | import DicewareOptions from './DicewareOptions'
import React, { PureComponent } from 'react'
export default class App extends PureComponent {
state = {
length: 6
}
handleLengthChange = event => this.setState({ length: parseInt(event.target.value, 10) })
handlePossibleItemsChange = possibleItems => this.se... | import DicewareOptions from './DicewareOptions'
import React, { PureComponent } from 'react'
export default class App extends PureComponent {
state = {
length: 6
}
handleLengthChange = event => this.setState({ length: parseInt(event.target.value, 10) })
handlePossibleItemsChange = possibleItems => this.se... | Clean up result math and notation | Clean up result math and notation
| JavaScript | isc | nickmccurdy/password-entropy,nickmccurdy/password-entropy |
962dd6226d16428acf12993eb35c6b90d29bc109 | js/bitazza.js | js/bitazza.js | 'use strict';
// Bitazza uses Alphapoint, also used by ndax
// In order to use private endpoints, the following are required:
// - 'apiKey'
// - 'secret',
// - 'uid' (userId in the api info)
// - 'login' (the email address used to log into the UI)
const ndax = require ('./ndax.js');
// -----------------------------... | 'use strict';
// Bitazza uses Alphapoint, also used by ndax
// In order to use private endpoints, the following are required:
// - 'apiKey'
// - 'secret',
// - 'uid' (userId in the api info)
// - 'login' (the email address used to log into the UI)
// - 'password' (the password used to log into the UI)
const ndax = re... | Add 'password' to comment on required credentials | Add 'password' to comment on required credentials
| JavaScript | mit | ccxt/ccxt,ccxt/ccxt,ccxt/ccxt,ccxt/ccxt,ccxt/ccxt |
2b65809bc9b134d281a5552387e385fda7b63b84 | src/app.js | src/app.js | import React from 'react'
import ReactDOM from 'react-dom'
class App extends React.Component { // eslint-disable-line no-unused-vars
render () {
return (
<div className="container-fluid">
<div className="row">
<div className="jumbotron text-center">
<h1>Login Screen</h1>
... | import React from 'react'
import ReactDOM from 'react-dom'
class App extends React.Component { // eslint-disable-line no-unused-vars
render () {
return (
<div className="container-fluid">
<div className="row">
<div className="jumbotron text-center">
<h1>Login Screen</h1>
... | Refactor TODO to be below the jumbotron | Refactor TODO to be below the jumbotron
| JavaScript | mit | cpwilkerson/login-server,cpwilkerson/login-server |
dbaaef857da2f402700e254f0ee0d63bb56b6870 | karma.conf.js | karma.conf.js | module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon-chrome', 'karma-typescript'],
files: [
'src/ts/**/*.ts'
],
exclude: [
'src/ts/constants.ts'
],
preprocessors: {
'src/ts/**/*.ts': ['karma-typescript']
},
client: {
c... | module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon-chrome', 'karma-typescript'],
files: [
'src/ts/**/*.ts'
],
exclude: [
'src/ts/constants.ts'
],
preprocessors: {
'src/ts/**/*.ts': ['karma-typescript']
},
client: {
c... | Use common ts compiler options in karma test and webpack build | chore(test): Use common ts compiler options in karma test and webpack build
| JavaScript | mit | xtangle/ZoundCloud,xtangle/ZoundCloud |
a7591058f6fe14412ea645703695b2ebad987083 | test/index.spec.js | test/index.spec.js | import expect from 'expect.js';
import constantMirror from '../src';
describe('constantMirror', () => {
it('exports a function', () => {
expect(constantMirror).to.be.a('function');
});
it('creates a mirrored hash from a list of strings', () => {
expect(constantMirror('HELLO', 'WORLD')).to.eql({
H... | import expect from 'expect.js';
import constantMirror from '..';
describe('constantMirror', () => {
it('exports a function', () => {
expect(constantMirror).to.be.a('function');
});
it('creates a mirrored hash from a list of strings', () => {
expect(constantMirror('HELLO', 'WORLD')).to.eql({
HELLO... | Test compiled JS, not ES6 source | Test compiled JS, not ES6 source
| JavaScript | mit | tough-griff/constant-mirror |
6e6a449ddda27c2471a72b436fb7074ac5ae7403 | lib/loaders/utils/to-code.js | lib/loaders/utils/to-code.js | /* eslint-disable no-use-before-define */
function toCodeArray(array) {
return `[${array.map(item => toCode(item)).join(",")}]`
}
function toCodeObject(object) {
return `{${Object.keys(object).map(key => `"${key}": ${toCode(object[key])}`).join(",")}}`
}
function toCode(values) {
if (Array.isArray(values)) {
... | /* eslint-disable no-use-before-define */
function toCodeArray(array) {
return `[${array.map(item => toCode(item)).join(",")}]`
}
function toCodeObject(object) {
return `{${Object.keys(object).map(key => `"${key}": ${toCode(object[key])}`).join(",")}}`
}
// Convert an arbitrary object, array, or primitive into a... | Add comment our `toCode` function | Add comment our `toCode` function
| JavaScript | mit | mavenlink/mavenlink-ui-concept,ahuth/mavenlink-ui-concept |
2d839b07c96bbfc38588bb3e32aece3e6d9be6d6 | js/js-engine.js | js/js-engine.js | $(document).ready(function() {
// Add class to all inputs (input's type attribute value)
$('input').each(function() {$(this).addClass(this.type)});
// put all your jQuery code here
}); | $(document).ready(function() {
// Add class to all inputs (input's type attribute value)
$('input').each(function() {$(this).addClass(this.type)});
// put all your jQuery code here
}); | Add class to all inputs | Add class to all inputs
| JavaScript | mit | maciejsmolinski/html-go |
f4489c9b6cc45d41bd0ee41c7988af369dc249d9 | src/majesty.js | src/majesty.js | (function($) {
$.fn.majesty = function() {
var findDependents = function(rootElement) {
return rootElement.find('[data-depends-on]');
};
var findMatches = function(searchValue, elements) {
searchValue = $.trim(searchValue);
if(searchValue === '') {
return $([]);
}
... | (function($) {
var findDependents = function(rootElement) {
return rootElement.find('[data-depends-on]');
};
var findMatches = function(searchValue, elements) {
searchValue = $.trim(searchValue);
if(searchValue === '') {
return $([]);
}
// Hack for now. Probably use regex later
... | Move functions outside of plugin block | Move functions outside of plugin block
| JavaScript | mit | craigerm/majesty-js |
7106e052ff1e92dd7792908798c595b4bc4f6410 | lib/server.js | lib/server.js | var connections = {};
var expire = function(id) {
Presences.remove(id);
delete connections[id];
};
var tick = function(id) {
connections[id].lastSeen = Date.now();
};
Meteor.startup(function() {
Presences.remove({});
});
Meteor.onConnection(function(connection) {
// console.log('connectionId: ' + connecti... | var connections = {};
var presenceExpiration = 10000;
var expire = function(id) {
Presences.remove(id);
delete connections[id];
};
var tick = function(id) {
connections[id].lastSeen = Date.now();
};
Meteor.startup(function() {
Presences.remove({});
});
Meteor.onConnection(function(connection) {
// conso... | Set presenceExpiration outside of package | Set presenceExpiration outside of package
| JavaScript | mit | minden/meteor-presence |
9b9a73c31eddf1c7e70bb89352c3cf84edededea | client/intercom-shim.js | client/intercom-shim.js | (function() {
/* globals define */
'use strict';
function l(config) {
var i = function() {
i.c(arguments);
};
i.q = [];
i.c = function(args) {
i.q.push(args);
};
window.Intercom = i;
var d = document;
var s = d.createElement('script');
s.type = 'text/javascript';... | (function() {
/* globals define */
'use strict';
function l(config) {
var i = function() {
i.c(arguments);
};
i.q = [];
i.c = function(args) {
i.q.push(args);
};
window.Intercom = i;
var d = document;
var s = d.createElement('script');
s.type = 'text/javascript';... | Make sure we are checking that apply exists | Make sure we are checking that apply exists
| JavaScript | mit | mike-north/ember-intercom-io,levanto-financial/ember-intercom-io,seawatts/ember-intercom-io,seawatts/ember-intercom-io,levanto-financial/ember-intercom-io,mike-north/ember-intercom-io |
649509ca76845e45825ee75f6841d1cb894ff1e4 | scripts/transform/comments.js | scripts/transform/comments.js | 'use strict';
function makeFrontMatter(ast, dependencies) {
var value = [
'es6id: ',
'description: >'
];
var includes;
if (dependencies.length) {
includes = dependencies.map(function(file) {
return file + '.js';
}).join(', ');
value.push('includes: [' + includes + ']');
}
value = '---\n' + value.jo... | 'use strict';
var licenseYearPattern = /\bcopyright (\d{4})\b/i;
function makeFrontMatter(ast, dependencies) {
var value = [
'es6id: ',
'description: >'
];
var includes;
if (dependencies.length) {
includes = dependencies.map(function(file) {
return file + '.js';
}).join(', ');
value.push('includes: ... | Include license in transformed file | Include license in transformed file
Infer the year from the source file's code comments.
| JavaScript | mit | bocoup/test262-v8-machinery,bocoup/test262-v8-machinery |
986faef86b65b9ab7471077da321020ee5164cf8 | src/set-env.js | src/set-env.js | const {webpack} = require('@webpack-blocks/webpack2');
/**
* Sets environment variables with all possible ways.
*/
module.exports = (options = {}) => {
const {
nodeEnv = 'development',
babelEnv = 'development',
} = options;
process.env.NODE_ENV = nodeEnv;
process.env.BABEL_ENV = bab... | const {webpack} = require('@webpack-blocks/webpack2');
/**
* Sets environment variables with all possible ways.
*/
module.exports = (options = {}) => {
const {
nodeEnv,
babelEnv,
} = options;
process.env.NODE_ENV = nodeEnv;
process.env.BABEL_ENV = babelEnv;
return () => ({
... | Set setEnv defaults to undefined | Set setEnv defaults to undefined
| JavaScript | mit | fugr-ru/webpack-custom-blocks |
9df8d7dca7a9f881eca551551b856f8cdf5ae6a4 | simul/app/components/login.js | simul/app/components/login.js | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TextInput,
TouchableHighlight,
} from 'react-native';
class Login extends Component{
constructor(){
super();
this.state = {
name: "",
username: "",
password_digest: "",
location: "",
bio: "",
... | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TextInput,
TouchableHighlight,
} from 'react-native';
class Login extends Component{
constructor(){
super();
this.state = {
name: "",
username: "",
password_digest: "",
location: "",
bio: "",
... | Create onLoginPressed function and add to render function | Create onLoginPressed function and add to render function
| JavaScript | mit | sf-red-pandas-2016/simul-react-native,sf-red-pandas-2016/simul-react-native,sf-red-pandas-2016/simul-react-native |
94a9cefb34e1adcdae67a9402e8a6745f9e85496 | klets-server/routes/messages/messages-controller.js | klets-server/routes/messages/messages-controller.js | var HttpError = require('../../lib/http-error');
var messageRepo = require('../../repository/message-repo');
module.exports.create = function (req, res, next) {
var message = req.body.message;
checkDefined(message, 'message');
checkDefined(message._id, 'message._id');
checkDefined(message.userName, 'me... | var HttpError = require('../../lib/http-error');
var messageRepo = require('../../repository/message-repo');
module.exports.create = function (req, res, next) {
var message = req.body.message;
checkDefined(message, 'message');
checkDefined(message._id, 'message._id');
checkDefined(message.userName, 'me... | Allow Cross Origin requests on create message endpoint | Allow Cross Origin requests on create message endpoint
| JavaScript | mit | rhmeeuwisse/KletsApp,rhmeeuwisse/KletsApp |
4c2067c2609ad7af84e0384c39b0452341fb0358 | config/configuration.js | config/configuration.js | /**
* @file Defines the provider settings.
*
* Will set the path to Mongo, and applications id
* Most of the configuration can be done using system environment variables.
*/
// Load environment variables from .env file
var dotenv = require('dotenv');
dotenv.load();
// node_env can either be "development" or "pro... | /**
* @file Defines the provider settings.
*
* Will set the path to Mongo, and applications id
* Most of the configuration can be done using system environment variables.
*/
// Load environment variables from .env file
var dotenv = require('dotenv');
dotenv.load();
// node_env can either be "development" or "pro... | Add redis and mongo URL in config | Add redis and mongo URL in config
| JavaScript | mit | AnyFetch/gcontacts-provider.anyfetch.com |
d47521a1d9281c2a89cf78bd8902c112ae16e38e | live-examples/js-examples/classes/classes-static.js | live-examples/js-examples/classes/classes-static.js | class ClassWithStaticMethod {
static staticMethod() {
return 'static method has been called.';
}
}
console.log(ClassWithStaticMethod.staticMethod());
// expected output: "static method has been called."
| class ClassWithStaticMethod {
static staticProperty = "someValue";
static staticMethod() {
return 'static method has been called.';
}
}
console.log(ClassWithStaticMethod.staticProperty);
// output: "someValue"
console.log(ClassWithStaticMethod.staticMethod());
// output: "static method has been called."
| Update example to include static property | Update example to include static property
| JavaScript | cc0-1.0 | mdn/interactive-examples,mdn/interactive-examples,mdn/interactive-examples |
287c5ef21117352df8cde5eaa4592ce15c01031c | client/src/reducers/sourcesReducer.js | client/src/reducers/sourcesReducer.js | import initialState from './initialState'
export default function sourcesReducer(state = initialState.sources, action) {
switch (action.type) {
case 'GET_SOURCES':
return action.payload.map (source => (
{...source, selected: true}
))
default:
return state;
}
}
| import initialState from './initialState'
export default function sourcesReducer(state = initialState.sources, action) {
switch (action.type) {
case 'GET_SOURCES':
return action.payload.map (source => (
{...source, selected: false}
))
default:
return state;
}
}
| Change GET_SOURCES action to default to selected:false | Change GET_SOURCES action to default to selected:false
| JavaScript | mit | kevinladkins/newsfeed,kevinladkins/newsfeed,kevinladkins/newsfeed |
8dc31229b164225e2aa8d84f499b7bc0ef9be9f2 | ui/main.js | ui/main.js |
// Blank the document so the 404 page doesn't show up visibly.
document.documentElement.style.display = 'none';
// Can't use DOMContentLoaded, calling document.write or document.close inside it from
// inside an extension causes a crash.
onload = function() {
document.write(
"<!DOCTYPE html>" +
"<... |
// Blank the document so the 404 page doesn't show up visibly.
document.documentElement.style.display = 'none';
// Can't use DOMContentLoaded, calling document.write or document.close inside it from
// inside an extension causes a crash.
onload = function() {
document.write(
"<!DOCTYPE html>" +
"<... | Add a <title>. We should make it dynamic eventually so history works. | Add a <title>. We should make it dynamic eventually so history works.
| JavaScript | bsd-3-clause | esprehn/chromium-codereview,esprehn/chromium-codereview |
22c91010c17691aceb15523cfa052b60cdc47d23 | app.js | app.js | var pg = require('pg');
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 3000 });
server.start(function () {
console.log('Server running at:', server.info.uri);
});
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
re... | var pg = require('pg');
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 3000 });
server.start(function () {
console.log('Server running at:', server.info.uri);
});
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
re... | Remove duplicate route for / | Remove duplicate route for /
| JavaScript | bsd-2-clause | SpotScore/spotscore |
e76026335f7d999168fa377bc6b9f76295f4c7f1 | cli.js | cli.js | #!/usr/bin/env node
'use strict';
var chalk = require('chalk');
var meow = require('meow');
var process = require('process');
var allPrograms = [
'atom',
'bash',
'bin',
'git',
'gnome-terminal',
'vim',
'vscode'
];
var cli = meow({
help: [
'Usage: dotfiles install [<program>]',
'',
'where <program... | #!/usr/bin/env node
'use strict';
var chalk = require('chalk');
var meow = require('meow');
var process = require('process');
var allPrograms = [
'atom',
'bash',
'bin',
'git',
'gnome-terminal',
'vim',
'vscode'
];
var cli = meow({
help: [
'Usage: dotfiles install [<program>...]',
'',
'where <prog... | Allow install of multiple programs | Allow install of multiple programs
Fixes #26
| JavaScript | mit | Tyriar/dotfiles,Tyriar/tyr-tools,Tyriar/tyr-tools,Tyriar/dotfiles,Tyriar/dotfiles |
581b9393ac0e0c6a505bedaaf6cbb7d30c0e4f4f | app/components/application/emoji-react-demo.js | app/components/application/emoji-react-demo.js | const script = String.raw`<script type="text/javascript">
var emojis = "tada, fire, grinning"
var selector = "body"
var url = window.location.href.replace(/(http:\/\/|https:\/\/)/gi, '').replace(/^\/|\/$/g, '');
var iframe = document.createElement("iframe")
iframe.src = "https://emojireact.com/embed?emojis="... | import autosize from "autosize"
const script = String.raw`<script type="text/javascript">
var emojis = "tada, fire, grinning"
var selector = "body"
var url = window.location.href.replace(/(http:\/\/|https:\/\/)/gi, '').replace(/^\/|\/$/g, '');
var iframe = document.createElement("iframe")
iframe.src = "http... | Fix issue where demo text does not autosize textarea. | Fix issue where demo text does not autosize textarea.
Closes #8
| JavaScript | mit | EagerIO/InstantPlugin,EagerIO/InstantPlugin |
41aece86398d40e173f6ed14a633a66b90f804b2 | test/specs/server_spec.js | test/specs/server_spec.js | import test from 'tape';
import { Database, Router, Server } from '../../src';
//
// TODO: Check the same with XHR
//
export const serverSpec = () => {
// @TODO Test Server's config
test('Server # use database', (assert) => {
const myDB = new Database();
const router = new Router();
const server = n... | // @TODO Test Server's config
import test from 'tape';
import { Database, Router, Server } from '../../src';
const xhrRequest = (url) => {
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.send();
}
export const serverSpec = () => {
test('Server # use database', (assert) => {
assert.plan... | Check that scenarios works with xhr | Check that scenarios works with xhr
| JavaScript | mit | devlucky/Kakapo.js,devlucky/Kakapo.js |
9702cf0a66e26860102b2a091bc1d1600d200e57 | app/instance-initializers/in-app-livereload.js | app/instance-initializers/in-app-livereload.js | import Ember from 'ember';
const { run } = Ember;
export function initialize(app) {
let config = app.container.lookupFactory('config:environment');
let env = config.environment;
if (config.cordova && config.cordova.reloadUrl &&
(env === 'development' || env === 'test')) {
let url = config.cordova.rel... | import Ember from 'ember';
const { run } = Ember;
export function initialize(app) {
let config = app.resolveRegistration('config:environment');
let env = config.environment;
if (config.cordova && config.cordova.reloadUrl &&
(env === 'development' || env === 'test')) {
let url = config.cordova.reloadU... | Use resolveRegistration rather than container.lookupFactory to lookup the environment. | Use resolveRegistration rather than container.lookupFactory to lookup the environment.
| JavaScript | mit | isleofcode/ember-cordova,isleofcode/corber,isleofcode/ember-cordova,isleofcode/corber |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.