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 |
|---|---|---|---|---|---|---|---|---|---|---|
ccc01b4599b586651bab6a60df91517bced9e4d4 | src/social-icon.js | src/social-icon.js | import React, { PropTypes } from 'react';
import cx from 'classnames';
import Background from './background';
import Icon from './icon';
import Mask from './mask';
import { keyFor } from './networks';
import { socialIcon, socialContainer, socialSvg } from './styles';
function getNetworkKey(props) {
return props.netw... | import React, { PropTypes } from 'react';
import cx from 'classnames';
import Background from './background';
import Icon from './icon';
import Mask from './mask';
import { keyFor } from './networks';
import { socialIcon, socialContainer, socialSvg } from './styles';
function getNetworkKey(props) {
return props.netw... | Add support for label prop | Add support for label prop
| JavaScript | mit | jaketrent/react-social-icons,jaketrent/react-social-icons | ---
+++
@@ -11,7 +11,7 @@
}
function SocialIcon(props) {
- const { url, network, color, className, ...rest } = props;
+ const { url, network, color, className, label, ...rest } = props;
const networkKey = getNetworkKey({ url, network });
return (
@@ -20,7 +20,8 @@
target="_blank"
rel="no... |
f8787b6bccd15d8850a10ea66a9d13bb059437cc | src/store/store.js | src/store/store.js | import { createStore, applyMiddleware, compose } from 'redux';
import createHistory from 'history/createHashHistory';
import { routerMiddleware } from 'connected-react-router';
import createRootReducer from 'reducers/root';
import gitHubAPIMiddleware from 'middlewares/gitHubAPI';
export const history = createHistory()... | import { createStore, applyMiddleware, compose } from 'redux';
import { createHashHistory } from 'history';
import { routerMiddleware } from 'connected-react-router';
import createRootReducer from 'reducers/root';
import gitHubAPIMiddleware from 'middlewares/gitHubAPI';
export const history = createHashHistory();
con... | FIX (router): use proper import instead of depricated | FIX (router): use proper import instead of depricated
| JavaScript | mit | Gisto/Gisto,Gisto/Gisto,Gisto/Gisto,Gisto/Gisto | ---
+++
@@ -1,10 +1,10 @@
import { createStore, applyMiddleware, compose } from 'redux';
-import createHistory from 'history/createHashHistory';
+import { createHashHistory } from 'history';
import { routerMiddleware } from 'connected-react-router';
import createRootReducer from 'reducers/root';
import gitHubAPIM... |
a04c89d7251148fdc298828535fdfd4977893135 | app/services/data/get-team-caseload.js | app/services/data/get-team-caseload.js | const config = require('../../../knexfile').web
const knex = require('knex')(config)
module.exports = function (id, type) {
var table = "team_caseload_overview"
var whereObject = {}
if (id !== undefined) {
whereObject.id = id
}
return knex(table)
.where(whereObject)
.select('name',
'g... | const config = require('../../../knexfile').web
const knex = require('knex')(config)
module.exports = function (id, type) {
var table = "team_caseload_overview"
var whereObject = {}
if (id !== undefined) {
whereObject.id = id
}
return knex(table)
.where(whereObject)
.select('name',
'g... | Change the column name to follow the standard naming convention. | 784: Change the column name to follow the standard naming convention.
| JavaScript | mit | ministryofjustice/wmt-web,ministryofjustice/wmt-web | ---
+++
@@ -10,7 +10,7 @@
return knex(table)
.where(whereObject)
.select('name',
- 'gradeCode',
+ 'grade_code as gradeCode',
'untiered',
'd2',
'd1',
@@ -19,7 +19,7 @@
'b2',
'b1',
'a',
- 'totalCa... |
5754f8e24f47a86f442e5833bff15661a45c6a30 | scripts.js | scripts.js | var markup = null;
$(function() {
var markupTools = MarkupTools('.button-bar > div');
markup = Markup('#pdf-markup', markupTools);
$(markup).on('update add', function() {
$('#result').text(JSON.stringify(markup.Serialize()));
});
$(markupTools).on('browse', function(e, settings) {
... | var markup = null;
$(function() {
var markupTools = MarkupTools('.button-bar > div');
markup = Markup('#pdf-markup', markupTools);
$(markup).on('update add', function() {
$('#result').text(JSON.stringify(markup.Serialize()));
});
$(markupTools).on('browse', function(e, settings) {
... | Add example of using the Load method on the Markup object | Add example of using the Load method on the Markup object
| JavaScript | mit | Soneritics/pdf-markup,Soneritics/pdf-markup | ---
+++
@@ -18,4 +18,6 @@
markup.AddPlugin(plugin);
$(this).on('click', function(){ window[$(this).data('plugin')].New(markup); });
});
+
+ markup.Load([{"type":"text","text":"Invoice","x":94,"y":2,"color":"#00000","size":"20","bold":"1"},{"type":"image","source":"example.png","x":47,"y":50,... |
4fb0b46888829fb6b325dfa666cad5763eacdfeb | src/client.js | src/client.js | import React from 'react'
import { applyMiddleware, createStore, compose } from 'redux'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { applyRouterMiddleware, browserHistory, Router } from 'react-router'
import { ReduxAsyncConnect } from 'redux-connect'
import { persistState } from 'r... | import React from 'react'
import { applyMiddleware, createStore, compose } from 'redux'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { applyRouterMiddleware, browserHistory, Router } from 'react-router'
import { ReduxAsyncConnect } from 'redux-connect'
import { persistState } from 'r... | Disable redux devtools for fixing invalid object on mobile browser | Disable redux devtools for fixing invalid object on mobile browser
| JavaScript | mit | nomkhonwaan/nomkhonwaan.github.io | ---
+++
@@ -16,14 +16,16 @@
const store = createStore(
reducers,
initialState,
- compose(
+ // compose(
applyMiddleware(
PromiseMiddleware,
routerMiddleware(browserHistory)
),
- window.devToolsExtension && window.devToolsExtension(),
- persistState(window.location.href.match(/[?... |
0e0e931c759a1ed3589481eaa2e6b82511519bba | examples/whack/js/common.js | examples/whack/js/common.js | var hits = 0;
function setup() {
hits = 0;
}
function hit() {
hits++;
console.log(hits);
}
function showAll() {
$('.hole').flip(true);
}
function hideAll() {
$('.hole').flip({
trigger: 'manual'
});
}
function randomTimeout() {
return Math.random() * 5000 + 2500;
}
function won(... | var hits = 0;
function setup() {
hits = 0;
}
function hit() {
hits++;
}
function showAll() {
$('.hole').flip(true);
}
function hideAll() {
$('.hole').flip({
trigger: 'manual'
});
}
function randomTimeout() {
return Math.random() * 5000 + 2500;
}
function won() {
alert('You won!... | Remove debugging statements from example. | Remove debugging statements from example.
| JavaScript | mit | efritz/arrows,JoshuaSCochrane/arrows | ---
+++
@@ -6,7 +6,6 @@
function hit() {
hits++;
- console.log(hits);
}
function showAll() {
@@ -24,9 +23,9 @@
}
function won() {
- console.log('You won!');
+ alert('You won!');
}
function lost() {
- console.log('You lost!');
+ alert('You lost!');
} |
28e6e967eac14e0d4196e45dcdea9c06cd5562b4 | lib/dsl.js | lib/dsl.js | (function (define) { 'use strict';
define(function (require) {
var _ = require('lodash');
function DSL() {
this.matches = [];
}
_.extend(DSL.prototype, {
route: function (name, options, callback) {
if (arguments.length === 2 && typeof options === 'function') {
callback = options;
... | (function (define) { 'use strict';
define(function (require) {
var _ = require('lodash');
function DSL(ancestors) {
this.ancestors = ancestors;
this.matches = [];
}
_.extend(DSL.prototype, {
route: function (name, options, callback) {
if (arguments.length === 2 && typeof options === 'functi... | Add information about the ancestors to each route descriptor | Add information about the ancestors to each route descriptor
| JavaScript | mit | QubitProducts/cherrytree,QubitProducts/cherrytree,nathanboktae/cherrytree,nathanboktae/cherrytree | ---
+++
@@ -3,7 +3,8 @@
var _ = require('lodash');
- function DSL() {
+ function DSL(ancestors) {
+ this.ancestors = ancestors;
this.matches = [];
}
@@ -24,7 +25,7 @@
}
if (callback) {
- var routes = DSL.map(callback);
+ var routes = DSL.map(callback, this.ancestors... |
6eabbb5565d5b529835cd36ac5d7d3c380416105 | spec/buster.js | spec/buster.js | var config = module.exports;
config["specs"] = {
rootPath: "../",
environment: "browser",
sources: [
"lib/*.js"
],
tests: [
"spec/*.spec.js"
],
}
| /*global module: true */
var config = module.exports;
config.specs = {
rootPath: "../",
environment: "browser",
sources: [
// lib/helpers.js needs to be loaded first
"lib/helpers.js",
"lib/EnglishParser.js",
"lib/interpreters.js"
],
specs: [
"spec/*.spec.js"
... | Fix loading error of helpers.js | Fix loading error of helpers.js | JavaScript | mit | jmdeldin/content-usability,jmdeldin/content-usability | ---
+++
@@ -1,12 +1,16 @@
+/*global module: true */
var config = module.exports;
-config["specs"] = {
- rootPath: "../",
- environment: "browser",
- sources: [
- "lib/*.js"
- ],
- tests: [
- "spec/*.spec.js"
- ],
-}
+config.specs = {
+ rootPath: "../",
+ environment: "browser",
+ sources: [
+ ... |
dd634ae9873d1dddb44a20396e0d8ee8f764c429 | src/Context.js | src/Context.js | import React from "react/addons";
import Resolver from "./Resolver";
class ResolverContext extends React.Component {
getChildContext() {
const resolver = this.props.resolver || this.context.resolver;
return { resolver };
}
render() {
return React.addons.cloneWithProps(this.props.element, this.prop... | import React from "react";
import Resolver from "./Resolver";
class ResolverContext extends React.Component {
getChildContext() {
const resolver = this.props.resolver || this.context.resolver;
return { resolver };
}
render() {
return React.cloneElement(this.props.element);
}
}
ResolverContext.c... | Switch from React.addons.cloneWithProps to React.cloneElement | Switch from React.addons.cloneWithProps to React.cloneElement
| JavaScript | isc | matthiasak/react-resolver,iamdustan/react-resolver,gilesbradshaw/react-resolver-csp,iamdustan/react-resolver,kwangkim/react-resolver,goatslacker/react-resolver,Daniel15/react-resolver,shaunstanislaus/react-resolver,gilesbradshaw/react-resolver-csp,eiriklv/react-resolver,donabrams/react-resolver | ---
+++
@@ -1,4 +1,4 @@
-import React from "react/addons";
+import React from "react";
import Resolver from "./Resolver";
@@ -10,7 +10,7 @@
}
render() {
- return React.addons.cloneWithProps(this.props.element, this.props);
+ return React.cloneElement(this.props.element);
}
}
|
1b8b28bad82576de80b8066ccd4d23663a11598b | test-loader.js | test-loader.js | /* globals requirejs, require */
(function() {
define("ember-cli/test-loader",
[],
function() {
"use strict";
var TestLoader = function() {
};
TestLoader.prototype = {
shouldLoadModule: function(moduleName) {
return (moduleName.match(/[-_]test$/));
},
loadModules: functi... | /* globals requirejs, require */
(function() {
define("ember-cli/test-loader",
[],
function() {
"use strict";
var TestLoader = function() {
};
TestLoader.prototype = {
shouldLoadModule: function(moduleName) {
return moduleName.match(/\/.*[-_]test$/);
},
loadModules: func... | Exclude the project name when requiring files | Exclude the project name when requiring files
| JavaScript | mit | ember-cli/ember-cli-test-loader | ---
+++
@@ -10,7 +10,7 @@
TestLoader.prototype = {
shouldLoadModule: function(moduleName) {
- return (moduleName.match(/[-_]test$/));
+ return moduleName.match(/\/.*[-_]test$/);
},
loadModules: function() { |
fd5251c0a047cf100ce051e2a6d4bfb4184d5131 | test/unit/utils-test.js | test/unit/utils-test.js | 'use strict';
var utils = require('../../').utils;
var assert = require('chai').assert;
suite('Utils', () => {
test('create a random hex string', () => {
const test1 = utils.getRandomHexString();
assert.isString(test1);
assert.equal(test1, test1.match(/^[0-9A-F]{8}$/)[0]);
const test2 = utils.getRa... | 'use strict';
var utils = require('../../').utils;
var assert = require('chai').assert;
suite('Utils', () => {
test('create a random hex string', () => {
const test1 = utils.getRandomHexString();
assert.isString(test1);
assert.equal(test1, test1.match(/^[0-9A-F]{8}$/)[0]);
const test2 = utils.getRa... | Enhance test coverage of util helpers | Enhance test coverage of util helpers
| JavaScript | mit | MariusRumpf/node-lifx | ---
+++
@@ -13,4 +13,13 @@
assert.isString(test2);
assert.equal(test2, test2.match(/^[0-9A-F]{16}$/)[0]);
});
+
+ test('getting host ips', () => {
+ const hostIPs = utils.getHostIPs();
+ assert.isArray(hostIPs);
+ hostIPs.forEach((ip) => {
+ assert.isString(ip, 'IPs are given as');
+ ... |
109b89e89845eaa7371d74ab603ba993be0fb504 | app/services/Admin/Admin.js | app/services/Admin/Admin.js | 'use strict';
angular
.module('lmServices')
.constant('Admin', (/((; )|^)admin=true(;|$)/).test(document.cookie));
| 'use strict';
// This "admin" cookie is not intended to be secure. All it does is display a few convenience
// buttons for quick access to the admin interface. Access to the admin interface is unrestricted;
// the admin interface merely displays the same data as the normal web interface, but in an
// editable manner. ... | Add comments explaining how the admin interface works | Add comments explaining how the admin interface works
| JavaScript | mit | peferron/lilymandarin-web,peferron/lilymandarin-web,peferron/lilymandarin-v1-web,peferron/lilymandarin-v1-web | ---
+++
@@ -1,5 +1,9 @@
'use strict';
+// This "admin" cookie is not intended to be secure. All it does is display a few convenience
+// buttons for quick access to the admin interface. Access to the admin interface is unrestricted;
+// the admin interface merely displays the same data as the normal web interface,... |
c29f89a08b83fe3d907978d0ff38e0094a390b92 | tests/DOM/CreateSpec.js | tests/DOM/CreateSpec.js | describe("$.create", function() {
it("creates an element and sets properties on it", function() {
var element = $.create("article", {
className: "wide"
});
expect(element).to.be.an.instanceOf(Element);
expect(element.className).to.be.equal("wide");
expect(element.tagName).to.be.equal("ARTICLE");
});
i... | describe("$.create", function() {
it("creates an element and sets properties on it", function() {
var element = $.create("article", {
className: "wide"
});
expect(element).to.be.an.instanceOf(Element);
expect(element.className).to.be.equal("wide");
expect(element.tagName).to.be.equal("ARTICLE");
});
i... | Test that $.create makes a div by default | Test that $.create makes a div by default
Adds a test for #13
| JavaScript | mit | LeaVerou/bliss,zdfs/bliss,LeaVerou/bliss,dperrymorrow/bliss,zdfs/bliss,dperrymorrow/bliss | ---
+++
@@ -29,4 +29,10 @@
expect(element.tagName).to.be.equal("DIV");
});
});
+
+ it("creates a div when there are no arguments", function() {
+ var element = $.create();
+
+ expect(element.tagName).to.be.equal("DIV");
+ });
}); |
f4fb9da3a005a95126cff182659d9415a0fe7b28 | src/Spinner.js | src/Spinner.js | const React = require('react');
const classNames = require('classnames');
const SIZES = require('./SIZES');
const Spinner = React.createClass({
propTypes: {
centered: React.PropTypes.bool,
size: React.PropTypes.oneOf(SIZES)
},
getDefaultProps: function() {
return {
... | const React = require('react');
const classNames = require('classnames');
const SIZES = require('./SIZES');
const Spinner = React.createClass({
propTypes: {
centered: React.PropTypes.bool,
inverse: React.PropTypes.bool,
size: React.PropTypes.oneOf(SIZES)
},
getDefaultProps: f... | Add prop inverse for spinner | Add prop inverse for spinner
| JavaScript | apache-2.0 | rlugojr/styleguide,GitbookIO/styleguide,GitbookIO/styleguide,rlugojr/styleguide | ---
+++
@@ -6,6 +6,7 @@
const Spinner = React.createClass({
propTypes: {
centered: React.PropTypes.bool,
+ inverse: React.PropTypes.bool,
size: React.PropTypes.oneOf(SIZES)
},
|
5368611171153c0abdd37e65b654415d6314e9ca | packages/inline-node/InsertInlineNodeCommand.js | packages/inline-node/InsertInlineNodeCommand.js | import Command from '../../ui/Command'
import insertInlineNode from '../../model/transform/insertInlineNode'
class InsertInlineNodeCommand extends Command {
constructor(...args) {
super(...args)
if (!this.params.nodeType) {
throw new Error('Every AnnotationCommand must have a nodeType')
}
}
g... | import Command from '../../ui/Command'
import insertInlineNode from '../../model/transform/insertInlineNode'
class InsertInlineNodeCommand extends Command {
constructor(...args) {
super(...args)
if (!this.params.nodeType) {
throw new Error('Every AnnotationCommand must have a nodeType')
}
}
g... | Use nodeType from params instead of static prop. | Use nodeType from params instead of static prop.
| JavaScript | mit | stencila/substance,andene/substance,podviaznikov/substance,substance/substance,michael/substance-1,substance/substance,podviaznikov/substance,michael/substance-1,andene/substance | ---
+++
@@ -38,7 +38,7 @@
createNodeData(tx, args) { // eslint-disable-line
return {
- type: this.constructor.type
+ type: this.params.nodeType
}
}
|
057fde01ab9527d3a48d053d17b356d0fb6f6428 | test/writer.js | test/writer.js | var fs = require('fs')
var assert = require('assert')
var rmrf = require('rimraf')
var Writer = require('../src/writer')
describe('Writer', function() {
this.timeout(5000)
var tempPath = __dirname + '/../tmp'
var filePath = tempPath + '/../tmp/test.txt'
beforeEach(function() {
rmrf.sync(tempPath)
fs... | var fs = require('fs')
var assert = require('assert')
var rmrf = require('rimraf')
var Writer = require('../src/writer')
describe('Writer', function() {
this.timeout(10000)
var tempPath = __dirname + '/../tmp'
var filePath = tempPath + '/../tmp/test.txt'
beforeEach(function() {
rmrf.sync(tempPath)
f... | Update test (trying to fix Travis error) | Update test (trying to fix Travis error)
| JavaScript | mit | typicode/lowdb,etiktin/lowdb,CreaturePhil/lowdb,beni55/lowdb,typicode/lowdb | ---
+++
@@ -5,7 +5,7 @@
describe('Writer', function() {
- this.timeout(5000)
+ this.timeout(10000)
var tempPath = __dirname + '/../tmp'
var filePath = tempPath + '/../tmp/test.txt' |
4c2bfe4fa16e2fdca974fe3abe8890313bc00500 | tests/index.js | tests/index.js | /* eslint-env mocha */
'use strict';
import plugin from '../src';
import assert from 'assert';
import fs from 'fs';
import path from 'path';
const rules = fs.readdirSync(path.resolve(__dirname, '../src/rules/'))
.map(f => path.basename(f, '.js'));
describe('all rule files should be exported by the plugin', () => ... | /* eslint-env mocha */
'use strict';
import plugin from '../src';
import assert from 'assert';
import fs from 'fs';
import path from 'path';
const rules = fs.readdirSync(path.resolve(__dirname, '../src/rules/'))
.map(f => path.basename(f, '.js'));
describe('all rule files should be exported by the plugin', () => ... | Fix test to pass lint. | Fix test to pass lint.
| JavaScript | mit | jessebeach/eslint-plugin-jsx-a11y,evcohen/eslint-plugin-jsx-a11y | ---
+++
@@ -21,8 +21,8 @@
});
});
-describe('configurations', function() {
- it('should export a \'recommended\' configuration', function() {
+describe('configurations', () => {
+ it('should export a \'recommended\' configuration', () => {
assert(plugin.configs.recommended);
});
}); |
cb2e70635a77d1b503d9c9f4c313c6e29eae4f0a | test/karma.conf.js | test/karma.conf.js | // karma.conf.js
module.exports = function(config) {
config.set({
basePath : '../',
frameworks: ['jasmine'],
files : [
'public/bower_components/jquery/dist/jquery.js',
'public/bower_components/angular/angular.js',
'public/bower_components/angular-cookies/angular-cookies.js',
'publi... | // karma.conf.js
module.exports = function(config) {
config.set({
basePath : '../',
frameworks: ['jasmine'],
files : [
'public/bower_components/jquery/dist/jquery.js',
'public/bower_components/angular/angular.js',
'public/bower_components/angular-cookies/angular-cookies.js',
'publi... | Add dots reporting to karma | Add dots reporting to karma
| JavaScript | mit | solarkennedy/uchiwa,pantheon-systems/uchiwa,pauloconnor/uchiwa,sensu/uchiwa,pantheon-systems/uchiwa,palourde/uchiwa,palourde/uchiwa,palourde/uchiwa,solarkennedy/uchiwa,Contegix/uchiwa,pgporada/uchiwa,palourde/uchiwa,upfluence/uchiwa,sensu/uchiwa,palourde/uchiwa,ransoni/uchiwa,jsoriano/uchiwa,pgporada/uchiwa,jsoriano/uc... | ---
+++
@@ -14,7 +14,7 @@
'public/js/**/*.js',
'test/unit/**/*.js'
],
- reporters: ['junit', 'coverage'],
+ reporters: ['junit', 'coverage', 'dots'],
coverageReporter: {
type: 'html',
dir: 'build/coverage/' |
e3ec369f409c759573b64f44ce904acfcc8a87a6 | test/pages-test.js | test/pages-test.js | const { expect } = require('chai');
const cheerio = require('cheerio');
const request = require('supertest');
const app = require('../app');
describe('Pages', function() {
let req;
describe('/', function() {
beforeEach(function() {
req = request(app).get('/')
});
it('returns 200 OK', function(... | const { expect } = require('chai');
const cheerio = require('cheerio');
const request = require('supertest');
const app = require('../app');
describe('Pages', function() {
let req;
describe('/', function() {
beforeEach(function() {
req = request(app).get('/');
});
it('returns 200 OK', function... | Add semicolon in test file | Add semicolon in test file
| JavaScript | mit | slavapavlutin/pavlutin-node,slavapavlutin/pavlutin-node | ---
+++
@@ -9,7 +9,7 @@
describe('/', function() {
beforeEach(function() {
- req = request(app).get('/')
+ req = request(app).get('/');
});
it('returns 200 OK', function(done) { |
bd2ea150c6922e686b12c5f7a658b802bfafb3b7 | src/routes.js | src/routes.js | import React from 'react';
import { Route, IndexRoute } from 'react-router';
/* containers */
import { App } from 'components/App';
import { Home } from 'components/Home';
import { DataDisplay } from 'components/DataDisplay';
// import { List } from 'containers/List';
export default (
<Route path="/" component={App... | import React from 'react';
import { Route, IndexRoute } from 'react-router';
/* containers */
import { App } from 'components/App';
import { Home } from 'components/Home';
import { About } from 'components/About';
import { DataDisplay } from 'components/DataDisplay';
// import { List } from 'containers/List';
export ... | Add route path for About page | Add route path for About page
| JavaScript | mit | TerryCapan/twitchBot,badT/Chatson,badT/Chatson,TerryCapan/twitchBot,badT/twitchBot,dramich/twitchBot,dramich/Chatson,dramich/Chatson,badT/twitchBot,dramich/twitchBot | ---
+++
@@ -4,6 +4,7 @@
/* containers */
import { App } from 'components/App';
import { Home } from 'components/Home';
+import { About } from 'components/About';
import { DataDisplay } from 'components/DataDisplay';
// import { List } from 'containers/List';
@@ -11,6 +12,7 @@
<Route path="/" component={App}... |
85e242dd7e5293a92f124fb1976dfd51fbda6f6e | src/server.js | src/server.js | import bodyParser from "body-parser"
import cors from "cors"
import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
import models from "./db"
import schema from "./graphql"
// Constants
const CONFIG = require("./settings.yaml")
... | import bodyParser from "body-parser"
import cors from "cors"
import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
import models, { sequelize } from "./db"
import schema from "./graphql"
// Constants
const CONFIG = require("./se... | Add sequelize to context of GraphQL queries | Add sequelize to context of GraphQL queries
| JavaScript | mit | DevNebulae/ads-pt-api | ---
+++
@@ -3,7 +3,7 @@
import express from "express"
import graphqlHTTP from "express-graphql"
import { graphqlExpress, graphiqlExpress } from "graphql-server-express"
-import models from "./db"
+import models, { sequelize } from "./db"
import schema from "./graphql"
// Constants
@@ -21,7 +21,8 @@
sche... |
01db3107f6f7d6b4edddd1375b8096810099adff | test/index.js | test/index.js | import test from 'ava';
import plugin from '../postcss-rem-phi-units'
import postcss from 'postcss';
import { readFileSync } from 'fs';
test('Settingless units', async t => {
postcss(plugin)
.process(readFileSync('in.css'))
.then(result =>
t.same(result.css, readFileSync('expected.css', 'utf8'))
);
});
| import test from 'ava';
import plugin from '../postcss-rem-phi-units';
import postcss from 'postcss';
import { readFileSync } from 'fs';
test('Settingless units', async t => {
postcss(plugin)
.process(readFileSync('in.css'))
.then(result =>
t.same(result.css, readFileSync('expected.css', 'utf8'));
);
});
| Convert test js to happiness | Convert test js to happiness
It’d be a PITA to lint these differently so we should either convert this back to ES5 or convert postcss-rem-phi-units.js to ES2015.
| JavaScript | mit | posthumans/postcss-rem-phi-units | ---
+++
@@ -1,5 +1,5 @@
import test from 'ava';
-import plugin from '../postcss-rem-phi-units'
+import plugin from '../postcss-rem-phi-units';
import postcss from 'postcss';
import { readFileSync } from 'fs';
@@ -7,6 +7,6 @@
postcss(plugin)
.process(readFileSync('in.css'))
.then(result =>
- t.same(resu... |
52f11529a145f849f3db58a85c35c124c53ac4a5 | package.js | package.js | Package.describe({
summary: 'Web tracing framework wrapper for Meteor',
version: "0.0.2",
git: 'git@github.com:eluck/meteor-web-tracing-framework.git'
});
Npm.depends({
"tracing-framework": "2014.8.18-1"
});
Package.on_use(function (api) {
api.add_files('import.js', ['server']);
api.add_files('web-tracing... | Package.describe({
summary: 'Web tracing framework wrapper for Meteor',
version: "0.0.2",
git: 'https://github.com/eluck/meteor-web-tracing-framework.git'
});
Npm.depends({
"tracing-framework": "2014.8.18-1"
});
Package.on_use(function (api) {
api.add_files('import.js', ['server']);
api.add_files('web-tra... | Update path to the repository | Update path to the repository
| JavaScript | mit | eluck/meteor-web-tracing-framework | ---
+++
@@ -1,7 +1,7 @@
Package.describe({
summary: 'Web tracing framework wrapper for Meteor',
version: "0.0.2",
- git: 'git@github.com:eluck/meteor-web-tracing-framework.git'
+ git: 'https://github.com/eluck/meteor-web-tracing-framework.git'
});
Npm.depends({ |
3235e1e88f357be9172b45edf32a276065b7c291 | src/server/config.js | src/server/config.js | var nconf = require('nconf');
// Specifying an env delimiter allows you to override below config when shipping to production server
// by e.g. defining piping__ignore or version variables.
nconf.env('__');
var config = {
appLocales: ['en', 'fr'],
defaultLocale: 'en',
googleAnalyticsId: 'UA-XXXXXXX-X',
isProdu... | var nconf = require('nconf');
// Specifying an env delimiter allows you to override below config when shipping to production server
// by e.g. defining piping__ignore or version variables.
nconf.env('__');
var config = {
appLocales: ['en', 'fr'],
defaultLocale: 'en',
googleAnalyticsId: 'UA-XXXXXXX-X',
isProdu... | Update comment about piping hook. | Update comment about piping hook.
| JavaScript | mit | puzzfuzz/othello-redux,XeeD/test,laxplaer/este,este/este,puzzfuzz/othello-redux,skyuplam/debt_mgmt,gaurav-/este,TheoMer/Gyms-Of-The-World,grabbou/este,neozhangthe1/framedrop-web,amrsekilly/updatedEste,steida/este,ViliamKopecky/este,XeeD/este,TheoMer/este,este/este,sikhote/davidsinclair,obimod/este,AugustinLF/este,cazac... | ---
+++
@@ -12,8 +12,7 @@
piping: {
// Ignore webpack custom loaders on server. TODO: Reuse index.js config.
ignore: /(\/\.|~$|\.(css|less|sass|scss|styl))/,
- // Hook ensures server restart on all required deps, even client side.
- // Server restarting invalidates require cache, no more stale html... |
50036eab17d4ead74316e2023bed1a4a55b256a7 | modules/phenyl-api-explorer-client/src/components/OperationResult/Response.js | modules/phenyl-api-explorer-client/src/components/OperationResult/Response.js | import React from 'react'
import { Segment, Message } from 'semantic-ui-react'
import JSONTree from 'react-json-tree'
type Props = {
loading: boolean,
expanded: boolean,
response: any,
error: ?Error,
}
const Response = ({ loading, expanded, response, error }: Props) => {
if (loading) {
return (
<S... | import React from 'react'
import { Segment, Tab, Message } from 'semantic-ui-react'
import JSONTree from 'react-json-tree'
type Props = {
loading: boolean,
expanded: boolean,
response: any,
error: ?Error,
}
const Response = ({ loading, expanded, response, error }: Props) => {
if (loading) {
return (
... | Add `Raw JSON` pane to response | Add `Raw JSON` pane to response
| JavaScript | apache-2.0 | phenyl-js/phenyl,phenyl-js/phenyl,phenyl-js/phenyl,phenyl-js/phenyl | ---
+++
@@ -1,5 +1,5 @@
import React from 'react'
-import { Segment, Message } from 'semantic-ui-react'
+import { Segment, Tab, Message } from 'semantic-ui-react'
import JSONTree from 'react-json-tree'
type Props = {
@@ -25,13 +25,33 @@
)
} else if (response != null) {
return (
- <Segment class... |
77f0b638cbb12224871700129b6885abea6ff2e4 | packages/react-hot-boilerplate/webpack.config.js | packages/react-hot-boilerplate/webpack.config.js | var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./scripts/index'
],
output: {
path: __dirname + '/scripts/',
filename: 'bundle.js',
publicPath: '/scripts/'
},
plugins: [... | var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./scripts/index'
],
output: {
path: __dirname + '/scripts/',
filename: 'bundle.js',
publicPath: '/scripts/'
},
plugins: [... | Allow jsx extension as some people prefer it | Allow jsx extension as some people prefer it
| JavaScript | mit | gaearon/react-hot-loader,gaearon/react-hot-loader | ---
+++
@@ -17,11 +17,11 @@
new webpack.NoErrorsPlugin()
],
resolve: {
- extensions: ['', '.js']
+ extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
- { test: /\.js$/, loaders: ['react-hot', 'jsx?harmony'], exclude: /node_modules/ },
+ { test: /\.jsx?$/, loaders: ['react-ho... |
3f31666935ca6a7c3bf48aabd393112542ebbba7 | app/client/templates/modals/project/activity_discuss/activity_discuss.js | app/client/templates/modals/project/activity_discuss/activity_discuss.js | /*****************************************************************************/
/* ActivityDiscuss: Event Handlers */
/*****************************************************************************/
Template.ActivityDiscuss.events({
});
/*****************************************************************************/
/* ... | /*****************************************************************************/
/* ActivityDiscuss: Event Handlers */
/*****************************************************************************/
Template.ActivityDiscuss.events({
});
/*****************************************************************************/
/* ... | Fix missing id of project in discussion of activities | Fix missing id of project in discussion of activities
| JavaScript | agpl-3.0 | openp2pdesign/OpenMetaDesign,openp2pdesign/OpenMetaDesign,openp2pdesign/OpenMetaDesign | ---
+++
@@ -9,7 +9,7 @@
/*****************************************************************************/
Template.ActivityDiscuss.helpers({
thisRoomId: function() {
- return this.project + '-' + thisActivity.id;
+ return thisProject._id + '-' + thisActivity.id;
},
thisUsername: function(... |
0d9dd06d48773c1caeb130265f0f5d0e2d9b4f8f | lib/board.js | lib/board.js | const Block = require('./block');
const typeToConfig = require('./type-to-config');
class Board {
constructor() {
this.height = 3;
this.width = 3;
this.blocks = [
[null, null, null],
[null, null, null],
[null, null, null],
];
}
getBlock(x, y) {
return this.blocks[y][x];
}
placeBlock(x, y, typ... | const Block = require('./block');
const typeToConfig = require('./type-to-config');
class Board {
constructor() {
this.height = 3;
this.width = 3;
this.blocks = [
[null, null, null],
[null, null, null],
[null, null, null],
];
this.inputBlockX = 1;
this.inputBlockY = 0;
this.outputBlockX = 1;
... | Define input and output block information | Define input and output block information
| JavaScript | mit | tsg-ut/mnemo,tsg-ut/mnemo | ---
+++
@@ -10,6 +10,18 @@
[null, null, null],
[null, null, null],
];
+ this.inputBlockX = 1;
+ this.inputBlockY = 0;
+ this.outputBlockX = 1;
+ this.outputBlockY = 2;
+ }
+
+ get inputBlock() {
+ return this.blocks[this.inputBlockY][this.inputBlockX];
+ }
+
+ get outputBlock() {
+ return this.blocks... |
182621443c609d145f8185e97611bf53d6337607 | Brocfile.js | Brocfile.js | /* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp({
'ember-cli-jquery-ui': {
'theme': 'redmond'
},
vendorFiles: {
'handlebars.js': {
production: 'bower_components/handlebars/handlebars.js'
}
}
});
// Use `app.import` to add addi... | /* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp({
'ember-cli-jquery-ui': {
'theme': 'redmond'
},
'ember-cli-bootstrap-sass': {
'importBootstrapJS': true
},
vendorFiles: {
'handlebars.js': {
production: 'bower_components/handl... | Add Bootstrap JavaScript to build | Add Bootstrap JavaScript to build
| JavaScript | mit | liveband/liveband | ---
+++
@@ -5,6 +5,9 @@
var app = new EmberApp({
'ember-cli-jquery-ui': {
'theme': 'redmond'
+ },
+ 'ember-cli-bootstrap-sass': {
+ 'importBootstrapJS': true
},
vendorFiles: {
'handlebars.js': { |
e29fc0a4f15bd33237ecf8465a4eacebb1461b6f | server/game/cards/06-CotE/MagnificentTriumph.js | server/game/cards/06-CotE/MagnificentTriumph.js | const DrawCard = require('../../drawcard.js');
const EventRegistrar = require('../../eventregistrar.js');
const { CardTypes, Players } = require('../../Constants');
class MagnificentTriumph extends DrawCard {
setupCardAbilities(ability) {
this.duelWinnersThisConflict = [];
this.eventRegistrar = new... | const DrawCard = require('../../drawcard.js');
const EventRegistrar = require('../../eventregistrar.js');
const { CardTypes, Players } = require('../../Constants');
class MagnificentTriumph extends DrawCard {
setupCardAbilities(ability) {
this.duelWinnersThisConflict = [];
this.eventRegistrar = new... | Fix to target events (not all card effects) | Fix to target events (not all card effects)
| JavaScript | mit | gryffon/ringteki,gryffon/ringteki,jeremylarner/ringteki,jeremylarner/ringteki,gryffon/ringteki,jeremylarner/ringteki | ---
+++
@@ -19,12 +19,12 @@
ability.effects.modifyBothSkills(2),
ability.effects.cardCannot({
cannot: 'target',
- restricts: 'opponentsCardEffects'
+ restricts: 'opponentsEvents'
... |
d56023c3b7beb44184aaee799cd5448e76acef1d | lib/hooks/responder/rpc/rpc_serialize.js | lib/hooks/responder/rpc/rpc_serialize.js | // RPC reply serializer, that should heppen in the end,
// because we pass errors in serialized form too
//
'use strict';
////////////////////////////////////////////////////////////////////////////////
module.exports = function (N) {
N.wire.after('responder:rpc', { priority: 90 }, function rpc_serialize(env) ... | // RPC reply serializer, that should heppen in the end,
// because we pass errors in serialized form too
//
'use strict';
////////////////////////////////////////////////////////////////////////////////
module.exports = function (N) {
N.wire.after('responder:rpc', { priority: 90 }, function rpc_serialize(env) ... | Fix pagination links on the RPC page navigation. | Fix pagination links on the RPC page navigation.
| JavaScript | mit | nodeca/nodeca.core,nodeca/nodeca.core | ---
+++
@@ -13,31 +13,22 @@
N.wire.after('responder:rpc', { priority: 90 }, function rpc_serialize(env) {
- //
// Set Content-Type and charset (override existing)
- //
-
env.headers['Content-Type'] = 'application/json; charset=UTF-8';
- //
// Status is always ok - errors are embedded ... |
80736399737e0c3e5d7b203d2d3234cb32805aae | client/src/bg/background.js | client/src/bg/background.js | // if you checked "fancy-settings" in extensionizr.com, uncomment this lines
// var settings = new Store("settings", {
// "sample_setting": "This is how you use Store.js to remember values"
// });
function generateUUID() {
let id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
let r ... | // if you checked "fancy-settings" in extensionizr.com, uncomment this lines
// var settings = new Store("settings", {
// "sample_setting": "This is how you use Store.js to remember values"
// });
function generateUUID() {
let id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
let r ... | Use sync storage instead of local storage | Use sync storage instead of local storage
| JavaScript | mit | zhoutwo/url_connect,zhoutwo/url_connect,zhoutwo/url_connect | ---
+++
@@ -19,7 +19,7 @@
class StorageService {
constructor() {
- this.storage = chrome.storage.local;
+ this.storage = chrome.storage.sync;
this.storage.get(defaults, (items) => {
this.storage.set(items);
}) |
63d2478dd04fb1287232a59225cb11fe567e3dcd | test_apps/test_app/test/simple_storage_deploy_spec.js | test_apps/test_app/test/simple_storage_deploy_spec.js | /*global contract, it, embark, assert, before*/
const SimpleStorage = embark.require('Embark/contracts/SimpleStorage');
contract("SimpleStorage Deploy", function () {
let SimpleStorageInstance;
before(async function() {
SimpleStorageInstance = await SimpleStorage.deploy({arguments: [150]}).send();
});
it... | /*global contract, it, embark, assert, before, web3*/
const SimpleStorage = embark.require('Embark/contracts/SimpleStorage');
const Utils = require('embarkjs').Utils;
contract("SimpleStorage Deploy", function () {
let simpleStorageInstance;
before(function(done) {
Utils.secureSend(web3, SimpleStorage.deploy({a... | Fix embark test using node option | Fix embark test using node option
| JavaScript | mit | iurimatias/embark-framework,iurimatias/embark-framework | ---
+++
@@ -1,22 +1,34 @@
-/*global contract, it, embark, assert, before*/
+/*global contract, it, embark, assert, before, web3*/
const SimpleStorage = embark.require('Embark/contracts/SimpleStorage');
+const Utils = require('embarkjs').Utils;
contract("SimpleStorage Deploy", function () {
- let SimpleStorageIns... |
09fe7ea33c4037b47d3128a95ae76ebddf836fc7 | tests/main.js | tests/main.js | var allTestFiles = [];
var TEST_REGEXP = /(spec|test)\.js$/i;
var pathToModule = function(path) {
return path.replace(/^\/base\//, '').replace(/\.js$/, '');
};
Object.keys(window.__karma__.files).forEach(function(file) {
if (TEST_REGEXP.test(file)) {
allTestFiles.push(pathToModule(file));
}
});
require.con... | var allTestFiles = [];
var TEST_REGEXP = /(spec|test)\.js$/i;
var pathToModule = function(path) {
return path.replace(/^\/base\//, '').replace(/\.js$/, '');
};
Object.keys(window.__karma__.files).forEach(function(file) {
if (TEST_REGEXP.test(file)) {
allTestFiles.push(pathToModule(file));
}
});
require.con... | Define component path in the test RequireJS config. | Define component path in the test RequireJS config.
| JavaScript | mit | rishabhsrao/voxel-hologram,rishabhsrao/voxel-hologram,rishabhsrao/voxel-hologram | ---
+++
@@ -21,6 +21,7 @@
// Application
"app": "app/scripts/app",
+ "components/example": "app/scripts/components/example",
// /Application
// Fixtures |
56979c9b70008adb38cd04294924e7611b838098 | mehuge-chat/chat-config.js | mehuge-chat/chat-config.js | ChatConfig = {
join: ["uidev"],
leave: [],
hideDeathSpam: false,
autoexec: [
"/closeui perfhud",
"jumpdelay 0",
"/sleep 1000",
"/openui mehuge-lb",
"/openui mehuge-heatmap",
"/openui mehuge-perf",
"/openui mehuge-pop",
"/openui mehuge-bct",... | ChatConfig = {
join: ["uidev"],
leave: [],
hideDeathSpam: false,
autoexec: [
"/closeui perfhud",
"jumpdelay 0",
"/sleep 1000",
"/openui mehuge-lb",
"/openui mehuge-heatmap",
"/openui mehuge-perf",
"/openui mehuge-pop",
"/openui mehuge-bct",... | Join _modsquad channel (my personal config) | Join _modsquad channel (my personal config)
| JavaScript | mpl-2.0 | Mehuge/cu-ui-legacy,Mehuge/cu-ui-legacy,Mehuge/cu-ui-legacy,Mehuge/cu-ui-legacy,Mehuge/cu-ui-legacy | ---
+++
@@ -17,6 +17,7 @@
"/openui mehuge-group",
"/openui mehuge-combatlog",
"/openui castbar",
- "/openui ortu-compass"
+ "/openui ortu-compass",
+ "/join _modsquad",
]
}; |
20e426730539d3df99e3999926ce670b2fd3cee0 | js/models/levels/level_1.js | js/models/levels/level_1.js | var LevelOne = function(){
this.bricks = [new Brick(), new Brick(140), new Brick(230), new Brick(320), new Brick(410), new Brick(500), new Brick(590), new Brick(680), new Brick(50, 80),new Brick(140, 80), new Brick(230, 80), new Brick(320, 80), new Brick(410, 80), new Brick(500, 80), new Brick(590, 80), new Brick(680... | var LevelOne = function(){
this.bricks = [
new Brick(),
new Brick(140),
new Brick(230),
new Brick(320),
new Brick(410),
new Brick(500),
new Brick(590),
new Brick(680),
new Brick(50, 80),
new Brick(140, 80),
new Brick(230, 80),
new Brick(320, 80),
new Brick(410, 80),... | Tidy up ogranisation of Brick objects in a level | Tidy up ogranisation of Brick objects in a level
| JavaScript | mit | theomarkkuspaul/Brick-Breaker,theomarkkuspaul/Brick-Breaker | ---
+++
@@ -1,3 +1,20 @@
var LevelOne = function(){
- this.bricks = [new Brick(), new Brick(140), new Brick(230), new Brick(320), new Brick(410), new Brick(500), new Brick(590), new Brick(680), new Brick(50, 80),new Brick(140, 80), new Brick(230, 80), new Brick(320, 80), new Brick(410, 80), new Brick(500, 80), new ... |
bc2108c68406a22f2b339942336a292c85935a21 | build/postcss.config.js | build/postcss.config.js | 'use strict'
module.exports = (ctx) => ({
map: ctx.file.dirname.includes('examples') ? false : {
inline: false,
annotation: true,
sourcesContent: true
},
plugins: {
autoprefixer: {}
}
})
| 'use strict'
module.exports = (ctx) => ({
map: ctx.file.dirname.includes('examples') ? false : {
inline: false,
annotation: true,
sourcesContent: true
},
plugins: {
autoprefixer: { cascade: false }
}
})
| Set autoprefixer's cascade option to false. | Set autoprefixer's cascade option to false.
BS4 commits: c70eaa156f5fc0b7f7019593390ebac1650967e2
| JavaScript | mit | todc/todc-bootstrap,todc/todc-bootstrap,todc/todc-bootstrap | ---
+++
@@ -7,6 +7,6 @@
sourcesContent: true
},
plugins: {
- autoprefixer: {}
+ autoprefixer: { cascade: false }
}
}) |
55f0f4ab81f18cf33ff62389752ee7571623c27f | backend/dynamic-web-apps/voting-app/src/tests/integrated/database.spec.js | backend/dynamic-web-apps/voting-app/src/tests/integrated/database.spec.js | const test = require('tape');
const User = require('../../../models/User');
const { connect, add, remove } = require('../../database');
test('connection to database', async (assert) => {
const res = await connect();
assert.equal(res, 0, 'It should connect to the database without errors');
assert.end();
});
test... | const test = require('tape');
const User = require('../../../models/User');
const { connect, add, remove } = require('../../database');
test('connection to database', async (assert) => {
const actual = await connect();
const expected = 0;
assert.equal(actual, expected, 'It should connect to the database without ... | Update test file variable names | Update test file variable names
| JavaScript | mit | mkermani144/freecodecamp-projects,mkermani144/freecodecamp-projects | ---
+++
@@ -3,26 +3,25 @@
const { connect, add, remove } = require('../../database');
test('connection to database', async (assert) => {
- const res = await connect();
- assert.equal(res, 0, 'It should connect to the database without errors');
+ const actual = await connect();
+ const expected = 0;
+ assert.... |
da5deec709e4f2f1635ad72e26dd69740f20cd02 | rules/base.js | rules/base.js | module.exports = {
rules: {
'quote-props': [2, 'as-needed'],
'array-bracket-spacing': [2, 'never'],
'vars-on-top': 0,
'no-param-reassign': 0,
'max-len': [
1,
110,
2,
{
"ignoreComments": true,
"ignoreUrls": true
}
],
'comma-dangle': [2, 'never']... | module.exports = {
rules: {
'quote-props': [2, 'as-needed', {keywords: true}],
'array-bracket-spacing': [2, 'never'],
'vars-on-top': 0,
'no-param-reassign': 0,
'max-len': [
1,
110,
2,
{
"ignoreComments": true,
"ignoreUrls": true
}
],
'comma-dan... | Add the `keywords: true` option | feat(quote-props): Add the `keywords: true` option
Without it `{ 'boolean': 'xxx' }` fails. However, this is not valid JS.
| JavaScript | mit | algolia/eslint-config-algolia,algolia/eslint-config-algolia,algolia/eslint-config-algolia | ---
+++
@@ -1,6 +1,6 @@
module.exports = {
rules: {
- 'quote-props': [2, 'as-needed'],
+ 'quote-props': [2, 'as-needed', {keywords: true}],
'array-bracket-spacing': [2, 'never'],
'vars-on-top': 0,
'no-param-reassign': 0, |
4a4686e98d33d5eda9df4d5d21884254c6c11fa7 | src/app/components/Can.js | src/app/components/Can.js | import React, { Component, PropTypes } from 'react';
function can(permissionsData, permission) {
const permissions = JSON.parse(permissionsData);
return permissions[permission];
}
class Can extends Component {
render() {
if (can(this.props.permissions, this.props.permission)) {
return (this.props.chil... | import React, { Component, PropTypes } from 'react';
function can(permissionsData, permission) {
try {
const permissions = JSON.parse(permissionsData);
return permissions[permission];
} catch (e) {
throw `Error parsing permissions data: ${permissionsData}`
}
}
class Can extends Component {
render(... | Throw more descriptive permissions parse errors | Throw more descriptive permissions parse errors | JavaScript | mit | meedan/check-web,meedan/check-web,meedan/check-web | ---
+++
@@ -1,8 +1,12 @@
import React, { Component, PropTypes } from 'react';
function can(permissionsData, permission) {
- const permissions = JSON.parse(permissionsData);
- return permissions[permission];
+ try {
+ const permissions = JSON.parse(permissionsData);
+ return permissions[permission];
+ } ... |
2a37fa9601da2277042e9a2485daae545337e9e8 | lib/Pluggable/Pluggable.js | lib/Pluggable/Pluggable.js | // We have to remove node_modules/react to avoid having multiple copies loaded.
// eslint-disable-next-line import/no-unresolved
import React, { PropTypes } from 'react';
import { modules } from 'stripes-loader'; // eslint-disable-line
const Pluggable = props => {
const plugins = modules.plugin || [];
let best;
... | // We have to remove node_modules/react to avoid having multiple copies loaded.
// eslint-disable-next-line import/no-unresolved
import React, { PropTypes } from 'react';
import { modules } from 'stripes-loader'; // eslint-disable-line
const Pluggable = (props, context) => {
const plugins = modules.plugin || [];
l... | Use Stripes object from context, not from prop | Use Stripes object from context, not from prop
Part of STRIPES-395.
| JavaScript | apache-2.0 | folio-org/stripes-components,folio-org/stripes-components | ---
+++
@@ -3,7 +3,7 @@
import React, { PropTypes } from 'react';
import { modules } from 'stripes-loader'; // eslint-disable-line
-const Pluggable = props => {
+const Pluggable = (props, context) => {
const plugins = modules.plugin || [];
let best;
@@ -11,16 +11,22 @@
const m = plugins[name];
i... |
351594b202b9fe655a380031d2dce7d7a797f29e | lib/control/v1/conqueso.js | lib/control/v1/conqueso.js | 'use strict';
const HTTP_OK = 200;
const HTTP_METHOD_NOT_ALLOWED = 405;
/**
* Conqueso compatible API
*
* @param {Express.App} app
*/
function Conqueso(app) {
app.get('/v1/conqueso*', (req, res) => {
res.set('Content-Type', 'text/plain')
res.status(HTTP_OK);
res.end();
});
app.post('/v1/conques... | 'use strict';
const HTTP_OK = 200;
const HTTP_METHOD_NOT_ALLOWED = 405;
/**
* Conqueso compatible API
*
* @param {Express.App} app
*/
function Conqueso(app) {
function methodNotAllowed(req, res) {
res.set('Allow', 'POST,PUT,OPTIONS');
res.status(HTTP_METHOD_NOT_ALLOWED);
res.end();
}
const rout... | Refactor to use a route instead of pretty handlers. | Refactor to use a route instead of pretty handlers.
| JavaScript | mit | rapid7/propsd,rapid7/propsd,rapid7/propsd | ---
+++
@@ -9,31 +9,36 @@
* @param {Express.App} app
*/
function Conqueso(app) {
- app.get('/v1/conqueso*', (req, res) => {
+ function methodNotAllowed(req, res) {
+ res.set('Allow', 'POST,PUT,OPTIONS');
+ res.status(HTTP_METHOD_NOT_ALLOWED);
+ res.end();
+ }
+
+ const route = app.route('/v1/conques... |
44f9a70d53832e467aafba3a87c6fb06215a2a28 | test/plugin.js | test/plugin.js | const expect = require('expect');
const proxyquire = require('proxyquire');
const ContextMock = require('./mocks/context');
const GitHubMock = require('./mocks/github');
const RobotMock = require('./mocks/robot');
function arrange(handleEventSpy) {
const Plugin = proxyquire('../lib/plugin', {
'./handle-event': ... | const expect = require('expect');
const proxyquire = require('proxyquire');
const ContextMock = require('./mocks/context');
const GitHubMock = require('./mocks/github');
const RobotMock = require('./mocks/robot');
function arrange(handleEventSpy) {
const Plugin = proxyquire('../lib/plugin', {
'./handle-event': ... | Implement `Plugin` test for `event-handled` event | Implement `Plugin` test for `event-handled` event
| JavaScript | mit | jarrodldavis/probot-gpg | ---
+++
@@ -31,7 +31,21 @@
expect(handleEventSpy).toHaveBeenCalledWith(robotMock, event, contextMock);
});
- it('should emit event-handled event when event is handled successfully');
+ it('should emit event-handled event when event is handled successfully', async () => {
+ // Arrange
+ const { plugi... |
04d1cd56b942f5830e8be4f50c5603d0fed23fed | test/shared.js | test/shared.js | import React from 'react';
import { mount } from 'enzyme';
import { createStore } from 'redux';
import Phone from '../dev-server/Phone';
import App from '../dev-server/containers/App';
import brandConfig from '../dev-server/brandConfig';
import version from '../dev-server/version';
import prefix from '../dev-server/pr... | import React from 'react';
import { mount } from 'enzyme';
import { createStore } from 'redux';
import getIntlDateTimeFormatter from 'ringcentral-integration/lib/getIntlDateTimeFormatter';
import Phone from '../dev-server/Phone';
import App from '../dev-server/containers/App';
import brandConfig from '../dev-server/br... | Fix _defaultFormatter undefined issue in tests | Fix _defaultFormatter undefined issue in tests
| JavaScript | mit | u9520107/ringcentral-js-widget,ringcentral/ringcentral-js-widget,u9520107/ringcentral-js-widget,ringcentral/ringcentral-js-widget,u9520107/ringcentral-js-widget,ringcentral/ringcentral-js-widget | ---
+++
@@ -1,6 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';
import { createStore } from 'redux';
+import getIntlDateTimeFormatter from 'ringcentral-integration/lib/getIntlDateTimeFormatter';
import Phone from '../dev-server/Phone';
import App from '../dev-server/containers/App';
@@ -35,6... |
fbb9efc5ac0c7b7e673ade6fbfb214c51024fdf3 | common/models/city.js | common/models/city.js | module.exports = function(City) {
City.search = function(query, callback) {
// TODO: sanitize query
City.find(
{
where: {
name: {
like: '%' + query + '%'
}
}
}, function (err, results) {
callback(null, results);
}
);
};
City.re... | module.exports = function(City) {
City.search = function(query, callback) {
// TODO: sanitize query
City.find(
{
where: {
name: {
like: '%' + query + '%'
}
},
include: [
'region'
]
}, function (err, results) {
callba... | Include region model on City search | Include region model on City search
| JavaScript | bsd-3-clause | craigcabrey/ratemycoop,dkgramming/ratemycoop,craigcabrey/ratemycoop,dkgramming/ratemycoop | ---
+++
@@ -7,7 +7,10 @@
name: {
like: '%' + query + '%'
}
- }
+ },
+ include: [
+ 'region'
+ ]
}, function (err, results) {
callback(null, results);
} |
821f61f3d1c4df9ca4d9710b9f5c57b0b5b27795 | lib/methods/competencies.js | lib/methods/competencies.js |
Meteor.methods({
'competencies.insert': function(params) {
Nodes.insert({
name: params.name,
type: 'C'
});
}
});
|
Meteor.methods({
'competencies.insert': function(params) {
Nodes.insert({
name: params.name,
description: params.description,
type: 'C'
});
},
'competencies.node.add': function(params) {
Nodes.findAndModify({
query: { _id: params.competency._id },
update: {
$push... | Add node to competency method | Add node to competency method
| JavaScript | apache-2.0 | ExtensionEngine/talc,ExtensionEngine/talc | ---
+++
@@ -3,7 +3,21 @@
'competencies.insert': function(params) {
Nodes.insert({
name: params.name,
+ description: params.description,
type: 'C'
+ });
+ },
+ 'competencies.node.add': function(params) {
+ Nodes.findAndModify({
+ query: { _id: params.competency._id },
+ upd... |
badc42261d76c1437f949ac260f6b82cb1628de4 | js/tilemapper.js | js/tilemapper.js | $(document).ready(function() {
var canvas = document.getElementById('canvas');
canvas.width = $('#tileset').width();
canvas.height = $('#tileset').height();
});
| function tilesetClip(tileset, number) {
var index = number - 1;
var row = Math.floor((index * tileset.tilewidth) / tileset.imagewidth);
return {
x: (index * tileset.tilewidth) % tileset.imagewidth,
y: (row * tileset.tileheight) % tileset.imageheight,
width: tileset.tilewidth,
height: tileset.tile... | Add clip number resolving function | Add clip number resolving function
| JavaScript | mit | nihey/tilemapper,nihey/tilemapper | ---
+++
@@ -1,3 +1,15 @@
+function tilesetClip(tileset, number) {
+ var index = number - 1;
+ var row = Math.floor((index * tileset.tilewidth) / tileset.imagewidth);
+
+ return {
+ x: (index * tileset.tilewidth) % tileset.imagewidth,
+ y: (row * tileset.tileheight) % tileset.imageheight,
+ width: tileset.... |
4c9c3ded30c71caa797cee69190d09bf936f6da5 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | var
socket = window.socket = new WebSocket("ws://localhost:8080/");
socket.onmessage = function(event) {
var message = $.parseJSON(event.data);
$("#events table")
.append("<tr><td>" + message.name + " has entered the room.</td></tr>");
};
| window.socket = new WebSocket("ws://localhost:8080/");
window.socket.addEventListener("message", function(event) {
var message = $.parseJSON(event.data);
$("#events table")
.append(
$("<tr>").append(
$("<td>", { text: message.name + " has entered the room." })
)
);
}, false);
| Clean up the example JavaScript. | Clean up the example JavaScript.
| JavaScript | mit | tristandunn/cucumber-websocket-example,tristandunn/cucumber-websocket-example | ---
+++
@@ -1,8 +1,11 @@
-var
-socket = window.socket = new WebSocket("ws://localhost:8080/");
-socket.onmessage = function(event) {
+window.socket = new WebSocket("ws://localhost:8080/");
+window.socket.addEventListener("message", function(event) {
var message = $.parseJSON(event.data);
$("#events table")
- ... |
0bf440d7214159c76d5aa57ea44dd3e431984be2 | .babelrc.js | .babelrc.js | const env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development';
const browsers = process.env.BROWSERSLIST;
const targets = {};
if (browsers) {
targets.browsers = browsers;
}
if (env === 'production') {
targets.uglify = true;
}
if (env === 'testing') {
targets.node = 'current';
}
const preset = {
p... | module.exports = () => {
const env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development';
const browsers = process.env.BROWSERSLIST;
const targets = {};
if (browsers) {
targets.browsers = browsers;
}
if (env === 'production') {
targets.uglify = true;
}
if (env === 'testing') {
ta... | Fix Babel config env being shared. | Fix Babel config env being shared.
| JavaScript | mit | u-wave/web,welovekpop/uwave-web-welovekpop.club,welovekpop/uwave-web-welovekpop.club,u-wave/web | ---
+++
@@ -1,49 +1,51 @@
-const env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development';
-const browsers = process.env.BROWSERSLIST;
+module.exports = () => {
+ const env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development';
+ const browsers = process.env.BROWSERSLIST;
-const targets = {... |
d9792a52a49efcf3ad1c4e343d2782a68002719c | app/initializer/layout-initializer.js | app/initializer/layout-initializer.js | import React from 'react';
import FocusCore from 'focus-core';
import FocusComponents from 'focus-components';
import render from 'focus-core/application/render';
import Layout from 'focus-components/components/layout';
import ConfirmWrapper from 'focus-components/components/confirm';
import DemoMenuLeft from '../views... | import React from 'react';
import FocusCore from 'focus-core';
import FocusComponents from 'focus-components';
import render from 'focus-core/application/render';
import Layout from 'focus-components/components/layout';
import ConfirmWrapper from 'focus-components/components/confirm';
import DemoMenuLeft from '../views... | Remove function because it is now included in the layour | [initializer] Remove function because it is now included in the layour
| JavaScript | mit | KleeGroup/focus-demo-app,get-focus/focus-demo-app,KleeGroup/focus-demo-app,KleeGroup/focus-starter-kit,KleeGroup/focus-starter-kit | ---
+++
@@ -6,6 +6,6 @@
import ConfirmWrapper from 'focus-components/components/confirm';
import DemoMenuLeft from '../views/menu/menu-left';
-render(()=> <div><Layout MenuLeft={DemoMenuLeft}></Layout><ConfirmWrapper /></div>, '[data-focus="application"]', {
- props: {}
+render(Layout, '[data-focus="applicatio... |
a1a087d2db9b67895ee7ac6220e3dc39d969f82a | lib/npmalerts.js | lib/npmalerts.js | 'use strict';
var github = require('./github');
var npm = require('./npm');
var db = require('./db');
var email = require('./email');
var _ = require('underscore');
var cache = {};
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
npm.getLatestPackages(yesterday, function(error, packages) {
... | 'use strict';
var github = require('./github');
var npm = require('./npm');
var db = require('./db');
var email = require('./email');
var _ = require('underscore');
var cache = {};
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
npm.getLatestPackages(yesterday, function(error, packages) {
... | Add fallback for empty dependencies and devDependencies | Add fallback for empty dependencies and devDependencies
| JavaScript | mit | seriema/npmalerts,creationix/npmalerts | ---
+++
@@ -40,7 +40,7 @@
return console.error(error);
}
- var packages = _.filter(_.extend(json.dependencies, json.devDependencies), isPackageInCache);
+ var packages = _.filter(_.extend(json.dependencies || {}, json.devDependencies || {}), isPackageInCache);
_.each(packages, functi... |
f66815b189260d66090e1f3de5a0967a23fb5155 | configure.js | configure.js | var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
var assignDeep = require('assign-deep');
var values = require('object-values');
var configureCommon = require('./configureCommon');
var configureDevelopment = require('./configureDevelopment');
module.exports = function(port, entryFi... | var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
var assignDeep = require('assign-deep');
var values = require('object-values');
var configureCommon = require('./configureCommon');
var configureDevelopment = require('./configureDevelopment');
module.exports = function(port, entryFi... | Use base name as default package name | Use base name as default package name
| JavaScript | bsd-3-clause | interactivethings/packup,interactivethings/packup | ---
+++
@@ -16,7 +16,7 @@
__DEV__: (env === 'development'),
'process.env.NODE_ENV': JSON.stringify(env)
},
- package: fs.existsSync(packagePath) ? require(packagePath) : {name: 'packup-app', title: 'Packup-App', version: '0.0.0', description: '', dependencies: {}},
+ package: fs.existsSync(pa... |
57b0d056e3ecd7676edc641f75d69e93b06f54c9 | lib/util/wrap.js | lib/util/wrap.js | 'use strict'
module.exports = wrap
wrap.needed = needed
var phrasing = require('mdast-util-phrasing')
/* Wrap all inline runs of MDAST content in `paragraph` nodes. */
function wrap(nodes) {
var result = []
var length = nodes.length
var index = -1
var node
var queue
while (++index < length) {
node ... | 'use strict'
module.exports = wrap
wrap.needed = needed
var phrasing = require('mdast-util-phrasing')
/* Wrap all inline runs of MDAST content in `paragraph` nodes. */
function wrap(nodes) {
var result = []
var length = nodes.length
var index = -1
var node
var queue
while (++index < length) {
node ... | Fix bug where white space only paragraphs showed | Fix bug where white space only paragraphs showed
| JavaScript | mit | syntax-tree/hast-util-to-mdast | ---
+++
@@ -24,20 +24,28 @@
queue.push(node)
} else {
- if (queue !== undefined) {
- result.push({type: 'paragraph', children: queue})
- queue = undefined
- }
-
+ flush()
result.push(node)
}
}
- if (queue !== undefined) {
- result.push({type: 'paragraph'... |
7a65f45051fbede11859fd2c044d35982cd9a51a | source/sw.js | source/sw.js | importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js');
workbox.core.skipWaiting();
workbox.precaching.precacheAndRoute([]);
// NOTE: All HTML pages should be dynamically cached, and also constantly
// revalidated to make sure that the cache is always up-to-date.
const staticUrlRege... | importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js');
workbox.core.skipWaiting();
workbox.precaching.precacheAndRoute([]);
const persistentPages = ['/', '/blog/', '/events/', '/projects/'];
const persistentPagesStrategy = new workbox.strategies.StaleWhileRevalidate({
cacheName:... | Store persistent pages in separate cache | Store persistent pages in separate cache
| JavaScript | mit | arnellebalane/arnellebalane.com,arnellebalane/arnellebalane.com,arnellebalane/arnellebalane.com | ---
+++
@@ -3,19 +3,16 @@
workbox.core.skipWaiting();
workbox.precaching.precacheAndRoute([]);
-// NOTE: All HTML pages should be dynamically cached, and also constantly
-// revalidated to make sure that the cache is always up-to-date.
+const persistentPages = ['/', '/blog/', '/events/', '/projects/'];
+const per... |
50ff39933815985cd7bcc8df3cbe25a2b5f4a543 | js/scratch-pad.js | js/scratch-pad.js | (function (context) {
var Sample = {};
Sample.switchCase = function (x) {
var returnValue;
switch(val) {
case 2:
returnValue = 'A'
break;
case 6:
returnValue = 'B'
break;
case 9:
returnValue = 'C'
break;
default:
returnValue = ... | (function (context) {
var Sample = {};
Sample.switchCase = function (x) {
var returnValue;
switch(val) {
case 2:
returnValue = 'A'
break;
case 6:
returnValue = 'B'
break;
case 9:
returnValue = 'C'
break;
default:
returnValue = ... | Add whatTheFunc to scratch pad. | Add whatTheFunc to scratch pad.
| JavaScript | unlicense | CWDG/Functional-JavaScript-Talk | ---
+++
@@ -35,6 +35,21 @@
}
};
+ Sample.whatTheFunc = function (bar) {
+ return function (baz) {
+ return function (derp) {
+ return bar.callback(baz, derp, bar.value);
+ };
+ };
+ };
+
+ Sample.whatTheFuncData = {
+ callback: function (x, y, z) { return [x, y, z].join(' '); },... |
2db577b84eb075b0183bc3744fd60464e6ed6465 | src/index.js | src/index.js | export { Diory as default, Diory } from './Diory'
export { default as DioryText } from './DioryText'
export { default as DioryImage } from './DioryImage'
| export { Diory as default, Diory } from './Diory'
export { DioryText } from './DioryText'
export { DioryImage } from './DioryImage'
| Fix export of the components | Fix export of the components
| JavaScript | mit | DioryMe/diory-react-components,DioryMe/diory-react-components | ---
+++
@@ -1,3 +1,3 @@
export { Diory as default, Diory } from './Diory'
-export { default as DioryText } from './DioryText'
-export { default as DioryImage } from './DioryImage'
+export { DioryText } from './DioryText'
+export { DioryImage } from './DioryImage' |
691f9ecf58861fec54d299d3d1f9b14d123f0d14 | lib/plugins/body_parser.js | lib/plugins/body_parser.js | // Copyright 2012 Mark Cavage, Inc. All rights reserved.
var jsonParser = require('./json_body_parser');
var formParser = require('./form_body_parser');
var multipartParser = require('./multipart_parser');
var errors = require('../errors');
var UnsupportedMediaTypeError = errors.UnsupportedMediaTypeError;
functio... | // Copyright 2012 Mark Cavage, Inc. All rights reserved.
var jsonParser = require('./json_body_parser');
var formParser = require('./form_body_parser');
var multipartParser = require('./multipart_parser');
var errors = require('../errors');
var UnsupportedMediaTypeError = errors.UnsupportedMediaTypeError;
functio... | Make bodyParser play well with PATCH too. | Make bodyParser play well with PATCH too. | JavaScript | mit | rborn/node-restify,msaffitz/node-restify,jclulow/node-restify,kevinykchan/node-restify,TheDeveloper/node-restify,chaordic/node-restify,adunkman/node-restify,prasmussen/node-restify,ferhatsb/node-restify,uWhisp/node-restify | ---
+++
@@ -16,7 +16,7 @@
var parseMultipart = multipartParser(options);
return function parseBody(req, res, next) {
- if (req.method !== 'POST' && req.method !== 'PUT')
+ if (req.method !== 'POST' && req.method !== 'PUT' && req.method !== 'PATCH')
return next();
if (req.contentLength === ... |
4a95ed75556c4922653a14c8db7a0e480eba1b28 | src/sketch.js | src/sketch.js | function setup() {
createCanvas(640, 480);
}
function draw() {
ellipse(50, 50, 80, 80);
}
/**
* Boid class
*/
function Boid(x_pos, y_pos, mass) {
this.position= createVector(x_pos, y_pos);
this.velocity = createVector(0, 0);
this.acceleration = createVector(0, 0);
this.mass = mass;
}
Boid.prototype = {... | var boids = [];
/**
* P5js initialization
*/
function setup() {
createCanvas(640, 480);
for (var i = 0; i < 10; i++) {
boids.push(new Boid(10*i, 10*i, 10));
}
}
/**
* P5js render loop
*/
function draw() {
boids.forEach(
Boid.prototype.display
);
}
/**
* Boid class
*/
function Boid(x_pos,... | Implement Boid display method, uses arbitrary radius | Implement Boid display method, uses arbitrary radius
| JavaScript | mit | dkgramming/rgw,dkgramming/rgw | ---
+++
@@ -1,9 +1,27 @@
+var boids = [];
+
+/**
+ * P5js initialization
+ */
function setup() {
+
createCanvas(640, 480);
+
+ for (var i = 0; i < 10; i++) {
+ boids.push(new Boid(10*i, 10*i, 10));
+ }
+
}
+/**
+ * P5js render loop
+ */
function draw() {
- ellipse(50, 50, 80, 80);
+
+ boids.forEach(
+ ... |
0cd2a9e4571986dfe951805f33d9dcfe369e64db | tasks/build.js | tasks/build.js | // imports
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var uglify = require('gulp-uglify');
var buffer = require('vinyl-buffer');
// build src
gulp.task('browserify', function(cb){
return browserify('./src/app.js', {
debug: ... | // imports
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var uglify = require('gulp-uglify');
var buffer = require('vinyl-buffer');
// build src
gulp.task('browserify', function(cb){
return browserify('./src/app.js', {
debug: ... | Update path fonts gulp task | Update path fonts gulp task | JavaScript | mit | microscope-mobile/ionic-tabs,microscope-mobile/ionic-tabs,microscope-mobile/ionic-tabs,microscope-mobile/ionic-tabs,microscope-mobile/ionic-tabs | ---
+++
@@ -32,7 +32,7 @@
// copy fonts
gulp.task('fonts', function(cb){
- return gulp.src('node_modules/ionic-framework/release/fonts/**')
+ return gulp.src('node_modules/ionic-npm/fonts/**')
.pipe(gulp.dest('./www/fonts/'));
cb();
}); |
c90559b246ed418c54ddc9c64cdb864dbab3ef6d | prompts.js | prompts.js | 'use strict';
var _ = require('lodash');
var prompts = [
{
type: 'input',
name: 'projectName',
message: 'Machine-name of your project?',
// Name of the parent directory.
default: _.last(process.cwd().split('/')),
validate: function (input) {
return (input.search(' ') === -1) ? true : '... | 'use strict';
var _ = require('lodash');
var prompts = [
{
type: 'input',
name: 'projectName',
message: 'Machine-name of your project?',
// Name of the parent directory.
default: _.last(process.cwd().split('/')),
validate: function (input) {
return (input.search(' ') === -1) ? true : '... | Remove nginx as a directly supported option. | Remove nginx as a directly supported option.
| JavaScript | mit | phase2/generator-outrigger-drupal,phase2/generator-outrigger-drupal,phase2/generator-outrigger-drupal | ---
+++
@@ -19,7 +19,6 @@
message: 'Choose your webserver:',
choices: [
'apache',
- 'nginx',
'custom'
],
default: 'apache' |
10af81baad62584ef31a497b21479ca8db31fb5a | statistics.js | statistics.js | var config = require('./config');
var rdb = config.rdb;
var rdbLogger = config.rdbLogger;
module.exports = function statistics() {
return function (req, res, next) {
rdb.sismember(
'stats:ip',
req.connection.remoteAddress,
function (err, reply) {
if (err || typeof reply === 'undefined')... | var config = require('./config');
var rdb = config.rdb;
var rdbLogger = config.rdbLogger;
module.exports = function statistics() {
return function (req, res, next) {
var ip = '';
if (req.headers['x-nginx-proxy'] == 'true') {
ip = req.headers['x-real-ip'];
} else {
ip = req.connection.remoteAd... | Fix nginx forwarding issue with remote address. | Fix nginx forwarding issue with remote address.
| JavaScript | mit | s1na/talkie | ---
+++
@@ -4,15 +4,21 @@
module.exports = function statistics() {
return function (req, res, next) {
+ var ip = '';
+ if (req.headers['x-nginx-proxy'] == 'true') {
+ ip = req.headers['x-real-ip'];
+ } else {
+ ip = req.connection.remoteAddress;
+ }
rdb.sismember(
'stats:ip',
-... |
56ffe01657459d41dc62b187903afbad2348e587 | app/assets/javascripts/title_onload.js | app/assets/javascripts/title_onload.js | window.onload = function(){
var headerText = "WriteNow".split("")
animateHeader(headerText);
};
animateHeader = function(text){
current = 0;
header = $(".main_header");
setInterval(function() {
if(current < text.length) {
header.text(header.text() + text[current++]);
}
}, 120);
} | TitleLoader = {
animateHeader: function(text){
current = 0;
header = $(".main_header");
setInterval(function() {
if (current < text.length) {
header.text(header.text() + text[current++]);
}
}, 120);
},
displayTagline: function() {
$(".tagline").fadeIn(4700);
}
}
$(docume... | Add TitleLoader namespace for onload functionality. | Add TitleLoader namespace for onload functionality.
| JavaScript | mit | tiger-swallowtails-2014/write-now,tiger-swallowtails-2014/write-now | ---
+++
@@ -1,14 +1,20 @@
-window.onload = function(){
- var headerText = "WriteNow".split("")
- animateHeader(headerText);
-};
+TitleLoader = {
+ animateHeader: function(text){
+ current = 0;
+ header = $(".main_header");
+ setInterval(function() {
+ if (current < text.length) {
+ header.text... |
e9a71f62a6d88a13d8be3435e970814b6087bd3e | app/components/layer-info/component.js | app/components/layer-info/component.js | import Ember from 'ember';
import loadAll from 'ember-osf/utils/load-relationship';
export default Ember.Component.extend({
users: Ember.A(),
bibliographicUsers: Ember.A(),
institutions: Ember.A(),
getAuthors: function() {
// Cannot be called until node has loaded!
const node = this.get... | import Ember from 'ember';
import loadAll from 'ember-osf/utils/load-relationship';
export default Ember.Component.extend({
users: Ember.A(),
bibliographicUsers: Ember.A(),
institutions: Ember.A(),
getAuthors: function() {
// Cannot be called until node has loaded!
const node = this.get... | Fix affiliated institutions multiplying at every render | Fix affiliated institutions multiplying at every render
| JavaScript | apache-2.0 | Rytiggy/osfpages,caneruguz/osfpages,caneruguz/osfpages,Rytiggy/osfpages | ---
+++
@@ -23,6 +23,7 @@
getAffiliatedInst: function (){
const node = this.get('node');
if (!node) { return };
+ if(this.get('institutions').length > 0) { return; }
const institutions = Ember.A();
loadAll(node, 'affiliatedInstitutions', institutions).then(() => {
... |
031233307e0a4892ad4ff80372873a44d11d6fa9 | tasks/serve.js | tasks/serve.js | const gulp = require('gulp');
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const compress = require('compression');
const browserSync = require('browser-sync');
const config = require('../config');
const webpackConfig = require('../config/webpack.config');
module.... | const gulp = require('gulp');
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const compress = require('compression');
const browserSync = require('browser-sync');
const config = require('../config');
const webpackConfig = require('../config/webpack.config');
module.... | Fix Webpack Tapable deprecation warning | Fix Webpack Tapable deprecation warning
| JavaScript | mit | strt/bricks | ---
+++
@@ -10,7 +10,7 @@
const tasks = require('../utils/getTasks'); // eslint-disable-line global-require
const compiler = webpack(webpackConfig);
- compiler.plugin('done', () => {
+ compiler.hooks.done.tap({ name: 'BrowserSync' }, () => {
browserSync.reload();
});
|
fb1d25a1135f41b4be2cb18f73f14b94dfc47bbf | models/ticket.js | models/ticket.js | var mongoose = require('mongoose');
var Ticket = new mongoose.Schema({
name:String,
phoneNumber: String,
description: String,
createdAt : Date
});
var ticket = mongoose.model('ticket', Ticket);
module.exports = ticket;
| var mongoose = require('mongoose');
var Ticket = new mongoose.Schema({
name:String,
phoneNumber: String,
description: String,
createdAt : Date
});
// Delete model definition in case it is already defined
delete mongoose.models.ticket;
var ticket = mongoose.model('ticket', Ticket);
module.exports = ticket;
| Delete cached model definition Everytime the Ticket model is defined | Delete cached model definition Everytime the Ticket model is defined
| JavaScript | mit | TwilioDevEd/browser-calls-node,TwilioDevEd/browser-calls-node | ---
+++
@@ -7,5 +7,8 @@
createdAt : Date
});
+// Delete model definition in case it is already defined
+delete mongoose.models.ticket;
+
var ticket = mongoose.model('ticket', Ticket);
module.exports = ticket; |
7e4320b1bb12ed9ada7c758ff2c9401b1149f7ae | modules/lists/list-empty.js | modules/lists/list-empty.js | // @flow
import * as React from 'react'
import {View, Text} from 'react-native'
type Props = {
mode: 'bug' | 'normal',
}
export class ListEmpty extends React.PureComponent<Props> {
render() {
return (
<View>
<Text>List is empty</Text>
</View>
)
}
}
| // @flow
import * as React from 'react'
import {NoticeView} from '@frogpond/notice'
type Props = {
mode: 'bug' | 'normal',
}
export class ListEmpty extends React.PureComponent<Props> {
render() {
return <NoticeView text="List is empty" />
}
}
| Change the listempty component to be a noticeview | Change the listempty component to be a noticeview
| JavaScript | agpl-3.0 | StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native | ---
+++
@@ -1,6 +1,6 @@
// @flow
import * as React from 'react'
-import {View, Text} from 'react-native'
+import {NoticeView} from '@frogpond/notice'
type Props = {
mode: 'bug' | 'normal',
@@ -8,10 +8,6 @@
export class ListEmpty extends React.PureComponent<Props> {
render() {
- return (
- <View>
- <... |
d13b0473314ff148146f00b60c8a3fa4dd3b26f7 | tabcounter.js | tabcounter.js | 'use strict';
var tabRemoved = false;
browser.browserAction.setBadgeBackgroundColor({color: "gray"});
browser.tabs.onActivated.addListener(refreshCounter);
browser.tabs.onCreated.addListener(refreshCounter);
browser.tabs.onAttached.addListener(refreshCounter);
browser.tabs.onRemoved.addListener(() => tabRemoved = tru... | 'use strict';
var tabRemoved = false;
browser.browserAction.setBadgeBackgroundColor({color: "gray"});
browser.tabs.onActivated.addListener(refreshCounter);
browser.tabs.onRemoved.addListener(() => tabRemoved = true);
initCounter();
function initCounter() {
browser.tabs.query({currentWindow: true}).then(tabs => up... | Fix tab counting when moving tab between windows | Fix tab counting when moving tab between windows
| JavaScript | mit | cakebaker/yet-another-tab-counter | ---
+++
@@ -4,17 +4,19 @@
browser.browserAction.setBadgeBackgroundColor({color: "gray"});
browser.tabs.onActivated.addListener(refreshCounter);
-browser.tabs.onCreated.addListener(refreshCounter);
-browser.tabs.onAttached.addListener(refreshCounter);
browser.tabs.onRemoved.addListener(() => tabRemoved = true);
... |
db884e3373d9ad0440473e292dd41d41ccf93c99 | test/vendor.js | test/vendor.js |
;(function() {
var MODULES_PATH = 'https://a.alipayobjects.com/static/arale/'
if (location.href.indexOf('/~lifesinger/') > 0) {
MODULES_PATH = 'http://' + location.host + '/~lifesinger/seajs/spm/modules/'
}
// Ref: https://github.com/miohtama/detectmobile.js
function isMobile() {
return Math.max(... |
;(function() {
var MODULES_PATH = 'https://a.alipayobjects.com/static/arale/'
if (location.href.indexOf('/~lifesinger/') > 0) {
MODULES_PATH = 'http://' + location.host + '/~lifesinger/seajs/spm/modules/'
}
// Ref: https://github.com/miohtama/detectmobile.js
function isMobile() {
return Math.max(... | Exclude pad from mobile device | Exclude pad from mobile device
| JavaScript | mit | kaijiemo/seajs,miusuncle/seajs,miusuncle/seajs,LzhElite/seajs,yuhualingfeng/seajs,121595113/seajs,sheldonzf/seajs,FrankElean/SeaJS,13693100472/seajs,PUSEN/seajs,LzhElite/seajs,treejames/seajs,kuier/seajs,judastree/seajs,lianggaolin/seajs,FrankElean/SeaJS,moccen/seajs,sheldonzf/seajs,seajs/seajs,liupeng110112/seajs,imcy... | ---
+++
@@ -10,12 +10,12 @@
// Ref: https://github.com/miohtama/detectmobile.js
function isMobile() {
- return Math.max(screen.availWidth || screen.availHeight) < 970
+ return Math.max(screen.availWidth || screen.availHeight) <= 480
}
function root(path) {
- return MODULES_PATH + path;
+ ... |
7a933da519e0cd556ea2e79b380978b8df9787e1 | node-tests/blueprints/test-helper-test.js | node-tests/blueprints/test-helper-test.js | 'use strict';
var setupTestHooks = require('ember-cli-blueprint-test-helpers/lib/helpers/setup');
var BlueprintHelpers = require('ember-cli-blueprint-test-helpers/lib/helpers/blueprint-helper');
var generateAndDestroy = BlueprintHelpers.generateAndDestroy;
describe('Acceptance: ember generate and destroy test-h... | 'use strict';
var blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
var setupTestHooks = blueprintHelpers.setupTestHooks;
var emberNew = blueprintHelpers.emberNew;
var emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
var chai = require('ember-cli-blueprint-test-helpers/chai');
var e... | Use alternative blueprint test helpers | tests/test-helper: Use alternative blueprint test helpers
| JavaScript | mit | ember-cli/ember-cli-legacy-blueprints,ember-cli/ember-cli-legacy-blueprints | ---
+++
@@ -1,23 +1,24 @@
'use strict';
-var setupTestHooks = require('ember-cli-blueprint-test-helpers/lib/helpers/setup');
-var BlueprintHelpers = require('ember-cli-blueprint-test-helpers/lib/helpers/blueprint-helper');
-var generateAndDestroy = BlueprintHelpers.generateAndDestroy;
+var blueprintHelpers =... |
bb400919494f2805e6a4d6087602a47866d362d4 | pages/article.js | pages/article.js | import React from 'react'
import { connect } from 'react-redux';
import { compose } from 'redux';
import Link from 'next/link';
import app from '../components/App';
import { load } from '../redux/articleDetail';
export default compose(
app((dispatch, {query: {id}}) => dispatch(load(id))),
connect(({articleDetail}... | import React from 'react'
import { connect } from 'react-redux';
import { compose } from 'redux';
import Link from 'next/link';
import app from '../components/App';
import { load } from '../redux/articleDetail';
export default compose(
app((dispatch, {query: {id}}) => dispatch(load(id))),
connect(({articleDetail}... | Remove “back to list” link because it is not accurately “back to list” | Remove “back to list” link because it is not accurately “back to list” | JavaScript | mit | cofacts/rumors-site,cofacts/rumors-site | ---
+++
@@ -22,7 +22,6 @@
return (
<div>
- <Link href="/"><a>Back to list</a></Link>
<pre>{JSON.stringify(article.toJS(), null, ' ')}</pre>
</div>
); |
8cea0ec1551b4b51123a6e9c25ab6fe1823c8d1e | database/seeds/users.js | database/seeds/users.js | const bcrypt = require('bcryptjs')
const users = [
{
username: 'kudakwashe',
password: hashedPassword('kp')
},
{
username: 'garikai',
password: hashedPassword('gg')
}
]
function hashedPassword (password) {
return bcrypt.hashSync(password, 10)
}
exports.seed = (knex, Promise) => knex('users'... | const bcrypt = require('bcryptjs')
const users = [
{
username: 'kudakwashe',
password: hashedPassword('paradzayi')
},
{
username: 'garikai',
password: hashedPassword('rodneygg')
}
]
function hashedPassword (password) {
return bcrypt.hashSync(password, 10)
}
exports.seed = (knex, Promise) =>... | Increase the length of passwords to be consistent with the vaalidation rules | Increase the length of passwords to be consistent with the vaalidation rules
| JavaScript | mit | byteBridge/transcriptus-api | ---
+++
@@ -3,11 +3,11 @@
const users = [
{
username: 'kudakwashe',
- password: hashedPassword('kp')
+ password: hashedPassword('paradzayi')
},
{
username: 'garikai',
- password: hashedPassword('gg')
+ password: hashedPassword('rodneygg')
}
]
|
29abdb6ceff6038cce37e9e5761513b204a08ea0 | module/json_api_request.js | module/json_api_request.js | /*!
* apiai
* Copyright(c) 2015 http://api.ai/
* Apache 2.0 Licensed
*/
'use strict';
var Request = require('./request').Request;
var util = require('util');
var ServerError = require('./exceptions').ServerError;
exports.JSONApiRequest = module.exports.JSONApiRequest = JSONApiRequest;
util.inherits(JSONApiRequ... | /*!
* apiai
* Copyright(c) 2015 http://api.ai/
* Apache 2.0 Licensed
*/
'use strict';
var Request = require('./request').Request;
var util = require('util');
var ServerError = require('./exceptions').ServerError;
exports.JSONApiRequest = module.exports.JSONApiRequest = JSONApiRequest;
util.inherits(JSONApiRequ... | Fix issue with wrong data in response | Fix issue with wrong data in response
| JavaScript | apache-2.0 | dialogflow/dialogflow-nodejs-client,api-ai/api-ai-node-js,api-ai/apiai-nodejs-client,api-ai/api-ai-node-js,api-ai/apiai-nodejs-client,dialogflow/dialogflow-nodejs-client | ---
+++
@@ -24,11 +24,22 @@
var body = '';
+ var buffers = [];
+ var bufferLength = 0;
+
response.on('data', function(chunk) {
- body += chunk;
+ bufferLength += chunk.length;
+ buffers.push(chunk);
});
response.on('end', function() {
+ if (bufferLength) {
+ ... |
74b9cebd9c43e4a281ba642c9bcc20f24411a801 | src/runner/install/package-json.js | src/runner/install/package-json.js | import path from 'path'
import json from '../../util/json'
const saguiScripts = {
'build': 'sagui build',
'develop': 'sagui develop --port 3000',
'dist': 'NODE_ENV=production sagui build --optimize',
'start': 'npm run develop',
'test': 'npm run test:lint && npm run test:unit',
'test:lint': 'sagui lint',
... | import path from 'path'
import json from '../../util/json'
const saguiScripts = {
'build': 'sagui build',
'develop': 'sagui develop --port 3000',
'dist': 'NODE_ENV=production sagui build --optimize',
'start': 'npm run develop',
'test': 'npm run test:lint && npm run test:unit',
'test:coverage': 'npm run tes... | Fix bootstrapped `test:unit:watch` npm script 🐛 | Fix bootstrapped `test:unit:watch` npm script 🐛 | JavaScript | mit | saguijs/sagui,saguijs/sagui | ---
+++
@@ -7,10 +7,10 @@
'dist': 'NODE_ENV=production sagui build --optimize',
'start': 'npm run develop',
'test': 'npm run test:lint && npm run test:unit',
+ 'test:coverage': 'npm run test:unit -- --coverage',
'test:lint': 'sagui lint',
'test:unit': 'NODE_ENV=test sagui test',
- 'test:coverage': 'n... |
00216ffd2ba8907d5c70ff067f4bf9fa051027f8 | server/controllers/Book.js | server/controllers/Book.js | import omit from 'lodash/omit';
import db from '../models';
const { User } = db;
export default {
create(req, res) {
return User
.create(req.userInput)
.then((user) => {
const data = omit(user.dataValues, [
'password'
]);
return res.status(201).send({
messa... | import db from '../models';
const { Book } = db;
export default {
create(req, res) {
return Book
.create(req.userInput)
.then(() => {
return res.status(201).send({
success: true,
message: 'Book uploaded successfully',
});
})
.catch(error => res.status(4... | Add book route and creator | Add book route and creator
| JavaScript | mit | nosisky/Hello-Books,nosisky/Hello-Books | ---
+++
@@ -1,19 +1,16 @@
-import omit from 'lodash/omit';
import db from '../models';
-const { User } = db;
+const { Book } = db;
export default {
create(req, res) {
- return User
+ return Book
.create(req.userInput)
- .then((user) => {
- const data = omit(user.dataValues, [
- ... |
b4c5139d53430ae26bb869d621cfbdfa9f3124ec | src/testUtils/warningFreeBasics.js | src/testUtils/warningFreeBasics.js | /**
* Test for a few basic patterns that usually should
* case no warnings.
*
* This should not be used by rules that intentionally
* warn for these cases.
*/
export default function (tr) {
tr.ok("", "empty stylesheet")
tr.ok("a {}", "empty rule set")
tr.ok("@import \"foo.css\";", "blockless statement")
}
| /**
* Test for a few basic patterns that usually should
* case no warnings.
*
* This should not be used by rules that intentionally
* warn for these cases.
*/
export default function (tr) {
tr.ok("", "empty stylesheet")
tr.ok("a {}", "empty rule set")
tr.ok (":global {}", "CSS Modules global empty rule set"... | Add :global to basic tests | Add :global to basic tests
| JavaScript | mit | gaidarenko/stylelint,gucong3000/stylelint,stylelint/stylelint,stylelint/stylelint,hudochenkov/stylelint,gucong3000/stylelint,heatwaveo8/stylelint,hudochenkov/stylelint,heatwaveo8/stylelint,heatwaveo8/stylelint,stylelint/stylelint,m-allanson/stylelint,gucong3000/stylelint,gaidarenko/stylelint,evilebottnawi/stylelint,sty... | ---
+++
@@ -8,5 +8,6 @@
export default function (tr) {
tr.ok("", "empty stylesheet")
tr.ok("a {}", "empty rule set")
+ tr.ok (":global {}", "CSS Modules global empty rule set")
tr.ok("@import \"foo.css\";", "blockless statement")
} |
c062c2af8e43790759194633fe6bff6b098d4933 | src/adhocracy_frontend/adhocracy_frontend/tests/acceptance/EmbeddedSharePage.js | src/adhocracy_frontend/adhocracy_frontend/tests/acceptance/EmbeddedSharePage.js | "use strict";
var shared = require("./shared.js");
var EmbeddedSharePage = function() {
this.url = "/embed/social-share";
this.dummyTweetButton = element(by.css(".tweet.dummy_btn"));
this.dummyFacebookLikeButton = element(by.css(".fb_like.dummy_btn"));
this.get = function() {
browser.get(this... | "use strict";
var shared = require("./shared.js");
var EmbeddedSharePage = function() {
this.url = "/embed/social-share";
this.dummyTweetButton = element(by.css(".tweet.dummy_btn"));
this.dummyFacebookLikeButton = element(by.css(".fb_like.dummy_btn"));
this.get = function() {
browser.get(this... | Fix Twitter share test not deterministic | Fix Twitter share test not deterministic
| JavaScript | agpl-3.0 | xs2maverick/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,fhartwig/adhocracy3.mer... | ---
+++
@@ -14,6 +14,7 @@
this.clickDummyTweetButton = function() {
this.dummyTweetButton.click();
+ browser.waitForAngular();
};
this.getTwitterIframe = function() { |
c80bd1e6459211f35f3f7676c11e62e132f91c27 | src/main/web/florence/js/functions/_makeEditSections.js | src/main/web/florence/js/functions/_makeEditSections.js | function makeEditSections(collectionName, response) {
if (response.type === 'bulletin') {
bulletinEditor(collectionName, response);
} else {
$('.fl-editor__sections').hide();
$("#addSection").remove();
$('.fl-editor__headline').show().val(JSON.stringify(response, null, 2));
$('.fl-panel--editor... | function makeEditSections(collectionName, response, path) {
if (response.type === 'bulletin') {
bulletinEditor(collectionName, response);
} else {
$('.fl-editor__sections').hide();
$("#addSection").remove();
$('.fl-editor__headline').show().val(JSON.stringify(response, null, 2));
$('.fl-pa... | Attach click handler to submit for review button to call API. | Attach click handler to submit for review button to call API.
| JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence | ---
+++
@@ -1,4 +1,5 @@
-function makeEditSections(collectionName, response) {
+function makeEditSections(collectionName, response, path) {
+
if (response.type === 'bulletin') {
bulletinEditor(collectionName, response);
} else {
@@ -8,15 +9,16 @@
$('.fl-panel--editor__nav__save').unbind("click")... |
e130009deb5af19ae8de099dc38d81ae076f12f7 | djplaces/static/js/djplaces.js | djplaces/static/js/djplaces.js |
$(document).ready(function() {
$("#id_place")
.geocomplete({
map: "#map_location",
mapOptions: {
zoom: 10
},
markerOptions: {
draggable: true
}
})
.bind("geocode:result", function(event, result) {
var coordinates = result.geome... |
$(document).ready(function() {
$("#id_place")
.geocomplete({
map: "#map_location",
mapOptions: { zoom: 10 },
markerOptions: { draggable: true }
})
.bind("geocode:result", function(event, result) {
$('#id_location').val(result.geometry.location.lat() + ',' + resul... | Update lat and lng on marker dragged | Update lat and lng on marker dragged
| JavaScript | mit | oscarmcm/django-places,oscarmcm/django-places,oscarmcm/django-places | ---
+++
@@ -3,22 +3,20 @@
$("#id_place")
.geocomplete({
map: "#map_location",
- mapOptions: {
- zoom: 10
- },
- markerOptions: {
- draggable: true
- }
+ mapOptions: { zoom: 10 },
+ markerOptions: { draggable: true }
})
.bin... |
71a1c4a3fe010a3f79ea83a4271b6240f5c9c0a8 | app/models/post.js | app/models/post.js | var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var safeOpts = {
j: 1,
w: "majority",
wtimeout: 10000
};
var postSchema = new Schema({
saved_at: { type: Date, default: Date.now, required: true},
created_at: { type: Date, required: true},
created_at_i: { typ... | var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var safeOpts = {
j: 1,
w: "majority",
wtimeout: 10000
};
var postSchema = new Schema({
saved_at: { type: Date, default: Date.now, required: true},
created_at: { type: Date, required: true},
created_at_i: { typ... | Add model, not only the schema | Add model, not only the schema
| JavaScript | mit | dburgos/HN-feed,dburgos/HN-feed | ---
+++
@@ -17,4 +17,6 @@
num_comments: Number
}, { safe: safeOpts });
-module.exports = postSchema;
+var Post = mongoose.model('Post', postSchema);
+
+module.exports = Post; |
7f511555f48096c94aeaefd0254d43f8bcf672fc | app/models/task.js | app/models/task.js | import DS from "ember-data";
import Ember from "ember";
import config from '../config/environment';
export default DS.Model.extend( {
prerequisities: DS.attr("prerequisite"),
state: DS.attr("string"),
active: Ember.computed("state", function() {
return ["base", "correcting", "done"].index... | import DS from "ember-data";
import Ember from "ember";
import config from '../config/environment';
export default DS.Model.extend( {
prerequisities: DS.attr("prerequisite"),
state: DS.attr("string"),
active: Ember.computed("state", function() {
return ["base", "correcting", "done"].index... | Fix CSP violation on profile. | Fix CSP violation on profile.
| JavaScript | mit | fi-ksi/web-frontend,fi-ksi/web-frontend,fi-ksi/web-frontend | ---
+++
@@ -26,6 +26,9 @@
picture: Ember.computed("picture_base", "picture_suffix", "active",
"state", function() {
+ if(!this.get("picture_base")) {
+ return undefined;
+ }
if(!this.get("active")) {
return config.API_LOC + this.get("picture_base") + "locked... |
e6ef64968bc99b6f8ed30fb0f1a581bc78763a97 | tests/configs/modules/weather/currentweather_options.js | tests/configs/modules/weather/currentweather_options.js | /* Magic Mirror Test config default weather
*
* By fewieden https://github.com/fewieden
*
* MIT Licensed.
*/
let config = {
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
language: "en",
timeFormat: 24,
units: "metric",
electronOptions: {
webPreferences: {
nodeIntegration: true
}... | /* Magic Mirror Test config default weather
*
* By fewieden https://github.com/fewieden
*
* MIT Licensed.
*/
let config = {
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
language: "en",
timeFormat: 24,
units: "metric",
electronOptions: {
webPreferences: {
nodeIntegration: true
}... | Disable Sunrise/Sunset in Config option | Disable Sunrise/Sunset in Config option
| JavaScript | mit | MichMich/MagicMirror,MichMich/MagicMirror,Tyvonne/MagicMirror,MichMich/MagicMirror,Tyvonne/MagicMirror,Tyvonne/MagicMirror,MichMich/MagicMirror,Tyvonne/MagicMirror | ---
+++
@@ -28,6 +28,7 @@
initialLoadDelay: 3000,
useBeaufort: false,
showWindDirectionAsArrow: true,
+ showSun: false,
showHumidity: true,
roundTemp: true,
degreeLabel: true |
11e185860f52757c013f64221927f0b605805cd1 | .htmlhintrc.js | .htmlhintrc.js | const htmlHintConfig = require('kolibri-tools/.htmlhintrc');
htmlHintConfig['--vue-component-conventions'] = false;
module.exports = htmlHintConfig;
| const htmlHintConfig = require('kolibri-tools/.htmlhintrc');
htmlHintConfig['id-class-value'] = false;
htmlHintConfig['--vue-component-conventions'] = false;
module.exports = htmlHintConfig;
| Disable html hint class value check | Disable html hint class value check
Vuetify helper classes contain double dashes,
e.g. grey--text.
| JavaScript | mit | DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation | ---
+++
@@ -1,3 +1,4 @@
const htmlHintConfig = require('kolibri-tools/.htmlhintrc');
+htmlHintConfig['id-class-value'] = false;
htmlHintConfig['--vue-component-conventions'] = false;
module.exports = htmlHintConfig; |
144874d96097be560057901149af29fe65bf57ba | packages/test/testserver.js | packages/test/testserver.js | #!/usr/bin/env node
/**
* Minimal server for local, manual web page testing.
*/
'use strict'; // eslint-disable-line
const portfinder = require('portfinder');
const http = require('http');
const path = require('path');
const nodeStatic = require('node-static');
const webroot = path.resolve(process.argv[2]);
portf... | #!/usr/bin/env node
/**
* Minimal server for local, manual web page testing.
*/
/* eslint-disable strict, no-console *//* tslint:disable no-console */
'use strict';
const portfinder = require('portfinder');
const http = require('http');
const path = require('path');
const nodeStatic = require('node-static');
con... | Fix lint errors in test server | Fix lint errors in test server
| JavaScript | isc | WeAreGenki/wag-ui | ---
+++
@@ -4,7 +4,9 @@
* Minimal server for local, manual web page testing.
*/
-'use strict'; // eslint-disable-line
+/* eslint-disable strict, no-console *//* tslint:disable no-console */
+
+'use strict';
const portfinder = require('portfinder');
const http = require('http'); |
5c4981122946fbbe8c8bcece6ebc959dd942aa76 | client.js | client.js | var configUtils = _altboilerScope.configUtils
/* Wait until the client-side configuration has been done */
addEventListener('load', function () {
var showLoader = altboiler.getConfig('showLoader')
/* Clear the object */
altboiler.tmpConf = {}
/* Don't do anything if the loader should be shown */
if(configUti... | var configUtils = _altboilerScope.configUtils
/* Wait until the client-side configuration has been done */
addEventListener('load', function () {
var showLoader = altboiler.getConfig('showLoader')
var styles
/* Clear the object */
altboiler.tmpConf = {}
/* Don't do anything if the loader should be shown */
... | Fix the path to the linked loader css | Fix the path to the linked loader css
| JavaScript | mit | Kriegslustig/meteor-altboiler,Kriegslustig/meteor-altboiler | ---
+++
@@ -3,13 +3,16 @@
/* Wait until the client-side configuration has been done */
addEventListener('load', function () {
var showLoader = altboiler.getConfig('showLoader')
+ var styles
/* Clear the object */
altboiler.tmpConf = {}
/* Don't do anything if the loader should be shown */
if(configU... |
a288ab32b8b5c5e6e545739cbb480b16cc00da22 | src/main/web/florence/js/functions/_viewTeams.js | src/main/web/florence/js/functions/_viewTeams.js | function viewTeams() {
getTeams(
success = function (data) {
populateTeamsTable(data.teams);
},
error = function (jqxhr) {
handleApiError(jqxhr);
}
);
function populateTeamsTable(data) {
var teams = _.sortBy(data, function (d) {
r... | function viewTeams() {
getTeams(
success = function (data) {
populateTeamsTable(data.teams);
},
error = function (jqxhr) {
handleApiError(jqxhr);
}
);
function populateTeamsTable(data) {
var teamsHtml = templates.teamList(teams);
$('.... | Remove client side ordering of teams list (fixed in zebedee now) | Remove client side ordering of teams list (fixed in zebedee now)
| JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence | ---
+++
@@ -10,9 +10,6 @@
);
function populateTeamsTable(data) {
- var teams = _.sortBy(data, function (d) {
- return d.name.toLowerCase()
- });
var teamsHtml = templates.teamList(teams);
$('.section').html(teamsHtml);
|
16737528b47ed1b7e91e06cf9927f5acb0465e6a | demos/events/06-musical-data/script.js | demos/events/06-musical-data/script.js | var pianoKeys = document.querySelectorAll('.piano-key');
for (var i = 0; i < pianoKeys.length; i++) {
pianoKeys[i].addEventListener('click', function (event) {
var note = this.getAttribute('data-piano-key');
playNote(note);
});
}
| // Write an event listener for each key that looks at the data-piano-key of the
// element that was clicked and passes that note to the playNote global function
| Remove solution code for data-attributes demo | Remove solution code for data-attributes demo
| JavaScript | mpl-2.0 | joshcass/advanced-js-fundamentals-ck,mdn/advanced-js-fundamentals-ck,mdn/advanced-js-fundamentals-ck,joshcass/advanced-js-fundamentals-ck | ---
+++
@@ -1,10 +1,2 @@
-var pianoKeys = document.querySelectorAll('.piano-key');
-
-for (var i = 0; i < pianoKeys.length; i++) {
-
- pianoKeys[i].addEventListener('click', function (event) {
- var note = this.getAttribute('data-piano-key');
- playNote(note);
- });
-
-}
+// Write an event listener for each k... |
010fc67d6558cb35f6810d00ac4fcb62092c75fa | lib/node_modules/@stdlib/math/base/dist/betaprime/lib/index.js | lib/node_modules/@stdlib/math/base/dist/betaprime/lib/index.js | 'use strict';
/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
// MAIN //
/**
* Top-level namespace.
*
* @namespace betaprime
*/
var betaprime = {};
/**
* ... | 'use strict';
/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
// MAIN //
/**
* Top-level namespace.
*
* @namespace betaprime
*/
var betaprime = {};
/**
* ... | Add variance to beta prime namespace | Add variance to beta prime namespace
| JavaScript | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | ---
+++
@@ -27,6 +27,15 @@
*/
setReadOnly( betaprime, 'mean', require( '@stdlib/math/base/dist/betaprime/mean' ) );
+/**
+* @name variance
+* @memberof betaprime
+* @readonly
+* @type {Function}
+* @see {@link module:@stdlib/math/base/dist/betaprime/variance}
+*/
+setReadOnly( betaprime, 'variance', require( '@st... |
094b42ab7dd77ead37bb8160d0001343c4347972 | imports/startup/client/index.js | imports/startup/client/index.js | // PhantomJS does not support web fonts
if (Meteor.isTest == false) {
WebFontConfig = {
google: { families: [ 'Oswald:300,400' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = '//ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js';
wf.type = 'text/javascript';
wf.a... | // PhantomJS does not support web fonts
WebFontConfig = {
google: { families: [ 'Oswald:300,400' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = '//ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsB... | Remove the clause around the font loader since it wasn't working anyway. | Remove the clause around the font loader since it wasn't working anyway.
| JavaScript | mit | howlround/worldtheatremap,howlround/worldtheatremap | ---
+++
@@ -1,14 +1,12 @@
// PhantomJS does not support web fonts
-if (Meteor.isTest == false) {
- WebFontConfig = {
- google: { families: [ 'Oswald:300,400' ] }
- };
- (function() {
- var wf = document.createElement('script');
- wf.src = '//ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js';
- ... |
cc5410b3b4860862d41da79a569ae8eeb268d23e | client/js/controllers/auth.js | client/js/controllers/auth.js | angular
.module('app')
.controller('AuthLoginController', ['$scope', 'AuthService', '$state',
function ($scope, AuthService, $state) {
$scope.login = function () {
AuthService.login($scope.user.username, $scope.user.email, $scope.user.password)
.then(function () {
$state.go('area-clienti-inizio');... | angular
.module('app')
.controller('AuthLoginController', ['$scope', 'AuthService', '$state',
function ($scope, AuthService, $state) {
$scope.login = function () {
AuthService.login($scope.user.username, $scope.user.email, $scope.user.password)
.then(function () {
$state.go('area-clienti');
}... | Fix an error on login | Fix an error on login
| JavaScript | mit | dev-augmenta/vrseum-backend,dev-augmenta/vrseum-backend | ---
+++
@@ -5,7 +5,7 @@
$scope.login = function () {
AuthService.login($scope.user.username, $scope.user.email, $scope.user.password)
.then(function () {
- $state.go('area-clienti-inizio');
+ $state.go('area-clienti');
});
};
}]) |
d93d4dd2b4300641505509191956b42c8a132a87 | static/js/drop_points.js | static/js/drop_points.js | /* vim: set expandtab ts=4 sw=4: */
| var last_update = Date.now()/1000;
function refresh_drop_points() {
return $.ajax({
type: "POST",
url: apiurl,
data: {
action: "dp_json",
ts: last_update
},
success: function (response) {
last_update = Date.now() / 1000;
drop_p... | Add stupid polling for changes via API | Add stupid polling for changes via API
| JavaScript | mit | der-michik/c3bottles,der-michik/c3bottles,der-michik/c3bottles,der-michik/c3bottles | ---
+++
@@ -1 +1,29 @@
+var last_update = Date.now()/1000;
+
+function refresh_drop_points() {
+ return $.ajax({
+ type: "POST",
+ url: apiurl,
+ data: {
+ action: "dp_json",
+ ts: last_update
+ },
+ success: function (response) {
+ last_update = ... |
55230781219ec63c6e95c0fd94a632b4c9677180 | stories/setup.stories.js | stories/setup.stories.js | /**
* External dependencies
*/
import { storiesOf } from '@storybook/react';
/**
* Internal dependencies
*/
import Setup from '../assets/js/components/setup';
storiesOf( 'Setup', module )
.add( 'Step one', () => {
global.googlesitekit.setup.isSiteKitConnected = false;
global.googlesitekit.setup.authenticated... | /**
* External dependencies
*/
import { storiesOf } from '@storybook/react';
/**
* Internal dependencies
*/
import Setup from '../assets/js/components/setup';
storiesOf( 'Setup', module )
.add( 'Step one', () => {
global.googlesitekit.setup.isSiteKitConnected = false;
global.googlesitekit.setup.isAuthenticat... | Revert change to global name. | Revert change to global name.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | ---
+++
@@ -11,7 +11,7 @@
storiesOf( 'Setup', module )
.add( 'Step one', () => {
global.googlesitekit.setup.isSiteKitConnected = false;
- global.googlesitekit.setup.authenticated = false;
+ global.googlesitekit.setup.isAuthenticated = false;
global.googlesitekit.setup.isVerified = false;
global.googlesi... |
415bf090411644dc2844b4a86a7d38b3fae6667a | packages/pg/lib/index.js | packages/pg/lib/index.js | 'use strict'
var Client = require('./client')
var defaults = require('./defaults')
var Connection = require('./connection')
var Pool = require('pg-pool')
const poolFactory = (Client) => {
return class BoundPool extends Pool {
constructor(options) {
super(options, Client)
}
}
}
var PG = function (cl... | 'use strict'
var Client = require('./client')
var defaults = require('./defaults')
var Connection = require('./connection')
var Pool = require('pg-pool')
const poolFactory = (Client) => {
return class BoundPool extends Pool {
constructor(options) {
super(options, Client)
}
}
}
var PG = function (cl... | Remove console.error on pg-native module not found | Remove console.error on pg-native module not found
| JavaScript | mit | brianc/node-postgres,brianc/node-postgres | ---
+++
@@ -40,9 +40,6 @@
if (err.code !== 'MODULE_NOT_FOUND') {
throw err
}
- /* eslint-disable no-console */
- console.error(err.message)
- /* eslint-enable no-console */
}
// overwrite module.exports.native so that getter is never called again |
2094436175c4a3c2482b974700ac2202a1a4b6a8 | errors.js | errors.js | (function(root) {
if (typeof exports !== 'undefined') {
var _ = require('underscore');
var util = require('./util')
} else {
var util = Substance.util;
}
var errors = {};
SubstanceError = function(name, code, message) {
this.message = message;
this.name = name;
this.code = code;
this.stack = util.cal... | (function(root) {
if (typeof exports !== 'undefined') {
var _ = require('underscore');
var util = require('./util')
} else {
var util = Substance.util;
}
var errors = {};
SubstanceError = function(name, code, message) {
this.message = message;
this.name = name;
this.code = code;
this.stack = util.cal... | Return a freshly defined error class. | Return a freshly defined error class.
| JavaScript | mit | substance/util | ---
+++
@@ -40,6 +40,8 @@
errors.define = function(className, code) {
errors[className] = SubstanceError.bind(null, className, code);
errors[className].prototype = SubstanceError.prototype;
+
+ return errors[className];
}
if (typeof exports === 'undefined') { |
75bbb60783f5decc00ece0cf80cb590b5dfbafef | test/scripts/preview.js | test/scripts/preview.js | const mocha = require('mocha');
const assert = require('assert');
const path = require('path');
const fs = require('fs');
const describe = mocha.describe;
const it = mocha.it;
const allResumes = require('./allResumes');
describe('npm run preview', () => {
it('should have generated the png files', () => {
const r... | const mocha = require('mocha');
const assert = require('assert');
const path = require('path');
const fs = require('fs');
const describe = mocha.describe;
const it = mocha.it;
const allResumes = require('./allResumes');
describe('npm run preview', () => {
it('should have generated the png files', () => {
setTime... | ADD sleep before running test | ADD sleep before running test
| JavaScript | mit | salomonelli/best-resume-ever,salomonelli/best-resume-ever | ---
+++
@@ -8,10 +8,12 @@
describe('npm run preview', () => {
it('should have generated the png files', () => {
- const resumes = allResumes();
- resumes.forEach(resume => {
- const p = path.join(__dirname, '../../src/assets/preview/resume-' + resume.path + '.png');
- assert.ok(fs.existsSync(p))... |
d6f57a39a457e800a87fec02d3c5cc6800cdd6d0 | test/svg-test-helper.js | test/svg-test-helper.js | import $ from "cheerio";
const SvgTestHelper = {
RECTANGULAR_SEQUENCE: ["M", "L", "L", "L", "L"],
expectIsRectangular(wrapper) {
expect(exhibitsRectangularDirectionSequence(wrapper)).to.be.true;
}
};
function exhibitsRectangularDirectionSequence(wrapper) {
const commands = getPathCommandsFromWrapper(wrap... | import $ from "cheerio";
const RECTANGULAR_SEQUENCE = ["M", "L", "L", "L", "L"];
const CIRCULAR_SEQUENCE = ["M", "m", "a", "a"];
const SvgTestHelper = {
expectIsRectangular(wrapper) {
expect(exhibitsShapeSequence(wrapper, RECTANGULAR_SEQUENCE)).to.be.true;
},
expectIsCircular(wrapper) {
expect(exhibits... | Refactor and add circular shape helper | Refactor and add circular shape helper
| JavaScript | mit | FormidableLabs/victory-chart,GreenGremlin/victory-chart,FormidableLabs/victory-chart,GreenGremlin/victory-chart | ---
+++
@@ -1,17 +1,22 @@
import $ from "cheerio";
+const RECTANGULAR_SEQUENCE = ["M", "L", "L", "L", "L"];
+const CIRCULAR_SEQUENCE = ["M", "m", "a", "a"];
+
const SvgTestHelper = {
- RECTANGULAR_SEQUENCE: ["M", "L", "L", "L", "L"],
+ expectIsRectangular(wrapper) {
+ expect(exhibitsShapeSequence(wrapper, RE... |
afdf568adcb412eb2c37bb9a516696f12f381000 | karma.conf.js | karma.conf.js | module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha'],
webpack: {
mode: 'development',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
op... | module.exports = function(config) {
const { KARMA_FILE = 'src/**/*.spec.js' } = process.env;
const FILE = KARMA_FILE || 'src/**/*.spec.js';
config.set({
basePath: '',
frameworks: ['mocha'],
webpack: {
mode: 'development',
module: {
rules: [
{
test: /\.js$/,
... | Add ability to set karma file through env | Add ability to set karma file through env
| JavaScript | mit | formio/formio.js,formio/formio.js,formio/formio.js | ---
+++
@@ -1,4 +1,6 @@
module.exports = function(config) {
+ const { KARMA_FILE = 'src/**/*.spec.js' } = process.env;
+ const FILE = KARMA_FILE || 'src/**/*.spec.js';
config.set({
basePath: '',
frameworks: ['mocha'],
@@ -44,12 +46,12 @@
served: true,
nocache: false
},
- ... |
d2d0a8a4f911d6a46cf4def218dabc9ca2c50ed4 | workshop/www/js/recipe.js | workshop/www/js/recipe.js | recipe.js
| var Recipe = function(data){
this.title = data.Title;
this.ingredients = [];
this.instructions = data.Instructions;
this.prepTime = data.TotalMinutes;
this.yieldNumber = data.YieldNumber;
this.yieldUnit = data.YieldUnit;
this.stars = data.StarRating;
this.instructions = data.Instructions;
this.imageUr... | Create Recipe class to wrap desired JSON data from 2nd API call | Create Recipe class to wrap desired JSON data from 2nd API call
All attributes for Recipe object, created on invocation of BigOvenGetRecipeJson function, are functional except for ingredients, which requires creation of new JS constructors.
| JavaScript | mit | danasselin/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,danasselin/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,danasselin/lin... | ---
+++
@@ -1 +1,29 @@
-recipe.js
+var Recipe = function(data){
+ this.title = data.Title;
+ this.ingredients = [];
+ this.instructions = data.Instructions;
+ this.prepTime = data.TotalMinutes;
+ this.yieldNumber = data.YieldNumber;
+ this.yieldUnit = data.YieldUnit;
+ this.stars = data.StarRating;
+ this.ins... |
a164d5fdd4ab443abd63042737d91706e7559350 | js/map.js | js/map.js | var atlas = {};
function initMap() {
atlas = L.map('atlas').setView([40, -100], 4);
L.tileLayer('//stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png').addTo(atlas);
}
function buildMap() {
console.log(data.maps);
_.each(data.maps, function(map) {
var options = {
className: 'atlas--map-ar... | var atlas = {};
function initMap() {
atlas = L.map('atlas').setView([40, -100], 4);
L.tileLayer('//stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png').addTo(atlas);
}
function buildMap() {
console.log(data.maps);
_.each(data.maps, function(map) {
var options = {
className: 'atlas--map-ar... | Send correct number to highlight and select functions | Send correct number to highlight and select functions
| JavaScript | mit | axismaps/tile-browser,axismaps/tile-browser | ---
+++
@@ -18,7 +18,11 @@
[map.bottom, map.left],
[map.top, map.right]
]).toGeoJSON();
-
+
+ rect.properties = {
+ number: parseInt(map.number)
+ }
+
L.geoJson(rect, {
style: function(f) {
return {
@@ -28,8 +32,8 @@
},
onEachFeature: functi... |
0154b921fa55444bb09dffb5e2f09382cc780def | exercises/buffer_concat/solution/solution.js | exercises/buffer_concat/solution/solution.js | var buffers = [];
process.stdin.on('readable', function(chunk) {
var chunk = process.stdin.read();
if (chunk !== null) {
buffers.push(chunk);
}
});
process.stdin.on('end', function() {
console.log(Buffer.concat(buffers));
});
| var buffers = [];
process.stdin.on('readable', function() {
var chunk = process.stdin.read();
if (chunk !== null) {
buffers.push(chunk);
}
});
process.stdin.on('end', function() {
console.log(Buffer.concat(buffers));
});
| Remove unnecessary argument to 'readable' callback | Remove unnecessary argument to 'readable' callback
| JavaScript | bsd-2-clause | karissa/bytewiser,karissa/bytewiser,maxogden/bytewiser,maxogden/bytewiser | ---
+++
@@ -1,6 +1,6 @@
var buffers = [];
-process.stdin.on('readable', function(chunk) {
+process.stdin.on('readable', function() {
var chunk = process.stdin.read();
if (chunk !== null) {
buffers.push(chunk); |
670580b52e520b42698ab80f02fe9fb8df6c8b50 | external/amber-cli/tests/amberVersionTest.js | external/amber-cli/tests/amberVersionTest.js | // Tests if the `amber version` command returns the expected amber version number, according to the configuration file `package.json`
// Displays 'ok' in green if test succeeds, else 'not ok' in red.
require('shelljs/global');
require('colors');
var JSON_PACKAGE_PATH = '../package.json'; // {amber directory}/external... | // Tests if the `amber version` command returns the expected amber version number, according to the configuration file `package.json`
// Displays 'ok' in green if test succeeds, else 'not ok' in red.
require('shelljs/global');
require('colors');
var AMBER_VERSION_COMMAND = './support/amber-cli.js version';
var amber... | Fix amber version smoke test - cannot test actual version | Fix amber version smoke test - cannot test actual version
Version presented by amber cli is the version of amber
it was compiled with, not version of amber-cli itself.
| JavaScript | mit | adrian-castravete/amber,adrian-castravete/amber,amber-smalltalk/amber,adrian-castravete/amber,amber-smalltalk/amber,amber-smalltalk/amber | ---
+++
@@ -4,18 +4,15 @@
require('shelljs/global');
require('colors');
-var JSON_PACKAGE_PATH = '../package.json'; // {amber directory}/external/amber-cli/package.json
var AMBER_VERSION_COMMAND = './support/amber-cli.js version';
var amberResult = exec("node " + AMBER_VERSION_COMMAND, {silent: true}).output;... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.