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 |
|---|---|---|---|---|---|---|---|---|---|
0f10d3ca4b275651b826b26aecf0a4b6d7bb2c70 | lib/assets/javascripts/new-dashboard/store/modules/config/index.js | lib/assets/javascripts/new-dashboard/store/modules/config/index.js | import getCARTOData from 'new-dashboard/store/utils/getCARTOData';
// Data coming from Static Page Loading,
// which requests user and config data from
// /me API endpoint.
const CARTOData = getCARTOData();
const CARTOUserData = CARTOData.user_data;
const config = {
namespaced: true,
state: {
...CARTOData.con... | import getCARTOData from 'new-dashboard/store/utils/getCARTOData';
// Data coming from Static Page Loading,
// which requests user and config data from
// /me API endpoint.
const CARTOData = getCARTOData();
const CARTOUserData = CARTOData.user_data;
const config = {
namespaced: true,
state: {
...CARTOData.con... | Update carto config to fix account update url | Update carto config to fix account update url
| JavaScript | bsd-3-clause | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb |
235f04f5cf90b53137404bb662c0de1bac2af310 | generators/app/templates/test.js | generators/app/templates/test.js | /* global describe, it */
(function () {
'use strict';
describe('Give it some context', function () {
describe('maybe a bit more context here', function () {
it('should run here few assertions', function () {
});
});
});
})();
| /* global describe, it */
(function () {
'use strict';
describe('Give it some context', function () {
describe('maybe a bit more context here', function () {
it('should run here few assertions', function () {
});
});
});
})();
| Use 2 spaces for indentation | Use 2 spaces for indentation
| JavaScript | bsd-2-clause | yeoman/generator-mocha,yeoman/generator-mocha |
882ecab1c967ae90828b9e87221e6bebc18d0111 | chrome/common/extensions/docs/examples/api/messaging/timer/page.js | chrome/common/extensions/docs/examples/api/messaging/timer/page.js | chrome.extension.onConnect.addListener(function(port) {
port.onMessage.addListener(function(msg) {
port.postMessage({counter: msg.counter+1});
});
});
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
sendResponse({counter: request.counter+1});
});
| if (window == top) {
chrome.extension.onConnect.addListener(function(port) {
port.onMessage.addListener(function(msg) {
port.postMessage({counter: msg.counter+1});
});
});
chrome.extension.onRequest.addListener(
function(request, sender, sendResponse) {
sendResponse({counter: request.coun... | Fix the messaging timing extension to only message the toplevel frame. | Fix the messaging timing extension to only message the toplevel frame.
BUG=no
Review URL: http://codereview.chromium.org/384133
git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@31978 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
| JavaScript | bsd-3-clause | wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser |
d382ef7fbb25bd8393b040a8f917c361f5e88092 | examples/radioStations.js | examples/radioStations.js | exports.stations = {
"4 Ever Floyd": "http://67.205.85.183:5500",
"Feeling Floyd": "http://Streaming23.radionomy.com/FeelingFloyd",
"KFRC": "http://2133.live.streamtheworld.com:80/KFRCFMCMP3",
".977 The Comedy Channel": "http://icecast3.977music.com/comedy"
};
exports.random = function() {
var keys = Object.... | exports.stations = {
"4 Ever Floyd": "http://67.205.85.183:5500",
"4 Ever Zeppelin": "http://173.236.59.82:8330",
"Feeling Floyd": "http://Streaming23.radionomy.com/FeelingFloyd",
"KFRC": "http://2133.live.streamtheworld.com:80/KFRCFMCMP3",
".977 The Comedy Channel": "http://icecast3.977music.com/comedy"
};
... | Add another example radio station: '4 Ever Zeppelin'. | Add another example radio station: '4 Ever Zeppelin'.
| JavaScript | mit | TooTallNate/node-icy,StreamMachine/node-icecast |
132bd9997d3618ce9e14715e7279248df37474bb | js/app.js | js/app.js | (function(){
var node = document.getElementById('target');
var app = Elm.TM.embed(node);
app.ports.restart.send(JSON.stringify({
"tm": {
"tape": {
"left": ["I"],
"current": "I",
"right": ["I", "I", "I", "I"]
},
"stat... | (function(){
tm = {
'successor': {
"tm": {
"tape": {
"left": [],
"current": "I",
"right": ["I", "I", "I", "I"]
},
"state": 0,
"transitions": [
{ "curren... | Create a dictionary of turing machines | Create a dictionary of turing machines
| JavaScript | mit | fifth-postulate/turing-machine,fifth-postulate/turing-machine |
36419d6e6137c5bc864ef0ddae19f26a9e3ba490 | lib/box-sizing.js | lib/box-sizing.js | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-box-sizing/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-box-sizing/tachyons-box-sizing.min.css', 'utf8')
var mod... | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-box-sizing/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-box-sizing/tachyons-box-sizing.min.css', 'utf8')
var mod... | Update with reference to global nav partial | Update with reference to global nav partial
| JavaScript | mit | matyikriszta/moonlit-landing-page,tachyons-css/tachyons,pietgeursen/pietgeursen.github.io,fenderdigital/css-utilities,topherauyeung/portfolio,cwonrails/tachyons,topherauyeung/portfolio,topherauyeung/portfolio,fenderdigital/css-utilities,getfrank/tachyons |
71b32bb213023063bc0e9196fd2391fd4ce0b121 | lib/String/prototype/ends-with.js | lib/String/prototype/ends-with.js | // Whether strings ends with given string
'use strict';
module.exports = function (searchString) {
var self, index;
self = String(this);
index = self.lastIndexOf(searchString);
return (index !== -1) && (index === (self.length - searchString.length));
};
| 'use strict';
module.exports = function (searchString) {
var self, index;
self = String(this);
index = self.lastIndexOf(searchString);
return (index !== -1) && (index === (self.length - searchString.length));
};
| Move all documentation to README.md | Move all documentation to README.md
| JavaScript | isc | medikoo/es5-ext |
3a0335eebd2f96510a8e29007a35ffdc58b4fe1f | placard.js | placard.js | (function(window, google) {
'use strict';
var Placard = {
Map: function(el, config) {
this.el = el;
this.config = config;
this._map = this._createMap();
},
Point: function(point) {
this.lat = point.lat;
this.lng = point.lng;
}
};
Placard.Map.prototype._createMap ... | (function(window, google) {
'use strict';
var Placard = {};
Placard.Map = function(el, config) {
this.el = el;
this.config = config;
this._map = this._createMap();
};
Placard.Map.prototype._createMap = function() {
return new google.maps.Map(document.getElementById(this.el), this.config);
... | Move Map and Point constructors out | Move Map and Point constructors out
| JavaScript | mit | taylorsmith/placard |
2d12177240e4023f53718b67a4f2f78719ebcd64 | src/main/javascript/counts.js | src/main/javascript/counts.js | /*
* Copyright 2016 the original author or 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 applicab... | /*
* Copyright 2016 the original author or 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 applicab... | Fix warning when iterating over object | Fix warning when iterating over object
| JavaScript | apache-2.0 | pvorb/platon,pvorb/platon,pvorb/platon |
6babdfc8d4ac8483b59b4da1d2c9b13fddcc4383 | webpack.config.js | webpack.config.js | var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
context: path.join(__dirname, 'webapp', 'src'),
entry: {
main: './index.js'
},
output: {
path: path.join(__dirname, 'app', 'assets'),
filename: '[name].[hash].js',
publ... | var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
context: path.join(__dirname, 'webapp', 'src'),
entry: {
main: './index.js'
},
output: {
path: path.join(__dirname, 'app', 'assets'),
filename: '[name].[hash].js',
publ... | Update webpack settings for v2 | Update webpack settings for v2
| JavaScript | mit | hagifoo/gae-pomodoro,hagifoo/gae-pomodoro,hagifoo/gae-pomodoro |
61355959d5ecdda9b642159b9eda90cdfb8cb9cb | src/js/schemas/ServiceSchema.js | src/js/schemas/ServiceSchema.js | /* eslint-disable no-unused-vars */
import React from 'react';
/* eslint-enable no-unused-vars */
import ContainerSettings from './service-schema/ContainerSettings';
import EnvironmentVariables from './service-schema/EnvironmentVariables';
import General from './service-schema/General';
import HealthChecks from './ser... | /* eslint-disable no-unused-vars */
import React from 'react';
/* eslint-enable no-unused-vars */
import ContainerSettings from './service-schema/ContainerSettings';
import EnvironmentVariables from './service-schema/EnvironmentVariables';
import General from './service-schema/General';
import HealthChecks from './ser... | Change order of the subnavigation | Change order of the subnavigation
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
4ef115df9a8dbddf197872c9e6ebad6477fc1136 | webpack.config.js | webpack.config.js | var path = require('path')
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
entry: './src/index.js',
target: 'node',
output: {
path: path.join(__dirname, 'build'),
filename: 'index.js'
},
plugins: [
new CopyPlugin([
{ from: 'manifest.konnector' },
{ from: 'package.... | var path = require('path')
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
entry: './src/index.js',
target: 'node',
output: {
path: path.join(__dirname, 'build'),
filename: 'index.js'
},
plugins: [
new CopyPlugin([
{ from: 'manifest.konnector' },
{ from: 'package.... | Add yarn on webpack build | chore: Add yarn on webpack build
| JavaScript | agpl-3.0 | briced/cozy-konnector-v3-ameli |
4d25226f2f0b2240ed4beb8737f9c83323a1a016 | webpack.config.js | webpack.config.js | //@ts-check
"use strict";
const path = require("path");
/**
* @type {import("webpack").Configuration}
*/
const config = {
devtool: "source-map",
entry: "./src/extension/extension.ts",
// https://webpack.js.org/configuration/externals/
externals: {
vscode: "commonjs vscode",
},
module: {
rules: [{
excl... | //@ts-check
"use strict";
// Webpack will output the following warnings when building:
//
// WARNING in ./node_modules/ws/lib/buffer-util.js
// Module not found: Error: Can't resolve 'bufferutil' in '/Users/dantup/Dev/Dart-Code/node_modules/ws/lib'
//
// WARNING in ./node_modules/ws/lib/validation.js
// Module not fo... | Add a note about webpack warnings | Add a note about webpack warnings
| JavaScript | mit | Dart-Code/Dart-Code,Dart-Code/Dart-Code,Dart-Code/Dart-Code,Dart-Code/Dart-Code,Dart-Code/Dart-Code |
cbfc446b711e5a570a712330f3533cb6a54b6a1a | src/components/Button.js | src/components/Button.js | import React, { Component } from 'react';
import _ from 'lodash';
import styles from './css/Button.module.css';
export default class Button extends Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool
}
constructor (props) {
sup... | import React, { Component } from 'react';
import _ from 'lodash';
import styles from './css/Button.module.css';
export default class Button extends Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool
}
constructor (props) {
sup... | Remove touch handerls from buttons | Remove touch handerls from buttons
| JavaScript | mit | neontribe/spool,neontribe/spool |
eecc2f6e67e8260bb49b0167cff88ddd258134fc | tests/jasmine/server/integration/pages-publication-spec.js | tests/jasmine/server/integration/pages-publication-spec.js | describe("Pages publication", function() {
beforeEach(function (done) {
Meteor.call('fixtures/reset', done);
});
it('should not return premiumContent when a user is not logged in', function() {
//Setup
Letterpress.Collections.Pages.insert({
_id: 'myId',
title: 'My Title with Spaces and Ca... | describe("Pages publication", function() {
beforeEach(function (done) {
Meteor.call('fixtures/reset', done);
});
it('should return regular data but not premiumContent when a user is not logged in', function() {
//Setup
Letterpress.Collections.Pages.insert({
_id: 'myId',
title: 'My Title w... | Test a bit more of the pub data | Test a bit more of the pub data
| JavaScript | mit | liangsun/Letterpress,FleetingClouds/Letterpress,liangsun/Letterpress,xolvio/Letterpress,chrisdamba/Letterpress,shrop/Letterpress,liangsun/Letterpress,xolvio/Letterpress,cp612sh/Letterpress,FleetingClouds/Letterpress,chrisdamba/Letterpress,FleetingClouds/Letterpress,cp612sh/Letterpress,nhantamdo/Letterpress,chrisdamba/L... |
3308fcad7c258e175911ee1a8f4ca02bc8e81612 | test/recordings/arm-cli-keyvault-tests/suite.arm-cli-keyvault-tests.nock.js | test/recordings/arm-cli-keyvault-tests/suite.arm-cli-keyvault-tests.nock.js | // This file has been autogenerated.
var profile = require('../../../lib/util/profile');
exports.getMockedProfile = function () {
var newProfile = new profile.Profile();
newProfile.addSubscription(new profile.Subscription({
id: 'c2619f08-57f7-492b-a9c3-45dee233805b',
name: 'kmsngtu Key Vault Account',
... | // This file has been autogenerated.
var profile = require('../../../lib/util/profile');
exports.getMockedProfile = function () {
var newProfile = new profile.Profile();
newProfile.addSubscription(new profile.Subscription({
id: 'c2619f08-57f7-492b-a9c3-45dee233805b',
name: 'kmsngtu Key Vault Account',
... | Add environment variable to test recordings. | Add environment variable to test recordings.
Add variable so recorded tests will pass.
| JavaScript | apache-2.0 | colrack/azure-xplat-cli,haocs/azure-xplat-cli,AzureRT/azure-xplat-cli,GuoyuHao/azure-xplat-cli,MsysTechnologiesllc/azure-xplat-cli,namratab/azure-xplat-cli,msfcolombo/azure-xplat-cli,mkliu/azure-xplat-cli,jasper-schneider/azure-xplat-cli,Nepomuceno/azure-xplat-cli,colrack/azure-xplat-cli,huangpf/azure-xplat-cli,yuezh/a... |
c8bb7fb115d9a3fe571919941c133927b393d70b | packages/ember-views/lib/core.js | packages/ember-views/lib/core.js | /**
@module ember
@submodule ember-views
*/
var jQuery = (this && this.jQuery) || (Ember.imports && Ember.imports.jQuery);
if (!jQuery && typeof require === 'function') {
jQuery = require('jquery');
}
Ember.assert("Ember Views require jQuery 1.7, 1.8, 1.9, 1.10, or 2.0", jQuery && (jQuery().jquery.match(/^((1\.(7|8... | /**
@module ember
@submodule ember-views
*/
var jQuery = (this && this.jQuery) || (Ember.imports && Ember.imports.jQuery);
if (!jQuery && typeof require === 'function') {
jQuery = require('jquery');
}
Ember.assert("Ember Views require jQuery between 1.7 and 2.1", jQuery && (jQuery().jquery.match(/^((1\.(7|8|9|10|11... | Allow jQuery version 1.11 and 2.1 | Allow jQuery version 1.11 and 2.1
Both RC1's of jQuery 1.11 and 2.1 have just been released.
(I screwed up last PR)
| JavaScript | mit | mmpestorich/ember.js,mmpestorich/ember.js,mmpestorich/ember.js |
9657907c860918014698edf82288b69a4b02a38b | inviewport.jquery.js | inviewport.jquery.js | /*jslint browser: true, indent: 2 */
(function ($) {
'use strict';
$.fn.inviewport = function (options) {
var settings = $.extend({
'minPercentageInView' : 100,
'standardClassName': 'in-view'
}, options);
this.each(function () {
var $this = $(this),
$win = $(window),
ch... | /*jslint browser: true, indent: 2 */
(function ($) {
'use strict';
$.fn.inviewport = function (options) {
var settings = $.extend({
'minPercentageInView' : 100,
'standardClassName': 'in-view'
}, options);
this.each(function () {
var $this = $(this),
$win = $(window),
ch... | Add a custom event trigger | Add a custom event trigger
I needed to add a custom event trigger so I could fire specific JS code when the element came into view (animating a count of numbers), so thought I'd suggest this simple edit which made it possible.
It allowed me to then add code as follows:
`$(selector).on("inviewport", function() { /*... | JavaScript | mit | henkbulder/inViewPort |
ebeb53dfe961c8fbc9616ab529bb6d6fc345dbcc | src/modules/common/constants.js | src/modules/common/constants.js | import {UnitState} from '../unit/constants';
export const API_URL = 'https://servicemat.hel.ninja/servicemap/v1'; //http://api.hel.fi/servicemap/v1';
export const DIGITRANSIT_API_URL = 'https://api.digitransit.fi/geocoding/v1';
export const APP_NAME = 'outdoors-sports-map';
export const DEFAULT_LANG = 'fi';
export c... | import {UnitState} from '../unit/constants';
export const API_URL = 'http://api.hel.fi/servicemap/v1';
export const DIGITRANSIT_API_URL = 'https://api.digitransit.fi/geocoding/v1';
export const APP_NAME = 'outdoors-sports-map';
export const DEFAULT_LANG = 'fi';
export const mobileBreakpoint = 768;
export type Actio... | Change API URL to production one | Change API URL to production one
| JavaScript | mit | nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map |
75b1e7b3a384d7e8997e27369ff6bd415156fef7 | spec/javascripts/dropdown_spec.js | spec/javascripts/dropdown_spec.js | describe("Dropdown: ", function(){
beforeEach(function(){
loadFixtures('dropdown_fixture.html');
locastyle.dropdown.init();
});
describe("Dropdown toggle", function(){
describe('when click on a dropdown trigger', function () {
it("should activate a disabled related dropdown module", function()... | describe("Dropdown: ", function(){
beforeEach(function(){
loadFixtures('dropdown_fixture.html');
locastyle.dropdown.init();
});
describe("Dropdown toggle", function(){
describe('when click on a dropdown trigger', function () {
it("should activate a disabled related dropdown module", function()... | Make sure the default event is been prevented on dropdown module click. | Make sure the default event is been prevented on dropdown module click.
| JavaScript | mit | EveraldoReis/locawebstyle,MaizerGomes/locawebstyle,kemelzaidan/locawebstyle,locaweb/locawebstyle,EveraldoReis/locawebstyle,locaweb/locawebstyle,locaweb/locawebstyle,kemelzaidan/locawebstyle,diegoeis/locawebstyle,deividmarques/locawebstyle,diegoeis/locawebstyle,deividmarques/locawebstyle,diegoeis/locawebstyle,EveraldoRe... |
1ee6f31909b87737062ba729dbeae7534cdafce2 | node/src/test/vcap-parser.spec.js | node/src/test/vcap-parser.spec.js |
'use strict';
var vcap = require('../main/vcap-parser'),
reappt = require('../main/reappt');
describe('VCAP service parser', function() {
it('can find Reappt service', function() {
var parser = new vcap.Parser([new reappt.Parser()]);
var services = parser.parse({
'push-reappt' : ... |
'use strict';
var vcap = require('../main/vcap-parser'),
reappt = require('../main/reappt');
describe('VCAP service parser', function() {
it('can find Reappt service', function() {
var parser = new vcap.Parser([new reappt.Parser()]);
var services = parser.parse({
'push-reappt' : ... | Test string parsing with a more interesting value. | Test string parsing with a more interesting value.
| JavaScript | mit | mattunderscorechampion/vcap-services-parser |
225d94b2aa021213165d5780118290443a1649a1 | lib/services/cloudsearchdomain.js | lib/services/cloudsearchdomain.js | var AWS = require('../core');
/**
* Note: the `AWS.CloudSearchDomain` constructor must be created with a
* valid endpoint.
*/
AWS.util.update(AWS.CloudSearchDomain.prototype, {
/**
* @api private
*/
validateService: function validateService() {
if (!this.config.endpoint || this.config.endpoint.i... | var AWS = require('../core');
/**
* Constructs a service interface object. Each API operation is exposed as a
* function on service.
*
* ### Sending a Request Using CloudSearchDomain
*
* ```javascript
* var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'});
* csd.search(params, function (err, data) {
... | Add constructor and customized class documentation | Add constructor and customized class documentation
| JavaScript | apache-2.0 | MitocGroup/aws-sdk-js,GlideMe/aws-sdk-js,prestomation/aws-sdk-js,jmswhll/aws-sdk-js,jeskew/aws-sdk-js,chrisradek/aws-sdk-js,AdityaManohar/aws-sdk-js,jmswhll/aws-sdk-js,aws/aws-sdk-js,aws/aws-sdk-js,grimurjonsson/aws-sdk-js,AdityaManohar/aws-sdk-js,aws/aws-sdk-js,misfitdavidl/aws-sdk-js,GlideMe/aws-sdk-js,beni55/aws-sdk... |
905e9e96451e84fab6203ed8d122cae3ed8e8d1e | lib/common/reset-search-paths.js | lib/common/reset-search-paths.js | const path = require('path')
const Module = require('module')
// Clear Node's global search paths.
Module.globalPaths.length = 0
// Clear current and parent(init.js)'s search paths.
module.paths = []
module.parent.paths = []
// Prevent Node from adding paths outside this app to search paths.
const originalNodeModule... | const path = require('path')
const Module = require('module')
// Clear Node's global search paths.
Module.globalPaths.length = 0
// Clear current and parent(init.js)'s search paths.
module.paths = []
module.parent.paths = []
// Prevent Node from adding paths outside this app to search paths.
const originalNodeModule... | Include trailing separator in comparisons | Include trailing separator in comparisons
| JavaScript | mit | brave/electron,renaesop/electron,miniak/electron,joaomoreno/atom-shell,seanchas116/electron,the-ress/electron,MaxWhere/electron,bpasero/electron,tonyganch/electron,the-ress/electron,twolfson/electron,MaxWhere/electron,posix4e/electron,joaomoreno/atom-shell,gerhardberger/electron,bpasero/electron,deed02392/electron,Gerh... |
93d576981fbac6c0f781b9826f2650c381493a13 | lib/passport-twitter/strategy.js | lib/passport-twitter/strategy.js | /**
* Module dependencies.
*/
var util = require('util')
, OAuthStrategy = require("passport-oauth").OAuthStrategy;
/**
* `Strategy` constructor.
*
* @api public
*/
function Strategy(options, validate) {
options = options || {};
options.requestTokenURL = options.requestTokenURL || 'https://twitter.com/oau... | /**
* Module dependencies.
*/
var util = require('util')
, OAuthStrategy = require("passport-oauth").OAuthStrategy;
/**
* `Strategy` constructor.
*
* @api public
*/
function Strategy(options, verify) {
options = options || {};
options.requestTokenURL = options.requestTokenURL || 'https://twitter.com/oauth... | Support for denied Twitter authentication attempts. | Support for denied Twitter authentication attempts.
| JavaScript | mit | mauricionr/passport-twitter,poliveira89/passport-identityua,jaredhanson/passport-twitter,coloradokim/passport-twitter,tj/passport-twitter,coloradokim/passport-twitter,Jdesk/passport-twitter,poliveira89/passport-identityua |
62e82323e5a9b0d2e957289fb0d2b1b2ebd5d609 | lib/classes/Renderable.js | lib/classes/Renderable.js | var hooks = require('hooks');
var async = require('async');
function Renderable(View) {
this.data = {};
this.mode = 'main';
this.view = {};
if (typeof View === 'function') {
this.view = new View();
}
this.render = function(cb) {
// recursively render any Renderable objects inside this.data
//... | var hooks = require('hooks');
var async = require('async');
function Renderable(View) {
this.data = {};
this.mode = 'main';
this.view = {};
if (typeof View === 'function') {
this.view = new View();
}
this.render = function(cb) {
// recursively render any Renderable objects inside this.data
//... | Clean up some linter warnings | Clean up some linter warnings
| JavaScript | mit | jay-depot/turnpike,jay-depot/turnpike |
15481c310e35027f011f541e7ae87fd089987fdf | src/components/calculators/input.js | src/components/calculators/input.js | import React, {Component} from 'react'
import Icon from 'react-fa'
import {EditorState, Editor, ContentState} from 'draft-js'
export class Input extends Component{
state = {editorState: EditorState.createWithContent(ContentState.createFromText(''))}
componentDidMount() {
if (this.props.isFirst) {
// t... | import React, {Component} from 'react'
import Icon from 'react-fa'
import {EditorState, Editor, ContentState} from 'draft-js'
export class Input extends Component{
state = {editorState: EditorState.createWithContent(ContentState.createFromText(''))}
componentDidMount() {
if (this.props.isFirst) {
setT... | Add delay to field focus to ensure it will work | Add delay to field focus to ensure it will work
| JavaScript | mit | getguesstimate/guesstimate-app |
1d600b029dcf16357ae8248d74c3dd139020159e | .storybook/config.js | .storybook/config.js | import { configure, addDecorator } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
import '../lib/global.css';
/**
* React intl support
*/
// Load the locale data for all your defined locales
import { setIntlConfig, withIntl } from 'storybook-addon-intl';
import enTranslations from ... | import { configure, addDecorator } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
import '../lib/global.css';
/**
* React intl support
*/
// Load the locale data for all your defined locales
import { setIntlConfig, withIntl } from 'storybook-addon-intl';
import enTranslations from ... | Fix translations path for storybook | Fix translations path for storybook
| JavaScript | apache-2.0 | folio-org/stripes-components,folio-org/stripes-components |
145ba38103c9e179dde639c2b9131be8c4c33468 | 01-twitter-sample.js | 01-twitter-sample.js | // Twitter Sample
//
// Using the Twitter Streaming API. In this example, we retrieve the
// sample of the statuses in real time.
// Import node modules
var Twit = require('twit'), // Twitter API Client
config = require('./config.json'); // Twitter Credentials
// Configure the Twit object with the ap... | // Twitter Sample
//
// Using the Twitter Streaming API. In this example, we retrieve the
// sample of the statuses in real time.
// Import node modules
var Twit = require('twit'), // Twitter API Client
config = require('./config.json'); // Twitter Credentials
// Configure the Twit object with the ap... | Update the twitter sample example | Update the twitter sample example
| JavaScript | mit | pnavarrc/chirp-server |
097057e11c950bdd3c1b525df842cfef953833c9 | src/frontend/narrows-schemas.js | src/frontend/narrows-schemas.js | const {schema: baseSchema} = require("prosemirror-schema-basic");
const model = require("prosemirror-model"),
Schema = model.Schema,
Mark = model.Mark,
MarkType = model.MarkType,
Attribute = model.Attribute,
Fragment = model.Fragment;
const {addListNodes} = require("prosemirror-schema-list... | const {schema: baseSchema} = require("prosemirror-schema-basic");
const model = require("prosemirror-model"),
Schema = model.Schema,
Mark = model.Mark,
MarkType = model.MarkType,
Attribute = model.Attribute,
Fragment = model.Fragment;
const {addListNodes} = require("prosemirror-schema-list... | Remove images from the character description schema | Remove images from the character description schema
Character descriptions and backstories cannot contain images
because there is no way to upload them. Until a way to do so is
added, remove the image element from the schema used for character
descriptions and backstories.
| JavaScript | bsd-3-clause | emanchado/narrows,emanchado/narrows |
2c26b27c72b7d01694d32d42398995a0974db869 | day2/solution.js | day2/solution.js | let util = require("../util");
let input = require("fs").readFileSync("./data").toString();
let presentDimensions = input
.split("\n")
.map(present =>
present.split("x")
.map(dimension => parseInt(dimension, 10))
.sort((a, b) => a - b)
)
.map(present => {
return {
l: present[0],
w: present[1],
h:... | let util = require("../util");
let input = require("fs").readFileSync("./data").toString();
let presentDimensions = input
.split("\n")
.map(present =>
present.split("x")
.map(dimension => parseInt(dimension, 10))
.sort((a, b) => a - b)
);
let wrappingNeeded = util.sum(presentDimensions.map(present =>
pre... | Remove mapping of arbitrary lengths to l/w/h. | Remove mapping of arbitrary lengths to l/w/h.
- No need
- Unknown which is which anyway
| JavaScript | mit | Mark-Simulacrum/advent-of-code-2015,Mark-Simulacrum/advent-of-code-2015,Mark-Simulacrum/advent-of-code-2015,Mark-Simulacrum/advent-of-code-2015 |
4ab11d783bd10ac41bd1a429e59bc25cfa678e03 | src/components/Graphs/BarGraph.js | src/components/Graphs/BarGraph.js | import React from "react";
import ReactDOM from "react-dom";
import tabify from "../../utils/tabify";
import * as d3 from "d3";
import "./BarGraph.css";
export default class BarGraph extends React.Component {
render() {
const { response, configuration, onBarClick } = this.props;
const { width, he... | import React from "react";
import ReactDOM from "react-dom";
import tabify from "../../utils/tabify";
import * as d3 from "d3";
import "./BarGraph.css";
export default class BarGraph extends React.Component {
constructor(){
super();
this.xScale = d3.scaleBand();
this.yScale = d3.scaleLinea... | Add pseudo bar chart using D3 scales with JSX | Add pseudo bar chart using D3 scales with JSX
| JavaScript | bsd-3-clause | nuagenetworks/visualization-framework,nuagenetworks/visualization-framework,nuagenetworks/visualization-framework,nuagenetworks/visualization-framework,nuagenetworks/visualization-framework |
eb9e03e3353f67575dfd2d050bab4a2008dc87d9 | src/js/schemas/ServiceSchema.js | src/js/schemas/ServiceSchema.js | /* eslint-disable no-unused-vars */
import React from 'react';
/* eslint-enable no-unused-vars */
import General from './service-schema/General';
import Labels from './service-schema/Labels';
import Optional from './service-schema/Optional';
import ContainerSettings from './service-schema/ContainerSettings';
let Serv... | /* eslint-disable no-unused-vars */
import React from 'react';
/* eslint-enable no-unused-vars */
import ContainerSettings from './service-schema/ContainerSettings';
import General from './service-schema/General';
import Labels from './service-schema/Labels';
import Optional from './service-schema/Optional';
let Serv... | Change order of the imports to be alphabetised | Change order of the imports to be alphabetised
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
9a49be6e9d5d32691d9d80791d53a588f76a70ee | generators/app/templates/src/index.spec.js | generators/app/templates/src/index.spec.js | <% if (framework === 'angular2') { -%>
require('reflect-metadata');
<% } -%>
/* globals require */
<% if (js === 'babel') { -%>
const context = require.context('./app', true, /\.spec$/);
<% } else { -%>
var context = require.context('./app', true, /\.spec$/);
<% } -%>
context.keys().forEach(context);
| <% if (framework === 'angular2') { -%>
require('reflect-metadata');
<% } -%>
/* globals require */
<% if (js === 'js') { -%>
var context = require.context('./app', true, /\.spec$/);
<% } else { -%>
const context = require.context('./app', true, /\.spec$/);
<% } -%>
context.keys().forEach(context);
| Use const instead of var for typescript | Use const instead of var for typescript
| JavaScript | mit | FountainJS/generator-fountain-karma |
a24a2180970b207577aa8d0f6bebb850a1d61b19 | src/containers/DatasetOverview.js | src/containers/DatasetOverview.js | import { connect } from 'react-redux'
import DatasetOverview from '../components/DatasetOverview'
import { makeDatasetFactDictFxn, makeColTypesCntFxn, makePublishingFactsFxn, calculatePublishingHealthFxn } from '../reducers'
import { loadRelatedDatasets } from '../actions'
const mapStateToProps = (state, ownProps) => ... | import { connect } from 'react-redux'
import DatasetOverview from '../components/DatasetOverview'
import { makeDatasetFactDictFxn, makeColTypesCntFxn, makePublishingFactsFxn, calculatePublishingHealthFxn } from '../reducers'
import { loadRelatedDatasets } from '../actions'
const mapStateToProps = (state, ownProps) => ... | Refactor overview so props do not mutate state in container | Refactor overview so props do not mutate state in container
| JavaScript | mit | DataSF/open-data-explorer,DataSF/open-data-explorer,DataSF/open-data-explorer |
a181a6eacd0f766b57df4477d50ba9a5f792ab58 | module/pipeAll.js | module/pipeAll.js | /**
* @module 1-liners/pipeAll
*
* @description
*
* Pipe arguments through an array of functions.
*
* @example
*
* const pipeAll = require('1-liners/pipeAll');
*
* pipeAll([f, g, h])(1, 2) === h(g(f(1, 2)));
*
*/
export default (fns) => fns.reverse().reduce( (f, g) => (...args) => f(g(...args)) );
| /**
* @module 1-liners/pipeAll
*
* @description
*
* Pipe arguments through an array of functions.
*
* @example
*
* const pipeAll = require('1-liners/pipeAll');
*
* pipeAll([f, g, h])(1, 2) === h(g(f(1, 2)));
*
*/
export default (fns) => fns.reduceRight( (f, g) => (...args) => f(g(...args)) );
| Use `.reduceRight` instead of `.reverse().reduce` | Use `.reduceRight` instead of `.reverse().reduce`
`reduceRight` [has good browser support](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight#Browser_compatibility) and skips the [mutating `reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Glob... | JavaScript | mit | 1-liners/1-liners |
d160e966f04341383de930c0447dac6e92909c80 | lathe/js/box-lerp.js | lathe/js/box-lerp.js | /* eslint-env es6 */
/* global VertexIndices */
window.lerpBoxVertex = (function() {
'use strict';
return function lerpA( geometryA, vertexA ) {
const indexA = VertexIndices[ vertexA.toUpperCase() ];
return function lerpB( geometryB, vertexB ) {
const indexB = VertexIndices[ vertexB.toUpperCase() ];... | /* eslint-env es6 */
/* global VertexIndices */
window.lerpBoxVertex = (function() {
'use strict';
return function lerpA( vertexA, t ) {
const indexA = VertexIndices[ vertexA.toUpperCase() ];
return function lerpB( geometryA, geometryB, vertexB ) {
const indexB = VertexIndices[ vertexB.toUpperCase()... | Change argument order of BoxGeometry lerp(). | lathe[cuboid]: Change argument order of BoxGeometry lerp().
| JavaScript | mit | razh/experiments-three.js,razh/experiments-three.js |
c6cedc7fa613c9f376b5d59938acdaad1e4eae7f | api/db/migrations/20170418114929_remove_login_from_users.js | api/db/migrations/20170418114929_remove_login_from_users.js | const TABLE_NAME = 'users';
exports.up = function(knex, Promise) {
return Promise.all([
knex.schema.table(TABLE_NAME, function (table) {
table.dropColumn('login');
table.boolean('cgu');
table.unique('email');
})
]);
};
exports.down = function(knex, Promise) {
return Promise.all([
... | const TABLE_NAME = 'users';
exports.up = function(knex, Promise) {
return Promise.all([
knex.schema.table(TABLE_NAME, function (table) {
table.dropColumn('login');
table.boolean('cgu');
})
]);
};
exports.down = function(knex, Promise) {
return Promise.all([
knex.schema.table(TABLE_NAME... | FIX - Removing unique constraint on user.email from migration script | FIX - Removing unique constraint on user.email from migration script
| JavaScript | agpl-3.0 | sgmap/pix,sgmap/pix,sgmap/pix,sgmap/pix |
c84f0ec4b75b18cc00622333b67735c62bc5cdad | src/generators/background-colors.js | src/generators/background-colors.js | const postcss = require('postcss')
const _ = require('lodash')
function findColor(colors, color) {
return _.mapKeys(colors, (value, key) => {
return _.camelCase(key)
})[_.camelCase(color)]
}
module.exports = function ({ colors, backgroundColors }) {
if (_.isArray(backgroundColors)) {
backgroundColors = ... | const postcss = require('postcss')
const _ = require('lodash')
function findColor(colors, color) {
const colorsNormalized = _.mapKeys(colors, (value, key) => {
return _.camelCase(key)
})
return _.get(colorsNormalized, _.camelCase(color), color)
}
module.exports = function ({ colors, backgroundColors }) {
... | Support colors not in map | Support colors not in map
If you specify a background color that isn't a key in the colors map,
we just assume it's an actual color value and let you use it.
| JavaScript | mit | tailwindcss/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss |
88c39b09f70d0546e4008e2d6c0e71ab573148fc | public/javascripts/helper.js | public/javascripts/helper.js | 'use strict';
/*
* Helper functions.
*
* This script contains miscellaneous helpers used throughout Tanura's code.
*/
/*
* Log something.
*
* For now, this is just aliased to console.log.
*/
tanura.log = console.log;
| 'use strict';
/*
* Helper functions.
*
* This script contains miscellaneous helpers used throughout Tanura's code.
*/
/*
* Log something.
*/
tanura.log = (_) => console.log("[Tanura] " + _);
| Add [Tanura] badge to log messages. | Add [Tanura] badge to log messages.
| JavaScript | agpl-3.0 | theOtherNuvanda/Tanura,theOtherNuvanda/Tanura,theOtherNuvanda/Tanura |
61ddcc611159a6eec3fbec7117cb3a238b7c0a62 | src/js/bs3/module/ImagePopover.js | src/js/bs3/module/ImagePopover.js | define([
'summernote/base/core/func',
'summernote/base/core/list',
'summernote/base/core/dom'
], function (func, list, dom) {
var ImagePopover = function (context) {
var ui = $.summernote.ui;
var options = context.options;
this.shouldInitialize = function () {
return !list.isEmpty(options.po... | define([
'summernote/base/core/func',
'summernote/base/core/list',
'summernote/base/core/dom',
'summernote/base/core/key'
], function (func, list, dom, key) {
var ImagePopover = function (context) {
var self = this;
var ui = $.summernote.ui;
var options = context.options;
this.shouldInitiali... | Remove image on backspace key event | Remove image on backspace key event
| JavaScript | mit | bebeeteam/summernote,bebeeteam/summernote,bebeeteam/summernote |
e69c0204d12afcc3ad60af6507329ad9a20f2087 | lib/TfsDatasource.js | lib/TfsDatasource.js | /*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
/** A TtsDatasource fetches triples from a Triple File System */
var tfs = require('triple-file-system'),
q = require('q');
var LIMIT = 100;
// Creates a new TfsDatasource
function TfsDatasource(path) {
this._tfs = new tfs.Tripl... | /*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
/** A TtsDatasource fetches triples from a Triple File System */
var tfs = require('triple-file-system'),
q = require('q');
var LIMIT = 100;
var LARGECOUNTESTIMATE = 500000000;
// Creates a new TfsDatasource
function TfsDatasource... | Return an estimate if counting takes too long. | Return an estimate if counting takes too long.
| JavaScript | mit | kba/ldf-server,pabloem/Server.js,infitude/Server.js,infitude/Server.js,MementoHackathon2015/ldf-memento-server,MementoHackathon2015/ldf-memento-server,kba/Server.js,infitude/Server.js,kba/ldf-server,pabloem/Server.js,cmh2166/Server.js,cmh2166/Server.js,kba/Server.js,pabloem/Server.js |
53572088ef98b408eba4a4b7e74b949d21019ec2 | router.js | router.js | /**
* Created by Stein-Otto Svorstøl on 26.08.15.
*/
'use strict';
var bookController = require('./controllers/bookController');
function setup(app){
var bodyParser = require('body-parser'); // Some setup for encoding of requests
app.use(bodyParser.json()); // to support JSON-encoded bodies
app.us... | /**
* Created by Stein-Otto Svorstøl on 26.08.15.
*/
'use strict';
var bookController = require('./controllers/bookController');
function setup(app){
var bodyParser = require('body-parser'); // Some setup for encoding of requests
app.use(bodyParser.json()); // to support JSON-encoded bodies
app.us... | Add /api/ in front of API-URLs | Add /api/ in front of API-URLs
| JavaScript | mit | CrowdShelf/server,CrowdShelf/server |
23991aaef3ec1d9be8de478d799acb100b9501d1 | server.js | server.js | var config = require('./config.js');
var Slack = require('slack-client');
var token = config.slackApiKey;
var slack = new Slack(token, true, true);
slack.on('message', function(message) {
var user = slack.getUserByID(message.user);
var channel = slack.getChannelGroupOrDMByID(message.channel);
if (message.ty... | var config = require('./config.js');
var Slack = require('slack-client');
var token = config.slackApiKey;
var slack = new Slack(token, true, true);
slack.on('message', function(message) {
var user = slack.getUserByID(message.user);
var channel = slack.getChannelGroupOrDMByID(message.channel);
// if (messa... | Create basic time regex and stub out flow | Create basic time regex and stub out flow
| JavaScript | mit | dfarr/fathertime |
de6e247cd7f8f759c6b9f4a3c8939b4af67e3344 | main/directives/broadcastScrollPosition.js | main/directives/broadcastScrollPosition.js | 'use strict';
// http://stackoverflow.com/a/872537
function getScrollTop(){
if ( typeof window.pageYOffset !== 'undefined' ) {
// most browsers except IE before #9
return window.pageYOffset;
} else {
var b = document.body; // IE 'quirks'
var d = document.documentElement; // IE with doctype
retu... | 'use strict';
// http://stackoverflow.com/a/872537
function getScrollTop(){
if ( typeof window.pageYOffset !== 'undefined' ) {
// most browsers except IE before #9
return window.pageYOffset;
} else {
var b = document.body; // IE 'quirks'
var d = document.documentElement; // IE with doctype
retu... | Fix invalid reference before first scroll | Fix invalid reference before first scroll
| JavaScript | mit | unkhz/almost-static-site,unkhz/almost-static-site |
96f02c8246f8928bb54a86c581c46eb293652398 | js/backends/graphics/graphics.js | js/backends/graphics/graphics.js | document.write("<canvas>")
var Graphics = new Processing(document.querySelector('canvas'));
Graphics.keyPressed = function() {
World.query("keyboard").forEach(function(e) {
e.key = Graphics.keyCode;
});
}
Graphics.keyReleased = function() {
World.query("keyboard").forEach(function(e) {
delete e.key;
}... | document.write("<canvas>")
var Graphics = new Processing(document.querySelector('canvas'));
Graphics.keyPressed = function() {
World.query("keyboard").forEach(function(e) {
e.key = Graphics.keyCode;
});
}
Graphics.keyReleased = function() {
World.query("keyboard").forEach(function(e) {
delete e.key;
}... | Add black background logic to Graphics backend | Add black background logic to Graphics backend
| JavaScript | mit | sangohan/twelve,nasser/twelve,sangohan/twelve,nasser/twelve |
c40e990a702702db78722e8d903f65a2dddcd321 | server.js | server.js | 'use strict';
var express = require('express');
var app = express();
var stationsRoutes = require('./src/routes/stations');
if (!process.env['BIKE_API_KEY']) {
console.warn('WARNING : The environment variable $BIKE_API_KEY is not configured.');
} else {
console.log('The $BIKE_API_KEY is ' + process.env['BIKE... | 'use strict';
var express = require('express');
var app = express();
var stationsRoutes = require('./src/routes/stations');
if (!process.env['BIKE_API_KEY']) {
console.warn('WARNING : The environment variable $BIKE_API_KEY is not configured.');
} else {
console.log('The $BIKE_API_KEY is ' + process.env['BIKE... | Remove useless header setting, since it is already set by express. | Remove useless header setting, since it is already set by express.
| JavaScript | mit | jordanabderrachid/velo-app,jordanabderrachid/velo-app |
5a6fc4248baea91a67ede38fa1c39ec87c24ffe3 | packages/tools/addon/components/cs-editor-switch.js | packages/tools/addon/components/cs-editor-switch.js | import { inject as service } from '@ember/service';
import Component from '@ember/component';
import layout from '../templates/components/cs-editor-switch';
export default Component.extend({
layout,
classNames: ['cs-editor-switch'],
tools: service('cardstack-tools'),
actions: {
setEditing(value) {
th... | import { inject as service } from '@ember/service';
import Component from '@ember/component';
import layout from '../templates/components/cs-editor-switch';
export default Component.extend({
layout,
classNames: ['cs-editor-switch'],
tools: service('cardstack-tools'),
actions: {
setEditing(value) {
th... | Disable opened field when editor is off | Disable opened field when editor is off
| JavaScript | mit | cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack |
1e738323d45d382829b4161c1578ebc2d8787ae4 | src/ui/scripts/components/Select.js | src/ui/scripts/components/Select.js | import { createElement as h } from 'react'
import PropTypes from 'prop-types'
const Select = (props) => {
return (
h('select', {
className: 'select',
value: props.value,
onChange: props.onChange,
disabled: props.disabled
},
props.items.map((item, index) => (
h('option', {
key: item.value ... | import { createElement as h } from 'react'
import PropTypes from 'prop-types'
const Select = (props) => {
return (
h('select', {
className: 'select',
id: props.id,
required: props.required,
disabled: props.disabled,
value: props.value,
onChange: props.onChange
},
props.items.map((item, index... | Add more props to select field | Add more props to select field
| JavaScript | mit | electerious/Ackee |
f9a99cf53d4e1557bbf7974eb6dfdee3e6dbd56f | server.js | server.js | 'use strict';
var Hapi = require('hapi');
var server = new Hapi.Server();
if( process.env.PORT ) {
server.connection({ port: process.env.PORT });
}
else {
server.connection({ port: 1337 });
}
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('Hello, world!');
}
});... | 'use strict';
var Hapi = require('hapi');
var server = new Hapi.Server();
if( process.env.PORT ) {
server.connection({ port: process.env.PORT });
}
else {
server.connection({ port: 1337 });
}
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('Hello, world!');
}
});... | Add hapi route to bower packages. | Add hapi route to bower packages.
| JavaScript | mit | rmarteleto/CloudTutorial,rmarteleto/CloudTutorial,rmarteleto/CloudTutorial |
8a572c4d46955595f6069e01bfd1644d320ae43b | packages/jest-enzyme/src/index.js | packages/jest-enzyme/src/index.js | /* eslint-disable new-cap */
/**
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree. *
*
* @providesModule setupTestFrameworkScriptFile
* @flow
*/
import enzymeMatchers from 'enzyme-matchers';
import serializer from 'enzyme-to-json/ser... | /* eslint-disable new-cap */
/**
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree. *
*
* @providesModule setupTestFrameworkScriptFile
* @flow
*/
import enzymeMatchers from 'enzyme-matchers';
import serializer from 'enzyme-to-json/ser... | Fix flow for message function | Fix flow for message function
| JavaScript | mit | blainekasten/enzyme-matchers |
283ef9bf4e93577635a44d0bcba9b89bd1f11f3b | src/client/app/app.component.js | src/client/app/app.component.js | "use strict";
(function (app) {
app.AppComponent = ng.core
.Component({
selector: "my-app",
template: "<h1>My First Angular 2 (2.0.0-beta.0) App</h1>"
})
.Class({
constructor: function () {}
});
}(window.app || (window.app = {})));
| "use strict";
(function (app) {
app.AppComponent = ng.core
.Component({
selector: "my-app",
template: "<h1>My First Angular 2 App</h1>"
})
.Class({
constructor: function () {}
});
}(window.app || (window.app = {})));
| Change text in basic template. | Change text in basic template. | JavaScript | mit | albertosantini/angular2-es5-jumpstart,albertosantini/angular2-es5-jumpstart |
1a366993d5e04c56303e921f27bda0484d6e7d56 | src/bg.js | src/bg.js | "use strict";
function sendToggle(tabs) {
let id = tabs[0].id;
browser.tabs.sendMessage(id, {request: 'toggle'}).then(m => {
if (m.toggle) {
browser.browserAction.setBadgeText({text: "", tabId: id});
} else {
browser.browserAction.setBadgeText({text: "🞬", tabId: id});
}
});
}
browser.br... | /* Copyright (c) 2016 Dmitri Kourennyi */
/* See the file COPYING for copying permission. */
'use strict';
| Remove unused code in background script | Remove unused code in background script
| JavaScript | mit | DmitriK/darkContrast,DmitriK/darkContrast,DmitriK/darkContrast |
760a9310eea7ceb3c2c4d99e15c43659e9fd5486 | src/components/CommentStream.js | src/components/CommentStream.js | import React, { Component } from 'react';
class CommentStream extends Component {
render() {
return (
<ul></ul>
);
}
}
export default CommentStream;
| import React, { Component } from 'react';
class CommentStream extends Component {
render() {
return (
<ul>
{this.props.events.map((event, index) => (
<li key={index}>{JSON.stringify(event)}</li>
))}
</ul>
);
}
}
CommentStream.propTypes = {
events: React.PropTypes.a... | Make a kinda ghetto comment stream dump | Make a kinda ghetto comment stream dump
| JavaScript | mit | mg4tv/mg4tv-web,mg4tv/mg4tv-web |
034d2495c2f5e9dd482ad0b461d7e66659892d87 | client/testem.js | client/testem.js | /*jshint node:true*/
module.exports = {
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
"launch_in_ci": [
"PhantomJS"
],
"launch_in_dev": [
"PhantomJS",
"Chrome"
]
};
| /*jshint node:true*/
module.exports = {
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
"launch_in_ci": [
"PhantomJS"
],
"launch_in_dev": [
"PhantomJS",
"Chrome"
],
"reporter": "dot"
};
| Use the dot test reporter. | Use the dot test reporter.
With TAP, it's hard to get the failure info without having to scroll
back.
| JavaScript | bsd-2-clause | mblayman/lcp,mblayman/lcp,mblayman/lcp |
0b03c1cde454864967ccb0cec15d9c7671aea833 | node/twitter_bot/index.js | node/twitter_bot/index.js | const Twit = require('twit');
const secrets = require('./secrets');
var T = new Twit({
consumer_key: secrets.consumer_key,
consumer_secret: secrets.consumer_secret,
access_token: secrets.access_token,
access_token_secret: secrets.access_token_secret,
});
| const Twit = require('twit');
const secrets = require('./secrets');
var T = new Twit({
consumer_key: secrets.consumer_key,
consumer_secret: secrets.consumer_secret,
access_token: secrets.access_token,
access_token_secret: secrets.access_token_secret,
});
var params = { q: 'banana', count: 3 };
function call... | Test get request to Twitter | Test get request to Twitter
| JavaScript | unlicense | greganswer/devnotes,greganswer/devnotes,greganswer/devnotes |
b08f5ecd8f7205a3c6650439d5ce78425e58fdbb | src/cli.js | src/cli.js | #!/usr/bin/env node
import pcap from 'pcap';
import yargs from 'yargs';
import ArpProbes from './ArpProbes';
import MacAddresses from './MacAddresses';
import NetworkInterfaces from './NetworkInterfaces';
if (require.main === module) {
let parser = yargs
.usage('Usage: $0 <command> [options]')
.command('sca... | #!/usr/bin/env node
import pcap from 'pcap';
import yargs from 'yargs';
import ArpProbes from './ArpProbes';
import MacAddresses from './MacAddresses';
import NetworkInterfaces from './NetworkInterfaces';
if (require.main === module) {
let parser = yargs
.usage('Usage: $0 <command> [options]')
.command('sca... | Print out the interface name | [CLI] Print out the interface name
| JavaScript | mit | ide/dash-button,ide/dash-button,ide/plasma-dash |
cc64ff36f07f3116c8a7f3e74bb0abdcb93d57e4 | repo_modules/brawndo/lib/Store.js | repo_modules/brawndo/lib/Store.js | var Fluxxor = require('fluxxor');
var _ = require('lodash-node');
class Store {
constructor(name, actions) {
var self = this;
this.name = name;
this.loading = false;
this.data = {};
this.emit = this.noop;
this.storeActions = {};
this.storeActions[`LOAD_${name}`] = this.onLoading;
th... | var Fluxxor = require('fluxxor');
class Store {
constructor(name, actions) {
var self = this;
this.name = name;
this.emit = this.noop;
this.flux = Fluxxor.createStore({
initialize() {
self.emit = this.emit;
this.bindActions(actions);
}
});
}
onLoading() {
thi... | Remove dup code in store | Remove dup code in store
| JavaScript | mit | Lupino/reapp-ui,reapp/reapp-ui,zackp30/reapp-ui,oToUC/reapp-ui,jhopper28/reapp-ui,srounce/reapp-ui,zenlambda/reapp-ui |
5c4533d7859857e90b44e895543880c7c1dbf24b | airtime_mvc/public/js/airtime/embeddableplayer/embeddableplayer.js | airtime_mvc/public/js/airtime/embeddableplayer/embeddableplayer.js | window.onload = function() {
document.getElementById('player_display_track_metadata').onchange = generateEmbedSrc;
}
function generateEmbedSrc()
{
}
| function generateEmbedSrc()
{
var $embedCodeParams = "?";
var $streamMode = getStreamMode();
if ($streamMode == "b") {
var $stream = $("input[name=player_stream_url]:radio:checked").val();
$embedCodeParams += "stream-mode=b&stream="+$stream;
} else if ($streamMode == "a") {
$embe... | Embed Player -> Update embed src code and preview when an option changes | SAAS-644: Embed Player -> Update embed src code and preview when an option changes
| JavaScript | agpl-3.0 | comiconomenclaturist/libretime,LibreTime/libretime,comiconomenclaturist/libretime,LibreTime/libretime,LibreTime/libretime,comiconomenclaturist/libretime,LibreTime/libretime,Lapotor/libretime,comiconomenclaturist/libretime,Lapotor/libretime,Lapotor/libretime,LibreTime/libretime,Lapotor/libretime,Lapotor/libretime,Lapoto... |
2a82ddac5b8ce40497d766304fb8ff8c676e4154 | src/components/universalSearch/tabs/tabStores/serviceInsightsTabStateStore.js | src/components/universalSearch/tabs/tabStores/serviceInsightsTabStateStore.js | /* eslint-disable class-methods-use-this */
/*
* Copyright 2019 Expedia Group
*
* 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.... | /* eslint-disable class-methods-use-this */
/*
* Copyright 2019 Expedia Group
*
* 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.... | Fix bug in service insights | Fix bug in service insights
| JavaScript | apache-2.0 | ExpediaDotCom/haystack-ui,ExpediaDotCom/haystack-ui |
dcc4d6f4bc089a2cfb65434edeceff0c0cbeda95 | content/composeOverlay.js | content/composeOverlay.js | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var AddHasAttachmentHeaderCompose = {
HEADER: 'X-Mozilla-Has-Attachment',
addHeader: function(aCompFields) {
... | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var AddHasAttachmentHeaderCompose = {
HEADER: 'X-Mozilla-Has-Attachment',
addHeader: function(aCompFields) {
... | Support Thunderbird 52 and later | Support Thunderbird 52 and later
| JavaScript | mpl-2.0 | clear-code/tb-add-has-attachment-header |
dfdd6c8736e71bc4958fd95c9777d514866bcff2 | tests/dummy/config/environment.js | tests/dummy/config/environment.js | 'use strict';
module.exports = function(environment) {
let ENV = {
modulePrefix: 'dummy',
environment,
rootURL: '/',
locationType: 'auto',
EmberENV: {
EXTEND_PROTOTYPES: true,
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'wi... | 'use strict';
module.exports = function(environment) {
let ENV = {
modulePrefix: 'dummy',
environment,
rootURL: '/',
locationType: 'auto',
EmberENV: {
EXTEND_PROTOTYPES: true,
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'wi... | Remove rootURL so netlify can deploy it | Remove rootURL so netlify can deploy it
| JavaScript | mit | elwayman02/ember-user-activity,elwayman02/ember-user-activity |
9c4a10c83c2beb0c6dc7eba823d6b4dfab1f3f71 | tests/unit/utils/group-by-test.js | tests/unit/utils/group-by-test.js | import { A as emberA } from '@ember/array';
import groupBy from 'dummy/utils/group-by';
import { module, test } from 'qunit';
module('Unit | Utility | group by');
test('It returns an empty object if array is empty', function (assert) {
let group = groupBy(emberA(), '');
assert.equal(typeof group, 'object');
});
... | import groupBy from 'dummy/utils/group-by';
import { module, setupTest, test } from 'qunit';
module('Unit | Utility | group by', function (hooks) {
setupTest(hooks);
test('It returns an empty object if array is empty', function (assert) {
const group = groupBy([], '');
assert.equal(typeof group, 'object')... | Add setup hooks and use async/await | Add setup hooks and use async/await
| JavaScript | mit | scottwernervt/ember-cli-group-by,scottwernervt/ember-cli-group-by |
71aa0ed11fd5fb8725406a6921509dd0fd67384e | packages/rockthatclub/lib/custom_fields.js | packages/rockthatclub/lib/custom_fields.js | import { Posts } from 'meteor/example-forum';
/*
Let's assign a color to each post (why? cause we want to, that's why).
We'll do that by adding a custom field to the Posts collection.
Note that this requires our custom package to depend on vulcan:posts and vulcan:users.
*/
Posts.addField([
{
fieldName: 'soundcl... | import { Posts } from 'meteor/example-forum';
/*
Let's assign a color to each post (why? cause we want to, that's why).
We'll do that by adding a custom field to the Posts collection.
Note that this requires our custom package to depend on vulcan:posts and vulcan:users.
*/
Posts.addField([
{
fieldName: 'soundcl... | Make custom fields viewable by guests | :guitar: Make custom fields viewable by guests
| JavaScript | mit | willclarktech/rockthat.club,willclarktech/rockthat.club,willclarktech/rockthat.club |
b63c98a9442e338e054d269137b9cfb8872a71eb | src/app/config/previous-route-middleware.js | src/app/config/previous-route-middleware.js | import {LOCATION_CHANGE} from 'react-router-redux';
let previousPathname = "";
// let previousAction = undefined;
// let counter = 0;
export default () => next => action => {
if (action.type === LOCATION_CHANGE) {
// counter++;
// console.log("Route change:", counter);
// console.log("Pre... | import {LOCATION_CHANGE} from 'react-router-redux';
let previousPathname = "";
export default () => next => action => {
if (action.type === LOCATION_CHANGE) {
const newAction = {
...action,
payload: {
...action.payload,
previousPathname
... | Remove redundant comments from previous-path routing middleware | Remove redundant comments from previous-path routing middleware
| JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence |
583587aad70c718384f6ad859d576ef845bcbe10 | lib/pipe-filename.js | lib/pipe-filename.js | //@flow
module.exports =
process.platform === "win32"
? "\\\\.\\pipe\\elm_test-" + process.pid
: "/tmp/elm_test-" + process.pid + ".sock";
| //@flow
// Incorporate the process PID into the socket name, so elm-test processes can
// be run parallel without accidentally sharing each others' sockets.
//
// See https://github.com/rtfeldman/node-test-runner/pull/231
module.exports =
process.platform === "win32"
? "\\\\.\\pipe\\elm_test-" + process.pid
... | Add a comment explaining socket naming. | Add a comment explaining socket naming.
| JavaScript | bsd-3-clause | rtfeldman/node-test-runner,ento/node-elm-test,ento/node-elm-test,rtfeldman/node-elm-test,rtfeldman/node-elm-test |
9c3fb15ac14c4558bc6c38339ac2b15a02d3eecc | is-palindrome.js | is-palindrome.js | // Is Palindrome Challenge
/*Rules:
Take any string as an argument
Return true if palindrome
return false if not
*/
/*PSEUDOCODE
1) Split string up to individual characters, strip away punctuation
2) Create new array with reversed array from original
3) Compare the two, and return true or false
*/
| // Is Palindrome Challenge
/*Rules:
Take any string as an argument
Return true if palindrome
return false if not
*/
/*PSEUDOCODE
1) Split string up to individual characters, strip away punctuation
2) Create new array with reversed array from original
3) Compare the two, and return true or false
*/
fu... | Write initial attempt at solution. Works, but not for every edge case | Write initial attempt at solution. Works, but not for every edge case
| JavaScript | mit | benjaminhyw/javascript_algorithms |
aac16eef09c6a5d8d99c8e35b7f28d7f330cf087 | src/is-node-supported.js | src/is-node-supported.js | import NodeType from './node-type'
export default function isNodeSupported (node = {}) {
return !(
isTagNameIgnored(node.tagName) ||
isNodeTypeIgnored(node.nodeType) ||
isNodeValueIgnored(node.nodeValue)
)
}
/**
* Tag names that are not supported.
* @type {Array}
*/
const IGNORED_TAG_NAMES = ['scri... | import NodeType from './node-type'
export default function isNodeSupported (node = {}) {
return !(
isTagNameIgnored(node.tagName) ||
isNodeTypeIgnored(node.nodeType) ||
isNodeValueIgnored(node.nodeValue)
)
}
/**
* Tag names that are not supported.
* @type {Array}
*/
const IGNORED_TAG_NAMES = ['scri... | Fix bug where text nodes beginning with newline would be ignored | Fix bug where text nodes beginning with newline would be ignored
| JavaScript | mit | Deschtex/html2react |
9f8a1386425afeb134489553cec1785f2c032574 | __tests__/learn.js | __tests__/learn.js | const fs = require('fs');
const { learn, getClassifier, } = require('../src/learn');
const intentsFile = require('../src/intents.json').intents;
const natural = require('natural');
const intents = {
hello: {
tag: 'hello',
patterns: [
'hello!',
],
responses: [
'hi!',
],
},
};
cons... | const fs = require('fs');
const { learn, getClassifier, } = require('../src/learn');
const intentsFile = require('../src/intents.json').intents;
const natural = require('natural');
const intents = {
hello: {
tag: 'hello',
patterns: [
'hello!',
],
responses: [
'hi!',
],
},
};
cons... | Fix tests for in promises | Fix tests for in promises
| JavaScript | mit | M195/m,M195/m |
00aa3fcdc70260c4ec6c771896bcafd488e6b51f | .eslintrc.js | .eslintrc.js | module.exports = {
"extends": ["vue"],
"plugins": [
"promise",
"mocha",
"chai-expect"
],
"rules": {
"mocha/no-exclusive-tests": "error"
}
}
| module.exports = {
"env": {
"es6": true
"mocha": true
},
"extends": ["vue"],
"plugins": [
"promise",
"mocha",
"chai-expect"
],
"rules": {
"mocha/no-exclusive-tests": "error"
}
}
| Change enable mocha, es6 eslint env | Change enable mocha, es6 eslint env
| JavaScript | mit | hrkt/shu-ho-standalone,hrkt/shu-ho-standalone |
286b8565c2a6c27300374c56ca604b0d3ea1cbda | .eslintrc.js | .eslintrc.js | const OFF = 0;
const ERROR = 2;
module.exports = {
root: true,
parser: "babel-eslint",
plugins: [
"node",
"import",
"react",
"flowtype",
"prettier",
],
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:react/recommended",
"prettier",
"prettier/flowt... | const OFF = 0;
const ERROR = 2;
module.exports = {
root: true,
parser: "babel-eslint",
plugins: [
"node",
"import",
"react",
"flowtype",
"prettier",
],
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:react/recommended",
"prettier",
"prettier/flowt... | Fix lint rules for non module files | Fix lint rules for non module files
| JavaScript | mit | celinaberg/BitFit,celinaberg/BitFit,celinaberg/BitFit |
38736ec077a0934fdecac9bbd8f0b1df9c17e174 | .eslintrc.js | .eslintrc.js | /*
* Copyright (c) 2014-2021 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
module.exports = {
extends: 'standard-with-typescript',
env: {
browser: true,
node: true,
jasmine: true,
mocha: true,
protractor: true
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'... | /*
* Copyright (c) 2014-2021 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
module.exports = {
extends: 'standard-with-typescript',
env: {
browser: true,
node: true,
jasmine: true,
mocha: true,
protractor: true
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'... | Change @typescript-eslint errors to warnings | Change @typescript-eslint errors to warnings
Signed-off-by: Ziyang Li <261a482ee4a4e19131e4e3f6a4a8d274da8aaeca@me.com>
| JavaScript | mit | bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop |
359dfefc90b8341858b784bc65cbf914286214fd | src/_test-helper/sinon-cleanup.js | src/_test-helper/sinon-cleanup.js | import sinon from 'sinon';
beforeEach(function() {
this.sinon = sinon.sandbox.create();
});
afterEach(function() {
this.sinon.restore();
});
| import sinon from 'sinon';
beforeEach(function() {
this.sinon = sinon.createSandbox();
});
afterEach(function() {
this.sinon.restore();
});
| Remove deprecated sinon sandbox call. | Remove deprecated sinon sandbox call.
| JavaScript | mit | tddbin/tddbin-frontend,tddbin/tddbin-frontend,tddbin/tddbin-frontend |
3cbcab45d71b0c3841f70c08f4921c8a276eb37f | src/component/download-button.js | src/component/download-button.js | import React, {PureComponent, PropTypes} from 'react'
import {connect} from 'react-redux'
import {parse} from 'url'
import ButtonItem from './button-item'
function mapStateToProps(state) {
return {
title: state.song.playing.title,
artist: state.song.playing.artist,
files: state.song.playing.files
}
}
... | import React, {PureComponent, PropTypes} from 'react'
import {connect} from 'react-redux'
import {parse} from 'url'
import {uniq} from 'lodash'
import ButtonItem from './button-item'
function mapStateToProps(state) {
return {
title: state.song.playing.title,
artist: state.song.playing.artist,
files: sta... | Fix duplicate download url, and fix unspecified key problem | Fix duplicate download url, and fix unspecified key problem
| JavaScript | mit | GyrosWorkshop/WukongWeb,GyrosWorkshop/WukongWeb |
66782f0da6743858122e88bb316f852135059fa7 | src/login/resources/js/themes.js | src/login/resources/js/themes.js | import React from 'react';
import { render } from 'react-dom';
import { compose, createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import persistState from 'redux-localstorage';
import Raven from "raven-js";
import createRavenMiddleware from "raven-for-redux";
import Themes from './c... | import React from 'react';
import { render } from 'react-dom';
import { compose, createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import persistState from 'redux-localstorage';
import Raven from "raven-js";
import createRavenMiddleware from "raven-for-redux";
import Themes from './c... | Use correct method to load Redux dev tools middleware | Use correct method to load Redux dev tools middleware
| JavaScript | mit | ComputerScienceHouse/csh-material-login,ComputerScienceHouse/csh-material-login,ComputerScienceHouse/csh-material-login |
1a890d68aa267143a7fcad5641020a5f2962a633 | src/components/parseMetaFiles.js | src/components/parseMetaFiles.js | const csv_stream = require('csv-stream');
const EOL = require('os').EOL;
// this CSV parser assumes that:
// - the first line contains column names
// - the delimiter is a comma
const options = {
escapeChar : '"', // default is an empty string
enclosedChar : '"', // default is an empty string
endLine: EOL
};
m... | const csv_stream = require('csv-stream');
const EOL = require('os').EOL;
// this CSV parser assumes that:
// - the first line contains column names
// - the delimiter is a comma
const options = {
escapeChar : '"', // default is an empty string
enclosedChar : '"', // default is an empty string
endLine: EOL
};
m... | Remove monkey patch no longer needed with csv-stream-0.2.0 | Remove monkey patch no longer needed with csv-stream-0.2.0
| JavaScript | mit | pelias/whosonfirst,pelias/whosonfirst |
d6a9fa150f35ccd69202f7fccf73f5c4c392eedf | src/layout/VerticalLayoutView.js | src/layout/VerticalLayoutView.js | // @flow
import { helpers } from 'utils';
import LayoutBehavior from './behaviors/LayoutBehavior';
const classes = {
CLASS_NAME: 'layout__vertical-layout',
ITEM: 'layout__vertical-layout-item',
HIDDEN: 'layout__hidden'
};
export default Marionette.View.extend({
initialize(options) {
helpers.en... | // @flow
import { helpers } from 'utils';
import LayoutBehavior from './behaviors/LayoutBehavior';
const classes = {
CLASS_NAME: 'layout__vertical-layout',
ITEM: 'layout__vertical-layout-item',
HIDDEN: 'layout__hidden'
};
export default Marionette.View.extend({
initialize(options) {
helpers.en... | Fix vertical layout visibility update | Fix vertical layout visibility update
| JavaScript | mit | comindware/core-ui,comindware/core-ui,comindware/core-ui,comindware/core-ui |
6a6f01988849b84605de83d2dccf1a1485c87c56 | src/containers/Counter/Counter.js | src/containers/Counter/Counter.js | import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { incrementCounter, decrementCounter, incrementCounterAsync } from '../../actions/counter'
import {} from './counter.scss'
let Counter = ({ counter, onIncrementCounter, onDecrementCounter, onIncrementCounterAsync }) => (
<div cla... | import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { incrementCounter, decrementCounter, incrementCounterAsync } from '../../actions/counter'
import {} from './counter.scss'
class Counter {
render() {
return (
<div className="counter">
<h2 className="counter__nu... | Make containers use class syntax | Make containers use class syntax
| JavaScript | mit | epicsharp/react-boilerplate,RSS-Dev/live-html,epicsharp/react-boilerplate,RSS-Dev/live-html |
a27c98cd75bc303b407b788208fb59a59b5f6873 | src/redux/reducers/user-views.js | src/redux/reducers/user-views.js | import * as ActionTypes from '../action-types';
import * as ActionHelpers from '../action-helpers';
const {request, response, fail} = ActionHelpers;
export default function userViews(state = {}, action) {
switch (action.type) {
case request(ActionTypes.SUBSCRIBE):
case request(ActionTypes.UNSUBSCRIBE): {
... | import * as ActionTypes from '../action-types';
import * as ActionHelpers from '../action-helpers';
const {request, response, fail} = ActionHelpers;
export default function userViews(state = {}, action) {
switch (action.type) {
case request(ActionTypes.SUBSCRIBE):
case request(ActionTypes.SEND_SUBSCRIPTION_... | Add a throbber for "sending sub request" in UserCard | Add a throbber for "sending sub request" in UserCard
| JavaScript | mit | clbn/freefeed-gamma,clbn/freefeed-gamma,clbn/freefeed-gamma |
d3c761f9c46d23774e8f7d4749713eb7591a849e | codebrag-ui/src/main/webapp/scripts/common/directives/reactionMessageSummary.js | codebrag-ui/src/main/webapp/scripts/common/directives/reactionMessageSummary.js | angular.module('codebrag.common.directives')
.directive('reactionMessageSummary', function() {
return {
restrict: 'E',
template: '<span>{{reactionMessage | truncate:50}}</span>',
replace: true,
scope: {
reaction: '='
},
... | angular.module('codebrag.common.directives')
.directive('reactionMessageSummary', function($filter) {
return {
restrict: 'E',
template: '<span ng-bind-html-unsafe="reactionMessage"></span>',
replace: true,
scope: {
reaction: '='
}... | Fix displaying quotes in followups list | Fix displaying quotes in followups list
| JavaScript | agpl-3.0 | cazacugmihai/codebrag,softwaremill/codebrag,softwaremill/codebrag,cazacugmihai/codebrag,cazacugmihai/codebrag,cazacugmihai/codebrag,softwaremill/codebrag,softwaremill/codebrag,cazacugmihai/codebrag |
75eba8fd512b448bb9b39005750ee78d655bb01b | native/lifecycle/lifecycle-handler.react.js | native/lifecycle/lifecycle-handler.react.js | // @flow
import * as React from 'react';
import { useDispatch } from 'react-redux';
import {
backgroundActionType,
foregroundActionType,
} from 'lib/reducers/foreground-reducer';
import { appBecameInactive } from '../redux/redux-setup';
import { addLifecycleListener } from './lifecycle';
const LifecycleHandler ... | // @flow
import * as React from 'react';
import { useDispatch } from 'react-redux';
import {
backgroundActionType,
foregroundActionType,
} from 'lib/reducers/foreground-reducer';
import { appBecameInactive } from '../redux/redux-setup';
import { addLifecycleListener } from './lifecycle';
const LifecycleHandler ... | Fix bug where Lifecycle listener subscription wasn't being torn down properly | [native] Fix bug where Lifecycle listener subscription wasn't being torn down properly
| JavaScript | bsd-3-clause | Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal |
fa2b73525631eadfdae5fed88a1149c8d893e9ba | src/commands/Ondemand/Fissures.js | src/commands/Ondemand/Fissures.js | 'use strict';
const Command = require('../../Command.js');
const FissureEmbed = require('../../embeds/FissureEmbed.js');
/**
* Displays the currently active Invasions
*/
class Fissures extends Command {
/**
* Constructs a callable command
* @param {Genesis} bot The bot object
*/
constructor(bot) {
... | 'use strict';
const Command = require('../../Command.js');
const FissureEmbed = require('../../embeds/FissureEmbed.js');
/**
* Displays the currently active Invasions
*/
class Fissures extends Command {
/**
* Constructs a callable command
* @param {Genesis} bot The bot object
*/
constructor(bot) {
... | Add sorting by fissure tier | Add sorting by fissure tier
This sorts the fissures in the list in ascending order according to tier, starting with Lith and ending with Axi. | JavaScript | apache-2.0 | WFCD/genesis,Warframe-Community-Developers/genesis,WFCD/genesis,Kaptard/genesis |
3a8164cfbccaf05a95b0b2f953afaf7d69e68a93 | protocols/discord.js | protocols/discord.js | const Core = require('./core');
class Discord extends Core {
constructor() {
super();
this.dnsResolver = { resolve: function(address) {return {address: address} } };
}
async run(state) {
this.usedTcp = true;
const raw = await this.request({
uri: 'https://discordapp.com/api/guilds/' + this.... | const Core = require('./core');
class Discord extends Core {
constructor() {
super();
this.dnsResolver = { resolve: function(address) {return {address: address} } };
}
async run(state) {
this.usedTcp = true;
const raw = await this.request({
uri: 'https://discordapp.com/api/guilds/' + this.... | Set max players to total amount of members in server | Set max players to total amount of members in server
| JavaScript | mit | sonicsnes/node-gamedig |
4fab6a0bb442abd7ec80e057ac2be6062f9f8d75 | addon/components/gravatar-image.js | addon/components/gravatar-image.js | import Ember from 'ember';
import md5 from 'md5';
export default Ember.Component.extend({
tagName: 'img',
attributeBindings: ['src', 'alt', 'title'],
classNames: ['gravatar-image'],
size: 250,
email: '',
title: '',
default: '',
secure: false,
src: Ember.computed('email', 'size', 'default', function(... | import Ember from 'ember';
import md5 from 'md5';
export default Ember.Component.extend({
tagName: 'img',
attributeBindings: ['src', 'alt', 'title'],
classNames: ['gravatar-image'],
size: 250,
email: '',
title: '',
default: '',
secure: null,
src: Ember.computed('email', 'size', 'default', function()... | Allow protocols to be null. | Allow protocols to be null. | JavaScript | mit | nightsh/ember-cli-libravatar,nightsh/ember-cli-libravatar,johnotander/ember-cli-gravatar,johnotander/ember-cli-gravatar |
e9910f455d77b391216cd897225feff7b2bdca26 | app/assets/javascripts/components/overview/my_articles/step_processes/reviews.js | app/assets/javascripts/components/overview/my_articles/step_processes/reviews.js | export default assignment => ([
{
title: 'Read the article',
content: 'Read the article and complete the Peer Review Exercise. This will help prepare you for providing feedback.',
status: 'not_yet_started',
trainings: [
{
title: 'Peer Review Exercise',
path: '../../../training/st... | export default assignment => ([
{
title: 'Read the article',
content: 'Read the article and complete the Peer Review Exercise. This will help prepare you for providing feedback.',
status: 'not_yet_started',
trainings: [
{
title: 'Peer Review Exercise',
path: '../../../training/st... | Add visual editor template to Peer Review on Provide Feedback step | Add visual editor template to Peer Review on Provide Feedback step
| JavaScript | mit | WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard |
a7e336a1ad247cc2285b94171fa9e30e1225d221 | lib/StyleUtil.js | lib/StyleUtil.js | /*
* Copyright 2015 the Mimu Authors (Dan Bornstein et alia).
* Licensed AS IS and WITHOUT WARRANTY under the Apache License,
* Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>
*/
"use strict";
// Utilities for interacting with styles. Instances are constructed with
// a node from which to get t... | /*
* Copyright 2015 the Mimu Authors (Dan Bornstein et alia).
* Licensed AS IS and WITHOUT WARRANTY under the Apache License,
* Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>
*/
"use strict";
// Utilities for interacting with styles. Instances are constructed with
// a node from which to get t... | Clean up and fix grammar. | Clean up and fix grammar.
| JavaScript | apache-2.0 | danfuzz/mimu,danfuzz/mimu,danfuzz/mimu |
43104cbd8c4a39e83583e75a62f2f916f35f5720 | app/js/controllers.js | app/js/controllers.js | 'use strict';
/* Controllers */
angular.module('myApp.controllers', [])
.controller('HomeController', ['$scope', function($scope) {
$scope.allMusic = [];
$scope.albums = [];
$scope.artists = [];
$scope.songs = [];
$scope.metadata = {song: '', artist: '', album: ''};
$scope.saveMusic = fun... | 'use strict';
/* Controllers */
angular.module('myApp.controllers', [])
.controller('HomeController', ['$scope', function($scope) {
$scope.allMusic = [];
$scope.albums = [];
$scope.artists = [];
$scope.songs = [];
$scope.metadata = {song: '', artist: '', album: ''};
$scope.saveMusic = fun... | Store songs, artists, and albums as objects | Store songs, artists, and albums as objects
Add 'favorite' bool as property of each object
| JavaScript | mit | wh1tney/recordly,wh1tney/recordly,wh1tney/recordly,wh1tney/recordly |
157c9ff7d4629817eea0a2f4bf202ecf7c1a3d1f | src/features/header/header-main/nav-main/desktop/styled-components/ListTypes.js | src/features/header/header-main/nav-main/desktop/styled-components/ListTypes.js | //@flow
import styled, { css } from "styled-components";
export const Ul = styled.ul`
${({ theme }: { theme: Theme }) => css`
padding: 0 0 0 ${theme.scale.s8()};
display: flex;
justify-content: flex-start;
align-items: flex-end;
list-style: none;
margin: 0;
`}
`;
export const Li = style... | //@flow
import styled, { css } from "styled-components";
export const Ul = styled.ul`
${({ theme }: { theme: Theme }) => css`
padding: 0 0 0 ${theme.scale.s8()};
display: flex;
justify-content: flex-start;
align-items: flex-end;
list-style: none;
margin: 0;
`}
`;
export const Li = style... | Remove css hover from nav items - moved to Highlight comp | Remove css hover from nav items - moved to Highlight comp
| JavaScript | mit | slightly-askew/portfolio-2017,slightly-askew/portfolio-2017 |
df8d9af3fef8812447fb82ea114490671f14efbe | app/controllers/application.js | app/controllers/application.js | import Ember from 'ember';
import config from '../config/environment';
export default Ember.Controller.extend({
cordova: Ember.inject.service(),
subscriptions: Ember.inject.controller(),
initSubscriptions: Ember.on('init', function() {
if (this.session.get("isLoggedIn")) {
this.send('setSubscriptions... | import Ember from 'ember';
import config from '../config/environment';
export default Ember.Controller.extend({
cordova: Ember.inject.service(),
subscriptions: Ember.inject.controller(),
config,
initSubscriptions: Ember.on('init', function() {
if (this.session.get("isLoggedIn")) {
this.send('setSub... | Fix rate itunes not being hidden on production build (to be enabled later) | Fix rate itunes not being hidden on production build (to be enabled later)
| JavaScript | mit | crossroads/shared.goodcity,crossroads/shared.goodcity |
bdeafec96e4ffa90ba1662176433440907a7e699 | app/lib/db/MigrationManager.js | app/lib/db/MigrationManager.js | "use strict";
var fs = require('fs'),
path = require('path');
exports.up = function(migrationName) {
};
exports.down = function(migrationName) {
};
exports.create = function(migrationName) {
var migrationTemplate = [
'"use strict"',
'',
'exports.up = function(mongoose, next) {',
' next();',
'... | "use strict";
var fs = require('fs'),
path = require('path');
var baseDirectory = path.join(__dirname, '..', '..');
var relativeMigrationDirectory = path.join('db', 'migrations');
var absoluteMigrationDirectory = path.join(baseDirectory, relativeMigrationDirectory);
function padNumeral(numeral) {
return Arra... | Add migration creation logic to MM.create() | Add migration creation logic to MM.create()
| JavaScript | mit | jwittevrongel/playchaser,jwittevrongel/playchaser,jwittevrongel/playchaser,jwittevrongel/playchaser |
bf9b97a59fdc38840cf8c21cb8b02a0d1a7bed1b | lib/templater.js | lib/templater.js | /* jslint node: true */
'use strict';
var _ = require( 'lodash' );
var Q = require( 'q' );
var dust = require( './dustjsExtended' );
var Joi = require( 'joi' );
function Templater( options ) {
var self = this;
// Maybe merge in some defaults here?
self.settings = _.merge( {
namespace: ''
}, options );
... | /* jslint node: true */
'use strict';
var _ = require( 'lodash' );
var Q = require( 'q' );
var dust = require( './dustjsExtended' );
var Joi = require( 'joi' );
function Templater( options ) {
var self = this;
// Maybe merge in some defaults here?
self.settings = _.merge( {
namespace: ''
}, options );
... | Update options to be option that makes sense | Update options to be option that makes sense
| JavaScript | mit | holidayextras/the-wall-templater-dustjs,holidayextras/the-wall-templater-dustjs |
95c9d76cefb35553c2149d84f15e7d170d9cc8d9 | ignite-base/App/Sagas/OpenScreenSagas.js | ignite-base/App/Sagas/OpenScreenSagas.js | import { call } from 'redux-saga/effects'
import { Actions as NavigationActions, ActionConst } from 'react-native-router-flux'
import { merge } from 'ramda'
// Process OPEN_SCREEN actions, intended for use with Reactotron to open a screen via a direct dispatch
export function * openScreen (action) {
const {screen, o... | import { call } from 'redux-saga/effects'
import { Actions as NavigationActions, ActionConst } from 'react-native-router-flux'
import { merge } from 'ramda'
// Process OPEN_SCREEN actions
export function * openScreen (action) {
const {screen, options} = action
// Always reset the nav stack when opening a screen by... | Remove references to Reactotron in the comments | Remove references to Reactotron in the comments
| JavaScript | mit | ruddell/ignite,infinitered/ignite,infinitered/ignite,infinitered/ignite,infinitered/ignite,infinitered/ignite,ruddell/ignite,infinitered/ignite,ruddell/ignite,infinitered/ignite,infinitered/ignite |
4b34ee31e81b0fdce9053d68eba2e775f5ed2ba7 | assets/js/scripts.js | assets/js/scripts.js | $(document).ready(function() {
$('a.menu').click(function() {
$('.site-header nav').slideToggle(100);
return false;
});
$(window).resize(function(){
var w = $(window).width();
var menu = $('.site-header nav');
if(w > 680 && menu.is(':hidden')) {
menu.removeAttr('style');
}
});
... | $(document).ready(function() {
$('a.menu').click(function() {
$('.site-header nav').slideToggle(100);
return false;
});
$(window).resize(function() {
var w = $(window).width();
var menu = $('.site-header nav');
if (w > 680 && menu.is(':hidden')) {
menu.removeAttr('style');
}
});
... | Fix this janky script and autoformat. | Fix this janky script and autoformat.
| JavaScript | mit | luketheobscure/luketheobscure.github.io,luketheobscure/luketheobscure.github.io,luketheobscure/luketheobscure.github.io |
fe44c7a5bfaf5f86d29d8532e32967162aa7a9f1 | apps/create-router.js | apps/create-router.js | import createRouter from 'router5';
import loggerPlugin from 'router5/plugins/logger';
import listenersPlugin from 'router5/plugins/listeners';
import browserPlugin from 'router5/plugins/browser';
import routes from './routes';
export default function configureRouter(useListenersPlugin = false) {
const router = cr... | import createRouter from 'router5';
import loggerPlugin from 'router5/plugins/logger';
import listenersPlugin from 'router5/plugins/listeners';
import browserPlugin from 'router5/plugins/browser';
import routes from './routes';
export default function configureRouter(useListenersPlugin = false) {
const router = cr... | Remove duplicated `export default` statement | Remove duplicated `export default` statement | JavaScript | mit | router5/examples,router5/router5,router5/router5,router5/examples,router5/examples |
e67a4737f799f847e58578cce67bbca1db60deb3 | public/js/scripts.js | public/js/scripts.js | //Load common code that includes config
require(['./require.config'], function (common) {
require([
'jquery',
'bootstrap',
'knockout',
'viewmodel'
], function($, _bootstrap, ko, HelloViewModel){
'use strict';
// this is where all the site code should begin
$(function() {
... | // load requirejs config file
require(['./require.config'], function (common) {
// test jquery by appending HTML content
require([
'jquery',
], function($){
'use strict';
// this is where the code goes
$(function() {
$('.lead').html('Use this document as a way to quickly start an... | Put knockout, bootstrap and jquery examples into separate requirejs modules | Put knockout, bootstrap and jquery examples into separate requirejs modules
| JavaScript | mit | thegreatsunra/propeller |
d29a72d13d473afd8713a9d77d3fffef7dd7bfab | src/main/resources/static/app.js | src/main/resources/static/app.js | angular.module('smartCampUZApp', ['ui.router', 'base64', 'angular-jwt'])
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
//starter screen
.state('starter', {
url: "/starter",
templateUrl: "templates/starter.html",
... | angular.module('smartCampUZApp', ['ui.router', 'base64', 'angular-jwt'])
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
//starter screen
.state('starter', {
url: "/starter",
templateUrl: "templates/starter.html",
... | Add auth flow onEnter states | Add auth flow onEnter states
| JavaScript | mit | UNIZAR-30249-2016-SmartCampUZ/smartCampUZ,UNIZAR-30249-2016-SmartCampUZ/smartCampUZ,UNIZAR-30249-2016-SmartCampUZ/smartCampUZ,UNIZAR-30249-2016-SmartCampUZ/smartCampUZ |
0a687756dc7428d0a91c4a8fd7965bba2708426e | devices/index.js | devices/index.js | 'use strict';
const hardwareModules = new Set([
require('./triones'),
]);
function createFor(peripheral) {
for (let module of hardwareModules) {
if (module.isCompatibleWith(peripheral.advertisement)) {
return module.createFor(peripheral);
}
}
return Promise.resolve(null);
... | 'use strict';
const noble = require('noble');
const hardwareModules = new Set([
require('./triones'),
]);
function createFor(peripheral) {
for (let module of hardwareModules) {
if (module.isCompatibleWith(peripheral.advertisement)) {
// Stop scanning: some BT devices do not support
... | Fix connecting to LE device not working on Linux | Fix connecting to LE device not working on Linux
| JavaScript | mit | mcuelenaere/bluelight |
bffd5a6519626e4ab903ab81f5e55735fda7386a | sashimi-webapp/test/e2e/specs/fileManager/create-file-folder.spec.js | sashimi-webapp/test/e2e/specs/fileManager/create-file-folder.spec.js | function createDoc(browser, docType) {
const devServer = browser.globals.devServerURL;
browser.url(`${devServer}/`);
browser.expect.element('#app').to.be.visible.before(5000);
browser.execute(() => {
const className = `.${docType}`;
const numDocs = document.querySelectorAll(className).length;
ret... | function createDoc(browser, docType) {
const devServer = browser.globals.devServerURL;
browser.url(`${devServer}/`);
browser.expect.element('#app').to.be.visible.before(5000);
browser.execute((data) => {
const className = `.${data}`;
const currentNumDocs = document.querySelectorAll(className).length;
... | Add e2e test case for create file/folder | Add e2e test case for create file/folder
| JavaScript | mit | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note |
a250752c96f75f8216be4caa22cd6259f8aff786 | app/models/user.js | app/models/user.js | var mongoose = require('mongoose')
var userSchema = new mongoose.Schema({
id: { type: String, index: { unique: true } },
twitter_id: String,
twitter_credentials: mongoose.Schema.Types.Mixed,
login_tokens: [ String ],
data: mongoose.Schema.Types.Mixed,
created_at: Date,
updated_at: Date,
last_street_id:... | var mongoose = require('mongoose')
var userSchema = new mongoose.Schema({
id: { type: String, index: { unique: true } },
auth0_id: String,
auth0_refesh_token: String,
login_tokens: [ String ],
data: mongoose.Schema.Types.Mixed,
created_at: Date,
updated_at: Date,
last_street_id: Number
})
userSchema.p... | Update User model to match with Auth0 data | Update User model to match with Auth0 data
| JavaScript | bsd-3-clause | codeforamerica/streetmix,codeforamerica/streetmix,codeforamerica/streetmix |
29f5efaff8c2c0d4b9b2896af7840ac64b053e98 | test/tests/delimiters.js | test/tests/delimiters.js | define(function(require, exports, module) {
"use strict";
var combyne = require("../../lib/index");
describe("Delimiters", function() {
it("can be changed on a template", function() {
var tmpl = combyne("[[test]]", { test: "prop" });
tmpl.setDelimiters({ START_PROP: "[[", END_PROP: "]]" });
... | define(function(require, exports, module) {
"use strict";
var combyne = require("../../lib/index");
describe("Delimiters", function() {
it("will throw an error if not passed an object", function() {
var tmpl = combyne("[[test]]", { test: "prop" });
expect(tmpl.setDelimiters).to.throw(Error);
... | Test ensuring setDelimiters requires an object. | Test ensuring setDelimiters requires an object.
| JavaScript | mit | tbranyen/combyne,kadamwhite/combyne,kadamwhite/combyne,tbranyen/combyne |
5cd956979669c600b1ca57d25bddd75fb0fb1809 | sample_target/app.js | sample_target/app.js |
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs... |
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var http = require('http');
var path = require('path');
var fs = require('fs');
var app = express();
var json = fs.readFileSync(__dirname + '/../config.json', 'utf8');
var fakeminder_config = JSON.parse(json);
// al... | Read port number for target site from JSON config | Read port number for target site from JSON config
| JavaScript | mit | chrisneave/FakeMinder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.