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 |
|---|---|---|---|---|---|---|---|---|---|
3617df199a77a9758b391615ec12e6ab0ae6362e | content.js | content.js | // Obtain ALL anchors on the page.
var links = document.links;
// The previous/next urls if they exist.
var prev = findHref("prev");
var next = findHref("next");
/**
* Find the href for a given name.
* @param {String} The name of the anchor to search for.
* @return {String} The href for a given tag, otherwise an e... | // Obtain ALL anchors on the page.
var links = document.links;
// The previous/next urls if they exist.
var prev = findHref("prev");
var next = findHref("next");
/**
* Find the href for a given name.
* @param {String} name - The name of the anchor to search for.
* @return {String} The href for a given tag, otherwi... | Refactor repeated checking to a helper method. | Refactor repeated checking to a helper method.
| JavaScript | mit | jawrainey/leftyrighty |
394ccb91c645cab13fbd2681cfdac3dd3bbaa602 | app/contentModule.js | app/contentModule.js | app.module("ContentModule", function(ContentModule, app){
ContentModule.listTemplate = "<div>List</div>";
ContentModule.showTemplate = "<div>Show <%= id %></div>";
ContentModule.ListView = Marionette.ItemView.extend({
template: _.template(ContentModule.listTemplate),
className: 'content list'
});
... | app.module("ContentModule", function(ContentModule, app){
ContentModule.itemTemplate = "Item";
ContentModule.listTemplate = "<div>List</div><ul></ul>";
ContentModule.showTemplate = "<div>Show <%= id %></div>";
ContentModule.ItemView = Marionette.ItemView.extend({
template: _.template(ContentModule.itemT... | Change list view to be a composite view | Change list view to be a composite view
| JavaScript | mit | Gerg/marionette-boilerplate |
a40f8e8464462e96cf78314098122bef99b2479f | client/src/components/ArticleCard.js | client/src/components/ArticleCard.js | import React from 'react'
import {Link} from 'react-router-dom'
function setArticleUrl(title) {
var sanitizedTitle = title.replace(/%/g, "[percent]")
debugger
return encodeURIComponent(sanitizedTitle)
}
const ArticleCard = ({channel, article}) => {
return (
<Link to={`/newsfeed/${channel.source_id}/${setA... | import React from 'react'
import {Link} from 'react-router-dom'
const ArticleCard = ({channel, article, setArticleUrl}) => {
return (
<Link to={`/newsfeed/${channel.source_id}/${setArticleUrl(article.title)}`} className="article-link">
<div className="card">
<h3>{article.title}</h3>
<img ... | Move setUrl functoin to parent | Move setUrl functoin to parent
| JavaScript | mit | kevinladkins/newsfeed,kevinladkins/newsfeed,kevinladkins/newsfeed |
cb839f6dd5000d1acfb62332344cf4d36e4df676 | config/http-get-param-interceptor.js | config/http-get-param-interceptor.js | 'use strict';
angular.module('gc.ngHttpGetParamInterceptor', [
'gc.utils'
]).factory('httpGetParamInterceptor', [
'utils',
function httpGetParamInterceptor(utils) {
return {
request: function(config) {
// Manually build query params using custom logic because Angular and
// Rails do not... | 'use strict';
angular.module('gc.ngHttpGetParamInterceptor', [
'gc.utils'
]).factory('httpGetParamInterceptor', [
'utils',
function httpGetParamInterceptor(utils) {
function deleteUndefinedValues(obj) {
_.keys(obj).forEach(function(key) {
if (_.isUndefined(obj[key])) {
delete obj[key... | Revert "Revert "delete undefined properties from http config params"" | Revert "Revert "delete undefined properties from http config params""
This reverts commit f2875d45257f892607df8a460b253cd35fb0900a.
| JavaScript | mit | gocardless-ng/ng-gc-base-app-service |
d804e831b659c5ad23b398df1f7d9198026d32d6 | src/main/webapp/components/BuildSnapshotContainer.js | src/main/webapp/components/BuildSnapshotContainer.js | import * as React from "react";
import {BuildSnapshot} from "./BuildSnapshot";
/**
* Container Component for BuildSnapshots.
*
* @param {*} props input property containing an array of build data to be
* rendered through BuildSnapshot.
*/
export const BuildSnapshotContainer = React.memo((props) =>
{
const S... | import * as React from "react";
import {BuildSnapshot} from "./BuildSnapshot";
/**
* Container Component for BuildSnapshots.
*
* @param {*} props input property containing an array of build data to be
* rendered through BuildSnapshot.
*/
export const BuildSnapshotContainer = React.memo((props) =>
{
const N... | Update fetch source, add parameters | Update fetch source, add parameters
| JavaScript | apache-2.0 | googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020 |
bb0c2f4f9f7a227820308f0802c062520b0f6a00 | stockflux-launcher/src/app-shortcuts/AppShortcuts.js | stockflux-launcher/src/app-shortcuts/AppShortcuts.js | import React, { useEffect, useState } from 'react';
import { OpenfinApiHelpers } from 'stockflux-core';
import Components from 'stockflux-components';
import './AppShortcuts.css';
export default () => {
const [apps, setApps] = useState([]);
useEffect(() => {
const options = {
method: 'GET'
};
O... | import React, { useEffect, useState } from 'react';
import { OpenfinApiHelpers } from 'stockflux-core';
import Components from 'stockflux-components';
import './AppShortcuts.css';
export default () => {
const [apps, setApps] = useState([]);
useEffect(() => {
const options = {
method: 'GET'
};
O... | Rename stockflux-search to stockflux-launcher in package.json and remove console.log | Rename stockflux-search to stockflux-launcher in package.json and remove console.log
| JavaScript | mit | owennw/OpenFinD3FC,owennw/OpenFinD3FC,ScottLogic/bitflux-openfin,ScottLogic/StockFlux,ScottLogic/StockFlux,ScottLogic/bitflux-openfin |
7e019de783a757fdeb5fc5babb05b297defb6b46 | src/client/es6/controller/cart-blog-create.js | src/client/es6/controller/cart-blog-create.js | import CartBlogEditorCtrl from './base/cart-blog-editor.js';
class CartBlogCreateCtrl extends CartBlogEditorCtrl {
constructor(...args) {
super(...args);
this.logInit('CartBlogCreateCtrl');
this.init();
}
init() {
this.apiService.postDefaultCategory().then(
(category) => {
this.ca... | import CartBlogEditorCtrl from './base/cart-blog-editor.js';
class CartBlogCreateCtrl extends CartBlogEditorCtrl {
constructor(...args) {
super(...args);
this.logInit('CartBlogCreateCtrl');
this.init();
}
init() {
this.apiService.postDefaultCategory().then(
(category) => {
this.ca... | Remove uuid in constructor, since strong loop server will see null as value provided, there won't be any defaultFn called. Otherwise you can give uuid "undefined", it's OK. | Remove uuid in constructor, since strong loop server will see null as value provided, there won't be any defaultFn called. Otherwise you can give uuid "undefined", it's OK.
| JavaScript | mit | agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart |
ee12708d43ff22bc9d9c9ea5a36011ee66fdd69a | tasks/autoprefixer.js | tasks/autoprefixer.js | /*
* grunt-autoprefixer
*
*
* Copyright (c) 2013 Dmitry Nikitenko
* Licensed under the MIT license.
*/
'use strict';
module.exports = function (grunt) {
var autoprefixer = require('autoprefixer');
grunt.registerMultiTask('autoprefixer', 'Parse CSS and add prefixed properties and values by Can I Use d... | /*
* grunt-autoprefixer
*
*
* Copyright (c) 2013 Dmitry Nikitenko
* Licensed under the MIT license.
*/
'use strict';
module.exports = function (grunt) {
var autoprefixer = require('autoprefixer');
grunt.registerMultiTask('autoprefixer', 'Parse CSS and add vendor prefixes to CSS rules using values fro... | Update the description of the task. | Update the description of the task.
| JavaScript | mit | nqdy666/grunt-autoprefixer,nDmitry/grunt-autoprefixer,yuhualingfeng/grunt-autoprefixer |
a5440e93f7550b2c107ffbf831a616938d90cbe7 | desktop/reactified/client/src/App.js | desktop/reactified/client/src/App.js | import React, { Component } from 'react';
import { Route, BrowserRouter as Router } from 'react-router-dom';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import injectTapEventPlugin from 'react-tap-event-plugin';
import { blue500 } from... | import React, { Component } from 'react';
import { Redirect, Route, BrowserRouter as Router } from 'react-router-dom';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import injectTapEventPlugin from 'react-tap-event-plugin';
import { blue... | Add default route from / to /tasks | Add default route from / to /tasks
| JavaScript | mit | mkermani144/wanna,mkermani144/wanna |
0369aa8e1381c1d98f7049268f6275342017b9e0 | src/components/with-drag-and-drop/item-target/item-target.js | src/components/with-drag-and-drop/item-target/item-target.js | import React from 'react';
import ReactDOM from 'react-dom';
const ItemTarget = {
hover(props, monitor, component) {
const dragIndex = monitor.getItem().index;
const hoverIndex = props.index;
// Don't replace items with themselves
if (dragIndex === hoverIndex) {
console.log(1);
return;
... | import ReactDOM from 'react-dom';
const ItemTarget = {
hover(props, monitor, component) {
const dragIndex = monitor.getItem().index;
const hoverIndex = props.index;
// Don't replace items with themselves
if (dragIndex === hoverIndex) {
return;
}
// Determine rectangle on screen
co... | Remove unused var and console statements | Remove unused var and console statements
| JavaScript | apache-2.0 | Sage/carbon,Sage/carbon,Sage/carbon |
042737ff4aad71ec237b8565e59a1fb988c1b7f3 | lib/node_modules/@stdlib/random/base/improved-ziggurat/lib/ratio_array.js | lib/node_modules/@stdlib/random/base/improved-ziggurat/lib/ratio_array.js | /**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | /**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | Fix example and dynamically resize array | Fix example and dynamically resize array
| 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 |
0ff964092fda25483633ce0fd4494b1bdf0858b0 | public/js/app.js | public/js/app.js | $(".up-button").mousedown(function(){
$.get("/movecam/moveUp");
}).mouseup(function(){
$.get("/movecam/moveStop");
});
$(".left-button").mousedown(function(){
$.get("/movecam/moveLeft");
}).mouseup(function(){
$.get("/movecam/moveStop");
});
$(".right-button").mousedown(function(){
$.get("/movecam/moveRight... | $(".up-button").bind("mousedown touchstart", function(){
$.get("/movecam/moveUp");
}).bind("mouseup touchend", function(){
$.get("/movecam/moveStop");
});
$(".left-button").bind("mousedown touchstart", function(){
$.get("/movecam/moveLeft");
}).bind("mouseup touchend", function(){
$.get("/movecam/moveStop");
}... | Enable touch use with jQuery element. | Enable touch use with jQuery element.
| JavaScript | mit | qrila/khvidcontrol,qrila/khvidcontrol |
f336097b6a75ac819d934dbc0db0f6901c4ad464 | randombytes.js | randombytes.js | var assert = require('nanoassert')
var randombytes = (function () {
var QUOTA = 65536 // limit for QuotaExceededException
var crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null
function windowBytes (out, n) {
for (var i = 0; i < n; i += QUOTA) {
crypto.getRandomValues(ou... | var assert = require('nanoassert')
var randombytes = (function () {
var QUOTA = 65536 // limit for QuotaExceededException
var crypto = typeof global !== 'undefined' ? crypto = (global.crypto || global.msCrypto) : null
function browserBytes (out, n) {
for (var i = 0; i < n; i += QUOTA) {
crypto.getRando... | Fix bug with undefined window in web workers | Fix bug with undefined window in web workers
Fixes #8
| JavaScript | mit | sodium-friends/sodium-javascript |
d14f4976cba654e91753d4f290c339fd11891c88 | frontend/common/directives/competition-infos/competitionInfos.controller.js | frontend/common/directives/competition-infos/competitionInfos.controller.js | 'use strict';
angular.module('konehuone.competitionInfos')
.controller('CompetitionInfosCtrl', function ($scope, lodash, apiService) {
var _ = lodash;
// # Variables
$scope.uiClosed = {
jj1: true,
jj2: true,
rc: true
};
$scope.compData = {};
$scope.igImages = [];
... | 'use strict';
angular.module('konehuone.competitionInfos')
.controller('CompetitionInfosCtrl', function ($scope, lodash, apiService) {
var _ = lodash;
// # Variables
$scope.uiClosed = {
jj1: false,
jj2: false,
rc: false
};
$scope.compData = {};
$scope.igImages = [];
... | Set comp info boxes opened as default | Set comp info boxes opened as default
| JavaScript | mit | miro/konehuone,miro/konehuone |
b2e9a173ccf695fceed5a2689e0b7dfce4d5f810 | package.js | package.js | Package.describe({
summary: "Ravelry OAuth flow",
name: "amschrader:ravelry",
git: "git@github.com:amschrader/meteor-ravelry.git",
version: "0.1.0"
});
Package.onTest(function(api) {
api.use('tinytest');
api.use('amschrader:ravelry');
api.addFiles('ravelry-tests.js');
});
Package.on_use(function(api) {
... | Package.describe({
summary: "Ravelry OAuth flow",
name: "amschrader:ravelry",
git: "https://github.com/amschrader/meteor-ravelry.git",
version: "0.1.2"
});
Package.onTest(function(api) {
api.use('tinytest');
api.use('amschrader:ravelry');
api.addFiles('ravelry-tests.js');
});
Package.onUse(function(api)... | Update git url, formatting nits | Update git url, formatting nits
| JavaScript | mit | amschrader/meteor-ravelry |
56e32f674d211ab1d94afd97660c0c28a82a621f | step_definitions/lib/navigation/link/index.js | step_definitions/lib/navigation/link/index.js | module.exports = {
validateAnchorText: validateAnchorText,
click: click,
};
/**
*
* @param {WebdriverIO} browser Instance of web driver
* @param {String} anchorText The anchor text to target by
*/
function click (browser, anchorText) {
return browser.click('a=' + anchorText);
}
/**
* Sets the client's ... | var interaction = require('../../interaction');
module.exports = {
validateAnchorText: validateAnchorText,
click: click,
};
/**
* Clicks an anchor element with the given anchor text
* @param {WebdriverIO} browser Instance of web driver
* @param {String} anchorText The anchor text to target by
*/
function ... | Refactor click link to use click element method | Refactor click link to use click element method
| JavaScript | mit | sudokrew/krewcumber,sudokrew/krewcumber |
2d311ac85665a5edef7a4aab7c8efaac43426201 | lab10/public/js/l10.js | lab10/public/js/l10.js | /**
* Created by curtis on 3/28/16.
*/
angular.module('clusterApp', [])
.controller('MainCtrl', [
'$scope',
'$http',
function($scope, $http) {
var completed = 0,
timesToQuery = 100,
pids = [];
$scope.cluster = [];
$scope.b... | /**
* Created by curtis on 3/28/16.
*/
angular.module('clusterApp', [])
.controller('MainCtrl', [
'$scope',
'$http',
function($scope, $http) {
var completed = 0,
timesToQuery = 100;
$scope.cluster = [];
$scope.busy = false;
$... | Clean up the lab10 code a bit. | Clean up the lab10 code a bit.
| JavaScript | mit | chocklymon/CS360,chocklymon/CS360,chocklymon/CS360,chocklymon/CS360 |
1890cfca8065635ced6755524d468614dead23f5 | src/services/GetCharityData.js | src/services/GetCharityData.js | class GetCharityData {
getData(){
var CHARITY_DATA = [
{amount: '41,234', month: 'January', year: '2015', name: 'Charity:Water', description: 'Cool description that was so hard to come up with. Hence I ended up writing some random text that dosent make much text' ,imageSource: 'https://s3.amazonaws.com/moveit-mul... | class GetCharityData {
getData(){
var CHARITY_DATA_ARRAY = [];
var spreadsheetID = "1f1tFr7y62QS7IRWOC2nNR5HWsTO99Bna3d0Xv1PTPiY";
var url = "https://spreadsheets.google.com/feeds/list/" + spreadsheetID + "/od6/public/values?alt=json";
fetch(url).then((response) => response.json())
.then((respon... | Implement service to fetch charity data from spreadsheet | Implement service to fetch charity data from spreadsheet
https://trello.com/c/wjthoHP0/28-user-sbat-view-the-charity-contributions-done-per-month-by-the-company
| JavaScript | mit | multunus/moveit-mobile,multunus/moveit-mobile,multunus/moveit-mobile |
74aa179b5e16f5456a7529326820aba1a97bbb1e | server/middleware/auth.js | server/middleware/auth.js | const session = require('express-session');
const RedisStore = require('connect-redis')(session);
const redisClient = require('redis').createClient();
module.exports.verify = (req, res, next) => {
if (req.isAuthenticated()) {
return next();
}
res.redirect('/login');
};
module.exports.profileRedirect = (req,... | const session = require('express-session');
const RedisStore = require('connect-redis')(session);
const redisClient = require('redis').createClient(process.env.REDIS_URL) || require('redis').createClient;
module.exports.verify = (req, res, next) => {
if (req.isAuthenticated()) {
return next();
}
res.redirect... | Add REDIS_URL to createClient as an argument | Add REDIS_URL to createClient as an argument
| JavaScript | mit | FuriousFridges/FuriousFridges,FuriousFridges/FuriousFridges |
9960f49700f7793c93295240481ef1fcb7080a93 | troposphere/static/js/stores/HelpLinkStore.js | troposphere/static/js/stores/HelpLinkStore.js | import Dispatcher from "dispatchers/Dispatcher";
import BaseStore from "stores/BaseStore";
import HelpLinkCollection from "collections/HelpLinkCollection";
var HelpLinkStore = BaseStore.extend({
collection: HelpLinkCollection,
queryParams: {
page_size: 100
},
});
var store = new HelpLinkStore();... | import _ from "underscore";
import Dispatcher from "dispatchers/Dispatcher";
import BaseStore from "stores/BaseStore";
import HelpLinkCollection from "collections/HelpLinkCollection";
var HelpLinkStore = BaseStore.extend({
collection: HelpLinkCollection,
queryParams: {
page_size: 100
},
});
var ... | Fix error when updateImageAttributes dispatched | Fix error when updateImageAttributes dispatched
An uncaught error has been occurring when an image creator saves any
changes to image attributes:
```
Uncaught TypeError: Cannot read property 'silent' of undefined
```
It turns out that the HelpLinkStore is performing check for an option,
`option.silent`, to determine... | JavaScript | apache-2.0 | CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend |
0393c02cf549c8ee3bc09278153208702ec2b25a | lib/app/store/geoip.js | lib/app/store/geoip.js | module.exports = function geoip (ip) {
return (state, emitter) => {
state.geoip = {
ip: ip,
isLoading: false
}
emitter.on('geoip:fetch', () => {
if (state.geoip.isLoading) return
state.geoip.isLoading = true
window.fetch('//api.ipify.org?format=json')
.then(body => ... | module.exports = function geoip (ip) {
return (state, emitter) => {
state.geoip = {
ip: ip,
isLoading: false
}
emitter.on('geoip:fetch', () => {
if (state.geoip.isLoading) return
state.geoip.isLoading = true
window.fetch('https://freegeoip.net/json/').then(body => {
... | Remove use of ipify.org service | Remove use of ipify.org service
| JavaScript | apache-2.0 | CIVIS-project/BRFApp |
53db1031477a5f159feeb90dfb30a51a83093840 | components/layout/layout-panel-header.directive.js | components/layout/layout-panel-header.directive.js | export default ['config', 'Core', function (config, Core) {
return {
template: require('components/layout/partials/panel-header.directive.html'),
transclude: {
'extraButtons': '?extraButtons',
'extraTitle': '?extraTitle'
},
scope: {
panelName: "@",... | export default ['config', 'Core', function (config, Core) {
return {
template: require('components/layout/partials/panel-header.directive.html'),
transclude: {
'extraButtons': '?extraButtons',
'extraTitle': '?extraTitle'
},
scope: {
panelName: "@",... | Fix incorrect injection of $scope for minification | Fix incorrect injection of $scope for minification
| JavaScript | mit | hslayers/hslayers-ng,hslayers/hslayers-ng,hslayers/hslayers-ng,hslayers/hslayers-ng |
84e900f20bc6738ca5f71d9346254a5f8322f5eb | examples/node-browser/tracer-init.js | examples/node-browser/tracer-init.js | /*
* Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://w... | /*
* Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://w... | Add deployment meta data to example app | Add deployment meta data to example app
| JavaScript | apache-2.0 | hawkular/hawkular-apm-opentracing-javascript |
523cdd46d039ad2a581a08f6da6438e7c72df472 | bi-platform-v2-plugin/cdf/js/components/simpleautocomplete.js | bi-platform-v2-plugin/cdf/js/components/simpleautocomplete.js |
var SimpleAutoCompleteComponent = BaseComponent.extend({
ph: undefined,
completionCallback: undefined,
update: function() {
this.ph = $("#" + this.htmlObject).empty();
this.input = $("<input type='text'>").appendTo(this.ph);
this.query = new Query(this.queryDefinition);
var myself... |
var SimpleAutoCompleteComponent = BaseComponent.extend({
ph: undefined,
completionCallback: undefined,
update: function() {
var myself = this;
this.ph = $("#" + this.htmlObject).empty();
this.input = $("<input type='text'>").appendTo(this.ph);
this.query = new Query(this.queryDefi... | Fix some bugs with simple autocomplete | Fix some bugs with simple autocomplete | JavaScript | mpl-2.0 | Tiger66639/cdf,pamval/cdf,krivera-pentaho/cdf,davidmsantos90/cdf,diogofscmariano/cdf,eliofreitas/cdf,jvelasques/cdf,Aliaksandr-Kastenka/cdf,pedrofvteixeira/cdf,pamval/cdf,jvelasques/cdf,diogofscmariano/cdf,diogofscmariano/cdf,Tiger66639/cdf,e-cuellar/cdf,afrjorge/cdf,afrjorge/cdf,webdetails/cdf,eliofreitas/cdf,scottyas... |
f60c3859905ed939366800d3adf71ec7e1da3a4b | eloquent_js/chapter12/ch12_ex03.js | eloquent_js/chapter12/ch12_ex03.js | function skipSpace(string) {
let toRemove = string.match(/^(?:\s|#.*)*/);
return string.slice(toRemove[0].length);
}
| function skipSpace(string) {
let match = string.match(/^(\s+|#.*)*/);
return string.slice(match[0].length);
}
| Add chapter 12, exercise 3 | Add chapter 12, exercise 3
| JavaScript | mit | bewuethr/ctci |
f98cf367c1d9fa9ca2516ab0d2dead2b80f7848a | test/test-issue-85.js | test/test-issue-85.js | var common = require("./common")
, odbc = require("../")
, db = new odbc.Database()
, assert = require("assert")
, util = require('util')
, count = 0
;
var sql = (common.dialect == 'sqlite' || common.dialect =='mysql')
? 'select cast(-1 as signed) as test;'
: 'select cast(-1 as int) as test;'
;
db.... | var common = require("./common")
, odbc = require("../")
, db = new odbc.Database()
, assert = require("assert")
, util = require('util')
, count = 0
;
var sql = (common.dialect == 'sqlite' || common.dialect =='mysql')
? 'select cast(-1 as signed) as test, cast(-2147483648 as signed) as test2, cast(2147... | Update test to include min and max of integer range | Update test to include min and max of integer range
| JavaScript | mit | jbaxter0810/node-odbc,gmahomarf/node-odbc,dfbaskin/node-odbc,bzuillsmith/node-odbc,Papercloud/node-odbc,bustta/node-odbc,gmahomarf/node-odbc,Papercloud/node-odbc,bzuillsmith/node-odbc,wankdanker/node-odbc,wankdanker/node-odbc,jbaxter0810/node-odbc,gmahomarf/node-odbc,dfbaskin/node-odbc,bustta/node-odbc,Papercloud/node-... |
32912d1ef7ede8ffc7722a15fa7eeba0751319a0 | example/app/models/post.js | example/app/models/post.js | module.exports = function () {
this.string('name', {
required: true,
minLength: 5
});
this.string('title', {
required: true,
minLength: 5
});
this.string('content');
this.timestamps();
this.filter('all', {
map: function (doc) {
if (doc.resource === 'Post') {
var x = ... | module.exports = function () {
this.string('name', {
required: true,
minLength: 5
});
this.string('title', {
required: true,
minLength: 5
});
this.string('content');
this.timestamps();
this.filter('all', {
map: function (doc) {
if (doc.resource === 'Post') {
emit(doc... | Change view based on fixes in resourceful | Change view based on fixes in resourceful
| JavaScript | mit | pksunkara/bullet |
92254b47944a101e37444aa4aea7f2ddb840cf38 | waltz-ng/client/extensions/extensions.js | waltz-ng/client/extensions/extensions.js | // extensions initialisation
import {registerComponents} from '../common/module-utils';
import {dynamicSections, dynamicSectionsByKind} from "../dynamic-section/dynamic-section-definitions";
import dbChangeInitiativeBrowser from './components/change-initiative/change-initiative-browser/db-change-initiative-browser';
... | // extensions initialisation
import _ from "lodash";
import {registerComponents} from '../common/module-utils';
import {dynamicSections, dynamicSectionsByKind} from "../dynamic-section/dynamic-section-definitions";
import dbChangeInitiativeBrowser from './components/change-initiative/change-initiative-browser/db-chan... | Fix change initiative section - Override GH section with DB specific one | Fix change initiative section - Override GH section with DB specific one
CTCTOWALTZ-706
| JavaScript | apache-2.0 | davidwatkins73/waltz-dev,kamransaleem/waltz,khartec/waltz,rovats/waltz,rovats/waltz,rovats/waltz,khartec/waltz,kamransaleem/waltz,khartec/waltz,rovats/waltz,davidwatkins73/waltz-dev,kamransaleem/waltz,kamransaleem/waltz,khartec/waltz,davidwatkins73/waltz-dev,davidwatkins73/waltz-dev |
8a779ce56482ab429172aa05c49d36d500bfea16 | public/backbone-marionette/js/router.js | public/backbone-marionette/js/router.js | /*global BackboneWizard, Backbone*/
BackboneWizard.Routers = BackboneWizard.Routers || {};
(function () {
'use strict';
BackboneWizard.Routers.WizardRouter = Backbone.Router.extend({
routes: {
'': 'index',
'verify': 'showVerify',
'payment': 'showPayment',
... | /*global BackboneWizard, Marionette*/
BackboneWizard.Routers = BackboneWizard.Routers || {};
(function () {
'use strict';
BackboneWizard.Routers.WizardRouter = Marionette.AppRouter.extend({
appRoutes: {
'': 'index',
'verify': 'showVerify',
'payment': 'showPayment',... | Use Marionette.AppRouter for the Router. | Use Marionette.AppRouter for the Router.
| JavaScript | mit | jonkemp/wizard-mvc |
8ca18ff251f2f44b93ebb9050931c542628fc8d1 | app/assets/javascripts/representativeSelector.js | app/assets/javascripts/representativeSelector.js | var HDO = HDO || {};
(function (H, $) {
H.representativeSelector = {
init: function (opts) {
var districtSelect, representativeSelect, representatives, selectedRepresentatives;
districtSelect = opts.districtSelect;
representativeSelect = opts.representativeSelect;
representatives ... | var HDO = HDO || {};
(function (H, $) {
H.representativeSelector = {
init: function (opts) {
var districtSelect, representativeSelect, representatives, selectedRepresentatives;
districtSelect = opts.districtSelect;
representativeSelect = opts.representativeSelect;
representatives ... | Disable district search + use contains filter for representatives. | Disable district search + use contains filter for representatives.
| JavaScript | bsd-3-clause | holderdeord/hdo-site,holderdeord/hdo-site,holderdeord/hdo-site,holderdeord/hdo-site |
728693fbf3fbad513fec2d1bee6aeabe4e5caf91 | frontend/src/components/ViewActivities/activityday.js | frontend/src/components/ViewActivities/activityday.js | import React from 'react';
import Accordion from 'react-bootstrap/Accordion';
import Card from 'react-bootstrap/Card';
import Activity from './activity';
import * as activityFns from './activityfns';
import * as utils from '../Utils/utils.js'
class ActivityDay extends React.Component {
/** @inheritdoc */
construct... | import React from 'react';
import Accordion from 'react-bootstrap/Accordion';
import Card from 'react-bootstrap/Card';
import Activity from './activity';
import * as activityFns from './activityfns';
import * as utils from '../Utils/utils.js'
class ActivityDay extends React.Component {
/** @inheritdoc */
construct... | Remove state variable where it can be removed. | Remove state variable where it can be removed.
| JavaScript | apache-2.0 | googleinterns/SLURP,googleinterns/SLURP,googleinterns/SLURP |
d6090f49d653d76a65696e3c5fe8417c673c398a | auto-bind.js | auto-bind.js | 'use strict';
var copy = require('es5-ext/object/copy')
, map = require('es5-ext/object/map')
, callable = require('es5-ext/object/valid-callable')
, validValue = require('es5-ext/object/valid-value')
, bind = Function.prototype.bind, defineProperty = Object.defineProperty
, hasOwnProperty = ... | 'use strict';
var copy = require('es5-ext/object/copy')
, ensureCallable = require('es5-ext/object/valid-callable')
, map = require('es5-ext/object/map')
, callable = require('es5-ext/object/valid-callable')
, validValue = require('es5-ext/object/valid-value')
, bind = Functio... | Reconfigure bindTo support into options.resolveContext | Reconfigure bindTo support into options.resolveContext
| JavaScript | isc | medikoo/d |
79e5bd95684823ee41af1d35474cb29a627328d2 | example/index.js | example/index.js | var express = require('express'),
app = express(),
kaching = require('kaching');
app.set('views', __dirname);
app.set('view engine', 'jade');
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
app.use(express.session({ secret: 'se... | var express = require('express'),
app = express(),
PaypalStrategy = require('kaching-paypal'),
kaching = require('kaching');
app.set('views', __dirname);
app.set('view engine', 'jade');
/**
* Test account: kaching@gmail.com
* Password: kachingtest
*/
kaching.use(new PaypalStrategy({
'client_id': 'AVN... | Use paypal strategy for testing. | Use paypal strategy for testing.
| JavaScript | mit | gregwym/kaching |
d769d4b6df913d6b4e32e1e4b44d4f69d9f926ca | bin/cli.js | bin/cli.js | var program = require('commander');
program
.description('Generate random documents, numbers, names, address, etc.')
.version('0.0.1')
.option('-f, --cpf', 'Select CPF')
.option('-j, --cnpj', 'Select CNPJ')
.option('-n, --name [gender]', 'Select Name')
.option('-c, --creditCard <type>', 'Select... | var program = require('commander');
program
.description('Generate random documents, numbers, names, address, etc.')
.version('0.0.1')
.option('-f, --cpf', 'Select CPF')
.option('-j, --cnpj', 'Select CNPJ')
.option('-c, --creditCard <type>', 'Select Credit Card. Types: maestro, dinersclub, laser, j... | Remove --name feature as it's not working at the moment | Remove --name feature as it's not working at the moment
| JavaScript | mit | lvendrame/dev-util-cli,lagden/dev-util-cli |
764061b8b87ff137633089f17f14e954f995cd8d | bin/cli.js | bin/cli.js | var program = require('commander');
var pkg = require('../package.json');
program
.version(pkg.version)
.description('Gitter bot for evaluating expressions')
.usage('<room-name>')
.parse(process.argv);
if (!program.args[0]) {
throw new Error('You must supply room');
}
| var program = require('commander');
var pkg = require('../package.json');
program
.version(pkg.version)
.description('Gitter bot for evaluating expressions')
.usage('[options] <room-name>')
.option('-k, --key', 'Override API key by default')
.parse(process.argv);
| Add option for override default API key | Add option for override default API key
| JavaScript | mit | ghaiklor/uwcua-vii |
8102b934e3aa9386d2dd68acb7cb5985c68684b8 | test/promises-tests.js | test/promises-tests.js | var path = require('path');
var fs = require('fs');
global.adapter = require('./adapter-a');
describe('promises-tests', function () {
var testsDir = path.join(path.dirname(require.resolve('promises-aplus-tests/lib/programmaticRunner.js')), 'tests');
var testFileNames = fs.readdirSync(testsDir);
testFileNames.f... | var tests = require('promises-aplus-tests');
var adapter = require('./adapter-a');
tests.mocha(adapter); | Use newer system for programatic runner | Use newer system for programatic runner
| JavaScript | mit | nodegit/promise,slang800/promise,then/promise,vigetlabs/promise,taylorhakes/promise,JoshuaWise/jellypromise,implausible/promise,ljharb/promise,npmcomponent/then-promise,astorije/promise,Bacra/promise,cpojer/promise |
ec3d29cdb3231abc1bed89d5fc5a02f29addb392 | examples/todo/webpack.config.js | examples/todo/webpack.config.js | var path = require('path');
module.exports = {
entry: path.resolve(__dirname, 'lib', 'client.js'),
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'lib'),
},
};
| var path = require('path');
module.exports = {
entry: [
'babel-core/polyfill',
path.resolve(__dirname, 'lib', 'client.js'),
],
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'lib'),
},
};
| Load babel-core/polyfill in the example (thanks to @DylanSale) | Load babel-core/polyfill in the example (thanks to @DylanSale)
| JavaScript | bsd-2-clause | AndriyShepitsen/react-relay-cbi,denvned/isomorphic-relay-router |
d6e9f814bde9c63af95ec9220c768ab477b2dc5a | app/assets/javascripts/routes/sign_in_route.js | app/assets/javascripts/routes/sign_in_route.js | HB.SignInRoute = Ember.Route.extend({
beforeModel: function() {
if (this.get('currentUser.isSignedIn')) {
this.transitionTo('dashboard');
}
}
});
| HB.SignInRoute = Ember.Route.extend({
beforeModel: function() {
if (this.get('currentUser.isSignedIn')) {
this.transitionTo('dashboard');
}
},
setupController: function(controller, model) {
controller.set('username', '');
controller.set('password', '');
controller.set('errorMessage', '')... | Reset login form on setupController | Reset login form on setupController
| JavaScript | apache-2.0 | saintsantos/hummingbird,MiLk/hummingbird,sidaga/hummingbird,jcoady9/hummingbird,sidaga/hummingbird,wlads/hummingbird,jcoady9/hummingbird,erengy/hummingbird,erengy/hummingbird,synthtech/hummingbird,hummingbird-me/hummingbird,vevix/hummingbird,MiLk/hummingbird,Snitzle/hummingbird,saintsantos/hummingbird,paladique/humming... |
0813ec552b2bbf3e3b781b0a4ccb81d142a8adb1 | blueprints/ember-cli-table-pagination/index.js | blueprints/ember-cli-table-pagination/index.js | /*jshint node:true*/
module.exports = {
description: 'install the addon'// ,
// locals: function(options) {
// // Return custom template variables here.
// return {
// foo: options.entity.options.foo
// };
// }
// afterInstall: function(options) {
// // Perform extra work here.
// }
... | /*jshint node:true*/
module.exports = {
description: 'install the addon',
// locals: function(options) {
// // Return custom template variables here.
// return {
// foo: options.entity.options.foo
// };
// }
// afterInstall: function(options) {
// // Perform extra work here.
// }
nor... | Revert "try changing the blueprint" | Revert "try changing the blueprint"
This reverts commit 9f6815ed2ef27ef7898fe5f2f444d2b5af1e816a.
| JavaScript | mit | jking6884/ember-cli-table-pagination,gte451f/ember-cli-table-pagination,jking6884/ember-cli-table-pagination,gte451f/ember-cli-table-pagination |
c63270920685755f00bf4df93734d5e4753ea798 | data/panel.js | data/panel.js | let selectElm = document.getElementById("switchy-panel-select");
selectElm.onchange = function() {
self.port.emit("changeProfile", selectElm.value);
}
let buttons = [ 'add', 'manager', 'settings', 'about' ];
for (let i = 0; i < buttons.length; ++i) {
createButton(buttons[i]);
}
function createButton(name) {
let... | let selectElm = document.getElementById("switchy-panel-select");
let buttons = [ 'add', 'manager', 'settings', 'about' ];
for (let i = 0; i < buttons.length; ++i) {
createButton(buttons[i]);
}
function createButton(name) {
let button = document.getElementById('switchy-panel-' + name + '-button');
button.onclick... | Select profile with 1 element in the select | Select profile with 1 element in the select
| JavaScript | mpl-2.0 | bakulf/switchy |
9186287a7e1881eb051fada1d782e4118804c2af | simpyapp/static/sim.js | simpyapp/static/sim.js | $(document).ready(function() {
init();
$.ajaxSetup({
crossDomain: false, // obviates need for sameOrigin test
beforeSend: function(xhr, settings) {
if (!csrfSafeMethod(settings.type)) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
}
}
});
});
function init() {
$(... | $(document).ready(function() {
init();
});
function init() {
$('#compare').click(function() {
$.ajax({
url: '/compare/',
type: 'post',
data: {
doc1: $('#doc1').val(),
doc2: $('#doc2').val(),
},
success: function(data){
$('#result').html(data);
},
... | Clean up csrf helper functions | Clean up csrf helper functions
| JavaScript | mit | initrc/simpy,initrc/simpy |
b6d910a90dfec796752c91b21014073f02618b01 | js/containers/makeSortable.js | js/containers/makeSortable.js | 'use strict';
var React = require('react');
var Sortable = require('../views/Sortable');
var {deepPureRenderMixin} = require('../react-utils');
// We skip the first column to keep 'samples' on the left.
function makeSortable(Component) {
return React.createClass({
displayName: 'SpreadsheetSortable',
mixins: [deep... | 'use strict';
var React = require('react');
var Sortable = require('../views/Sortable');
var {deepPureRenderMixin} = require('../react-utils');
// We skip the first column to keep 'samples' on the left.
function makeSortable(Component) {
return React.createClass({
displayName: 'SpreadsheetSortable',
mixins: [deep... | Enable tooltip freeze on samples. | Enable tooltip freeze on samples.
| JavaScript | apache-2.0 | ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client,ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client |
5305aea90d10ba8c89422ccae0d75a8b22baa806 | src/lib/run.js | src/lib/run.js | const path = require('path');
const babelOptions = {
presets: ['es2015', 'stage-0'],
plugins: ['transform-decorators-legacy', 'transform-runtime']
};
exports.module = function runModule(modulePath) {
/* eslint-disable lines-around-comment, global-require */
const packageJson = require(path.resolve('package.js... | const path = require('path');
const babelOptions = {
presets: ['es2015', 'stage-0'],
plugins: ['transform-decorators-legacy', 'transform-runtime']
};
exports.module = function runModule(modulePath) {
/* eslint-disable lines-around-comment, global-require */
const packageJson = require(path.resolve('package.js... | Remove src/ from package.json in development | Remove src/ from package.json in development
| JavaScript | mit | vinsonchuong/dist-es6 |
96e2badfc4d6a3bbdabe220cdbb6dd3851a6b6fc | src/global/style/utils.js | src/global/style/utils.js | //@flow
export function baseAdjust(n: number): string {
return `
padding-top: calc(${n}em / 16) !important;
margin-bottom: calc(-${n}em / 16) !important;
`;
}
| //@flow
import { css } from "styled-components";
export const baseAdjust = (n: number) => css`
padding-top: calc(${n}em / 16) !important;
margin-bottom: calc(-${n}em / 16) !important;
`;
| Edit baseAdjust to ()=> and include css`` in styled components output | Edit baseAdjust to ()=> and include css`` in styled components output
| JavaScript | mit | slightly-askew/portfolio-2017,slightly-askew/portfolio-2017 |
b9805279764f6fa4c3a50a4e3b9dbca7a40156c0 | addon/instance-initializers/body-class.js | addon/instance-initializers/body-class.js | import Ember from 'ember';
export function initialize(instance) {
const config = instance.container.lookupFactory('config:environment');
// Default to true when not set
let _includeRouteName = true;
if (config['ember-body-class'] && config['ember-body-class'].includeRouteName === false) {
_includeRouteNam... | import Ember from 'ember';
export function initialize(instance) {
var config;
if (instance.resolveRegistration) {
// Ember 2.1+
// http://emberjs.com/blog/2015/08/16/ember-2-1-beta-released.html#toc_registry-and-container-reform
config = instance.resolveRegistration('config:environment');
} else {
... | Use updated registry in Ember 2.1 | Use updated registry in Ember 2.1
| JavaScript | mit | AddJam/ember-body-class,AddJam/ember-body-class |
8767bd64bad5313a86dca9b44c227e1b688a9d81 | webpack-prod.config.js | webpack-prod.config.js | var config = module.exports = require("./webpack.config.js");
var webpack = require('webpack');
var _ = require('lodash');
config = _.merge(config, {
externals : {
"react" : "React"
}
});
var StringReplacePlugin = require("string-replace-webpack-plugin");
config.module.loaders.push({
test: /inde... | var config = module.exports = require("./webpack.config.js");
var webpack = require('webpack');
var _ = require('lodash');
config = _.merge(config, {
externals : {
"react" : "React",
"react-dom" : "ReactDOM"
}
});
var StringReplacePlugin = require("string-replace-webpack-plugin");
config.mod... | Update production build for react-0.14 | Update production build for react-0.14
| JavaScript | mit | payalabs/scalajs-react-bridge-example,payalabs/scalajs-react-bridge-example |
5408013ea3ade16bd810f418d1e6e6cea992a841 | db/config.js | db/config.js | //For Heroku Deployment
var URI = require('urijs');
var config = URI.parse(process.env.DATABASE_URL);
module.exports = config;
// module.exports = {
// database: 'sonder',
// user: 'postgres',
// //password: 'postgres',
// port: 32769,
// host: '192.168.99.100'
// };
| //For Heroku Deployment
var URI = require('urijs');
var config = URI.parse(process.env.DATABASE_URL);
config['ssl'] = true;
module.exports = config;
// module.exports = {
// database: 'sonder',
// user: 'postgres',
// //password: 'postgres',
// port: 32769,
// host: '192.168.99.100'
// };
| Enforce SSL connection to Postgres | Enforce SSL connection to Postgres
| JavaScript | mit | MapReactor/SonderServer,aarontrank/SonderServer,aarontrank/SonderServer,MapReactor/SonderServer |
485f1e8443bee8dd5f7116112f98717edbc49a08 | examples/ably.js | examples/ably.js | 'use strict';
require.config({
paths: {
Ably: '/ably.min'
}
});
define(['Ably'], function(Ably) {
var ably = new Ably();
return ably;
});
| 'use strict';
require.config({
paths: {
Ably: '/ably.min'
}
});
/* global define */
define(['Ably'], function(Ably) {
var ably = new Ably();
return ably;
});
| Allow "define" in examples (no-undef) | Allow "define" in examples (no-undef)
| JavaScript | mit | vgno/ably |
e5a8b77baea9eca2a44fb043dcff28e73177f8a6 | src/js/models.js | src/js/models.js |
var Pomodoro = Backbone.Model.extend({
defaults: {
isStarted: false,
duration: 25 * 60,
remainingSeconds: null
},
initialize: function() {
this.listenTo(this, 'finished', this.finish);
},
start: function(duration){
if (duration) {
this.set('dur... |
var Pomodoro = Backbone.Model.extend({
defaults: {
isStarted: false,
duration: 25 * 60,
remainingSeconds: null
},
initialize: function() {
this.listenTo(this, 'finished', this.finish);
},
start: function(duration){
if (duration) {
this.set('dur... | Fix bug when starting pmdr multiple times | Fix bug when starting pmdr multiple times
| JavaScript | mit | namlook/pmdr |
8552314ec2908bd82723ba50d406c48d4a0a6b59 | devServer.js | devServer.js | /* eslint no-var: 0, func-names: 0 , no-console: 0 */
/**
* Development Server
* - See https://github.com/gaearon/react-transform-boilerplate
*/
var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.config.dev');
var app = express();
var co... | /* eslint no-var: 0, func-names: 0 , no-console: 0 */
/**
* Development Server
* - See https://github.com/gaearon/react-transform-boilerplate
*/
var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.config.dev');
var app = express();
var co... | Read dev server port from env if its there | [cleanup] Read dev server port from env if its there | JavaScript | mit | jackp/finance-tracker,jackp/finance-tracker |
a73841eb0191f1585affb4228e05af6e2e503291 | shallowEqualImmutable.js | shallowEqualImmutable.js | var Immutable = require('immutable');
var is = Immutable.is.bind(Immutable),
getKeys = Object.keys.bind(Object);
function shallowEqualImmutable(objA, objB) {
if (is(objA, objB)) {
return true;
}
var keysA = getKeys(objA),
keysB = getKeys(objB),
keysAlength = keysA.length,
keysBlength =... | var Immutable = require('immutable');
var is = Immutable.is.bind(Immutable);
function shallowEqualImmutable(objA, objB) {
if (objA === objB || is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null ||
typeof objB !== 'object' || objB === null) {
return false;
}
var ... | Make more similar to original version | Make more similar to original version | JavaScript | mit | steffenmllr/react-immutable-render-mixin,jurassix/react-immutable-render-mixin |
15cb0b67e0850945fc3c505e902b9984c67e4923 | src/components/Menu.js | src/components/Menu.js | import React from 'react';
import {
Link
} from 'react-router';
import './Menu.css';
import User from './User';
import language from '../language/language';
const menuLanguage = language.components.menu;
let Menu = React.createClass ({
getInitialState() {
return { showUser: false };
},
toggleUser() {
... | import React from 'react';
import {
Link
} from 'react-router';
import './Menu.css';
import User from './User';
import language from '../language/language';
const menuLanguage = language.components.menu;
let Menu = React.createClass ({
getInitialState() {
return { showUser: false };
},
toggleUser() {
... | Add id the link where the toggleUser is bind | Add id the link where the toggleUser is bind
| JavaScript | bsd-3-clause | jeromelachaud/Last.fm-Activities-React,jeromelachaud/Last.fm-Activities-React |
f76fe4e96d4c637c10d11e80a73c280c28113550 | src/minipanel.js | src/minipanel.js | MiniPanel = function (game, text, x, y) {
Phaser.Group.call(this, game);
text = "TESTING"
var style = { font: "25px Arial", align: "center" };
this.label = game.add.text(x, y, text, style)
this.label.anchor.setTo(0.5)
var middle = this.game.add.tileSprite(x, y, this.label.width-50,
50,... | MiniPanel = function (game, text, x, y) {
Phaser.Group.call(this, game);
var style = { font: "25px Arial", align: "center" };
this.label = game.add.text(x, y, text, style)
this.label.anchor.setTo(0.5)
var middle = this.game.add.tileSprite(x, y, this.label.width-50,
50, 'sprites',
'be... | Remove "Testing" as best word every time | Remove "Testing" as best word every time
Signed-off-by: Reicher <d5b86a7882b5bcb4262a5e66c6cf4ed497795bc7@gmail.com>
| JavaScript | mit | Reicher/Lettris,Reicher/Lettris |
652d9409708510ddcfdf3c73c92205345ef3710c | generators/needle/needle-client-base.js | generators/needle/needle-client-base.js | const needleBase = require('./needle-base');
module.exports = class extends needleBase {
addStyle(style, comment, filePath, needle) {
const styleBlock = this.mergeStyleAndComment(style, comment);
this.addBlockContentToFile(filePath, styleBlock, needle);
}
mergeStyleAndComment(style, commen... | const needleBase = require('./needle-base');
module.exports = class extends needleBase {
addStyle(style, comment, filePath, needle) {
const styleBlock = this.mergeStyleAndComment(style, comment);
const rewriteFileModel = this.generateFileModel(filePath, needle, styleBlock);
this.addBlockCo... | Use needleNase API in clientBase | Use needleNase API in clientBase
| JavaScript | apache-2.0 | gmarziou/generator-jhipster,pascalgrimaud/generator-jhipster,mosoft521/generator-jhipster,wmarques/generator-jhipster,pascalgrimaud/generator-jhipster,mosoft521/generator-jhipster,gmarziou/generator-jhipster,jhipster/generator-jhipster,atomfrede/generator-jhipster,liseri/generator-jhipster,vivekmore/generator-jhipster,... |
f2b9463ee744299caaae1f936003e53ae0e826a6 | tasks/style.js | tasks/style.js | /*eslint-disable no-alert, no-console */
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import * as paths from './paths';
const $ = gulpLoadPlugins();
gulp.task('compile:styles', () => {
const AUTOPREFIXER_BROWSERS = [
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= ... | /*eslint-disable no-alert, no-console */
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import * as paths from './paths';
const $ = gulpLoadPlugins();
gulp.task('compile:styles', () => {
// See https://github.com/ai/browserslist for more details on how to set
// browser versions
co... | Simplify browser version selection for autoprefixer | Simplify browser version selection for autoprefixer
| JavaScript | unlicense | gsong/es6-jspm-gulp-starter,gsong/es6-jspm-gulp-starter |
e3859a6937aa4848c9940f7e6bbecfa35bd845bc | src/cli.js | src/cli.js | #!/usr/bin/env node
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory t... | #!/usr/bin/env node
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory t... | Use promise installer when using CLI | Use promise installer when using CLI
| JavaScript | mit | unindented/electron-installer-windows,unindented/electron-installer-windows |
a7c81ff7bb40623991cbec24777f7f2fae31a2d8 | plugins/async-await.js | plugins/async-await.js | module.exports = function (babel) {
var t = babel.types;
return {
visitor: {
Function: function (path) {
var node = path.node;
if (! node.async) {
return;
}
node.async = false;
node.body = t.blockStatement([
t.expressionStatement(t.stringLiter... | "use strict";
module.exports = function (babel) {
const t = babel.types;
return {
visitor: {
Function: {
exit: function (path) {
const node = path.node;
if (! node.async) {
return;
}
// The original function becomes a non-async function that
... | Enable native async/await in Node 8. | Enable native async/await in Node 8.
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor |
abd2538246f0e1f38a110efa84d973dfa6118b86 | lib/collections/checkID.js | lib/collections/checkID.js | Meteor.methods({
checkHKID: function (hkid) {
var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/;
var matchArray = hkid.match(hkidPat);
if(matchArray == null){throw new Meteor.Error('invalid', 'The HKID entered is invalid')} else {
var checkSum = 0;
var charPart = match... | Meteor.methods({
checkHKID: function (hkid) {
var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/; // HKID format = 1 or 2 letters followed by 6 numbers and 1 checksum digit.
var matchArray = hkid.match(hkidPat);
if(matchArray == null){idError()}
var checkSum = 0;
var charPart =... | Clean up HKID verification code | Clean up HKID verification code
| JavaScript | agpl-3.0 | gazhayes/Popvote-HK,gazhayes/Popvote-HK |
af64cda5c55b48be439bce1457016248a28d2d82 | Gruntfile.js | Gruntfile.js | /*jshint camelcase:false */
module.exports = function (grunt) {
// Load all grunt tasks
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
release: {
options: {
bump: true, //default: true
file: 'package.json', //default: package.json
add: true, ... | /*jshint camelcase:false */
module.exports = function (grunt) {
// Load all grunt tasks
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
release: {
options: {
bump: true, //default: true
file: 'package.json', //default: package.json
add: true, ... | Create unit watcher grunt task | Create unit watcher grunt task
| JavaScript | mit | thanpolas/kansas-metrics |
ef5f7fef4b715561983945604118bc27bb257d28 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function(grunt) {
// Load all tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pck: grunt.file.readJSON('package.json'),
clean: {
all: ['typebase.css']
},
watch: {
less: {
files: ['src/{,*/}*.less'],
tasks: ['less:dev']
... | 'use strict';
module.exports = function(grunt) {
// Load all tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pck: grunt.file.readJSON('package.json'),
clean: {
all: ['typebase.css']
},
watch: {
less: {
files: ['src/{,*/}*.less'],
tasks: ['less:dev']
... | Add a grunt task to translipe stylus | Add a grunt task to translipe stylus
| JavaScript | mit | devinhunt/typebase.css,devinhunt/typebase.css,aoimedia/typebase.css,Calinou/typebase.css,Calinou/typebase.css,aoimedia/typebase.css |
5e167fb98b87c1f21ef6787dda245560fbc786f6 | lib/config.js | lib/config.js | /**
* Configuration library
*
* On start-up:
* - load a configuration file
* - validate the configuration
* - populate configuration secrets from environment variables
*
* On configuration:
* - register authenticators
*/
'use strict';
module.exports = {
_safeGetEnvString: safeGetEnvString,
load,
popul... | 'use strict';
module.exports = {
_safeGetEnvString: safeGetEnvString,
load,
populateEnvironmentVariables,
};
/**
* Module dependencies.
*/
const { check, mapValuesDeep } = require('./utils');
const { flow } = require('lodash');
const read = require('read-data');
/**
* Assemble a configuration
*
* @return... | Remove old and incorrect workflow docs | Remove old and incorrect workflow docs
| JavaScript | mit | HiFaraz/identity-desk |
d806a1c4cd904dc9db5dd09932760b797beceac5 | lib/field_ref.js | lib/field_ref.js | lunr.FieldRef = function (docRef, fieldName) {
this.docRef = docRef
this.fieldName = fieldName
this._stringValue = fieldName + lunr.FieldRef.joiner + docRef
}
lunr.FieldRef.joiner = "/"
lunr.FieldRef.fromString = function (s) {
var n = s.indexOf(lunr.FieldRef.joiner)
if (n === -1) {
throw "malformed fi... | lunr.FieldRef = function (docRef, fieldName, stringValue) {
this.docRef = docRef
this.fieldName = fieldName
this._stringValue = stringValue
}
lunr.FieldRef.joiner = "/"
lunr.FieldRef.fromString = function (s) {
var n = s.indexOf(lunr.FieldRef.joiner)
if (n === -1) {
throw "malformed field ref string"
... | Stop needlessly recreating field ref string | Stop needlessly recreating field ref string
| JavaScript | mit | olivernn/lunr.js,olivernn/lunr.js,olivernn/lunr.js |
3de90480307a12d0dc1679b93a767b086f8420a2 | jquery.sticky.js | jquery.sticky.js | (function ($) {
// http://davidwalsh.name/ways-css-javascript-interact
function addCSSRule (sheet, selector, rules, index) {
if (sheet.insertRule) {
sheet.insertRule(selector + '{ ' + rules + ' }', index)
} else {
sheet.addRule(selector, rules, index)
}
}
function heightOffset (e... | (function ($) {
// http://davidwalsh.name/ways-css-javascript-interact
function addCSSRule (sheet, selector, rules, index) {
if (sheet.insertRule) {
sheet.insertRule(selector + '{ ' + rules + ' }', index)
} else {
sheet.addRule(selector, rules, index)
}
}
function heightOffset (e... | Use offset rather than calculating position by hand | Use offset rather than calculating position by hand | JavaScript | mit | leemachin/sticky.js,leemachin/sticky.js |
5357686b071fd82a3326576afd7aa61c46862f32 | examples/witExample.js | examples/witExample.js | const speeech = require("../src/index");
const get = require("lodash.get");
const say = require("say");
const serviceConfig = require("../witkeyfile.json");
const process = result => {
const intent = get(result, "entities.intent[0].value");
if (intent === "weather") {
const location = get(result, "entities.lo... | const speeech = require("../src/index");
const get = require("lodash.get");
const serviceConfig = require("../witkeyfile.json");
const process = result => {
const intent = get(result, "entities.intent[0].value");
console.log(`The intent is ${intent}`);
};
speeech.emit("start", speeech.witService(serviceConfig))... | Update first Wit example to do it more simple | Update first Wit example to do it more simple
| JavaScript | mit | joyarzun/speeech |
285abec25cba485a463e6dfaa30c1844736e899b | mltsp/tests/frontend/index.js | mltsp/tests/frontend/index.js | casper.test.begin('index loads', 1, function suite(test) {
casper.start('http://localhost:5000', function() {
test.assertTextExists('MLTSP', 'successfully loaded index page');
});
casper.run(function() {
test.done();
});
});
| casper.test.begin('index loads', 1, function suite(test) {
casper.start('http://localhost:5000', function() {
test.assertTextExists('Sign in with your Google Account',
'Authentication displayed on index page');
});
casper.run(function() {
test.done();
});
}... | Add valid test for front page | Add valid test for front page
| JavaScript | bsd-3-clause | bnaul/mltsp,mltsp/mltsp,bnaul/mltsp,mltsp/mltsp,bnaul/mltsp,mltsp/mltsp,acrellin/mltsp,mltsp/mltsp,acrellin/mltsp,acrellin/mltsp,acrellin/mltsp,bnaul/mltsp,acrellin/mltsp,mltsp/mltsp,bnaul/mltsp,acrellin/mltsp,bnaul/mltsp,mltsp/mltsp |
89ace9a841c782fa9172b2255eded1e42ba9a9c2 | src/rethinkdbConfig.js | src/rethinkdbConfig.js | let rethinkdbConfig = {
host: process.env.RETHINKDB_HOST || 'localhost',
port: process.env.RETHINKDB_PORT || 28015,
db: 'quill_lessons'
}
if (process.env.RETHINKDB_USER) {
rethinkdbConfig['user'] = process.env.RETHINKDB_USER
}
if (process.env.RETHINKDB_PASSWORD) {
rethinkdbConfig['password'] = process.env... | const rethinkdbConfig = (() => {
let config = {
host: process.env.RETHINKDB_HOST || 'localhost',
port: process.env.RETHINKDB_PORT || 28015,
db: 'quill_lessons'
}
if (process.env.RETHINKDB_USER) {
config['user'] = process.env.RETHINKDB_USER
}
if (process.env.RETHINKDB_PASSWORD) {
config... | Use module pattern because its javascript | Use module pattern because its javascript
| JavaScript | agpl-3.0 | empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core |
eb5e847adf69f0d183f6a13f72eb72ce7a1d2dc9 | test/unit/game_of_life.support.spec.js | test/unit/game_of_life.support.spec.js | describe('Support module', function () {
var S = GameOfLife.Support;
describe('For validating canvas', function () {
it('throws InvalidArgument if given other than a canvas element', function () {
expect(function () {
S.validateCanvas($('<p>foo</p>')[0]);
}).toThrow(new S.InvalidArgument('N... | describe('Support module', function () {
var S = GameOfLife.Support;
describe('For validating canvas', function () {
it('throws InvalidArgument if given other than a canvas element', function () {
expect(function () {
S.validateCanvas($('<p>foo</p>')[0]);
}).toThrow(new S.InvalidArgument('N... | Add unit test for object inversion | Add unit test for object inversion
| JavaScript | mit | tkareine/game_of_life,tkareine/game_of_life,tkareine/game_of_life |
4a69ba9da100f91abd49e90a1c810655e3785419 | lib/templates.js | lib/templates.js | const utilities = require('./utilities');
const limited = (limited) => limited ? ' | limited' : '';
const unique = (unique) => unique ? ' | unique' : '';
const points = (points) => (typeof points !== 'undefined' ? `${points}pt${points > 1 || points === 0 ? 's': ''}` : '');
const multiCard = (card) => `\n• *${c... | const utilities = require('./utilities');
const limited = (limited) => limited ? ' | limited' : '';
const unique = (unique) => unique ? ' | unique' : '';
const cardIntro = (card) => `${card.name} (${card.slot}${limited(card.limited)}${unique(card.unique)}): ${points(card.points)}`;
const points = (points) => (... | Split out the card template funciton | chore: Split out the card template funciton
| JavaScript | mit | bmds/SlackXWingCardCmd |
d5a2f021fc31a29bc2be216f43b8baf6850a1ee7 | lib/transform.js | lib/transform.js | const sharp = require('sharp')
const cropDimensions = (width, height, maxSize) => {
if (width <= maxSize && height <= maxSize) return [width, height]
const aspectRatio = width / height
if (width > height) return [maxSize, Math.round(maxSize / aspectRatio)]
return [maxSize * aspectRatio, maxSize]
}
module.expo... | const sharp = require('sharp')
const cropDimensions = (width, height, maxSize) => {
if (width <= maxSize && height <= maxSize) return [width, height]
const aspectRatio = width / height
if (width > height) return [maxSize, Math.round(maxSize / aspectRatio)]
return [maxSize * aspectRatio, maxSize]
}
module.expo... | Fix compatibility with sharp >=0.22.x | Fix compatibility with sharp >=0.22.x
.min() was removed | JavaScript | mit | pmb0/express-sharp,pmb0/express-sharp,pmb0/express-sharp |
a84f95e02670bb8f512ef1b0293610584de938f3 | web/js/main.js | web/js/main.js | jQuery(function ($) {
setup_search_box();
$('.tablesorter').tablesorter({
sortList: [[1,0]],
headers: {
0: { sorter: false },
1: { sorter: 'text'},
3: { sorter: false }
}
});
});
function setup_search_box() {
var el = $('#my_search_box .search... | jQuery(function ($) {
setup_search_box();
$('.tablesorter').tablesorter({
sortList: [[1,0]],
headers: {
1: { sorter: 'text'},
2: { sorter: false }
}
});
});
function setup_search_box() {
var el = $('#my_search_box .search');
if ( ! el.length ) { retur... | Fix sort order since we now display the module logo right aligned to the module name cell | Fix sort order since we now display the module logo right aligned to the module name cell
| JavaScript | artistic-2.0 | perl6/modules.perl6.org,perl6/modules.perl6.org,perl6/modules.perl6.org,perl6/modules.perl6.org |
ef980661130b68cfed37d32f29e3ad6069361fb9 | lib/feedpaper.js | lib/feedpaper.js | var Cache = require('./cache');
var fs = require('fs');
var handlers = require('./handlers');
var Ute = require('ute');
var util = require('./util');
function FeedPaper() {
this.ute = new Ute();
this.init();
}
FeedPaper.prototype.init = function () {
var categoryList = [];
var urlLookup ... | var Cache = require('./cache');
var fs = require('fs');
var handlers = require('./handlers');
var Ute = require('ute');
var util = require('./util');
function FeedPaper() {
this.ute = new Ute();
this.init();
}
FeedPaper.prototype.init = function () {
var categoryList = [];
var urlLookup ... | Add loading data log message. | Add loading data log message.
| JavaScript | mit | cliffano/feedpaper,cliffano/feedpaper,cliffano/feedpaper |
e5816421524dfb1d809b921923c7afb371471779 | lib/emitters/custom-event-emitter.js | lib/emitters/custom-event-emitter.js | var util = require("util")
, EventEmitter = require("events").EventEmitter
module.exports = (function() {
var CustomEventEmitter = function(fct) {
this.fct = fct
}
util.inherits(CustomEventEmitter, EventEmitter)
CustomEventEmitter.prototype.run = function() {
var self = this
// delay th... | var util = require("util")
, EventEmitter = require("events").EventEmitter
module.exports = (function() {
var CustomEventEmitter = function(fct) {
this.fct = fct;
var self = this;
process.nextTick(function() {
if (self.fct) {
self.fct.call(self, self)
}
}.bind(this));
... | Remove setTimeout in favor of process.nextTick() | Remove setTimeout in favor of process.nextTick()
According to [process.nextTick() documentation](http://nodejs.org/api/process.html#process_process_nexttick_callback), using setTimeout is not recommended:
On the next loop around the event loop call this callback. This is not a simple alias to setTimeout(fn, 0),... | JavaScript | mit | IrfanBaqui/sequelize |
99bbcbebfc35cfca348860c2ea93e0a54ba2c25c | lib/output/modifiers/inlineAssets.js | lib/output/modifiers/inlineAssets.js | var svgToImg = require('./svgToImg');
var svgToPng = require('./svgToPng');
var resolveImages = require('./resolveImages');
var fetchRemoteImages = require('./fetchRemoteImages');
var Promise = require('../../utils/promise');
/**
Inline all assets in a page
@param {String} rootFolder
*/
function inlineAssets... | var svgToImg = require('./svgToImg');
var svgToPng = require('./svgToPng');
var resolveImages = require('./resolveImages');
var fetchRemoteImages = require('./fetchRemoteImages');
var Promise = require('../../utils/promise');
/**
Inline all assets in a page
@param {String} rootFolder
*/
function inlineAssets... | Fix modifiers for ebook format | Fix modifiers for ebook format
| JavaScript | apache-2.0 | gencer/gitbook,strawluffy/gitbook,tshoper/gitbook,gencer/gitbook,tshoper/gitbook,GitbookIO/gitbook,ryanswanson/gitbook |
1fbef25c78e8677116d2bee0aea2a239b4653de6 | src/util/encodeToVT100.js | src/util/encodeToVT100.js | /**
* Bytes to encode to VT100 control sequence.
*
* @param {String} code Control code that you want to encode
* @returns {Buffer} Returns encoded bytes
*/
export const encodeToVT100 = code => `\u001b${code}`;
| /**
* Bytes to encode to VT100 control sequence.
*
* @param {String} code Control code that you want to encode
* @returns {String} Returns encoded string
*/
export const encodeToVT100 = code => '\u001b' + code;
| Change template string to concatenation | perf(util): Change template string to concatenation
| JavaScript | mit | kittikjs/cursor,ghaiklor/terminal-canvas,ghaiklor/terminal-canvas |
6a04967c6133b67b3525f2383dc9fbc6ba627ab8 | test/data-structures/testFenwickTree.js | test/data-structures/testFenwickTree.js | /* eslint-env mocha */
const FenwickTree = require('../../src').DataStructures.FenwickTree;
const assert = require('assert');
describe('Fenwick Tree', () => {
it('should be empty when initialized', () => {
const inst = new FenwickTree([]);
assert(inst.isEmpty());
assert.equal(inst.size, 0);
});
it('... | /* eslint-env mocha */
const FenwickTree = require('../../src').DataStructures.FenwickTree;
const assert = require('assert');
describe('Fenwick Tree', () => {
it('should be empty when initialized', () => {
const inst = new FenwickTree([]);
assert(inst.isEmpty());
assert.equal(inst.size, 0);
});
it('... | Test Fenwick Tree: Sums till index | Test Fenwick Tree: Sums till index
| JavaScript | mit | ManrajGrover/algorithms-js |
a4f7a4cf1b2aaaf0a5bec5d7de43057ef7b80e8f | server/config/config.js | server/config/config.js | const config = {
development: {
username: 'postgres',
password: '212213',
database: 'more-recipes-development',
host: '127.0.0.1',
dialect: 'postgres'
},
test: {
username: 'postgres',
password: '212213',
database: 'more-recipes-tests',
host: '127.0.0.1',
dialect: 'postgres'... | const config = {
development: {
username: 'postgres',
password: '212213',
database: 'more-recipes-development',
host: '127.0.0.1',
dialect: 'postgres'
},
test: {
username: 'postgres',
password: '212213',
database: 'more-recipes-tests',
host: '127.0.0.1',
dialect: 'postgres'... | Add database url for production | Add database url for production
| JavaScript | mit | WillyWunderdog/More-Recipes-Gbenga,WillyWunderdog/More-Recipes-Gbenga |
244cd6cc04e1f092f68654764ed054f5c1a1c77a | src/googleHandler.js | src/googleHandler.js | (function(){
angular.module('angularytics').factory('AngularyticsGoogleHandler', function($log) {
var service = {};
service.trackPageView = function(url) {
_gaq.push(['_set', 'page', url]);
_gaq.push(['_trackPageview', url]);
}
service.trackEvent = function(... | (function(){
angular.module('angularytics').factory('AngularyticsGoogleHandler', function($log) {
var service = {};
service.trackPageView = function(url) {
_gaq.push(['_set', 'page', url]);
_gaq.push(['_trackPageview', url]);
}
service.trackEvent = function(... | Change GoogleUniversal to set page as well | Change GoogleUniversal to set page as well
This has additional benefit that future trackEvent() calls will use the new page value as well.
Also, it silences a minor warning from the Analytics Debugger. | JavaScript | mit | mgonto/angularytics,l3r/angul3rytics,mirez/angularytics,suhyunjeon/angularytics |
31ec3d4799621b5464076e0535183c1b5403fec2 | tests/dummy/app/components/trigger-event-widget.js | tests/dummy/app/components/trigger-event-widget.js | import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { keyResponder, onKey } from 'ember-keyboard';
@keyResponder({ activated: true })
export default class extends Component {
@tracked keyboardActivated = true;
@tracked keyDown = false;
@tracked keyDownWithMods = false;... | import Component from '@glimmer/component';
import { set } from '@ember/object';
import { keyResponder, onKey } from 'ember-keyboard';
// Use set(this) instead of tracked properties for Ember 3.8 compatibility.
@keyResponder({ activated: true })
export default class extends Component {
keyboardActivated = true;
ke... | Make TriggerEventWidgetComponent compatible with Ember 3.8 | Make TriggerEventWidgetComponent compatible with Ember 3.8
| JavaScript | mit | null-null-null/ember-keyboard,null-null-null/ember-keyboard |
615a6b80cf560ab39e912349ff70d783d796c45b | src/routes/teams.js | src/routes/teams.js | const _ = require('koa-route');
const { teams } = require('src/api');
const { read } = require('src/middlewares/methods');
module.exports = [
_.get('/teams/', read(teams.list, {
schema: {
type: 'object',
properties: {
page: {default: '1'},
per_page: {default: '100'}
}
},
... | const _ = require('koa-route');
const { teams } = require('src/api');
const { read } = require('src/middlewares/methods');
module.exports = [
_.get('/organizations/:orgId/teams/', read(teams.list, {
schema: {
type: 'object',
properties: {
page: {default: '1'},
per_page: {default: '10... | Fix team list endpoint to start with /organizations/:orgId | Fix team list endpoint to start with /organizations/:orgId
| JavaScript | bsd-3-clause | praekelt/numi-api |
67c97274f6e1440124625ada17e00e801c9bb9a0 | api/services/NorthstarService.js | api/services/NorthstarService.js | 'use strict';
const NorthstarClient = require('@dosomething/northstar-js');
/**
* Nortstar client service.
*/
module.exports = {
getClient() {
if (!this.client) {
this.client = new NorthstarClient({
baseURI: sails.config.northstar.apiBaseURI,
apiKey: sails.config.northstar.apiKey,
... | 'use strict';
const NorthstarClient = require('@dosomething/northstar-js');
/**
* Nortstar client service.
*/
module.exports = {
getClient() {
if (!this.client) {
this.client = new NorthstarClient({
baseURI: sails.config.northstar.apiBaseURI,
apiKey: sails.config.northstar.apiKey,
... | Add isOneOfFieldSet method to Northstar service | Add isOneOfFieldSet method to Northstar service
| JavaScript | mit | DoSomething/quicksilver-api,DoSomething/quicksilver-api |
0cddf22bb68647e638bfaa25e5e3d686ca34617f | tests/test031.js | tests/test031.js | // test for string split
var b = "1,4,7";
var a = b.split(",");
result = a.length==3 && a[0]==1 && a[1]==4 && a[2]==7;
| // test for string split
var b = "1,4,7";
var a = b.split(",");
assert (a.length == 3, "a.length = " + a.length);
assert (a[0]==1, "a[0]=" + a[0]);
assert (a[1]==4, "a[1]=" + a[1]);
assert (a[2]==7, "a[2]=" + a[2]);
result = 1;
| Test rewritten to get more precise error location. | Test rewritten to get more precise error location. | JavaScript | mit | GuillermoHernan/AsyncScript,GuillermoHernan/AsyncScript,GuillermoHernan/AsyncScript |
01f264010f691f9c86fd6c83c3a231064d2b4913 | client/components/lists/ListSignupFormCreator.js | client/components/lists/ListSignupFormCreator.js | import React from 'react';
import { Modal } from 'react-bootstrap';
export default class ListSignupFormCreator extends React.Component {
constructor(props) {
super(props);
this.state = {
subscribeKey: this.props.subscribeKey,
showModal: false
};
}
showModal() {
this.setState({
... | import React from 'react';
import { Modal } from 'react-bootstrap';
export default class ListSignupFormCreator extends React.Component {
constructor(props) {
super(props);
this.state = {
subscribeKey: this.props.subscribeKey,
showModal: false
};
}
showModal() {
this.setState({
... | Add instructions and improve formatting | Add instructions and improve formatting
| JavaScript | bsd-3-clause | zhakkarn/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,karuppiah7890/Mail-for-Good |
cadc5ff5d1060a77cb00d90f1eb4d0cff81c0d14 | extract.js | extract.js | (function () {
function descend(path, o) {
var step = path.shift();
if (typeof(o[step]) === "undefined") {
throw new Error("Broken descend path");
}
while (path.length > 0) {
if (typeof(o[step]) !== "object") {
throw new Error("Invalid descend path");
}
ret... | (function () {
function descend(path, o) {
var step = path.shift();
if (typeof(o[step]) === "undefined") {
throw new Error("Broken descend path");
}
while (path.length > 0) {
if (typeof(o[step]) !== "object") {
throw new Error("Invalid descend path");
}
ret... | Replace forEach with while for wider reach | Replace forEach with while for wider reach
| JavaScript | mit | nikcorg/extract |
5d07a09b4d5c72eca8564dd30bcd5f2f2a4bb6f0 | tasks/watch.js | tasks/watch.js | 'use strict';
var gulp = require('gulp');
exports.css = function() {
gulp.watch('./app/**/*.css', ['autoprefix']);
};
exports.copy = function() {
gulp.watch('./app/**/*.html', ['copy']);
};
exports.js = function() {
gulp.watch('./app/**/*.js', ['browserify']);
};
| 'use strict';
var gulp = require('gulp');
exports.css = function() {
gulp.watch('./app/**/*.css', ['autoprefix']);
};
exports.copy = function() {
gulp.watch('./app/**/*.{html,jpg,jpeg,png,svg}', ['copy']);
};
exports.js = function() {
gulp.watch('./app/**/*.js', ['browserify']);
};
| Add images to the copy task | Add images to the copy task
| JavaScript | mit | dasilvacontin/animus,formap/animus |
1bcffdea0361b75307330351722a1fa48c6e758e | app.js | app.js | const express = require('express');
const aws = require('aws-sdk');
const app = express();
const port = process.env.PORT || 3000;
const bucket = process.env.S3_BUCKET;
app.use(express.static('./public'));
app.listen(port);
console.log('listening on port', port);
app.get('/sign-s3', (req, res) => {
const s3 = ne... | const express = require('express');
const aws = require('aws-sdk');
const app = express();
const port = process.env.PORT || 3000;
const S3_BUCKET = process.env.S3_BUCKET;
app.use(express.static('./public'));
app.listen(port);
console.log('listening on port', port);
app.get('/sign-s3', (req, res) => {
const s3 =... | Fix s3 bucket variable name bug | Fix s3 bucket variable name bug
| JavaScript | mit | bkilrain/FamilyPhotoShare,bkilrain/FamilyPhotoShare |
fe48a78bfc5402cca34be93914efd2700c3864d8 | app.js | app.js | const express = require('express');
const db = require('./lib/db');
const app = express();
const port = process.env.PORT || 3000;
process.env.PATH = `${process.env.PATH}:./node_modules/.bin`;
app.use('/current', require('./routes/current'));
app.use('/sparkline', require('./routes/sparkline'));
app.use('/update', re... | const express = require('express');
const db = require('./lib/db');
const app = express();
const port = process.env.PORT || 3000;
process.env.PATH = `${process.env.PATH}:./node_modules/.bin`;
app.use('/app/current', require('./routes/current'));
app.use('/app/sparkline', require('./routes/sparkline'));
app.use('/app... | Make routes match nginx config | Make routes match nginx config
| JavaScript | mit | andyjack/neo-tracker,andyjack/neo-tracker,andyjack/neo-tracker |
ad6472393c023af674fbd547f51c0473ee2cd8e2 | cli.js | cli.js | #!/usr/bin/env node
'use strict';
var meow = require('meow');
var chalk = require('chalk');
var updateNotifier = require('update-notifier');
var quote = require('./index.js');
var pkg = require('./package.json');
var cli = meow({
help: [
'Usage',
' $ quote-cli',
'',
'Options',
' qotd Display quote of the... | #!/usr/bin/env node
'use strict';
const meow = require('meow');
const chalk = require('chalk');
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
const quote = require('./index.js');
const cli = meow({
help: [
'Usage',
' $ quote-cli',
'',
'Options',
' qotd Display ... | Change import order for package.json | Change import order for package.json | JavaScript | mit | riyadhalnur/quote-cli |
dc160773cb01bb87a14000335e72d5d40250be03 | example.js | example.js | var Pokeio = require('./poke.io')
Pokeio.playerInfo.latitude = 62.0395926
Pokeio.playerInfo.longitude = 14.0266575
Pokeio.GetLocation(function(loc) {
console.log('[i] Current location: ' + loc)
});
Pokeio.GetAccessToken("Arm4x","OHSHITWADDUP", function(token) {
Pokeio.GetApiEndpoint(function(api_endpoint) {
... | var Pokeio = require('./poke.io')
Pokeio.playerInfo.latitude = 62.0395926
Pokeio.playerInfo.longitude = 14.0266575
Pokeio.GetLocation(function(err, loc) {
if (err) throw err;
console.log('[i] Current location: ' + loc)
});
Pokeio.GetAccessToken("Arm4x","OHSHITWADDUP", function(err, token) {
if (err) thr... | Add error check. Throw errors for now | Add error check. Throw errors for now
| JavaScript | mit | Tolia/Pokemon-GO-node-api,dddicillo/IBM-Dublin-PokeTracker,Armax/Pokemon-GO-node-api |
ef34b55bcca9a136f1c00a4112e2011f5279ccf1 | test/client_test.js | test/client_test.js | var client = require('../dist/client.js');
describe('A suite', function () {
it('contains spec with an expectation', function () {
expect(true).toBe(true);
});
});
| var client = require('../dist/client.js');
describe('Client', function () {
var sut;
beforeEach(function () {
sut = client({ on: function () {} });
});
it('should have a function called update', function () {
expect(sut.update).toBeDefined();
});
});
| Test if function update is defined | Test if function update is defined
| JavaScript | mit | klambycom/diffsync,klambycom/diffsync,klambycom/diffsync |
97d944bbcd6da304f51ed921707233e94f0e9e3c | test/create-test.js | test/create-test.js | var tape = require("tape"),
jsdom = require("jsdom"),
d3 = Object.assign(require("../"), require("d3-selection"));
/*************************************
************ Components *************
*************************************/
// Leveraging create hook with selection as first argument.
var checkboxHTML ... | var tape = require("tape"),
jsdom = require("jsdom"),
d3 = Object.assign(require("../"), require("d3-selection"));
/*************************************
************ Components *************
*************************************/
// Leveraging create hook with selection as first argument.
var checkboxHTML ... | Add more to test for selection in create hook. | Add more to test for selection in create hook.
| JavaScript | bsd-3-clause | curran/d3-component |
253564d368e32bec0507d8959be82f1b15a27e42 | test/thumbs_test.js | test/thumbs_test.js | window.addEventListener('load', function(){
module('touchstart');
test('should use touchstart when touchstart is supported', function() {
assert({ listener:'touchstart', receives:'touchstart' });
});
test('should use mousedown when touchstart is unsupported', function() {
assert({ listener:'touchstar... | window.addEventListener('load', function(){
module('mousedown');
test('should use mousedown', function() {
assert({ listener:'mousedown', receives:'mousedown' });
});
module('mouseup');
test('should use mouseup', function() {
assert({ listener:'mouseup', receives:'mouseup' });
});
module('mou... | Add tests against destroying mouse events. | Add tests against destroying mouse events.
| JavaScript | mit | mwbrooks/thumbs.js,pyrinelaw/thumbs.js,pyrinelaw/thumbs.js |
969a640cac2e979a50f1837624023be7d90030d2 | packages/konomi/test/propertyTest.js | packages/konomi/test/propertyTest.js | import assert from "power-assert";
import Component from "../src/Component";
import * as property from "../src/property";
describe("property", () => {
describe(".bind", () => {
const c1 = new Component();
property.define(c1, "p1");
const c2 = new Component();
property.bind(c2, "p2", [[c1, "p1"]], () ... | import assert from "power-assert";
import Component from "../src/Component";
import * as property from "../src/property";
describe("property", () => {
describe(".bind", () => {
let c1, c2;
beforeEach(() => {
c1 = new Component();
property.define(c1, "p1");
c2 = new Component();
prope... | Use beforeEach in property test | Use beforeEach in property test
| JavaScript | mit | seanchas116/konomi |
54498cb23b8b3e50e9dad44cbd8509916e917ae3 | test/select.js | test/select.js | var test = require("tape")
var h = require("hyperscript")
var FormData = require("../index")
test("FormData works with <select> elements", function (assert) {
var elements = {
foo: h("select", [
h("option", { value: "one" })
, h("option", { value: "two", selected: true })
... | var test = require("tape")
var h = require("hyperscript")
var FormData = require("../index")
var getFormData = require("../element")
test("FormData works with <select> elements", function (assert) {
var elements = {
foo: h("select", [
h("option", { value: "one" })
, h("option", { v... | Add test for rootElm with name prop fix. | Add test for rootElm with name prop fix.
| JavaScript | mit | Raynos/form-data-set |
2dc0f2b8842af35ab001f765f95b0d237e361efe | resources/js/picker.js | resources/js/picker.js | $(document).on('ajaxComplete ready', function () {
// Initialize inputs
$('input[data-provides="anomaly.field_type.datetime"]:not([data-initialized])').each(function () {
var $this = $(this);
var inputMode = $this.data('input-mode');
var options = {
altInput: true,
... | $(document).on('ajaxComplete ready', function () {
// Initialize inputs
$('input[data-provides="anomaly.field_type.datetime"]:not([data-initialized])').each(function () {
var $this = $(this);
var inputMode = $this.data('input-mode');
var options = {
altInput: true,
... | Fix issue where 24h format needed additional configuration for the plugin | Fix issue where 24h format needed additional configuration for the plugin
| JavaScript | mit | anomalylabs/datetime-field_type,anomalylabs/datetime-field_type |
6c4bad448fdc3753e24ab74824f7ed00e714c489 | problems/commit_to_it/verify.js | problems/commit_to_it/verify.js | #!/usr/bin/env node
var exec = require('child_process').exec
// check that they've commited changes
exec('git status', function(err, stdout, stdrr) {
var show = stdout.trim()
if (show.match("nothing to commit")) {
console.log("Changes have been committed!")
}
else if (show.match("Changes not staged fo... | #!/usr/bin/env node
var exec = require('child_process').exec
// check that they've commited changes
exec('git status', function(err, stdout, stdrr) {
var show = stdout.trim()
if (show.match("Initial commit")) {
console.log("Hmm, can't find\ncommitted changes.")
}
else if (show.match("nothing to commit")... | Make commit_to_it fail when the repo is blank | Make commit_to_it fail when the repo is blank
Before that I could PASS the tests with an empty repo :
* no commits
* no files
| JavaScript | bsd-2-clause | aijiekj/git-it,pushnoy100500/git-it,strider99/git-it,ubergrafik/git-it,anilmainali/git-it,thenaughtychild/git-it,itha92/git-it-1,jlord/git-it,seenaomi/git-it,strider99/git-it,thenaughtychild/git-it,pushnoy100500/git-it,gjbianco/git-it,jlord/git-it,AkimSolovyov/git-it,gjbianco/git-it,hicksca/git-it,aijiekj/git-it,anilma... |
d4156a3af771cd57da3f7719e9afb4c92b327e21 | app/routes/preprints.js | app/routes/preprints.js | import Ember from 'ember';
var dateCreated = new Date();
var meta = {
title: 'The Linux Command Line',
authors: 'Zach Janicki',
dateCreated: dateCreated,
abstract: "This is a sample usage of the MFR on the preprint server. This document will teach you everything you would ever want to know about the l... | import Ember from 'ember';
var dateCreated = new Date();
var meta = {
title: 'The Linux Command Line',
authors: 'Zach Janicki',
dateCreated: dateCreated,
abstract: "This is a sample usage of the MFR on the preprint server. This document will teach you everything you would ever want to know about the l... | Make all right with the world | Make all right with the world
| JavaScript | apache-2.0 | pattisdr/ember-preprints,hmoco/ember-preprints,pattisdr/ember-preprints,laurenrevere/ember-preprints,CenterForOpenScience/ember-preprints,laurenrevere/ember-preprints,hmoco/ember-preprints,caneruguz/ember-preprints,baylee-d/ember-preprints,caneruguz/ember-preprints,CenterForOpenScience/ember-preprints,baylee-d/ember-pr... |
8e39fd7762d1ccebd5647d96aaf7eeb30b6f1bbc | packages/non-core/bundle-visualizer/package.js | packages/non-core/bundle-visualizer/package.js | Package.describe({
version: '1.1.0',
summary: 'Meteor bundle analysis and visualization.',
documentation: 'README.md',
});
Npm.depends({
"d3-selection": "1.0.5",
"d3-shape": "1.0.6",
"d3-hierarchy": "1.1.4",
"d3-transition": "1.0.4",
"d3-collection": "1.0.4",
"pretty-bytes": "4.0.2",
});
Package.onU... | Package.describe({
version: '1.1.0',
summary: 'Meteor bundle analysis and visualization.',
documentation: 'README.md',
});
Npm.depends({
"d3-selection": "1.0.5",
"d3-shape": "1.0.6",
"d3-hierarchy": "1.1.4",
"d3-transition": "1.0.4",
"d3-collection": "1.0.4",
"pretty-bytes": "4.0.2",
});
Package.onU... | Make bundle-visualizer depend on dynamic-import directly again. | Make bundle-visualizer depend on dynamic-import directly again.
Since bundle-visualizer is a non-core package, it could be used with a
version of ecmascript that does not imply dynamic-import, though it
definitely requires support for `import()` to function properly.
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor |
554e12b30919a04779a4b96b2da50f15d770728d | e2e-tests/scenarios.js | e2e-tests/scenarios.js | 'use strict';
/* https://github.com/angular/protractor/blob/master/docs/toc.md */
describe('my app', function() {
browser.get('index.html');
it('should automatically redirect to /play when location hash/fragment is empty', function() {
expect(browser.getLocationAbsUrl()).toMatch("/play");
});
describe... | 'use strict';
describe('my app', function() {
browser.get('index.html');
it('should automatically redirect to /play when location hash/fragment is empty', function() {
expect(browser.getLocationAbsUrl()).toMatch("/play");
});
describe('play', function() {
beforeEach(function() {
browser.get('i... | Remove spaces from basic e2e tests. | Remove spaces from basic e2e tests.
| JavaScript | mit | blainesch/angular-morse,blainesch/angular-morse,blainesch/angular-morse |
f32ed63a71a9d3b57061830d4f6de470bbe76fd9 | nodejs/lib/models/account_stats.js | nodejs/lib/models/account_stats.js | var wompt = require("../includes"),
mongoose = wompt.mongoose,
ObjectId = mongoose.Schema.ObjectId;
var AccountStats = new mongoose.Schema({
account_id : {type: ObjectId, index: true}
,frequency : String
,t : Date
,peak_connections : Integer
,connections : Integer
});
// Mo... | var wompt = require("../includes"),
mongoose = wompt.mongoose,
ObjectId = mongoose.Schema.ObjectId;
var AccountStats = new mongoose.Schema({
account_id : {type: ObjectId, index: true}
,frequency : String
,t : Date
,peak_connections : Number
,connections : Number
});
// Mode... | Change AcountStats field type from Integer -> Number Integer isn't a type. | Change AcountStats field type from Integer -> Number
Integer isn't a type.
| JavaScript | mit | iFixit/wompt.com,iFixit/wompt.com,Wompt/wompt.com,iFixit/wompt.com,iFixit/wompt.com,Wompt/wompt.com,Wompt/wompt.com |
de1edd3537adc17c1da10a67c16f5bdd5199a230 | server/jobs/update-activity-cache.js | server/jobs/update-activity-cache.js | const Logger = require('franston')('jobs/update-cache')
const GithubActivity = require('../models/github-activity')
const GithubCache = require('../models/github-cache')
const Series = require('run-series')
let dateMap = {}
function saveActivityCounts (date, next) {
let count = dateMap[date]
let options = {
... | const Logger = require('franston')('jobs/update-cache')
const GithubActivity = require('../models/github-activity')
const GithubCache = require('../models/github-cache')
const Series = require('run-series')
let dateMap = {}
function saveActivityCounts (date, next) {
let count = dateMap[date]
let options = {
... | Fix bug by resetting dateMap during update | Fix bug by resetting dateMap during update
| JavaScript | mit | franvarney/franvarney-api |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.