commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
e3d2f266ed07b9a98f3a076d0684877e1d141970 | config/policies.js | config/policies.js | /**
* Policies are simply Express middleware functions which run before your controllers.
* You can apply one or more policies for a given controller or action.
*
* Any policy file (e.g. `authenticated.js`) can be dropped into the `/policies` folder,
* at which point it can be accessed below by its filename, minus... | /**
* Policies are simply Express middleware functions which run before your controllers.
* You can apply one or more policies for a given controller or action.
*
* Any policy file (e.g. `authenticated.js`) can be dropped into the `/policies` folder,
* at which point it can be accessed below by its filename, minus... | Attach admin policy to actions which create or destroy groups, rooms, or users. | Attach admin policy to actions which create or destroy groups, rooms, or users.
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com> | JavaScript | mit | maxfierke/WaterCooler | ---
+++
@@ -17,19 +17,32 @@
'*': true,
GroupController: {
- '*': 'authenticated'
+ '*': 'authenticated',
+ 'create': ['authenticated', 'admin'],
+ 'manage': ['authenticated', 'admin'],
+ 'user_add': ['authenticated', 'admin'],
+ 'user_delete': ['authenticated', 'a... |
0f21e7aed83f547ced598a9d6c869b7814686eb5 | init/rollup.config.js | init/rollup.config.js | const rollupBabel = require('rollup-plugin-babel');
const rollupCommonjs = require('rollup-plugin-commonjs');
const rollupNodeResolve = require('rollup-plugin-node-resolve');
const rollupUglify = require('rollup-plugin-uglify');
const path = require('path');
const pkg = require(path.join(process.cwd(), 'package.json'))... | const rollupBabel = require('rollup-plugin-babel');
const rollupCommonjs = require('rollup-plugin-commonjs');
const rollupNodeResolve = require('rollup-plugin-node-resolve');
const rollupUglify = require('rollup-plugin-uglify');
const path = require('path');
const pkg = require(path.join(process.cwd(), 'package.json'))... | Fix template literal issue with underscore templates. | fix(build): Fix template literal issue with underscore templates.
| JavaScript | mit | skatejs/build,skatejs/build | ---
+++
@@ -23,7 +23,7 @@
const moduleName = pkg['build:global'] || pkg.name;
module.exports = {
- dest: `dist/index${shouldMinify ? '.min' : ''}.js`,
+ dest: 'dist/index' + (shouldMinify ? '.min' : '') + '.js',
entry,
exports: 'named',
format: 'umd', |
bee126e3d4db9860e095f35a3c60b7b94f05b024 | blacklisted-sites.js | blacklisted-sites.js | // Add your blacklisted sites to this array. Subdomain and TLD are optional and flexible.
// Should probably be kept in sync with https://github.com/premgane/agolo-twitterbot/blob/master/server.py
var BLACKLIST = [
'github',
'agolo.com',
'youtube',
'youtu.be',
'atlassian.net',
'spotify.com',
'twitter.com'... | // Add your blacklisted sites to this array. Subdomain and TLD are optional and flexible.
// Should probably be kept in sync with https://github.com/premgane/agolo-twitterbot/blob/master/server.py
var BLACKLIST = [
'github',
'agolo.com',
'youtube',
'youtu.be',
'atlassian.net',
'spotify.com',
'twitter.com'... | Add zoom.us and appear.in to blacklist | Add zoom.us and appear.in to blacklist | JavaScript | mit | premgane/agolo-slackbot | ---
+++
@@ -13,7 +13,9 @@
'bit.ly',
'tinyurl',
'vine',
- 'dropbox'
+ 'dropbox',
+ 'zoom.us',
+ 'appear.in'
];
|
884455a7aa3cc8f8a6f1d6f9ca28faa597b4993f | ipwb/serviceWorker.js | ipwb/serviceWorker.js | /* eslint-env serviceworker */
// This makes a module available named "reconstructive"
importScripts('reconstructive.js')
// Customize configs (defaults should work for IPWB out of the box)
// reconstructive.init({
// version: 'reconstructive.js:v1',
// urimPattern: self.location.origin + '/memento/<datetime>/<ur... | /* eslint-env serviceworker */
// This makes a module available named "reconstructive"
importScripts('/reconstructive.js')
// Customize configs (defaults should work for IPWB out of the box)
// reconstructive.init({
// version: 'reconstructive.js:v1',
// urimPattern: self.location.origin + '/memento/<datetime>/<u... | Load reconstructive.js using an absolute path | Load reconstructive.js using an absolute path
| JavaScript | mit | oduwsdl/ipwb,oduwsdl/ipwb,oduwsdl/ipwb,oduwsdl/ipwb | ---
+++
@@ -1,7 +1,7 @@
/* eslint-env serviceworker */
// This makes a module available named "reconstructive"
-importScripts('reconstructive.js')
+importScripts('/reconstructive.js')
// Customize configs (defaults should work for IPWB out of the box)
// reconstructive.init({ |
2b5bd27f0323428e6814b202fefbfb774be97256 | lib/engines/scss.js | lib/engines/scss.js | 'use strict';
var Engine = require('./engine');
var herit = require('herit');
var path = require('path');
module.exports = herit(Engine, {
defaults: function () {
return {
paths: [],
indentedSyntax: false
};
},
run: function (asset, cb) {
try {
var sass = require('node-sass');
... | 'use strict';
var Engine = require('./engine');
var herit = require('herit');
var path = require('path');
module.exports = herit(Engine, {
defaults: function () {
return {
paths: [],
indentedSyntax: false
};
},
run: function (asset, cb) {
try {
var sass = require('node-sass');
... | Fix SCSS engine error message | Fix SCSS engine error message
| JavaScript | mit | caseywebdev/cogs,caseywebdev/cogs | ---
+++
@@ -24,7 +24,9 @@
if (!asset.ext()) asset.exts.push('css');
cb();
},
- error: function (er) { cb(new Error(er)); }
+ error: function (er) {
+ cb(new Error('Line ' + er.line + ': ' + er.message));
+ }
});
} catch (er) { cb(er); }
} |
3f55e7c83a838f2658191d475a00a453fe17157e | lib/infinitedivs.js | lib/infinitedivs.js | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var infinitedivs = function infinitedivs() {
_classCallCheck(this, infinitedivs);
... | /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModu... | Create infinitediv class and add basic buffer based loading. | Create infinitediv class and add basic buffer based loading.
| JavaScript | mit | supreetpal/infinite-divs,supreetpal/infinite-divs | ---
+++
@@ -1,13 +1,62 @@
-"use strict";
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
... |
368aef6a552b9b626b6e8e551f72d39f9a5ba144 | lib/modules/info.js | lib/modules/info.js | const chalk = require('chalk');
const helpers = require('../helpers');
exports.about = function () {
helpers.printMessage(chalk.green('Welcome to Space CLI'), '- a CLI for space information' + '\n\n' + 'Credits:' + '\n' + 'https://launchlibrary.net/ - API documentation for upcoming launches');
};
| const chalk = require('chalk');
const helpers = require('../helpers');
exports.about = function () {
helpers.printMessage(chalk.green('Welcome to Space CLI') + ' ' + '- a CLI for space information' + '\n\n' + 'Credits:' + '\n' + 'https://launchlibrary.net/ - API documentation for upcoming launches');
};
| Fix inconsistent rendering in about command | Fix inconsistent rendering in about command
| JavaScript | mit | Belar/space-cli | ---
+++
@@ -2,5 +2,5 @@
const helpers = require('../helpers');
exports.about = function () {
- helpers.printMessage(chalk.green('Welcome to Space CLI'), '- a CLI for space information' + '\n\n' + 'Credits:' + '\n' + 'https://launchlibrary.net/ - API documentation for upcoming launches');
+ helpers.printMessage(... |
2c082c238124844a8bae0c83eb890455452b7067 | lib/services/swf.js | lib/services/swf.js | var AWS = require('../core');
/**
* @constant
* @readonly
* Backwards compatibility for access to the {AWS.SWF} service class.
*/
AWS.SimpleWorkflow = AWS.SWF;
| var AWS = require('../core');
AWS.util.hideProperties(AWS, ['SimpleWorkflow']);
/**
* @constant
* @readonly
* Backwards compatibility for access to the {AWS.SWF} service class.
*/
AWS.SimpleWorkflow = AWS.SWF;
| Hide SimpleWorkflow service class from AWS properties | Hide SimpleWorkflow service class from AWS properties
| JavaScript | apache-2.0 | grimurjonsson/aws-sdk-js,jeskew/aws-sdk-js,mohamed-kamal/aws-sdk-js,mapbox/aws-sdk-js,Blufe/aws-sdk-js,jeskew/aws-sdk-js,chrisradek/aws-sdk-js,chrisradek/aws-sdk-js,beni55/aws-sdk-js,GlideMe/aws-sdk-js,ugie/aws-sdk-js,chrisradek/aws-sdk-js,guymguym/aws-sdk-js,chrisradek/aws-sdk-js,aws/aws-sdk-js,MitocGroup/aws-sdk-js,M... | ---
+++
@@ -1,4 +1,6 @@
var AWS = require('../core');
+
+AWS.util.hideProperties(AWS, ['SimpleWorkflow']);
/**
* @constant |
fb4ae324c3bd986677aa8dfed4b64bf5bae5beb6 | entity.js | entity.js | const createTransform = require('./transform')
let entityId = 0
function Entity (components, parent, tags) {
this.id = entityId++
this.tags = tags || []
this.components = components ? components.slice(0) : []
this.transform = this.getComponent('Transform')
if (!this.transform) {
this.transform = creat... | const createTransform = require('./transform')
let entityId = 0
function Entity (components, parent, tags) {
this.id = entityId++
this.tags = tags || []
this.components = components ? components.slice(0) : []
this.transform = this.getComponent('Transform')
if (!this.transform) {
this.transform = creat... | Add addComponent method to Entity | Add addComponent method to Entity
| JavaScript | mit | pex-gl/pex-renderer,pex-gl/pex-renderer | ---
+++
@@ -26,6 +26,11 @@
this.transform.set({ parent: null })
}
+Entity.prototype.addComponent = function (component) {
+ this.components.push(component)
+ component.init(this)
+}
+
Entity.prototype.getComponent = function (type) {
return this.components.find((component) => component.type === type)
} |
3053a37c25fa000223642db9c0eb0dc8b0c265ae | migrations/20170401114125_initial.js | migrations/20170401114125_initial.js |
exports.up = (knex, Promise) => Promise.all([
knex.schema.createTableIfNotExists('user', (table) => {
table.integer('telegram_id')
.primary();
table.string('piikki_username')
.unique();
table.string('default_group');
table.text('json_state');
}),
]);
exports.down = (knex, Promise) => P... |
exports.up = (knex, Promise) => Promise.all([
knex.schema.createTableIfNotExists('user', (table) => {
table.integer('telegram_id')
.primary();
table.string('piikki_username');
table.string('default_group');
table.text('json_state');
}),
]);
exports.down = (knex, Promise) => Promise.all([
k... | Allow multiple nulls in username | Allow multiple nulls in username
| JavaScript | mit | majori/piikki-client-tg | ---
+++
@@ -3,8 +3,7 @@
knex.schema.createTableIfNotExists('user', (table) => {
table.integer('telegram_id')
.primary();
- table.string('piikki_username')
- .unique();
+ table.string('piikki_username');
table.string('default_group');
table.text('json_state');
}), |
48d6b2ef33a9e8a27180d126db6cf37e6a685841 | src/components/SearchFilterCountries.js | src/components/SearchFilterCountries.js | import React from 'react';
import { FormattedMessage, FormattedNumber } from 'react-intl';
import { Button, Popover, Position, Spinner } from '@blueprintjs/core';
const SearchFilterCountries = ({ loaded, countries, currentValue, onOpen, onChange }) => {
function toggleCountryId(countryId) {
const newValue = cur... | import React from 'react';
import { FormattedMessage, FormattedNumber } from 'react-intl';
import { Button, Popover, Position, Spinner } from '@blueprintjs/core';
const SearchFilterCountries = ({ loaded, countries, currentValue, onOpen, onChange }) => {
function toggleCountryId(countryId) {
const newValue = cur... | Remove unnecessary value on inline prop | Remove unnecessary value on inline prop
| JavaScript | mit | pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,pudo/aleph | ---
+++
@@ -12,7 +12,7 @@
}
return (
- <Popover position={Position.BOTTOM} popoverWillOpen={onOpen} inline={true}>
+ <Popover position={Position.BOTTOM} popoverWillOpen={onOpen} inline>
<Button rightIconName="caret-down">
<FormattedMessage id="search.countries" defaultMessage="Countries"... |
8e75817344c4743a95f93efbb6a7124220183f60 | src/components/MdContent/styles.js | src/components/MdContent/styles.js | import theme from '../../theme'
export default {
mdContent: {},
content: {
position: 'relative',
},
markdown: {
display: 'block',
},
actions: {
float: 'right',
display: 'flex',
alignItems: 'center',
position: 'relative',
zIndex: 5
},
action: {
display: 'flex',
height... | import theme from '../../theme'
export default {
mdContent: {},
content: {
position: 'relative',
},
markdown: {
display: 'block',
},
actions: {
float: 'right',
display: 'flex',
alignItems: 'center',
position: 'relative',
zIndex: 5,
marginLeft: 20
},
action: {
display... | Fix space between title and version select | Fix space between title and version select
| JavaScript | mit | cssinjs/cssinjs | ---
+++
@@ -13,7 +13,8 @@
display: 'flex',
alignItems: 'center',
position: 'relative',
- zIndex: 5
+ zIndex: 5,
+ marginLeft: 20
},
action: {
display: 'flex', |
c08fa30117cf593cd91a1325b86a4199b0fd08f6 | config/webpack/webpack.config.test.js | config/webpack/webpack.config.test.js | "use strict";
/**
* Webpack frontend test configuration.
*/
var path = require("path");
var prodCfg = require("./webpack.config");
// Replace with `__dirname` if using in project root.
var ROOT = process.cwd();
var _ = require("lodash"); // devDependency
module.exports = {
cache: true,
context: path.join(ROOT, ... | "use strict";
/**
* Webpack frontend test configuration.
*/
var path = require("path");
var prodCfg = require("./webpack.config");
// Replace with `__dirname` if using in project root.
var ROOT = process.cwd();
var _ = require("lodash"); // devDependency
module.exports = {
cache: true,
context: path.join(ROOT, ... | Fix for enzyme and react 15 | Fix for enzyme and react 15
| JavaScript | mit | FormidableLabs/builder-radium-component,FormidableLabs/builder-radium-component | ---
+++
@@ -29,7 +29,8 @@
externals: {
"cheerio": "window",
"react/lib/ExecutionEnvironment": true,
- "react/lib/ReactContext": true
+ "react/lib/ReactContext": true,
+ "react/addons": true
},
module: _.assign({}, prodCfg.module, {
// enzyme webpack issue https://github.com/airbnb/enz... |
59fd6e6d26ddb98957dcdcdb415efddad1080be3 | content/bootloader.js | content/bootloader.js |
// Render the environment & partner menus
renderEnvironmentMenuItems();
renderPartnerMenuItems();
renderGaugeRowItems();
// Events binding
window.onhashchange = _handlerRefreshMenuAndPage;
// Update the menu and render the content
_handlerRefreshMenuAndPage();
|
// Render the environment & partner menus
renderEnvironmentMenuItems();
renderPartnerMenuItems();
renderGaugeRowItems();
// Events binding
window.onhashchange = _handlerRefreshMenuAndPage;
// Update the menu and render the content
_handlerRefreshMenuAndPage();
(function myLoop (i) {
setTimeout(function ... | Add simple code for time triggering of gauge | Add simple code for time triggering of gauge
| JavaScript | mit | vejuhust/yet-another-monitoring-dashboard,vejuhust/yet-another-monitoring-dashboard | ---
+++
@@ -9,3 +9,12 @@
// Update the menu and render the content
_handlerRefreshMenuAndPage();
+
+(function myLoop (i) {
+ setTimeout(function () {
+ renderGaugeRowItems();
+ if (--i) {
+ myLoop(i);
+ }
+ }, 3000)
+})(1000); |
8ccc4d34fe92889c75a06d01bcdbd9df226aa965 | inject.js | inject.js | function receiveMessage(event) {
var commentPath,
frameURL;
// get url of comment
commentPath = event.data.commentURL;
frameURL = "https://news.ycombinator.com/" + commentPath;
showComments( frameURL )
}
var showComments = function( URL ) {
var commentFrame;
}
var drawIframe = function() {
var frameset,... | function receiveMessage(event) {
var commentPath,
frameURL;
// get url of comment
commentPath = event.data.commentURL;
frameURL = "https://news.ycombinator.com/" + commentPath;
showComments( frameURL )
}
var showComments = function( URL ) {
var commentFrame;
commentFrame = document.querySelector( "#frameI... | Set attribute of comment frame. | Set attribute of comment frame.
| JavaScript | mit | tonyonodi/reddit-comments,tonyonodi/reddit-comments,tonyonodi/back-to-the-comments,tonyonodi/back-to-the-comments | ---
+++
@@ -11,7 +11,10 @@
var showComments = function( URL ) {
var commentFrame;
-
+
+ commentFrame = document.querySelector( "#frameID" );
+ commentFrame.setAttribute( "src", URL );
+
}
var drawIframe = function() { |
62dee18342aa659ad1f124be9de70b11d3a0c0d1 | src/jar/lang/Object/Object-info.js | src/jar/lang/Object/Object-info.js | JAR.register({
MID: 'jar.lang.Object.Object-info',
deps: ['..', '.!reduce|derive', '..Array!reduce']
}, function(lang, Obj, Arr) {
'use strict';
var reduce = Obj.reduce;
lang.extendNativeType('Object', {
keys: function() {
return reduce(this, pushKey, []);
},
p... | JAR.register({
MID: 'jar.lang.Object.Object-info',
deps: ['..', '.!reduce|derive', '..Array!reduce']
}, function(lang, Obj, Arr) {
'use strict';
var reduce = Obj.reduce;
lang.extendNativeType('Object', {
keys: function() {
return reduce(this, pushKey, Arr());
},
... | Use jar.lang.Array instead of native as returnvalue | Use jar.lang.Array instead of native as returnvalue
| JavaScript | mit | HROH/JAR | ---
+++
@@ -8,11 +8,11 @@
lang.extendNativeType('Object', {
keys: function() {
- return reduce(this, pushKey, []);
+ return reduce(this, pushKey, Arr());
},
pairs: function() {
- return reduce(this, pushKeyValue, []);
+ return reduce(this... |
9cd54ca34eee54d3cbe357147f2f81c6021bc606 | controllers/widget.js | controllers/widget.js | var args = _.extend({
duration: 2000,
animationDuration: 250,
message: '',
title: Ti.App.name,
elasticity: 0.5,
pushForce: 30,
usePhysicsEngine: true
}, arguments[0] || {});
var That = null;
exports.show = function(opt) {
if (_.isObject(opt)) _.extend(args, opt);
if (_.isString(opt)) _.extend(args, { message... | var args = _.extend({
duration: 2000,
animationDuration: 250,
message: '',
title: Ti.App.name,
elasticity: 0.5,
pushForce: 30,
usePhysicsEngine: true
}, arguments[0] || {});
var That = null;
exports.show = function(opt) {
if (_.isObject(opt)) _.extend(args, opt);
if (_.isString(opt)) _.extend(args, { message... | Allow update of notification text. | Allow update of notification text.
Allows you to update the message in the notification.
I wanted this feature to allow me to show loading percentage in the notification when downloading or uploading data. | JavaScript | mit | titanium-forks/CaffeinaLab.com.caffeinalab.titanium.notifications,CaffeinaLab/Ti.Notifications,DouglasHennrich/Ti.Notifications | ---
+++
@@ -31,6 +31,11 @@
}
};
+exports.update = function(message)
+{
+ That.update(message);
+};
+
exports.hide = function() {
if (That != null) {
That.hide(); |
2e048f088512f37e0fcc6feec79930b64a615c1d | number_insight/ni-advanced.js | number_insight/ni-advanced.js | require('dotenv').config({path: __dirname + '/../.env'})
const NEXMO_API_KEY = process.env.NEXMO_API_KEY
const NEXMO_API_SECRET = process.env.NEXMO_API_SECRET
// By default use the command line argument. Otherwise use the environment variable.
const INSIGHT_NUMBER = process.argv[2] || process.env.INSIGHT_NUMBER;
con... | require('dotenv').config({path: __dirname + '/../.env'})
const NEXMO_API_KEY = process.env.NEXMO_API_KEY
const NEXMO_API_SECRET = process.env.NEXMO_API_SECRET
// By default use the command line argument. Otherwise use the environment variable.
const INSIGHT_NUMBER = process.argv[2] || process.env.INSIGHT_NUMBER;
con... | Change level from `advanced` to `advancedSync` | Change level from `advanced` to `advancedSync`
As per: https://github.com/Nexmo/nexmo-node/pull/232 | JavaScript | mit | nexmo-community/nexmo-node-quickstart,nexmo-community/nexmo-node-quickstart | ---
+++
@@ -13,7 +13,7 @@
apiSecret: NEXMO_API_SECRET
});
-nexmo.numberInsight.get({level: 'advanced', number: INSIGHT_NUMBER}, (error, result) => {
+nexmo.numberInsight.get({level: 'advancedSync', number: INSIGHT_NUMBER}, (error, result) => {
if(error) {
console.error(error);
} |
460569d2ccd067dea0fcebca62a266e4f43c4ac8 | src/express/middleware/createContext.js | src/express/middleware/createContext.js | // ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
var data = require('../../data'),
notifications = require('../../notifications'),
attachOpe... | // ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
var data = require('../../data'),
notifications = require('../../notifications'),
attachOpe... | Throw meaningful exception if table does not exist | Throw meaningful exception if table does not exist
| JavaScript | mit | mamaso/azure-mobile-apps-node,shrishrirang/azure-mobile-apps-node,mamaso/azure-mobile-apps-node,mamaso/azure-mobile-apps-node,shrishrirang/azure-mobile-apps-node,shrishrirang/azure-mobile-apps-node | ---
+++
@@ -19,6 +19,8 @@
configuration: configuration,
logger: logger,
tables: function (name) {
+ if(!configuration.tables[name])
+ throw new Error("The table '" + name + "' does not exist.")
return attachOperators(name, dataP... |
7512a4e4e4588c16883ebc5499804a05286d1b64 | web/src/js/views/location-chooser.js | web/src/js/views/location-chooser.js | import locations from '../core/locations';
import View from '../base/view';
import {trigger} from '../utils/browser';
import template from '../../templates/location-chooser.ejs';
export default class LocationChooser extends View {
constructor({app, location, route}) {
super({app});
this.location = locat... | import locations from '../core/locations';
import View from '../base/view';
import {trigger} from '../utils/browser';
import template from '../../templates/location-chooser.ejs';
export default class LocationChooser extends View {
constructor({app, location, route}) {
super({app});
this.location = locat... | Simplify location chooser target route logic | Simplify location chooser target route logic
| JavaScript | mit | despawnerer/theatrics,despawnerer/theatrics,despawnerer/theatrics | ---
+++
@@ -27,10 +27,8 @@
}
getTargetRoute() {
- if (this.route.name == 'place-list') {
- return {name: 'place-list', args: this.route.args};
- } else if (this.route.name == 'event-list') {
- return {name: 'event-list', args: this.route.args};
+ if (['place-list', 'event-list'].includes(th... |
c69e67b560fd1fa97674f254e88e5637d177d1d9 | js/app.js | js/app.js | "use strict";
(function() {
var filters = {
age: function() {
this
.saturation(20)
.gamma(1.4)
.vintage()
.contrast(5)
.exposure(15)
.vignette(300, 60)
.render()
},
lomo: function() {
this
.brightness(15)
.exposure(15)
... | "use strict";
(function() {
var filters = {
age: function() {
this
.saturation(20)
.gamma(1.4)
.vintage()
.contrast(5)
.exposure(15)
.vignette(300, 60)
.render()
},
blackAndWhite: function() {
this
.gamma(100)
.contrast(... | Add black and white filter | Add black and white filter
| JavaScript | bsd-2-clause | fwenzel/hipstergram | ---
+++
@@ -10,6 +10,14 @@
.contrast(5)
.exposure(15)
.vignette(300, 60)
+ .render()
+ },
+
+ blackAndWhite: function() {
+ this
+ .gamma(100)
+ .contrast(30)
+ .saturation(-100)
.render()
},
|
b304daf4802a5fa1a870ac65ab9f3674eb83b4c1 | app/js/store.js | app/js/store.js | 'use strict';
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import reducer from './reducers';
const createStoreWithMiddleware = compose(
applyMiddleware(thunk),
window.devToolsExtension ? window.devToolsExtension() : f => f
)(createStore);
export default createSt... | 'use strict';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import reducer from './reducers';
const createStoreWithMiddleware = applyMiddleware(
thunk
)(createStore);
export default createStoreWithMiddleware(reducer);
| Revert "Add dev tools stuff" | Revert "Add dev tools stuff"
This reverts commit 46ebaea0030bdb0b81aa5b6ac343f70a968910b9.
| JavaScript | mit | rit-sse/officers,rit-sse/officers | ---
+++
@@ -1,12 +1,11 @@
'use strict';
-import { createStore, applyMiddleware, compose } from 'redux';
+import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import reducer from './reducers';
-const createStoreWithMiddleware = compose(
- applyMiddleware(thunk),
- window.devT... |
ed2d17a60d5d560f3c22722221603d846457ae9c | lib/router.js | lib/router.js | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound'
});
Router.route('/', {
name: 'home',
waitOn: function() {
return subscriptions.subscribe('allOwnedMangas', Meteor.userId());
},
fastRender: true
});
| var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound'
});
Router.route('/', {
name: 'home',
waitOn: function() {
return subscriptions.subscribe('allOwnedMangas', Meteor.userId());
},
fastRender: true
});
Router.route('/mi... | Add route for missing mangas | Add route for missing mangas
| JavaScript | mit | dexterneo/mangas,dexterneo/mangas,dexterneo/mangatek,dexterneo/mangatek | ---
+++
@@ -13,3 +13,11 @@
},
fastRender: true
});
+
+Router.route('/missingMangas', {
+ name: 'missingMangas',
+ waitOn: function() {
+ return subscriptions.subscribe('allMissingMangas', Meteor.userId());
+ },
+ fastRender: true
+}); |
3eba8d104dea9a21650e0dcb52ec8d00d42fe4b0 | plugin.js | plugin.js | 'use strict';
// Make our own plugin main interface an event emitter.
// This can be used to communicate and subscribe to others plugins events.
import { EventEmitter } from 'events';
/**
* Plugin Interface
* @class Plugin
*/
export default class extends EventEmitter {
/**
* Construct the plugin.
*/
con... | 'use strict';
// Make our own plugin main interface an event emitter.
// This can be used to communicate and subscribe to others plugins events.
import { EventEmitter } from 'events';
/**
* Plugin Interface
* @class Plugin
*/
export default class extends EventEmitter {
/**
* Construct the plugin.
*/
con... | Prepare for players and maps update of core. | Prepare for players and maps update of core.
| JavaScript | isc | ManiaJS/plugins,ManiaJS/plugins,ManiaJS/plugins | ---
+++
@@ -44,6 +44,7 @@
this.server = app.server;
// Expand app into separate parts.
- // TODO: Fill in plugins, server, players, maps.
+ this.players = app.players;
+ this.maps = app.maps;
}
} |
00efb338ffc61def70a3deb5aebc47d1f76203de | jsrts/Runtime-node.js | jsrts/Runtime-node.js | $JSRTS.os = require('os');
$JSRTS.fs = require('fs');
$JSRTS.prim_systemInfo = function (index) {
switch (index) {
case 0:
return "node";
case 1:
return $JSRTS.os.platform();
}
return "";
};
$JSRTS.prim_writeStr = function (x) { return process.stdout.write(x) }
$JSRTS... | $JSRTS.os = require('os');
$JSRTS.fs = require('fs');
$JSRTS.prim_systemInfo = function (index) {
switch (index) {
case 0:
return "node";
case 1:
return $JSRTS.os.platform();
}
return "";
};
$JSRTS.prim_writeStr = function (x) { return process.stdout.write(x) }
$JSRTS... | Fix undeclared variable in node runtime | Fix undeclared variable in node runtime
| JavaScript | bsd-3-clause | uuhan/Idris-dev,uuhan/Idris-dev,uuhan/Idris-dev,kojiromike/Idris-dev,uuhan/Idris-dev,markuspf/Idris-dev,markuspf/Idris-dev,kojiromike/Idris-dev,markuspf/Idris-dev,uuhan/Idris-dev,uuhan/Idris-dev,markuspf/Idris-dev,uuhan/Idris-dev,markuspf/Idris-dev,markuspf/Idris-dev,kojiromike/Idris-dev,markuspf/Idris-dev,kojiromike/I... | ---
+++
@@ -22,7 +22,7 @@
}
i++;
if (i == b.length) {
- nb = new Buffer(b.length * 2);
+ var nb = new Buffer(b.length * 2);
b.copy(nb)
b = nb;
} |
3692239249bb4d9efd4e84a2c1ea81d31b28f736 | spec/global-spec.js | spec/global-spec.js | var proxyquire = require("proxyquire");
// Returns an ajax instance that has the underlying XMLHttpRequest stubbed.
function getStubbedAjax(stub) {
proxyquire("../index.js", {
xmlhttprequest: {
"XMLHttpRequest": function () {
this.open = function () {};
this.send = function () {};
this.setRequestHead... | var proxyquire = require("proxyquire");
// Returns an ajax instance that has the underlying XMLHttpRequest stubbed.
function getStubbedAjax(stub) {
proxyquire("../index.js", {
xmlhttprequest: {
"XMLHttpRequest": function () {
this.open = function () {};
this.send = function () {};
this.setRequestHead... | Add basic tests for post/put/del | Add basic tests for post/put/del
| JavaScript | mit | levibotelho/dead-simple-ajax | ---
+++
@@ -27,10 +27,31 @@
it("works", function (done) {
var ajax = getStubbedAjax();
ajax.get("http://www.example.com")
- .then(function () {
- done();
- }, function () {
- fail();
- })
+ .then(done, fail);
});
});
+
+describe("The post method", function () {
+ it("works", function (done) {... |
da1cd5e7b6cfe09fb21599dd590b49aada010e3d | koans/AboutExpects.js | koans/AboutExpects.js | describe("About Expects", function() {
/We shall contemplate truth by testing reality, via spec expectations.
it("should expect true", function() {
expect(true).toBeTruthy(); //This should be true
});
//To understand reality, we must compare our expectations against reality.
it("should expect equality... | describe("About Expects", function() {
/We shall contemplate truth by testing reality, via spec expectations.
it("should expect true", function() {
expect(true).toBeTruthy(); //This should be true
});
//To understand reality, we must compare our expectations against reality.
it("should expect equality... | Change FILL_ME_IN to respective types | Change FILL_ME_IN to respective types
| JavaScript | mit | Imti/javascript-koans,Imti/javascript-koans | ---
+++
@@ -7,7 +7,7 @@
//To understand reality, we must compare our expectations against reality.
it("should expect equality", function () {
- var expectedValue = FILL_ME_IN;
+ var expectedValue = 2;
var actualValue = 1 + 1;
expect(actualValue === expectedValue).toBeTruthy();
@@ -15,7 +15,7 @... |
260c02133464f51f80d117fdb67893247f55551a | testem.js | testem.js | var Reporter = require('ember-test-utils/reporter')
module.exports = {
disable_watching: true,
framework: 'mocha',
launch_in_ci: [
'Chrome',
'Firefox'
],
launch_in_dev: [
'Chrome'
],
reporter: new Reporter(),
test_page: 'tests/index.html?hidepassed'
}
| var Reporter = require('ember-test-utils/reporter')
module.exports = {
disable_watching: true,
framework: 'mocha',
launch_in_ci: [
'Firefox',
'Chrome'
],
launch_in_dev: [
'Chrome'
],
reporter: new Reporter(),
test_page: 'tests/index.html?hidepassed'
}
| Test firefox first, so Chrome coverage is used | Test firefox first, so Chrome coverage is used
| JavaScript | mit | dafortin/ember-frost-core,EWhite613/ember-frost-core,helrac/ember-frost-core,rox163/ember-frost-core,EWhite613/ember-frost-core,dafortin/ember-frost-core,rox163/ember-frost-core,ciena-frost/ember-frost-core,rox163/ember-frost-core,ciena-frost/ember-frost-core,helrac/ember-frost-core,dafortin/ember-frost-core,EWhite613/... | ---
+++
@@ -4,8 +4,8 @@
disable_watching: true,
framework: 'mocha',
launch_in_ci: [
- 'Chrome',
- 'Firefox'
+ 'Firefox',
+ 'Chrome'
],
launch_in_dev: [
'Chrome' |
6384ec4372c63b3d5dc5bd540a2dca39552c910c | script.js | script.js | function playAudioOnKeyDown(elt) {
let soundToPlay = document.querySelector(`audio[data-key="${elt.keyCode}"]`);
let keyToAnimate = document.querySelector(`div[data-key="${elt.keyCode}"]`);
keyToAnimate.classList.add('playing');
soundToPlay.currentTime = 0;
soundToPlay.play();
keyToAnimate.addE... | Modify JavaScript file, first working version with keyDown | Modify JavaScript file, first working version with keyDown
| JavaScript | mit | shahzaibkhalid/electronic-drum-kit,shahzaibkhalid/electronic-drum-kit | ---
+++
@@ -0,0 +1,14 @@
+function playAudioOnKeyDown(elt) {
+ let soundToPlay = document.querySelector(`audio[data-key="${elt.keyCode}"]`);
+ let keyToAnimate = document.querySelector(`div[data-key="${elt.keyCode}"]`);
+ keyToAnimate.classList.add('playing');
+ soundToPlay.currentTime = 0;
+ soundToPl... | |
069aa383a0b5dc3cb3fca05bce98d8f3106ab1ce | server.js | server.js |
var http = require('http');
var mongoClient = require('mongodb').MongoClient;
var mongoUri = process.env.MONGO_URI || '';
var port = process.env.PORT || 80;
mongoClient.connect(mongoUri, function (err, client) {
http.createServer(function (req, res) {
if(err){
res.writeHead(500,... |
var http = require('http');
var mongoClient = require('mongodb').MongoClient;
var mongoUri = process.env.MONGO_URI || '';
var port = process.env.PORT || 80;
mongoClient.connect(mongoUri, function (err, client) {
http.createServer(function (req, res) {
if(err){
res.writeHead(500,... | Update text to test CI/CD | Update text to test CI/CD
| JavaScript | mit | TylerLu/hello-world,TylerLu/hello-world,TylerLu/hello-world | ---
+++
@@ -20,7 +20,7 @@
requests.count(function(error, count){
res.writeHead(200, { 'Content-Type': 'text/plain' });
- res.end(`Hello World!\nThere are ${count} request records.`);
+ res.end(`Hello World!\nThere are ${count} request records.1222`);
})
... |
5c104409305efe16dbffd04c5041c2d88e55846a | lib/daemon.js | lib/daemon.js | import readline from 'readline';
import Importer from './Importer';
const commandsToFunctionNames = {
fix: 'fixImports',
word: 'import',
goto: 'goto',
rewrite: 'rewriteImports',
add: 'addImports',
};
export default function daemon() {
const rlInterface = readline.createInterface({
input: process.stdi... | import readline from 'readline';
import Importer from './Importer';
const commandsToFunctionNames = {
fix: 'fixImports',
word: 'import',
goto: 'goto',
rewrite: 'rewriteImports',
add: 'addImports',
};
export default function daemon() {
const rlInterface = readline.createInterface({
input: process.stdi... | Print importjsd errors to stdout | Print importjsd errors to stdout
I'm playing around with using a vim channel to communicate with the
daemon. It's a lot simpler if we can assume all results (even errors)
get printed to stdout.
| JavaScript | mit | trotzig/import-js,trotzig/import-js,trotzig/import-js,Galooshi/import-js | ---
+++
@@ -28,7 +28,9 @@
process.stdout.write(`${JSON.stringify(result)}\n`);
}).catch((error) => {
// TODO: print entire stack trace here
- process.stderr.write(error.toString());
+ process.stdout.write(JSON.stringify({
+ error: error.toString(),
+ }));
});
});
} |
5594dd12afca6f57965eeac6fd1e5609c89d78b9 | lib/linter.js | lib/linter.js | 'use strict';
var gonzales = require('gonzales-pe');
var linters = [
require('./linters/space_before_brace')
];
exports.lint = function (data, path, config) {
var ast = this.parseAST(data);
var errors = [];
ast.map(function (node) {
var i;
for (i = 0; i < linters.length; i++) {
... | 'use strict';
var gonzales = require('gonzales-pe');
var linters = [
require('./linters/space_before_brace')
];
exports.lint = function (input, path, config) {
var ast = this.parseAST(input);
var errors = [];
ast.map(function (node) {
var i;
for (i = 0; i < linters.length; i++) {
... | Use 'input' instead of 'data' | Use 'input' instead of 'data'
| JavaScript | mit | JoshuaKGoldberg/lesshint,lesshint/lesshint,runarberg/lesshint,gilt/lesshint | ---
+++
@@ -5,8 +5,8 @@
require('./linters/space_before_brace')
];
-exports.lint = function (data, path, config) {
- var ast = this.parseAST(data);
+exports.lint = function (input, path, config) {
+ var ast = this.parseAST(input);
var errors = [];
ast.map(function (node) { |
3988262c70babec9b3d877077d1327f995247568 | problems/filtered_ls/setup.js | problems/filtered_ls/setup.js | const fs = require('fs')
, path = require('path')
, os = require('os')
, onlyAsync = require('workshopper/verify-calls').verifyOnlyAsync
, files = [
'learnyounode.dat'
, 'learnyounode.txt'
, 'learnyounode.sql'
, 'api.html'
, 'README.md'
... | const fs = require('fs')
, path = require('path')
, os = require('os')
, onlyAsync = require('workshopper/verify-calls').verifyOnlyAsync
, files = [
'learnyounode.dat'
, 'learnyounode.txt'
, 'learnyounode.sql'
, 'api.html'
, 'README.md'
... | Add test case from make_it_modular to filtered_ls | Add test case from make_it_modular to filtered_ls
This test case was present in the next, "same as the previous" challenge, thus preventing some solutions to filtered_ls to work for make_it_modular for an unclear reason. | JavaScript | mit | amandasilveira/learnyounode,soujiro27/learnyounode,sergiorgiraldo/learnyounode,AydinHassan/learnyounode,thenaughtychild/learnyounode,jqk6/learnyounode,Yas3r/learnyounode,kmckee/learnyounode,zpxiaomi/learnyounode,keshwans/learnyounode,jojo1311/learnyounode,5harf/learnyounode,hsidar/learnyounode,piccoloaiutante/learnyoun... | ---
+++
@@ -15,6 +15,7 @@
, 'w00t.dat'
, 'w00t.txt'
, 'wrrrrongdat'
+ , 'dat'
]
module.exports = function () { |
e62497abb96c1a8753a786e55be75b5e3bb3f90b | src/tasks/check-file-names/__tests__/index-test.js | src/tasks/check-file-names/__tests__/index-test.js | 'use strict';
import { runCommand } from '../../../utils/helper-tests';
import { join } from 'path';
describe('Check file names task', () => {
pit('should pass with valid file & folder names', () =>
runCommand(['gulp check-file-names', {
cwd: join(__dirname, 'valid-project')
}])
);
pit('should fa... | 'use strict';
import { extendJasmineTimeout, runCommand } from '../../../utils/helper-tests';
import { join } from 'path';
describe('Check file names task', () => {
extendJasmineTimeout(jasmine, beforeEach, afterEach);
pit('should pass with valid file & folder names', () =>
runCommand(['gulp check-file-names... | Fix checkFileNames tests (extend timeout) | Fix checkFileNames tests (extend timeout)
| JavaScript | mit | urbanjs/tools,urbanjs/tools,urbanjs/urbanjs-tools,urbanjs/tools,urbanjs/urbanjs-tools,urbanjs/urbanjs-tools | ---
+++
@@ -1,9 +1,11 @@
'use strict';
-import { runCommand } from '../../../utils/helper-tests';
+import { extendJasmineTimeout, runCommand } from '../../../utils/helper-tests';
import { join } from 'path';
describe('Check file names task', () => {
+ extendJasmineTimeout(jasmine, beforeEach, afterEach);
+
... |
67336759eedbcbd662d500336364ba5745ca306a | src/Schema/Address.js | src/Schema/Address.js | const mongoose = require("mongoose");
const shortid = require("shortid");
const ProcessorItem = require("./ProcessorItem");
const originals = require("mongoose-originals");
const Address = new mongoose.Schema({
_id: {
type: String,
default: shortid.generate,
},
processor: {
type: Pr... | const mongoose = require("mongoose");
const shortid = require("shortid");
const ProcessorItem = require("./ProcessorItem");
const originals = require("mongoose-originals");
const Address = new mongoose.Schema({
_id: {
type: String,
default: shortid.generate,
},
processor: {
type: Pr... | Remove not needed fields from schema | Remove not needed fields from schema | JavaScript | mit | enhancv/mongoose-subscriptions | ---
+++
@@ -12,13 +12,8 @@
type: ProcessorItem,
default: ProcessorItem,
},
- phone: String,
- company: String,
name: String,
country: String,
- locality: String,
- streetAddress: String,
- extendedAddress: String,
postalCode: String,
createdAt: Date,
upda... |
f78e46607cf15a7273ac780086a071f4cea092df | packages/meteor/server_environment.js | packages/meteor/server_environment.js | Meteor = {
isClient: false,
isServer: true
};
try {
if (process.env.METEOR_SETTINGS)
Meteor.settings = JSON.parse(process.env.METEOR_SETTINGS);
} catch (e) {
throw new Error("Settings are not valid JSON");
}
| Meteor = {
isClient: false,
isServer: true
};
try {
Meteor.settings = {};
if (process.env.METEOR_SETTINGS)
Meteor.settings = JSON.parse(process.env.METEOR_SETTINGS);
} catch (e) {
throw new Error("Settings are not valid JSON");
}
| Make the default for Meteor.settings be the empty object | Make the default for Meteor.settings be the empty object
| JavaScript | mit | TribeMedia/meteor,henrypan/meteor,l0rd0fwar/meteor,esteedqueen/meteor,jg3526/meteor,D1no/meteor,colinligertwood/meteor,Profab/meteor,skarekrow/meteor,dfischer/meteor,shadedprofit/meteor,servel333/meteor,shadedprofit/meteor,baiyunping333/meteor,skarekrow/meteor,GrimDerp/meteor,michielvanoeffelen/meteor,jeblister/meteor,... | ---
+++
@@ -4,6 +4,7 @@
};
try {
+ Meteor.settings = {};
if (process.env.METEOR_SETTINGS)
Meteor.settings = JSON.parse(process.env.METEOR_SETTINGS);
} catch (e) { |
876bd105dc905630f9d01d787c1d60f70113a72a | pages/authPassword/authPassword.js | pages/authPassword/authPassword.js | //var ERR = require('async-stacktrace');
var express = require('express');
var router = express.Router();
var csrf = require('../../lib/csrf');
var config = require('../../lib/config');
router.get('/', function(req, res) {
res.locals.passwordInvalid = 'pl_assessmentpw' in req.cookies;
res.render(__filename.r... | //var ERR = require('async-stacktrace');
var express = require('express');
var router = express.Router();
var csrf = require('../../lib/csrf');
var config = require('../../lib/config');
router.get('/', function(req, res) {
res.locals.passwordInvalid = 'pl_assessmentpw' in req.cookies;
res.render(__filename.r... | Add timeouts to CSRF and cookie | Add timeouts to CSRF and cookie
| JavaScript | agpl-3.0 | parasgithub/PrairieLearn,parasgithub/PrairieLearn,parasgithub/PrairieLearn,mwest1066/PrairieLearn,mwest1066/PrairieLearn,rbessick5/PrairieLearn,parasgithub/PrairieLearn,rbessick5/PrairieLearn,rbessick5/PrairieLearn,mwest1066/PrairieLearn,parasgithub/PrairieLearn,mwest1066/PrairieLearn,rbessick5/PrairieLearn,mwest1066/P... | ---
+++
@@ -16,9 +16,10 @@
if (req.body.__action == 'assessmentPassword') {
var pl_pw_origUrl = req.cookies.pl_pw_origUrl;
+ var maxAge = 1000 * 60 * 60 * 12; // 12 hours
- var pwCookie = csrf.generateToken({password: req.body.password}, config.secretKey);
- res.cookie('pl_asses... |
c0f10b0f04d691ad7ad2e2bcc5a28effc0f20414 | src/index.js | src/index.js | import React from 'react';
import Logo from './components/logo'
import SocialButtons from './components/social-buttons'
import Navigation from './components/navigation'
import Home from './components/home'
import Footer from './components/footer'
class Page {
render() {
return (
<div id="wrapper" classNam... | import React from 'react';
import Logo from './components/logo'
import SocialButtons from './components/social-buttons'
import Navigation from './components/navigation'
import Home from './components/home';
import Footer from './components/footer';
import AppUrl from './appurl'
class Page {
render() {
let... | Load the page according to the current url, using hashes. | Load the page according to the current url, using hashes. | JavaScript | mit | cosmowiki/cosmowiki,cosmowiki/cosmowiki,cosmowiki/cosmowiki,cosmowiki/cosmowiki | ---
+++
@@ -3,23 +3,53 @@
import Logo from './components/logo'
import SocialButtons from './components/social-buttons'
import Navigation from './components/navigation'
-import Home from './components/home'
-import Footer from './components/footer'
+import Home from './components/home';
+import Footer from './compo... |
969aa542268675b9edfeae9a8139d229712f1000 | server.js | server.js | var util = require('util'),
connect = require('connect'),
serveStatic = require('serve-static'),
port = 80,
app = connect();
app.use(serveStatic(__dirname)).listen(port);
util.puts('Listening on ' + port + '...');
util.puts('Press Ctrl + C to stop.'); | var util = require('util'),
connect = require('connect'),
serveStatic = require('serve-static'),
port = process.env.PORT || 3000,
app = connect();
app.use(serveStatic(__dirname)).listen(port);
util.puts('Listening on ' + port + '...');
util.puts('Press Ctrl + C to stop.'); | Update so PORT environment variable is used | Update so PORT environment variable is used
| JavaScript | mit | maael/design-patterns-presentation | ---
+++
@@ -1,7 +1,7 @@
var util = require('util'),
connect = require('connect'),
serveStatic = require('serve-static'),
- port = 80,
+ port = process.env.PORT || 3000,
app = connect();
app.use(serveStatic(__dirname)).listen(port); |
a6bb5eedb0f26bcdb5b837a5cffd86122db42cf8 | src/index.js | src/index.js | // @flow
import { elementNames } from './config'
import create from './helper'
export { apply } from './helper'
export function tag(head: string, ...tail: any[]): Function {
return create(head)(...tail)
}
export function createHelpers(names: string[]): { [key: string]: (...args: any[]) => Function } {
const hel... | // @flow
import { elementNames } from './config'
import create from './helper'
export { apply } from './helper'
function tag(head: string, ...tail: any[]): Function {
return create(head)(...tail)
}
export function createHelpers(names: string[]): { [key: string]: (...args: any[]) => Function } {
const helpers = ... | Move `tag` helper in default export | Move `tag` helper in default export
| JavaScript | mit | ktsn/vue-vnode-helper,ktsn/vue-vnode-helper | ---
+++
@@ -5,7 +5,7 @@
export { apply } from './helper'
-export function tag(head: string, ...tail: any[]): Function {
+function tag(head: string, ...tail: any[]): Function {
return create(head)(...tail)
}
@@ -14,6 +14,7 @@
names.forEach(name => {
helpers[name] = create(name)
})
+ helpers.tag ... |
bc30514628a5bf9ccd4f92999115ee75c499e2ad | server.js | server.js | var restify = require('restify');
var mainController = require('./controllers/mainController');
var server = restify.createServer({
name: 'self-signed'
});
server.use(restify.bodyParser());
server.put('/:client/key', mainController.key);
server.get('/:client/key', mainController.publicKey);
server.get('/:client/si... | var restify = require('restify');
var mainController = require('./controllers/mainController');
var server = restify.createServer({
name: 'self-signed'
});
server.use(restify.bodyParser());
server.put('/:client/key', mainController.key);
server.get('/:client/key', mainController.publicKey);
server.post('/:client/s... | Move signing method to post verb | Move signing method to post verb
| JavaScript | mit | shtpavel/node-signing-server | ---
+++
@@ -10,7 +10,7 @@
server.put('/:client/key', mainController.key);
server.get('/:client/key', mainController.publicKey);
-server.get('/:client/sign', mainController.sign);
+server.post('/:client/sign', mainController.sign);
server.listen(3000, function(){
console.log('Server started at port: 3000'); |
373fdd2d21739f38464fb502a75c063f07c8d1cf | src/index.js | src/index.js | var Alexa = require('alexa-sdk');
var APP_ID = 'amzn1.ask.skill.933585d3-ba4a-49f9-baed-86e109c589ed';
var SKILL_NAME = 'Snack Overflow';
var POSSIBLE_RECIPIES = [ 'Chicken Parmesan', 'Spaghetti', 'Turkey Sandwich' ];
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context,... | var Alexa = require('alexa-sdk');
var APP_ID = 'amzn1.ask.skill.85ae7ea2-b727-4d2a-9765-5c563a5ec379';
var SKILL_NAME = 'Snack Overflow';
var POSSIBLE_RECIPIES = [ 'Chicken Parmesan', 'Spaghetti', 'Turkey Sandwich' ];
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context,... | Update APP_ID to correct app id | Update APP_ID to correct app id
| JavaScript | mit | cwboden/amazon-hackathon-alexa | ---
+++
@@ -1,6 +1,6 @@
var Alexa = require('alexa-sdk');
-var APP_ID = 'amzn1.ask.skill.933585d3-ba4a-49f9-baed-86e109c589ed';
+var APP_ID = 'amzn1.ask.skill.85ae7ea2-b727-4d2a-9765-5c563a5ec379';
var SKILL_NAME = 'Snack Overflow';
var POSSIBLE_RECIPIES = [ 'Chicken Parmesan', 'Spaghetti', 'Turkey Sandwich' ]... |
0825b7031e33edfd6d684118046bced28b0a2fd2 | src/index.js | src/index.js | import isFunction from 'lodash/isFunction';
import isObject from 'lodash/isObject';
import assign from 'lodash/assign';
import pick from 'lodash/pick';
import flatten from 'lodash/flatten';
import pickBy from 'lodash/pickBy';
import assignWith from 'lodash/assignWith';
import compose from './compose';
export const is... | import {
isFunction, isObject,
assign, assignWith,
pick, pickBy,
flatten
} from 'lodash';
import compose from './compose';
export const isDescriptor = isObject;
export const isStamp = obj => isFunction(obj) && isFunction(obj.compose) && isDescriptor(obj.compose);
export const isComposable = obj => isDescrip... | Use single import of lodash | Use single import of lodash | JavaScript | mit | stampit-org/stamp-utils | ---
+++
@@ -1,10 +1,9 @@
-import isFunction from 'lodash/isFunction';
-import isObject from 'lodash/isObject';
-import assign from 'lodash/assign';
-import pick from 'lodash/pick';
-import flatten from 'lodash/flatten';
-import pickBy from 'lodash/pickBy';
-import assignWith from 'lodash/assignWith';
+import {
+ isF... |
a8c322a16c2a81f72b1632279604db757bd9cd2a | server.js | server.js | 'use strict';
var express = require('express');
var routes = require('./app/routes/index.js');
var mongoose = require('mongoose');
var passport = require('passport');
var session = require('express-session');
var bodyParser = require('body-parser')
var app = express();
require('dotenv').load();
require('./app/config/... | 'use strict';
var express = require('express');
var routes = require('./app/routes/index.js');
var mongoose = require('mongoose');
var passport = require('passport');
var session = require('express-session');
var bodyParser = require('body-parser')
var app = express();
// require('dotenv').load();
require('./app/conf... | Comment out dotenv for heroku deployment | Comment out dotenv for heroku deployment
| JavaScript | mit | jcsgithub/jcsgithub-votingapp,jcsgithub/jcsgithub-votingapp | ---
+++
@@ -8,7 +8,7 @@
var bodyParser = require('body-parser')
var app = express();
-require('dotenv').load();
+// require('dotenv').load();
require('./app/config/passport')(passport);
mongoose.connect(process.env.MONGO_URI); |
d715a4bbc039e4959caabcb3e92ccc8a7626d555 | public/javascripts/application.js | public/javascripts/application.js | $(document).ready(function() {
var divs = "#flash_success, #flash_notice, #flash_error";
$(divs).each(function() {
humanMsg.displayMsg($(this).text());
return false;
});
if (window.location.href.search(/query=/) == -1) {
$('#query').one('click', function() {
$(this).val('');
});
}
$(... | $(document).ready(function() {
$('#flash_success, #flash_notice, #flash_error').each(function() {
humanMsg.displayMsg($(this).text());
});
if (window.location.href.search(/query=/) == -1) {
$('#query').one('click, focus', function() {
$(this).val('');
});
}
$(document).bind('keyup', functi... | Clear the search query on focus as well and some minor JS clean up. | Clear the search query on focus as well and some minor JS clean up. | JavaScript | mit | bpm/getbpm.org,bpm/getbpm.org,alloy/gemcutter,dstrctrng/private_event,square/rubygems.org,alloy/gemcutter,dstrctrng/private_event,rubygems/rubygems.org-backup,rubygems/rubygems.org-backup,square/rubygems.org,1337807/rubygems.org,1337807/rubygems.org,square/rubygems.org,1337807/rubygems.org,rubygems/rubygems.org-backup | ---
+++
@@ -1,12 +1,10 @@
$(document).ready(function() {
- var divs = "#flash_success, #flash_notice, #flash_error";
- $(divs).each(function() {
+ $('#flash_success, #flash_notice, #flash_error').each(function() {
humanMsg.displayMsg($(this).text());
- return false;
});
if (window.location.href.se... |
56a95bd9065a4299a0195b6408ade51b47640ee2 | services/bovada.js | services/bovada.js | const axios = require('axios');
const BovadaParser = require('../services/BovadaParser');
axios.defaults.baseURL = 'https://www.bovada.lv/services/sports/event/v2/events/A/description/football';
axios.defaults.headers.common['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, li... | const axios = require('axios');
const BovadaParser = require('../services/BovadaParser');
axios.defaults.baseURL = 'https://www.bovada.lv/services/sports/event/v2/events/A/description/football';
axios.defaults.headers.common['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, li... | Add Bovada endpoint for super bowl lines | Add Bovada endpoint for super bowl lines
| JavaScript | mit | lentz/buddyduel,lentz/buddyduel,lentz/buddyduel | ---
+++
@@ -5,11 +5,13 @@
axios.defaults.headers.common['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36';
module.exports.getLines = async () => {
- const [regSeasonResp, playoffResp] = await Promise.all([
+ const [regSeaso... |
eeee14f6c0d0ae83cce051024739940960474147 | plugin.js | plugin.js | /**
* @file insert Non-Breaking SPace for CKEditor
* Copyright (C) 2014 Alfonso Martnez de Lizarrondo
* Create a command and enable the Ctrl+Space shortcut to insert a non-breaking space in CKEditor
*
*/
CKEDITOR.plugins.add( 'nbsp',
{
init : function( editor )
{
// Insert if Ctrl+Space is pressed:
e... | /**
* @file insert Non-Breaking Space for CKEditor
* Copyright (C) 2014 Alfonso Martínez de Lizarrondo
* Create a command and enable the Ctrl+Space shortcut to insert a non-breaking space in CKEditor
*
*/
CKEDITOR.plugins.add( 'nbsp',
{
init : function( editor )
{
// Insert if Ctrl+Space is pressed:
... | Fix inline tag splitting and comment formatting | Fix inline tag splitting and comment formatting
| JavaScript | mpl-2.0 | AlfonsoML/nbsp | ---
+++
@@ -1,6 +1,6 @@
/**
- * @file insert Non-Breaking SPace for CKEditor
- * Copyright (C) 2014 Alfonso Martnez de Lizarrondo
+ * @file insert Non-Breaking Space for CKEditor
+ * Copyright (C) 2014 Alfonso Martínez de Lizarrondo
* Create a command and enable the Ctrl+Space shortcut to insert a non-breaking spa... |
0e3042f89fb16fe3c130d1044b8e9c7f599f8e72 | server.js | server.js | var app = require('express')();
var parser = require('./src/scrip').parse;
app.get('/', function (req, res) {
var scrip = req.query.scrip;
var result = parser(scrip);
res.send(result);
});
app.listen('8000');
| var app = require('express')();
var parser = require('./src/scrip').parse;
app.get('/', function (req, res) {
var scrip = req.query.scrip;
if (scrip) {
var result = parser(scrip);
res.status(200).json(result);
} else {
res.status(422).json({'error': 'Invalid data'});
}
});
app.listen('8000');
mod... | Return 422 for invalid parameters | Return 422 for invalid parameters
| JavaScript | mit | pranavrc/scrip | ---
+++
@@ -3,10 +3,14 @@
app.get('/', function (req, res) {
var scrip = req.query.scrip;
- var result = parser(scrip);
-
- res.send(result);
+ if (scrip) {
+ var result = parser(scrip);
+ res.status(200).json(result);
+ } else {
+ res.status(422).json({'error': 'Invalid data'});
+ }
});
app.l... |
64de8750546e31361e85a1ebe2917afe2c7c30df | mspace.js | mspace.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/. */
/*jslint browser: true*/
"use strict";
(function () {
window.addEventListener("load", function () {
/... | /* 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/. */
/*jslint browser: true*/
"use strict";
(function () {
window.addEventListener("load", function () {
/... | Add a MathML namespace so that the detection works in XML too. | Add a MathML namespace so that the detection works in XML too.
| JavaScript | mpl-2.0 | fred-wang/mathml.css,josephlewis42/mathml.css,fred-wang/mathml.css,josephlewis42/mathml.css | ---
+++
@@ -10,7 +10,7 @@
// Insert mathml.css if the <mspace> element is not supported.
var box, div, link;
div = document.createElement("div");
- div.innerHTML = "<math><mspace height='23px' width='77px'/></math>";
+ div.innerHTML = "<math xmlns='http://www.w3.org/1998/Math/... |
47b5d6c7a2e90dec04f1b7e751abed54347488a2 | public/js/views/DashboardMainGraph.js | public/js/views/DashboardMainGraph.js | define([], function() {
'use strict';
return Backbone.View.extend({
jqplotId: null,
initialize: function(options) {
this.render();
var view = this;
diana.helpers.Event.on('DashboardTimeIntervalChange', function(interval) {
view.options.dashArgs.interval = interval;
view... | define([], function() {
'use strict';
return Backbone.View.extend({
jqplotId: null,
initialize: function(options) {
this.render();
var view = this;
diana.helpers.Event.on('DashboardTimeIntervalChange', function(interval) {
view.options.dashArgs.interval = interval;
vie... | Update route on interval drop-down changes. | Update route on interval drop-down changes.
| JavaScript | mit | codeactual/mainevent | ---
+++
@@ -11,6 +11,9 @@
var view = this;
diana.helpers.Event.on('DashboardTimeIntervalChange', function(interval) {
view.options.dashArgs.interval = interval;
+
+ view.navigate('dashboard', view.options.dashArgs, {trigger: false});
+
view.render();
});
}, |
9b5395ab11d8b28bc996f42e266a11a591057551 | online.js | online.js | #!/usr/bin/env node
'use strict';
let [,, onLineSrc, onCloseSrc ] = process.argv;
let onLine = eval(onLineSrc) || (line => line);
let onClose = eval(onCloseSrc) || (() => undefined);
let env = new Set();
require('readline')
.createInterface({
input: process.stdin
})
.on('line', line => {
l... | #!/usr/bin/env node
'use strict';
let [,, onLineSrc, onCloseSrc ] = process.argv;
let onLine = eval(onLineSrc) || (line => line);
let onClose = eval(onCloseSrc) || (() => undefined);
let env = new Set();
require('readline')
.createInterface({
input: process.stdin
})
.on('line', line => {
l... | Print the return value of onClose if it's not null | Print the return value of onClose if it's not null
| JavaScript | mit | bsdelf/scripts | ---
+++
@@ -18,5 +18,8 @@
}
})
.on('close', () => {
- onClose(env);
+ let value = onClose(env);
+ if (value != null) {
+ console.log(value);
+ }
}); |
0b942a6b920c3562468b21ff865c729eda5fe453 | public/js/login.js | public/js/login.js | /* eslint-env jquery */
start();
function start () {
'use strict';
$(document).ready(() => {
$('form').submit(event => {
event.preventDefault();
const username = $('#username').val();
const password = $('#password').val();
const loginObj = {
username,
password
};
... | /* eslint-env jquery */
start();
function start () {
'use strict';
$(document).ready(() => {
$('form').submit(event => {
event.preventDefault();
const username = $('#username').val();
const password = $('#password').val();
const loginObj = {
username,
password
};
... | Change double quotes to single quotes | Change double quotes to single quotes
| JavaScript | apache-2.0 | ailijic/era-floor-time,ailijic/era-floor-time | ---
+++
@@ -17,7 +17,7 @@
url: '/login',
data: JSON.stringify(loginObj),
dataType: 'JSON',
- contentType: "application/json; charset=utf-8",
+ contentType: 'application/json; charset=utf-8',
success: (result) => console.log(result)
});
}); |
e558d635be3c497a4766900400ad8b2acb26282f | gulpfile.js | gulpfile.js | var gulp = require('gulp')
var connect = require('gulp-connect')
var inlinesource = require('gulp-inline-source')
gulp.task('connect', () => {
connect.server({
root: 'dist',
livereload: true
})
})
gulp.task('html', () => {
gulp.src('./src/index.html')
.pipe(inlinesource())
.pipe(gulp.dest('./dis... | var gulp = require('gulp');
var connect = require('gulp-connect');
var inlinesource = require('gulp-inline-source');
gulp.task('connect', () => {
connect.server({
root: 'dist',
livereload: true
})
})
gulp.task('html', () => {
gulp.src('./src/index.html')
.pipe(inlinesource())
.pipe(gulp.dest('./... | Add test task for Gulp | Add test task for Gulp
| JavaScript | mit | jeerbl/beat.pm,jeerbl/beat.pm | ---
+++
@@ -1,6 +1,6 @@
-var gulp = require('gulp')
-var connect = require('gulp-connect')
-var inlinesource = require('gulp-inline-source')
+var gulp = require('gulp');
+var connect = require('gulp-connect');
+var inlinesource = require('gulp-inline-source');
gulp.task('connect', () => {
connect.server({
@@ -1... |
ead960958b97975c73851633e4c530ada3f374b8 | gulpfile.js | gulpfile.js | 'use strict';
const gulp = require('gulp'),
fs = require('fs'),
plumber = require('gulp-plumber');
const options = {
source: 'templates',
dist: 'dist',
workingDir: 'tmp',
src: function plumbedSrc() {
return gulp.src.apply(gulp, arguments).pipe(plumber());
}
};
/**
* Load tasks from the '/tasks' di... | 'use strict';
const gulp = require('gulp'),
fs = require('fs'),
plumber = require('gulp-plumber');
const options = {
source: 'templates',
dist: 'dist',
workingDir: 'tmp',
src: function plumbedSrc() {
return gulp.src.apply(gulp, arguments).pipe(plumber());
}
};
/**
* Load tasks from the '/tasks' di... | Create a gulp task to run pipeline once | Create a gulp task to run pipeline once
| JavaScript | mit | fadeit/responsive-html-email-signature,fadeit/responsive-html-email-signature | ---
+++
@@ -24,11 +24,14 @@
const postcss = require('./tasks/postcss')(options);
const sass = require('./tasks/sass')(options);
-/* By default templates will be built into '/dist' */
+/* Runs the entire pipeline once. */
+gulp.task('run-pipeline', gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build'));
... |
44d6583901f0eaabfb12594110397cdbfb8f21ad | gulpfile.js | gulpfile.js | var gulp = require("gulp");
var typescript = require("gulp-typescript");
const tsconfig = typescript.createProject("tsconfig.json");
gulp.task("compile", () => {
return gulp.src(["./src/**/*.ts", "!./src/**/*.d.ts"])
.pipe(tsconfig())
.pipe(gulp.dest("./build"));
});
| const argv = require("argv");
const gulp = require("gulp");
const path = require("path");
const sourcemaps = require("gulp-sourcemaps");
const typescript = require("gulp-typescript");
const args = argv.option({name: "env", short: "e", type: "string"}).run();
const isDebug = args.options["env"] === "debug";
const destD... | Fix project setup to support production and debug | Fix project setup to support production and debug
| JavaScript | mit | nickp10/shuffler,nickp10/shuffler | ---
+++
@@ -1,10 +1,31 @@
-var gulp = require("gulp");
-var typescript = require("gulp-typescript");
+const argv = require("argv");
+const gulp = require("gulp");
+const path = require("path");
+const sourcemaps = require("gulp-sourcemaps");
+const typescript = require("gulp-typescript");
+const args = argv.option(... |
d5d5e4f18a4a3fb467bac398a0a28d5c9a1701f4 | server/routes/dashboard/dashboard.route.js | server/routes/dashboard/dashboard.route.js | const express = require('express')
const router = express.Router()
module.exports = router
| const express = require('express')
const queryHelper = require('../../utilities/query')
const router = express.Router()
router.get('/number-of-student', (req, res) => {
queryHelper.queryAndResponse({
sql: `select substr(student_id, 1, 2) as academic_year,
count(*) as student_count from students
... | Add some service to dashboard | Add some service to dashboard
| JavaScript | mit | JThanat/student-management-system,JThanat/student-management-system | ---
+++
@@ -1,6 +1,26 @@
const express = require('express')
+const queryHelper = require('../../utilities/query')
+const router = express.Router()
-const router = express.Router()
+router.get('/number-of-student', (req, res) => {
+ queryHelper.queryAndResponse({
+ sql: `select substr(student_id, 1, 2) as acade... |
2ce08f2ca4392a0a5753106e2f582a3310914596 | gulpfile.js | gulpfile.js | var gulp = require('gulp'),
// this is an arbitrary object that loads all gulp plugins in package.json.
coffee = require('coffee-script/register'),
$ = require("gulp-load-plugins")(),
express = require('express'),
path = require('path'),
tinylr = require('tiny-lr'),
... | var gulp = require('gulp'),
// this is an arbitrary object that loads all gulp plugins in package.json.
coffee = require('coffee-script/register'),
$ = require("gulp-load-plugins")(),
express = require('express'),
path = require('path'),
tinylr = require('tiny-lr'),
... | Include bower components as assets | Include bower components as assets
| JavaScript | mit | GeoSensorWebLab/Arctic-Scholar-Portal,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/Arctic-Scholar-Portal | ---
+++
@@ -15,7 +15,13 @@
app.set('view engine', 'jade');
require('./routes')(app);
app.use(assets({
- paths: ['src/scripts', 'src/images', 'src/stylesheets', 'src/views']
+ paths: [
+ 'src/scripts',
+ 'src/images',
+ 'src/stylesheets',
+ 'src/views',
+ 'bower_components'
+ ... |
4ab099864a19bc91b50122853b6dc1808466d443 | gulpfile.js | gulpfile.js | var bower = require('bower'),
eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip');
// Installs bower dependencies
gulp.task('bower', function(callback) {
bower.command... | var bower = require('bower'),
eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip');
// Installs bower dependencies
gulp.task('bower', function(callback) {
bower.command... | Add prepare-release task for consistency | Add prepare-release task for consistency
| JavaScript | apache-2.0 | Mibew/emoji-plugin,Mibew/emoji-plugin | ---
+++
@@ -17,8 +17,7 @@
});
});
-// Builds and packs plugins sources
-gulp.task('default', ['bower'], function() {
+gulp.task('prepare-release', ['bower'], function() {
var version = require('./package.json').version;
return eventStream.merge(
@@ -30,6 +29,11 @@
)
.pipe(chmod(0644)... |
a91c6b4ca951b8cf5d1076d4f7b35746ddbf034f | shared/chat/conversation/messages/retry.js | shared/chat/conversation/messages/retry.js | // @flow
import React from 'react'
import {globalColors} from '../../../styles'
import {Box, Text} from '../../../common-adapters'
const Retry = ({onRetry}: {onRetry: () => void}) => (
<Box>
<Text type='BodySmall' style={{fontSize: 9, color: globalColors.red}}>{'┏(>_<)┓'}</Text>
<Text type='BodySmall' style=... | // @flow
import React from 'react'
import {globalColors, globalStyles} from '../../../styles'
import {Text} from '../../../common-adapters'
const Retry = ({onRetry}: {onRetry: () => void}) => (
<Text type='BodySmall'>
<Text type='BodySmall' style={{fontSize: 9, color: globalColors.red}}>{'┏(>_<)┓'}</Text>
<T... | Fix styling of Retry component on mobile | Fix styling of Retry component on mobile
| JavaScript | bsd-3-clause | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client | ---
+++
@@ -1,14 +1,14 @@
// @flow
import React from 'react'
-import {globalColors} from '../../../styles'
-import {Box, Text} from '../../../common-adapters'
+import {globalColors, globalStyles} from '../../../styles'
+import {Text} from '../../../common-adapters'
const Retry = ({onRetry}: {onRetry: () => void}... |
c1fce5f22ff9d83c06981be01a63b5b2da739f6d | website/app/application/core/projects/project/home/home.js | website/app/application/core/projects/project/home/home.js | (function (module) {
module.controller('projectHome', projectHome);
projectHome.$inject = ["project"];
function projectHome(project, ui) {
var ctrl = this;
ctrl.project = project;
}
}(angular.module('materialscommons')));
| (function (module) {
module.controller('projectHome', projectHome);
projectHome.$inject = ["project"];
function projectHome(project) {
var ctrl = this;
ctrl.project = project;
}
}(angular.module('materialscommons')));
| Remove reference to unused ui service. | Remove reference to unused ui service.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | ---
+++
@@ -2,7 +2,7 @@
module.controller('projectHome', projectHome);
projectHome.$inject = ["project"];
- function projectHome(project, ui) {
+ function projectHome(project) {
var ctrl = this;
ctrl.project = project;
} |
7b3bdf9c919d38bf18b8825d75deb0f6018c0e37 | httpmock.js | httpmock.js | var argv = require('optimist')
.usage("Usage: $0 --config [config] --port [port]")
.demand(['config'])
.default('port', 5000)
.argv;
var mock = require('./src/mock.js').mock;
mock(argv.port, process.cwd + "/" + argv.config);
| var argv = require('optimist')
.usage("Usage: $0 --config [config] --port [port]")
.demand(['config'])
.default('port', 5000)
.argv;
var mock = require('./src/mock.js').mock;
mock(argv.port, argv.config);
| Revert "Look for mock.js in the current directory" | Revert "Look for mock.js in the current directory"
This reverts commit c7f1aa03479a7fd2dedc5d172fbdc0dc692bcf85.
Conflicts:
httpmock.js
| JavaScript | mit | tildedave/httpmock.js | ---
+++
@@ -6,4 +6,5 @@
var mock = require('./src/mock.js').mock;
-mock(argv.port, process.cwd + "/" + argv.config);
+mock(argv.port, argv.config);
+ |
389851c4db207fbd92b424fe1bbccf773745f99b | config.js | config.js | /**
* React Static Boilerplate
* https://github.com/koistya/react-static-boilerplate
* Copyright (c) Konstantin Tarkus (@koistya) | MIT license
*/
export default {
title: 'Flashcards',
description: 'For studying stuff. Indeed, for learning stuff.',
googleAnalyticsId: 'UA-XXXXX-X',
};
| /**
* React Static Boilerplate
* https://github.com/koistya/react-static-boilerplate
* Copyright (c) Konstantin Tarkus (@koistya) | MIT license
*/
export default {
title: 'Super Flash Cards',
description: 'For studying stuff. Indeed, for learning stuff.',
googleAnalyticsId: 'UA-XXXXX-X',
};
| Change default <title> to "Super Flash Cards" | Change default <title> to "Super Flash Cards"
| JavaScript | mit | ahw/flash-cards-static-app,ahw/superflash.cards | ---
+++
@@ -5,7 +5,7 @@
*/
export default {
- title: 'Flashcards',
+ title: 'Super Flash Cards',
description: 'For studying stuff. Indeed, for learning stuff.',
googleAnalyticsId: 'UA-XXXXX-X',
}; |
91942007195c4eaa1f800be8854e6223b402a0ce | testem.js | testem.js | /* eslint-env node */
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'PhantomJS',
'Chrome'
],
launch_in_dev: [
'PhantomJS',
'Chrome'
],
browser_args: {
Chrome: [
'--disable-gpu',
'--headless',
'--remote-debugging-p... | /* eslint-env node */
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_args: {
Chrome: {
mode: 'ci',
args: [
// --no-sandbox is needed when running Chrome inside a container... | Use `--no-sandbox` on TravisCI 🔨 | Use `--no-sandbox` on TravisCI 🔨
Related to use of Headless Chrome, see https://github.com/ember-cli/ember-cli/pull/7566.
| JavaScript | mit | dunnkers/ember-polymer-paper,dunnkers/ember-polymer-paper | ---
+++
@@ -3,19 +3,23 @@
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
- 'PhantomJS',
'Chrome'
],
launch_in_dev: [
- 'PhantomJS',
'Chrome'
],
browser_args: {
- Chrome: [
- '--disable-gpu',
- '--headless',
- '--remote-debugging... |
415719a72236bb4609d8112037ed2e49a9cc2d9a | testem.js | testem.js | /* eslint-env node */
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_args: {
Chrome: {
mode: 'ci',
args: [
'--disable-gpu',
'--headless',
'--remote-debuggi... | /* eslint-env node */
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_args: {
Chrome: {
mode: 'ci',
args: [
'--disable-gpu',
'--headless',
'--no-sandbox',
... | Add --no-sandbox chrome argument to fix Travis CI build | Add --no-sandbox chrome argument to fix Travis CI build
| JavaScript | mit | LucasHill/ember-print-this,LucasHill/ember-print-this,LucasHill/ember-print-this | ---
+++
@@ -14,6 +14,7 @@
args: [
'--disable-gpu',
'--headless',
+ '--no-sandbox',
'--remote-debugging-port=9222',
'--window-size=1440,900'
] |
13ce5d9b14847599a894e2098ba10a2382a78bf8 | config.js | config.js | module.exports = {
refreshMin: 10,
github: {
per_page: 100,
timeout: 5000,
version: '3.0.0'
},
local: {
save: 'NEVER', // NEVER, ON_REFRESH, ALWAYS
location: undefined
}
}
| module.exports = {
refreshMin: 10,
github: {
per_page: 100,
timeout: 5000,
version: '3.0.0'
},
local: {
save: 'NEVER', // NEVER, ON_REFRESH, ALWAYS
location: null
}
}
| Use null instead of undefined and remove whitespace | Use null instead of undefined and remove whitespace
| JavaScript | mit | mcwhittemore/gist-db,pinn3/gist-db | ---
+++
@@ -6,7 +6,7 @@
version: '3.0.0'
},
local: {
- save: 'NEVER', // NEVER, ON_REFRESH, ALWAYS
- location: undefined
+ save: 'NEVER', // NEVER, ON_REFRESH, ALWAYS
+ location: null
}
} |
3c4b2a07c509c7031e7e914729982fc3431872d9 | server.js | server.js | 'use strict';
const express = require('express');
const app = express();
const path = require('path');
const twilio = require('twilio');
const bodyparser = require('body-parser');
const onConnect = require('./lib/socket').onConnect;
const twilioRoute = require('./lib/twilio');
app.use(express.static(path.join(__dirn... | 'use strict';
const express = require('express');
const app = express();
const path = require('path');
const twilio = require('twilio');
const bodyparser = require('body-parser');
const onConnect = require('./lib/socket').onConnect;
const twilioRoute = require('./lib/twilio');
app.use(express.static(path.join(__dirn... | Switch json for url parser | Switch json for url parser
| JavaScript | apache-2.0 | peterjuras/askeighty,peterjuras/askeighty | ---
+++
@@ -10,7 +10,7 @@
const twilioRoute = require('./lib/twilio');
app.use(express.static(path.join(__dirname, 'public')));
-app.use(bodyparser.json());
+app.use(bodyparser.urlencoded({ extended: false }));
app.post('/twilio/response', twilio.webhook({ validate: false }), twilioRoute.response);
const serv... |
ecd6064267b8bbdd126dbda09e74f85cdabc729f | src/reducers/visibilityFilter.js | src/reducers/visibilityFilter.js | const visibilityFilter = (state = 'SHOW_ALL', action) => {
switch(action.type) {
case 'SET_VISIBILITY_FILTER':
return action.filter;
default:
return state;
}
};
export default visibilityFilter;
| const visibilityFilter = (state = 'SHOW_ALL', action) => {
switch(action.type) {
case 'ADD_ITEM':
return 'SHOW_ALL';
case 'SET_VISIBILITY_FILTER':
return action.filter;
default:
return state;
}
};
export default visibilityFilter;
| Set viz-filter to SHOW_ALL when adding a new item | Set viz-filter to SHOW_ALL when adding a new item
| JavaScript | mit | blaqbern/lists,blaqbern/lists | ---
+++
@@ -1,7 +1,11 @@
const visibilityFilter = (state = 'SHOW_ALL', action) => {
switch(action.type) {
+ case 'ADD_ITEM':
+ return 'SHOW_ALL';
+
case 'SET_VISIBILITY_FILTER':
return action.filter;
+
default:
return state;
} |
286aaa28ea38b4b3022b35fac03b8948d8ff2807 | src/cli/Host.js | src/cli/Host.js | 'use strict';
const program = require('commander');
const path = require('path');
const FlaCompiler = require('./FlaCompiler');
program
.version(require('../../package.json').version)
.option('--interactive-compiler <path>', 'full path to Flash.exe')
.option('--input-directory <path>', 'full path to inpu... | 'use strict';
const program = require('commander');
const path = require('path');
const FlaCompiler = require('./FlaCompiler');
program
.version(require('../../package.json').version)
.option('--interactive-compiler <path>', 'absolute or relative path to Flash.exe')
.option('--input-directory <path>', 'a... | Allow relative path for interactive compiler parameter. Update help | Allow relative path for interactive compiler parameter. Update help
| JavaScript | mit | alexeiskachykhin/flc | ---
+++
@@ -7,16 +7,16 @@
program
.version(require('../../package.json').version)
- .option('--interactive-compiler <path>', 'full path to Flash.exe')
- .option('--input-directory <path>', 'full path to input directory that contains FLA files')
- .option('--output-directory <path>', 'full path to inp... |
b2f2591150c2bcc640fd706eef8cd2ae1cc740ad | src/actions/headerNav.js | src/actions/headerNav.js | import {
HEADER_NAV_MOUSE_ENTER,
HEADER_NAV_MOUSE_LEAVE,
SET_HEADER_NAV
} from '../constants/headerNav';
import { setCurrentAsset } from '../actions/assets';
import keyBy from 'lodash/keyBy';
export const setCurrentHeaderNav = headerNavID => dispatch => {
dispatch({
type: SET_HEADER_NAV,
payload: heade... | import {
HEADER_NAV_MOUSE_ENTER,
HEADER_NAV_MOUSE_LEAVE,
SET_HEADER_NAV
} from '../constants/headerNav';
import { setCurrentAsset } from '../actions/assets';
import keyBy from 'lodash/keyBy';
export const setCurrentHeaderNav = headerNavID => dispatch => {
dispatch({
type: SET_HEADER_NAV,
payload: heade... | Hide submenu on click sub menu item | Hide submenu on click sub menu item
| JavaScript | mit | g8extended/Character-Generator,g8extended/Character-Generator | ---
+++
@@ -30,4 +30,5 @@
const mapping = keyBy(getState().assetsToHeaderNavMapping, 'headerNavID')[headerNavID];
mapping && dispatch(setCurrentAsset(mapping.assetID));
dispatch(setCurrentHeaderNav(headerNavID));
+ dispatch(headevNavMouseLeave());
}; |
b487ddf16e2a8c396b927fb580919716a951f0a3 | bin/imp.js | bin/imp.js | #! /usr/bin/env node
var program = require("commander");
program
.version("0.0.1")
.command("devices [options]", "Lists devices, or adds/removes devices from project")
.command("deploy [options]", "Deploys the project")
.command("init", "Creates a new imp project")
.command("log [options]", "Logs messages ... | #! /usr/bin/env node
var program = require("commander");
program
.version("0.0.1")
.command("devices [options]", "Lists devices, or adds/removes devices from project")
.command("deploy [options]", "Deploys the project")
.command("init", "Creates a new imp project")
.command("log [options]", "Logs messages ... | Update migrate help text so that its purpose was more clear | Update migrate help text so that its purpose was more clear
| JavaScript | mit | deldrid1/imp-cli,matt-haines/imp-cli,cat-haines/imp-cli | ---
+++
@@ -12,6 +12,6 @@
.command("login [options]", "Sets your global API-Key")
.command("models [options]", "Lists models, or sets the project's model")
.command("pull [options]", "Fetches the most recent code from the imp server")
- .command("migrate [options]", "Migrates model from development imp serv... |
9e1f44dd5609ae683e9bb147f7c84955b3b7bdaa | bleep.com-dance-all-night.user.js | bleep.com-dance-all-night.user.js | // ==UserScript==
// @name bleep.com dance all night
// @namespace rob@middlerob.com
// @include https://bleep.com/*
// @version 1
// @description Disable the 60 second pause on bleep.com
// @license MIT
// @oujs:author middlerob
// @grant none
// ==/UserScript==
eval(durationChanged.toStrin... | // ==UserScript==
// @name bleep.com dance all night
// @namespace rob@middlerob.com
// @include https://bleep.com/*
// @version 2
// @description Disable the 60 second pause on bleep.com
// @license MIT
// @oujs:author middlerob
// @grant none
// ==/UserScript==
setInterval(function() {
w... | Fix script to work with latest website updates | Fix script to work with latest website updates | JavaScript | mit | Rob-ot/bleep.com-dance-all-night | ---
+++
@@ -2,15 +2,13 @@
// @name bleep.com dance all night
// @namespace rob@middlerob.com
// @include https://bleep.com/*
-// @version 1
+// @version 2
// @description Disable the 60 second pause on bleep.com
// @license MIT
// @oujs:author middlerob
// @grant none
// ==/User... |
8f05bb23c68bf3ded65cbf9b145f1f299b44205c | src/defaults.js | src/defaults.js | const defaults = {
/**
* Label
*/
label: 'Dialog',
/**
* Description - ID of HTMLElement to use as aria-describedby
*/
description: '',
/**
* Focus - HTMLElement to focus on open
*/
focus: '',
/**
* Alert - Is the dialog an alert?
*/
alert: false,
openClass: 'is-open',
/**
* Auto initia... | /**
* Default configuration.
*
* @property {string} label - ID of HTMLElement to use as label or a string.
* @property {string} description - ID of HTMLElement to use as aria-describedby.
* @property {boolean} alert - Set dialog role to alertdialog.
* @property {string} openClass - The class applied to elements.d... | Add docblock to default configuration object | Add docblock to default configuration object
| JavaScript | mit | rynpsc/dialog,rynpsc/dialog | ---
+++
@@ -1,30 +1,16 @@
+/**
+ * Default configuration.
+ *
+ * @property {string} label - ID of HTMLElement to use as label or a string.
+ * @property {string} description - ID of HTMLElement to use as aria-describedby.
+ * @property {boolean} alert - Set dialog role to alertdialog.
+ * @property {string} openClas... |
3561e1abd475ac6b1d3a48076b9f5d8a5ebaf3f1 | src/components/Facets/FacetsGroup.js | src/components/Facets/FacetsGroup.js | import React, { Component } from 'react'
import Facet from './Facet'
import { isActive } from '../../helpers/manageFilters'
const styles = {
type: {
textTransform: 'capitalize',
fontSize: '1em',
fontWeight: 400,
marginBottom: '1em',
},
group: {
marginBottom: '1em',
}
}
class FacetsGroup ex... | import React, { Component } from 'react'
import Facet from './Facet'
import { isActive } from '../../helpers/manageFilters'
const styles = {
type: {
textTransform: 'capitalize',
fontSize: '1em',
fontWeight: 400,
marginBottom: '1em',
},
group: {
marginBottom: '1em',
}
}
class FacetsGroup ex... | Hide facet if no filters are still inactive inside | Hide facet if no filters are still inactive inside
| JavaScript | mit | sgmap/inspire,sgmap/inspire | ---
+++
@@ -18,6 +18,12 @@
render() {
const { type, facets, filters, addFilter } = this.props
+ const activeMap = facets.map(facet => isActive(filters, {name: type, value: facet.value}))
+
+ if (activeMap.indexOf(false) === -1) {
+ return null;
+ }
+
return (
<div style={styles.gro... |
7ebb7b380645c5dc496d2b4376979bd7a9bbaa87 | src/converter/r2t/ConvertCodeCell.js | src/converter/r2t/ConvertCodeCell.js | import convertSourceCode from './convertSourceCode'
export default class ConvertCodeCell {
/*
Collect <code specific-use="cell"> and turn it into cell elements in
TextureJATS
TODO:
- Properly handle CDATA content
- Implement export method
*/
import(dom, converter) {
let cells = dom.... | import convertSourceCode from './convertSourceCode'
export default class ConvertCodeCell {
/*
Collect <code specific-use="cell"> and turn it into cell elements in
TextureJATS
TODO:
- Properly handle CDATA content
- Implement export method
*/
import(dom, converter) {
let cells = dom.... | Save cell id during conversion. | Save cell id during conversion.
| JavaScript | mit | substance/texture,substance/texture | ---
+++
@@ -14,7 +14,7 @@
let cells = dom.findAll('code[specific-use=cell]')
cells.forEach((oldCell) => {
- let cell = dom.createElement('cell')
+ let cell = dom.createElement('cell').attr('id', oldCell.id)
cell.append(
convertSourceCode(oldCell, converter) |
bf33de8661a8d2ff1dfa415929c86679eb7c8cc0 | src/css-clean-src/sortCss/sortCss.js | src/css-clean-src/sortCss/sortCss.js | function sortCss(settings, cssObject) {
function sortDeep(array) {
sortCss.scope(settings, array, {
displace : [
'sass function',
'sass import',
'sass include',
'sass include arguments',
'sass mixin',
'sass include block',
'sass extend',
'prope... | function sortCss(settings, cssObject) {
var displaceDeep = [
'sass function',
'sass import',
'sass include',
'sass include arguments',
'sass mixin',
'sass include block',
'sass extend',
'property group',
];
var displaceZeroDepth = [
'sass import',
'sass include',
'sass... | Declare 'displace' arrays at the top of the function | Declare 'displace' arrays at the top of the function
| JavaScript | mit | SeanJM/atom-css-clean | ---
+++
@@ -1,35 +1,42 @@
function sortCss(settings, cssObject) {
+ var displaceDeep = [
+ 'sass function',
+ 'sass import',
+ 'sass include',
+ 'sass include arguments',
+ 'sass mixin',
+ 'sass include block',
+ 'sass extend',
+ 'property group',
+ ];
+
+ var displaceZeroDepth = [
+ 's... |
3eb178c27d595833fe1ea7ebeb846c37ffd094e4 | js/board.js | js/board.js | import settings from 'settings';
import { bind } from 'util/dom';
var worker;
var messageCount;
var callbacks;
function post (command, data, callback) {
callbacks[messageCount] = callback;
worker.postMessage({
id: messageCount,
command: command,
data: JSON.parse(JSON.stringify(data)),... | import settings from 'settings';
import { bind } from 'util/dom';
var worker;
var messageCount;
var callbacks;
function post (command, data, callback) {
callbacks[messageCount] = callback;
worker.postMessage({
id: messageCount,
command: command,
data: JSON.parse(JSON.stringify(data)),... | Add error handler to Web Worker | Add error handler to Web Worker
| JavaScript | mit | darvelo/match-three | ---
+++
@@ -57,6 +57,9 @@
callbacks = [];
worker = new Worker('/scripts/workers/board.js');
bind(worker, 'message', messageHandler);
+ bind(worker, 'error', function (err) {
+ console.log('worker error:', err);
+ });
post('initialize', settings, callback);
}
|
4d84f4549135fce864890b00deedfb81eed3ad23 | js/count.js | js/count.js | document.addEventListener("DOMContentLoaded", function (event) {
// redirect to 7777 port
// ping golang counter
httpGetAsync("http://www.aracki.me:7777/count", function (res) {
alert(res);
})
});
function httpGetAsync(theUrl, callback) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onre... | document.addEventListener("DOMContentLoaded", function (event) {
// redirect to 7777 port
// ping golang counter
getRequest("localhost:7777/count", function (request) {
var response = request.currentTarget.response || request.target.responseText;
console.log(response);
})
});
function g... | Add getRequest() to golang app | Add getRequest() to golang app
| JavaScript | mit | Aracki/aracki.me,Aracki/aracki.me | ---
+++
@@ -1,20 +1,16 @@
document.addEventListener("DOMContentLoaded", function (event) {
// redirect to 7777 port
// ping golang counter
- httpGetAsync("http://www.aracki.me:7777/count", function (res) {
- alert(res);
+ getRequest("localhost:7777/count", function (request) {
+ var res... |
f4035de99216e3c4d587a53e5f728316acab1f22 | server.js | server.js | const express = require('express')
const path = require('path')
const fs = require('fs')
const formidable = require('formidable')
const app = express()
const PORT = process.env.PORT || 9000
const UPLOAD_DIR = path.join(__dirname, 'uploads/')
if (!fs.existsSync(UPLOAD_DIR)) {
console.warn('Creating uploads folder...'... | const express = require('express')
const path = require('path')
const fs = require('fs')
const formidable = require('formidable')
const app = express()
const PORT = process.env.PORT || 9000
const UPLOAD_DIR = path.join(__dirname, 'uploads/')
const CORS = process.env.NODE_ENV === 'production' ? process.env.HOST : '*'
i... | Change CORS to be set by environment | Change CORS to be set by environment
| JavaScript | mit | planigan/resource-center,planigan/resource-center,fus-marcom/resource-center,fus-marcom/resource-center | ---
+++
@@ -5,6 +5,7 @@
const app = express()
const PORT = process.env.PORT || 9000
const UPLOAD_DIR = path.join(__dirname, 'uploads/')
+const CORS = process.env.NODE_ENV === 'production' ? process.env.HOST : '*'
if (!fs.existsSync(UPLOAD_DIR)) {
console.warn('Creating uploads folder...')
@@ -31,7 +32,7 @@
... |
647e62ffa45e6cd91bf2232c7dfbe78055705599 | knexfile.js | knexfile.js | /**
* This file is automatically loaded when knex runs migrations
*/
require('babel-register')();
const config = require('./server/config').default;
module.exports = {
client: 'mssql',
connection: {
server: config.db.server,
user: config.db.user,
password: config.db.password,
database: config.d... | /**
* This file is automatically loaded when knex runs migrations
*/
require('babel-register')();
const config = require('./server/config').default;
module.exports = {
client: 'mssql',
connection: {
server: config.db.server,
user: config.db.user,
password: config.db.password,
database: config.d... | Use a more sensible connection timeout for knex | Use a more sensible connection timeout for knex
| JavaScript | mit | noms-digital-studio/csra-app,noms-digital-studio/csra-app,noms-digital-studio/csra-app | ---
+++
@@ -17,4 +17,5 @@
encrypt: true,
},
},
+ acquireConnectionTimeout: 5000,
}; |
5df0f46b25b9d97e5a20a9488de3ee01fc9baa71 | app/assets/javascripts/deck.js | app/assets/javascripts/deck.js | var Deck = function(cards = []) {
this.cards = cards;
};
Deck.prototype.addCard = function(card) {
this.cards.push(card);
};
Deck.prototype.nextCard = function(card) {
return this.cards.pop();
};
Deck.prototype.fetchCards = function() {
var request = $.ajax({
method: 'POST',
url: '/decks/new',
da... | var Deck = function() {
this.cards = [];
};
Deck.prototype.addCard = function(card) {
this.cards.push(card);
};
Deck.prototype.nextCard = function(card) {
return this.cards.pop();
};
Deck.prototype.fetchCards = function() {
var request = $.ajax({
method: 'POST',
url: '/decks/new',
data: $("input"... | Remove cards == [] from Deck() | Remove cards == [] from Deck()
| JavaScript | mit | zjuanz/tendr,zjuanz/tendr,zjuanz/tendr | ---
+++
@@ -1,5 +1,5 @@
-var Deck = function(cards = []) {
- this.cards = cards;
+var Deck = function() {
+ this.cards = [];
};
Deck.prototype.addCard = function(card) { |
b2416e04739afc0ee2c52ed64dabdd069c2ccaa2 | app/controllers/application.js | app/controllers/application.js | import Ember from 'ember';
export default Ember.Controller.extend({
flashError: null,
nextFlashError: null,
showUserOptions: false,
stepFlash: function() {
this.set('flashError', this.get('nextFlashError'));
this.set('nextFlashError', null);
},
resetDropdownOption: function(co... | import Ember from 'ember';
export default Ember.Controller.extend({
flashError: null,
nextFlashError: null,
showUserOptions: false,
stepFlash: function() {
this.set('flashError', this.get('nextFlashError'));
this.set('nextFlashError', null);
},
resetDropdownOption: function(co... | Extend the visible time after-click for a dropdown | Extend the visible time after-click for a dropdown
| JavaScript | apache-2.0 | chenxizhang/crates.io,withoutboats/crates.io,sfackler/crates.io,mbrubeck/crates.io,chenxizhang/crates.io,chenxizhang/crates.io,sfackler/crates.io,BlakeWilliams/crates.io,sfackler/crates.io,withoutboats/crates.io,Susurrus/crates.io,mbrubeck/crates.io,steveklabnik/crates.io,Gankro/crates.io,BlakeWilliams/crates.io,achand... | ---
+++
@@ -16,7 +16,7 @@
Ember.$(document).on('mousedown.useroptions', function() {
Ember.run.later(function() {
controller.set(option, false);
- }, 100);
+ }, 150);
Ember.$(document).off('mousedown.useroptions');
... |
f04da7379d9c870cc065460d5a20fd90d21dbf78 | app/libs/utils/color-string.js | app/libs/utils/color-string.js | 'use strict';
// Load requirements
const clk = require('chalk'),
chalk = new clk.constructor({level: 1, enabled: true});
// Formats a string with ANSI styling
module.exports = function(str) {
// Variables
const regex = /\{([a-z,]+)\:(.+?)\}/gi;
let m;
// Check for a non-string
if ( typeof str !== 's... | 'use strict';
// Load requirements
const clk = require('chalk'),
chalk = new clk.constructor({level: 1, enabled: true});
// Formats a string with ANSI styling
module.exports = function(str) {
// Variables
const regex = /\{([a-z,]+)\:([\s\S]*?)\}/gmi;
let m;
// Check for a non-string
if ( typeof str ... | Improve color string regex pattern for multiline matches | Improve color string regex pattern for multiline matches
| JavaScript | apache-2.0 | transmutejs/core | ---
+++
@@ -8,7 +8,7 @@
module.exports = function(str) {
// Variables
- const regex = /\{([a-z,]+)\:(.+?)\}/gi;
+ const regex = /\{([a-z,]+)\:([\s\S]*?)\}/gmi;
let m;
// Check for a non-string |
0ee588e3e67535829d31b06b5da91ffb3d1910a8 | src/apis/GifAPI.js | src/apis/GifAPI.js | import * as _ from 'lodash'
import UUID from 'node-uuid';
const KEY = 'GIFS';
export const loadData = () => {
let data = JSON.parse(localStorage.getItem(KEY));
if (_.isEmpty(data)) {
return {};
} else {
return data;
}
};
export const update = (update) => {
localStorage.setItem(KE... | import * as _ from 'lodash'
import UUID from 'node-uuid';
const KEY = 'GIFS';
export const loadData = () => {
let data = JSON.parse(localStorage.getItem(KEY));
if (_.isEmpty(data)) {
return {};
} else {
return data;
}
};
export const update = (update) => {
localStorage.setItem(KE... | Add stil url in mock | Add stil url in mock
| JavaScript | mit | macpie/Gif-Chrome-Extension,macpie/Gif-Chrome-Extension | ---
+++
@@ -26,7 +26,8 @@
data.push({
id: UUID.v4(),
name: 'Test ' + i,
- url: 'http://media2.giphy.com/media/geozuBY5Y6cXm/giphy.gif'
+ url: 'http://media2.giphy.com/media/geozuBY5Y6cXm/giphy.gif',
+ still_url: 'https://media2.giphy.com/media/geozuB... |
f60385580b7db9ef8a0a8a137d95e08abccb854e | lib/util.js | lib/util.js | /**
* Download tool for Unicode CLDR JSON data
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* https://github.com/rxaviers/cldr-data-downloader/blob/master/LICENSE-MIT
*/
"use strict";
var assert = require("assert");
var fs = require("fs");
var url = require("url");
module.exports ... | /**
* Download tool for Unicode CLDR JSON data
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* https://github.com/rxaviers/cldr-data-downloader/blob/master/LICENSE-MIT
*/
"use strict";
var assert = require("assert");
var fs = require("fs");
var url = require("url");
module.exports ... | Check error with instance of | Check error with instance of
Closes #22
Signed-off-by: Dominic Bartl <a9662aa7a7b7ac6326ee7732d0f7f2070642dd85@gmail.com>
| JavaScript | mit | rxaviers/cldr-data-downloader | ---
+++
@@ -17,7 +17,7 @@
try {
assert.deepEqual(a, b);
} catch (error) {
- if (error.name === "AssertionError") {
+ if (error instanceof assert.AssertionError) {
return false;
}
throw error; |
9163379bf273fde65b13d8a6b989c9c3b09a079e | app/webpacker/packs/vue_app.js | app/webpacker/packs/vue_app.js | import Vue from 'vue/dist/vue.esm';
import store from '../store/index.js.erb';
import '../config/axios';
import '../directives/selectionchange';
import TheAnnotator from '../components/TheAnnotator.vue.erb';
import AnnotationHandle from "../components/AnnotationHandle";
document.addEventListener('DOMContentLoaded', ... | import 'polyfills';
import Vue from 'vue/dist/vue.esm';
import store from '../store/index.js.erb';
import '../config/axios';
import '../directives/selectionchange';
import TheAnnotator from '../components/TheAnnotator.vue.erb';
import AnnotationHandle from "../components/AnnotationHandle";
document.addEventListener(... | Include polyfills for vue app js | Include polyfills for vue app js
| JavaScript | agpl-3.0 | harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o | ---
+++
@@ -1,3 +1,4 @@
+import 'polyfills';
import Vue from 'vue/dist/vue.esm';
import store from '../store/index.js.erb'; |
666bc930fece85dc2b45221bd7ffcecb73a057a3 | config/bootstrap.js | config/bootstrap.js | /**
* Bootstrap
* (sails.config.bootstrap)
*
* An asynchronous bootstrap function that runs before your Sails app gets lifted.
* This gives you an opportunity to set up your data model, run jobs, or perform some special logic.
*
* For more information on bootstrapping your app, check out:
* http://sailsjs.org/#... | /**
* Bootstrap
* (sails.config.bootstrap)
*
* An asynchronous bootstrap function that runs before your Sails app gets lifted.
* This gives you an opportunity to set up your data model, run jobs, or perform some special logic.
*
* For more information on bootstrapping your app, check out:
* http://sailsjs.org/#... | Change Bootstrap .exec to .then for consistency | Change Bootstrap .exec to .then for consistency
| JavaScript | mit | TheConnMan/jukebot,TheConnMan/jukebot,TheConnMan/jukebot | ---
+++
@@ -13,7 +13,7 @@
Video.findOne({
playing: true
- }).exec(function(err, current) {
+ }).then(function(err, current) {
if (current) {
SyncService.startVideo(current);
} |
5712884c7ddbe7edafdf2c3e03f456d031d96e84 | app/js/controllers/main_controller.js | app/js/controllers/main_controller.js | annotationApp.controller('MainController', function($scope) {
$scope.tokens = [
{ 'string' : 'Marcus', 'id' : '1' },
{ 'string' : 'rosam', 'id' : '2' },
{ 'string' : 'videt', 'id' : '3' },
{ 'string' : '.', 'id' : '4' }
];
$scope.selectedToken = { id: '1' };
$scope.currentToken = function() {
... | annotationApp.controller('MainController', function($scope) {
$scope.tokens = [
{ 'string' : 'Marcus', 'id' : '1' },
{ 'string' : 'rosam', 'id' : '2' },
{ 'string' : 'videt', 'id' : '3' },
{ 'string' : '.', 'id' : '4' }
];
$scope.selectedToken = { id: '1' };
$scope.currentToken = function() {
... | Add function to select a token | Add function to select a token
| JavaScript | mit | fbaumgardt/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,latin-language-toolkit/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,PonteIneptique/arethusa,PonteIneptique/arethusa,Masoumeh/arethusa,fbaumgardt/arethusa,Masoumeh/arethusa | ---
+++
@@ -11,4 +11,8 @@
$scope.currentToken = function() {
return $scope.tokens[$scope.selectedToken.id - 1]
};
+
+ $scope.selectToken = function(id) {
+ $scope.selectedToken.id = id
+ }
}); |
4c36269339935f0ccb44dc600d4c1dcd5d2725ec | config/webpack.dev.js | config/webpack.dev.js | const path = require("path");
const merge = require("webpack-merge");
const webpack = require("webpack");
const common = require("./webpack.common.js");
const postCSSPlugins = [
require("postcss-easy-import")({ prefix: "_" }),
require("postcss-mixins"),
require("postcss-simple-vars"),
require("postcss-nested")... | const path = require("path");
const merge = require("webpack-merge");
const webpack = require("webpack");
const common = require("./webpack.common.js");
const postCSSPlugins = [
require("postcss-easy-import")({ prefix: "_" }),
require("postcss-mixins"),
require("postcss-simple-vars"),
require("postcss-nested")... | Use more reliable JS source mapping technique | Use more reliable JS source mapping technique
| JavaScript | mit | trendyminds/pura,trendyminds/pura | ---
+++
@@ -19,7 +19,7 @@
"webpack/hot/only-dev-server"
],
mode: "development",
- devtool: "eval-cheap-module-source-map",
+ devtool: "eval-source-map",
watch: true,
devServer: {
headers: { |
091842d279f0456ca9f8f2f062a7d207c4e1466e | spec/client.spec.js | spec/client.spec.js | const Client = require('../lib/client');
const options = {
baseUrl: 'some value',
username: 'some value',
password: 'some value'
};
describe('Client', () => {
it('should be constructor and factory function', () => {
expect(Client).toBeFunction();
expect(new Client(options)).toBeObject();
expect(Cl... | const Client = require('../lib/client');
const options = {
baseUrl: 'some value',
username: 'some value',
password: 'some value'
};
describe('Client', () => {
it('should be constructor and factory function', () => {
expect(Client).toBeFunction();
expect(new Client(options)).toBeObject();
expect(Cl... | Cover one more branch in unit tests | tests: Cover one more branch in unit tests
| JavaScript | mit | bponomarenko/stash-web-api | ---
+++
@@ -28,6 +28,7 @@
expect(() => new Client({ baseUrl: null, username: null, password: null })).toThrow();
expect(() => new Client({ baseUrl: '123' })).toThrow();
expect(() => new Client({ username: '123', password: '123' })).toThrow();
+ expect(() => new Client({ username: '123', baseUrl: '12... |
188f10af537bfdfb3e0c24c676b129efca9117f5 | server.js | server.js | var http = require('http');
var fs = require('fs');
var path = require('path');
var mime = require('mime');
var cache = {};
function send404(response) {
response.writeHead(404, {'Content-Type': 'text/plain'});
response.write('Error 404: resource not found.');
response.end();
}
function sendFile(response, filePa... | var http = require('http');
var fs = require('fs');
var path = require('path');
var mime = require('mime');
var cache = {};
function send404(response) {
response.writeHead(404, {'Content-Type': 'text/plain'});
response.write('Error 404: resource not found.');
response.end();
}
function sendFile(response, filePa... | Add helper function for serving static files | Add helper function for serving static files
| JavaScript | mit | sebsonic2o/chatrooms,sebsonic2o/chatrooms | ---
+++
@@ -17,3 +17,24 @@
);
response.end(fileContents);
}
+
+function serveStatic(response, cache, absPath) {
+ if (cache[absPath]) {
+ sendFile(response, absPath, cache[absPath]);
+ } else {
+ fs.exists(absPath, function(exists) {
+ if (exists) {
+ fs.readFile(absPath, function(err, data... |
4b14769af554c0a28817f049e75b783dc2c18f36 | server.js | server.js | var koa = require('koa');
var http = require('http');
var route = require('koa-route');
var serve = require('koa-static');
var bodyParser = require('koa-bodyparser');
// Koa middleware
var error = require('./api/lib/middleware/error');
// Create koa app
var app = koa();
// Koa middleware
app.use(error());
app.use(bo... | var koa = require('koa');
var http = require('http');
var route = require('koa-route');
var serve = require('koa-static');
var bodyParser = require('koa-bodyparser');
// Koa middleware
var error = require('./api/lib/middleware/error');
// Create koa app
var app = koa();
// Koa middleware
app.use(error());
app.use(bo... | Improve port log message syntax | Improve port log message syntax
| JavaScript | apache-2.0 | eladnava/applicationize,eladnava/applicationize | ---
+++
@@ -25,4 +25,4 @@
app.listen(port);
// Log port
-console.log('Server listening on http://localhost:' + port);
+console.log('Server listening on port ' + port); |
0736453287987b2221129475d5c2fedfb160d8a2 | gulp-tasks/link-js.js | gulp-tasks/link-js.js | 'use strict';
(() => {
module.exports = (gulp, plugins, config) => {
return () => {
return plugins.vinylFs.src([config.patternsPath + '/**/*.js',
config.patternsPath + '/**/*.json',
'!' + config.patternsPath + '/**/rocketbelt.slipsum-cache.... | 'use strict';
(() => {
module.exports = (gulp, plugins, config) => {
return () => {
return plugins.vinylFs.src([`${config.patternsPath}/**/*.js`,
`${config.patternsPath}/**/*.json`,
`!${config.patternsPath}/**/rocketbelt.slipsum-cache.json`... | Exclude JS files in tools directory from symlinking. | fix(Build): Exclude JS files in tools directory from symlinking.
| JavaScript | mit | Pier1/rocketbelt,Pier1/rocketbelt | ---
+++
@@ -2,10 +2,13 @@
(() => {
module.exports = (gulp, plugins, config) => {
return () => {
- return plugins.vinylFs.src([config.patternsPath + '/**/*.js',
- config.patternsPath + '/**/*.json',
- '!' + config.patternsPath + '/**/rocke... |
8de650bcecb75087610aed4352e0a426290f690c | src/modules/common/components/App.js | src/modules/common/components/App.js | import React from 'react';
import {Provider} from 'react-redux';
import {Router, Route, IndexRoute} from 'react-router';
import HomeContainer from '../../home/components/HomeContainer';
import TranslationProvider from './translation/TranslationProvider';
import {routerPaths} from '../constants';
const routes = (
<... | import React from 'react';
import {Provider} from 'react-redux';
import {Router, Route, IndexRoute} from 'react-router';
import HomeContainer from '../../home/components/HomeContainer';
import TranslationProvider from './translation/TranslationProvider';
import {routerPaths} from '../constants';
const routes = (
<... | Change order of translation provider and store provider to allow translation provider access the storage | Change order of translation provider and store provider to allow translation provider access the storage
| JavaScript | mit | nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map | ---
+++
@@ -13,11 +13,11 @@
);
const App = ({store, history}) => (
- <TranslationProvider>
<Provider store={store}>
+ <TranslationProvider>
<Router history={history} routes={routes} key={Math.random()}/>
- </Provider>
- </TranslationProvider>
+ </TranslationProvider>
+ </Provider... |
826d3b49a409fc658991a25f2226f67a0a00722e | src/gates/Joke_NeGate.js | src/gates/Joke_NeGate.js | import {GateBuilder} from "src/circuit/Gate.js"
import {Matrix} from "src/math/Matrix.js"
import {GatePainting} from "src/draw/GatePainting.js"
const NeGate = new GateBuilder().
setSerializedId("NeGate").
setSymbol("-I").
setTitle("Ne-Gate").
setBlurb("Negates all amplitudes.").
setDrawer(args => {... | import {GateBuilder} from "src/circuit/Gate.js"
import {Matrix} from "src/math/Matrix.js"
import {Point} from "src/math/Point.js"
import {GatePainting} from "src/draw/GatePainting.js"
const NeGate = new GateBuilder().
setSerializedId("NeGate").
setTitle("Ne-Gate").
setBlurb("Negates all amplitudes.").
... | Update negate gate symbol to be a single thick line | Update negate gate symbol to be a single thick line
| JavaScript | apache-2.0 | Strilanc/Quantum-Circuit-Inspector,Strilanc/Quirk,Strilanc/Quirk,Strilanc/Quantum-Circuit-Inspector | ---
+++
@@ -1,25 +1,16 @@
import {GateBuilder} from "src/circuit/Gate.js"
import {Matrix} from "src/math/Matrix.js"
+import {Point} from "src/math/Point.js"
import {GatePainting} from "src/draw/GatePainting.js"
const NeGate = new GateBuilder().
setSerializedId("NeGate").
- setSymbol("-I").
setTitle... |
4d49374a63ede67e58ead2fd34dc484c67efa606 | assignments/javascript/anagram/anagram_test.spec.js | assignments/javascript/anagram/anagram_test.spec.js | var Anagram = require('./anagram');
describe('Anagram', function() {
it("no matches",function() {
var detector = new Anagram("diaper");
var matches = detector.match([ "hello", "world", "zombies", "pants"]);
expect(matches).toEqual([]);
});
xit("detects simple anagram",function() {
var detector ... | var Anagram = require('./anagram');
describe('Anagram', function() {
it("no matches",function() {
var detector = new Anagram("diaper");
var matches = detector.match([ "hello", "world", "zombies", "pants"]);
expect(matches).toEqual([]);
});
xit("detects simple anagram",function() {
var detector ... | Add test for same length, same letters, different letter instance counts | Add test for same length, same letters, different letter instance counts
One possible solution to detecting an anagram might be to check to see if the words are the same length and that each letter from the first word is contained in the second word. This additional test would guard against that solution appearing to ... | JavaScript | mit | wobh/xjavascript,marcCanipel/xjavascript,marcCanipel/xjavascript,nicgallardo/xjavascript,a25patel/xjavascript,cloudleo/xjavascript,schorsch3000/xjavascript,wobh/xjavascript,JenanMannette/xjavascript,Vontei/Xjavascript-Solutions,eloquence/xjavascript,exercism/xjavascript,nicgallardo/xjavascript,exercism/xjavascript,a25p... | ---
+++
@@ -12,6 +12,12 @@
var detector = new Anagram("ba");
var matches = detector.match(['ab', 'abc', 'bac']);
expect(matches).toEqual(['ab']);
+ });
+
+ xit("does not detect false positives",function() {
+ var detector = new Anagram("bba");
+ var matches = detector.match(["aab"]);
+ exp... |
214861a2176e4beb47802ef192927a286301fefe | packages/core/lib/commands/console.js | packages/core/lib/commands/console.js | const command = {
command: "console",
description:
"Run a console with contract abstractions and commands available",
builder: {},
help: {
usage: "truffle console [--network <name>] [--verbose-rpc]",
options: [
{
option: "--network <name>",
description:
"Specify the n... | const { promisify } = require("util");
const command = {
command: "console",
description:
"Run a console with contract abstractions and commands available",
builder: {},
help: {
usage: "truffle console [--network <name>] [--verbose-rpc]",
options: [
{
option: "--network <name>",
... | Move promisify require to top of file | Move promisify require to top of file
| JavaScript | mit | ConsenSys/truffle | ---
+++
@@ -1,3 +1,5 @@
+const { promisify } = require("util");
+
const command = {
command: "console",
description:
@@ -19,7 +21,6 @@
]
},
run: async function (options) {
- const { promisify } = require("util");
const Config = require("@truffle/config");
const Console = require("../con... |
f2ed67e33ec475506a9d5c5dfcfbd985a274b5f7 | Presentation.Web/protractor.conf.js | Presentation.Web/protractor.conf.js | var paths = require('../paths.config.js');
exports.config = {
// Path to the selenium server jar. Update version number accordingly!
seleniumServerJar: paths.seleniumServerJar,
// select all end to end tests
specs: paths.e2eFiles,
resultJsonOutputFile: paths.e2eReport
};
| var paths = require('../paths.config.js');
exports.config = {
// Path to the selenium server jar. Update version number accordingly!
seleniumServerJar: paths.seleniumServerJar,
// select all end to end tests
specs: paths.e2eFiles,
resultJsonOutputFile: paths.e2eReport,
// Increase timeout t... | Increase protractor timeout limit to enable AppVeyor to build database on first instantiation. | Increase protractor timeout limit to enable AppVeyor to build database on first instantiation.
| JavaScript | mpl-2.0 | os2kitos/kitos,os2kitos/kitos,miracle-as/kitos,os2kitos/kitos,miracle-as/kitos,miracle-as/kitos,miracle-as/kitos,os2kitos/kitos | ---
+++
@@ -7,5 +7,8 @@
// select all end to end tests
specs: paths.e2eFiles,
- resultJsonOutputFile: paths.e2eReport
+ resultJsonOutputFile: paths.e2eReport,
+
+ // Increase timeout to allow AppVeyor to rebuild database on first instantiation.
+ allScriptsTimeout: 30000
}; |
159689207deab42fbc4626d8f8b38d3e94c880ea | src/angular-ladda-lw.js | src/angular-ladda-lw.js | angular.module('ladda-lw', ['ngAnimate']).directive('ladda', function laddaDirective() {
return {
restrict: 'A',
scope: {
ladda: '=',
},
compile: (element, attrs) => {
const lLoading = attrs.ladda;
element.addClass('ladda-lw');
const textWrap = angular.element(`
<div ... | angular.module('ladda-lw', ['ngAnimate']).directive('ladda', function laddaDirective() {
return {
restrict: 'A',
scope: {
ladda: '=',
},
compile: (element, attrs) => {
const lLoading = attrs.ladda;
element.addClass('ladda-lw');
const textWrap = angular.element(`
<div ... | Fix for templates in es6 | Fix for templates in es6
| JavaScript | mit | aeharding/angular-ladda-lw,aeharding/angular-ladda-lw | ---
+++
@@ -11,15 +11,19 @@
const textWrap = angular.element(`
<div class="ladda-lw__text"
- ng-class="{\'ladda-lw__text--up\': ' + lLoading + '}">
+ ng-class="{'ladda-lw__text--up': ${lLoading}}">
</div>
`);
textWrap.append(element.contents());
... |
1600a066ccdb6cbb1b55ecfc0eb526f1854350e0 | Public/Resources/Javascript/global-config.js | Public/Resources/Javascript/global-config.js | /* We have to setup the global variables which will be used for web application.
As now everything comes from webframework globally so I put it here temprarily.
When we completely moved back ferite webframework then we setup it to main.js file
*/
var scriptSrcPath = "/Cention.app/Resources/ReactSrc/";
var imageSrc... | /* We have to setup the global variables which will be used for web application.
As now everything comes from webframework globally so I put it here temprarily.
When we completely moved back ferite webframework then we setup it to main.js file
*/
var scriptSrcPath = "/Cention.app/Resources/ReactSrc/";
var imageSrc... | Change controllerPath and webRoot for customer server installation | Change controllerPath and webRoot for customer server installation
| JavaScript | bsd-3-clause | cention/ferite-module-webframework,cention/ferite-module-webframework,cention/ferite-module-webframework | ---
+++
@@ -4,5 +4,5 @@
*/
var scriptSrcPath = "/Cention.app/Resources/ReactSrc/";
var imageSrcPath = "/Cention.app/Resources/Images/";
-var webRoot = "/web/";
-var controllerPath = "/Cention/";
+var webRoot = "/Cention/web/";
+var controllerPath = "/"; |
2ce7a8500f9b3ed7765a4befc070faecb87c7d4c | src/client/js/models/chatlog/index.js | src/client/js/models/chatlog/index.js | /* -*- js2-basic-offset: 2; indent-tabs-mode: nil; -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80; */
"use strict";
require("sockjs");
let Sock = window.SockJS,
{addMethod} = require("genfun"),
{clone, init} = require("../../lib/proto"),
_ = require("lodash"),
can = require("../../shims/can");
/*... | /* -*- js2-basic-offset: 2; indent-tabs-mode: nil; -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80; */
"use strict";
require("sockjs");
let Sock = window.SockJS,
{addMethod} = require("genfun"),
{clone, init} = require("../../lib/proto"),
_ = require("lodash"),
can = require("../../shims/can");
/*... | Reconnect if connection is lost | Reconnect if connection is lost
| JavaScript | agpl-3.0 | zkat/storychat | ---
+++
@@ -25,6 +25,8 @@
function initSocket(log) {
log.socket = new Sock("http://localhost:8080/ws");
log.socket.onmessage = _.partial(onMessage, log);
+ // TODO - this is probably a pretty naive way to go about reconnecting...
+ log.socket.onclose = _.partial(initSocket, log);
}
function initModelList... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.