commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
6f39b2d81f2d6f57d44e6110f36e91d35a6fa022
models/balance_model.js
models/balance_model.js
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var ObjectId = mongoose.Schema.Types.ObjectId; var User = require("./user_model"); var Ledger = require("./ledger_model"); var Q = require("q"); var BalanceSchema = new Schema({ user_id: { type: ObjectId, index: true, ref: "User", require...
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var ObjectId = mongoose.Schema.Types.ObjectId; var User = require("./user_model"); var Ledger = require("./ledger_model"); var Wallet = require("./wallet_model"); var Currency = require("./currency_model"); var BalanceSchema = new Schem...
Make Balance get the balance from the Wallets instead of the db
Make Balance get the balance from the Wallets instead of the db
JavaScript
mit
10layer/jexpress,10layer/jexpress
c2d0957af557d583175ff03658f2fd53322e064c
src/main.js
src/main.js
require('./plugins'); var Backbone = require('backbone'); var Application = require('src/application/application'); var app = new Application(); app.module('modal', { moduleClass: require('src/modal/module'), container: app.layout.overlay }); app.module('header', { moduleClass: require('src/header/module'), ...
require('./plugins'); var Backbone = require('backbone'); var Marionette = require('backbone.marionette'); // start the marionette inspector if (window.__agent) { window.__agent.start(Backbone, Marionette); } var Application = require('src/application/application'); var app = new Application(); app.module('modal'...
Update Marionette Wires to work with the inspector
Update Marionette Wires to work with the inspector
JavaScript
isc
batpad/marionette-wires-tada,paulfalgout/marionette-strings,batpad/marionette-wires-tada,onelovelyname/marionette-wires,yuya-takeyama/marionette-wires,jkappers/marionette-wires,yuya-takeyama/marionette-wires,joshbedo/marionette-wires,thejameskyle/marionette-wires,thejameskyle/marionette-wires,jkappers/marionette-wires,...
3087a2fd6b38cff3f689f2dfabaffc6c182fa17c
src/apps/adviser/filters.js
src/apps/adviser/filters.js
const { get, includes } = require('lodash') function filterActiveAdvisers ({ advisers = [], includeAdviser = [] }) { includeAdviser = [...includeAdviser] return advisers.filter(adviser => { // This returns all active users plus the include advisor (whether they are active or not) return ( get(adviser...
const { get, includes, castArray, compact, } = require('lodash') function filterActiveAdvisers ({ advisers = [], includeAdviser }) { let adviserIds = compact(castArray(includeAdviser)) return advisers.filter(adviser => { // This returns all active users plus the include advisor (whether they are active...
Fix for when a user edits a Client Relationship Manager
Fix for when a user edits a Client Relationship Manager
JavaScript
mit
uktrade/data-hub-fe-beta2,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-frontend
793425e2bc9d7782470cd5f7d899c41c3dc060b3
addon/routes/course.js
addon/routes/course.js
import { inject as service } from '@ember/service'; import Route from '@ember/routing/route'; import { loadFroalaEditor } from 'ilios-common/utils/load-froala-editor'; export default class CourseRoute extends Route { @service permissionChecker; @service dataLoader; @service session; @service store; titleTok...
import { inject as service } from '@ember/service'; import Route from '@ember/routing/route'; import { loadFroalaEditor } from 'ilios-common/utils/load-froala-editor'; export default class CourseRoute extends Route { @service permissionChecker; @service dataLoader; @service session; @service store; titleTok...
Add Explicit Model Hook for Course
Add Explicit Model Hook for Course The implicit model behavior of ember now causes some deprecation warnings from ember-data so let's ensure we have a hook.
JavaScript
mit
ilios/common,ilios/common
d1382e381644ea93ad85c615d69eacaae9d89745
src/emoji/emojiMap.js
src/emoji/emojiMap.js
/* @flow */ /* eslint-disable */ import 'string.fromcodepoint'; import codePointMap from './codePointMap'; export const nameToEmojiMap = Object.keys(codePointMap).reduce((obj, key) => { obj[key] = String.fromCodePoint(parseInt(codePointMap[key], 16)); return obj; }, {}); export const codeToEmojiMap = Object.valu...
/* @flow */ /* eslint-disable */ import 'string.fromcodepoint'; import codePointMap from './codePointMap'; export const nameToEmojiMap = Object.keys(codePointMap).reduce((obj, name) => { obj[name] = String.fromCodePoint(parseInt(codePointMap[name], 16)); return obj; }, ({}: { [string]: string })); export const c...
Add types on Unicode-emoji mapmaking code.
emoji: Add types on Unicode-emoji mapmaking code. Sadly `Object.values` has a bogus type in Flow's definitions, returning `Array<mixed>`; the least-ugly solution I can find is to switch to `Object.keys`.
JavaScript
apache-2.0
vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile
a2e5c51d0b38509dc068ad802e4781c0b0e688fe
src/commands/diagnostics.js
src/commands/diagnostics.js
import { Diagnostics } from 'xdl'; import { print as envinfoPrint } from 'envinfo'; import simpleSpinner from '@expo/simple-spinner'; import log from '../log'; async function action(options) { log('Generating diagnostics report...'); log('You can join our slack here: https://slack.expo.io/.'); envinfoPrint();...
import { Diagnostics } from 'xdl'; import { print as envinfoPrint } from 'envinfo'; import chalk from 'chalk'; import simpleSpinner from '@expo/simple-spinner'; import log from '../log'; async function action(options) { log('Generating diagnostics report...'); log('You can join our slack here: https://slack.expo...
Use chalk for ANSI codes
Use chalk for ANSI codes fbshipit-source-id: 2b2b9f8
JavaScript
mit
exponentjs/exp
9a10fbdb43131835c105a69ef37db5f9fdf4452a
app/components/Help.js
app/components/Help.js
import React from 'react'; const Help = ({ activate }) => { return ( <button onClick={activate}>Help</button> ); }; export default Help;
import React from 'react'; import * as styles from './Home.scss'; const Help = ({ activate }) => { return ( <button className={styles.helpButton} onClick={activate}>Help</button> ); }; export default Help;
Add backgroun color to help button
Add backgroun color to help button
JavaScript
mit
ivtpz/brancher,ivtpz/brancher
9289c6bb63cbdf4b59ff179f935af9a106ee8ac6
test/app.js
test/app.js
var path = require('path'); var assert = require('yeoman-generator').assert; var helpers = require('yeoman-generator').test; describe('app', function () { before(function (done) { helpers .run(path.join(__dirname, '../generators/app')) .withOptions({skipInstall: true}) .on('end', done); }); ...
var path = require('path'); var assert = require('yeoman-generator').assert; var helpers = require('yeoman-generator').test; describe('app', function () { before(function (done) { helpers .run(path.join(__dirname, '../generators/app')) .withOptions({skipInstall: true}) .withPrompts({ 'm...
Fix test when license is not set
Fix test when license is not set
JavaScript
mit
ghaiklor/generator-es5-npm-module
438736068e10e6e9e620d27d803ed09d8d3233a0
src/ol/geom/flat/segments.js
src/ol/geom/flat/segments.js
/** * @module ol/geom/flat/segments */ /** * This function calls `callback` for each segment of the flat coordinates * array. If the callback returns a truthy value the function returns that * value immediately. Otherwise the function returns `false`. * @param {Array<number>} flatCoordinates Flat coordinates. ...
/** * @module ol/geom/flat/segments */ /** * This function calls `callback` for each segment of the flat coordinates * array. If the callback returns a truthy value the function returns that * value immediately. Otherwise the function returns `false`. * @param {Array<number>} flatCoordinates Flat coordinates. ...
Remove opt_this param in forEach function
Remove opt_this param in forEach function
JavaScript
bsd-2-clause
tschaub/ol3,geekdenz/ol3,geekdenz/openlayers,ahocevar/ol3,tschaub/ol3,stweil/openlayers,geekdenz/ol3,stweil/ol3,adube/ol3,openlayers/openlayers,ahocevar/ol3,bjornharrtell/ol3,oterral/ol3,openlayers/openlayers,geekdenz/openlayers,openlayers/openlayers,bjornharrtell/ol3,ahocevar/ol3,geekdenz/ol3,tschaub/ol3,ahocevar/open...
345432ac37b188d658da9e228772d459a28ea7a5
src/immutableThunk.js
src/immutableThunk.js
import deepEqual from 'deep-equal'; // `ImmutableThunk` may be used with virtual-dom/vnode. export default class ImmutableThunk { constructor(fn, args, equalArgs, equalRenders) { this.fn = fn; this.args = args; this.equalArgs = equalArgs || defaultEqualArgs; this.equalRenders = equalRenders...
import deepEqual from 'deep-equal'; // `ImmutableThunk` may be used with virtual-dom/vnode. export default class ImmutableThunk { type = 'Thunk'; constructor(fn, args, thunkProto = {}, equalArgs = undefined, equalRenders = undefined) { this.fn = fn; this.args = args; Object.keys(thunkProto)...
Enable to set up other ImmutableThunk's properties
Enable to set up other ImmutableThunk's properties
JavaScript
mit
kuraga/rotorjs,kuraga/rotorjs
64eb3a7bb20730001c4c47d7f2ed768ba2d7f90b
src/tray.js
src/tray.js
'use strict' void (function () { const remote = require('remote') const Tray = remote.require('tray') const Menu = remote.require('menu') const MenuItem = remote.require('menu-item') const dialog = remote.require('dialog') const ipc = require('ipc') const grunt = require('./lib/Grunt') // Set up tray ...
'use strict' void (function () { const remote = require('remote') const Tray = remote.require('tray') const Menu = remote.require('menu') const MenuItem = remote.require('menu-item') const dialog = remote.require('dialog') const ipc = require('ipc') const grunt = require('./lib/Grunt') // Set up tray ...
Make sure we can rebuild the menu
Make sure we can rebuild the menu
JavaScript
mit
jenslind/piglet,jenslind/piglet
631977019821deb26edd6fee5147be5e25872216
src/generators/textStyle.js
src/generators/textStyle.js
import defineClasses from '../util/defineClasses' export default function() { return defineClasses({ 'italic': { 'font-style': 'italic' }, 'normal': { 'font-style': 'normal' }, 'uppercase': { 'text-transform': 'uppercase' }, 'lowercase': { 'text-transform': 'lowercase' }, 'capitalize': { 'text-tr...
import defineClasses from '../util/defineClasses' export default function() { return defineClasses({ 'italic': { 'font-style': 'italic' }, 'not-italic': { 'font-style': 'normal' }, 'uppercase': { 'text-transform': 'uppercase' }, 'lowercase': { 'text-transform': 'lowercase' }, 'capitalize': { 'te...
Use more human names for text style utilities
Use more human names for text style utilities
JavaScript
mit
tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss
bd1b1f114945183c06dd7df2a49b7129a80a16ff
src/modules/Router.js
src/modules/Router.js
class GelatoRouter extends Backbone.Router { execute(callback, args, name) { if (this.page) { this.page.remove(); } this.trigger('navigate:before', args, name); callback && callback.apply(this, args); this.trigger('navigate:after', args, name); } isRunning() { return Backbone.Hist...
class GelatoRouter extends Backbone.Router { execute(callback, args, name) { if (this.page) { this.page.remove(); } this.trigger('navigate:before', args, name); callback && callback.apply(this, args); this.trigger('navigate:after', args, name); } getQueryString() { const location ...
Move query string function to router class
Move query string function to router class
JavaScript
mit
mcfarljw/backbone-gelato,jernung/gelato,mcfarljw/gelato-framework,jernung/gelato,mcfarljw/gelato-framework,mcfarljw/backbone-gelato
3fad62052135fb4fa6080bae9a84432a6111e070
src/js/containers/bkmrkd.js
src/js/containers/bkmrkd.js
import React from 'react' import { IndexLink, Link } from 'react-router' import { connect } from 'react-redux' import snippet from '../helpers/snippet' function bkmrkd (props) { return ( <div className='app container'> <header className='main-nav'> <h1 className='h1'>bkmrkd</h1> <nav> ...
import React, { PropTypes } from 'react' import { IndexLink, Link } from 'react-router' import { connect } from 'react-redux' import snippet from '../helpers/snippet' function bkmrkd (props) { return ( <div className='app container'> <header className='main-nav'> <h1 className='h1'>bkmrkd</h1> ...
Add props validation to stateless functions
Add props validation to stateless functions
JavaScript
mit
mike-engel/bkmrkd,mike-engel/bkmrkd,mike-engel/bkmrkd
5d64f4389b1d730f84e7f035a803d54bd5d815e0
browser/irc-command.js
browser/irc-command.js
const commands = { 'join': ['channel'], 'part': ['channel', 'message?'], 'ctcp': ['target', 'type', 'text'], 'action': ['target', 'message'], 'whois': ['nick'], 'list': [], }; export const CommandParser = { validateArgs(info, args) { if (info.length !== args.length && info.filter(s => s[s.len...
const commands = { 'join': ['channel'], 'part': ['channel', '?message'], 'ctcp': ['target', 'type', 'text'], 'action': ['target', 'message'], 'whois': ['nick'], 'list': [], }; export const CommandParser = { validateArgs(info, args) { return info.length === args.length || info.filter(s => s...
Make command argument validation clear.
Make command argument validation clear.
JavaScript
mit
noraesae/koko,noraesae/koko,alienxp03/koko,noraesae/koko,woss/koko,KokoIRC/koko,KokoIRC/koko,alienxp03/koko,hachibasu/koko,woss/koko,KokoIRC/koko,hachibasu/koko,alienxp03/koko,woss/koko,hachibasu/koko
154ff3dfd97f172b0e18c45f14c8fcf7ba744e79
src/api/albumApi.js
src/api/albumApi.js
import Promise from 'bluebird'; import request from 'superagent'; import assign from 'lodash/object/assign'; const API_BASE = 'https://api.getchute.com/v2'; export default { fetchAssets: (albumId, opts = {}) => { return new Promise((resolve, reject) => { const defs = { 'per_page': 20, 'pag...
import Promise from 'bluebird'; import request from 'superagent'; import assign from 'lodash/object/assign'; const API_BASE = 'https://api.getchute.com/v2'; export default { fetchAssets: (albumId, opts = {}) => { return new Promise((resolve, reject) => { const defs = { 'per_page': 20, 'pag...
Fix the problem with Chute's API not returning correct Content-Type.
Fix the problem with Chute's API not returning correct Content-Type.
JavaScript
mit
mareksuscak/surfing-gallery,mareksuscak/surfing-gallery
ea7ad10e8a2148cafecb026e0be9f5f7109ce95e
lib/generate/json/index.js
lib/generate/json/index.js
var util = require("util"); var path = require("path"); var Q = require("q"); var fs = require("../fs"); var parse = require("../../parse"); var BaseGenerator = require("../generator"); var Generator = function() { BaseGenerator.apply(this, arguments); }; util.inherits(Generator, BaseGenerator); Generator.proto...
var util = require("util"); var path = require("path"); var Q = require("q"); var fs = require("../fs"); var parse = require("../../parse"); var BaseGenerator = require("../generator"); var Generator = function() { BaseGenerator.apply(this, arguments); }; util.inherits(Generator, BaseGenerator); Generator.proto...
Add support for multi-languages books in JSON format
Add support for multi-languages books in JSON format
JavaScript
apache-2.0
xxxhycl2010/gitbook,iflyup/gitbook,gencer/gitbook,intfrr/gitbook,JohnTroony/gitbook,strawluffy/gitbook,minghe/gitbook,escopecz/documentation,ryanswanson/gitbook,lucciano/gitbook,JozoVilcek/gitbook,xiongjungit/gitbook,gaearon/gitbook,nycitt/gitbook,npracht/documentation,athiruban/gitbook,iamchenxin/gitbook,alex-dixon/gi...
f14c3b7c4d0036f60c0faf2941fbc561833b2cfb
DeleteBar.js
DeleteBar.js
/** * The "Delete bar" is the area at the top of the screen where you can drag * expressions to remove them. * * @flow */ import React from 'react'; import { Text, } from 'react-native'; import StatelessComponent from './StatelessComponent'; type DeleteBarProps = { isDraggingExpression: boolean, } export...
/** * The "Delete bar" is the area at the top of the screen where you can drag * expressions to remove them. * * @flow */ import React from 'react'; import { Text, View, } from 'react-native'; import Icon from 'react-native-vector-icons/MaterialIcons'; import StatelessComponent from './StatelessComponent...
Add styles for the delete bar
Add styles for the delete bar
JavaScript
mit
alangpierce/LambdaCalculusPlayground,alangpierce/LambdaCalculusPlayground,alangpierce/LambdaCalculusPlayground
147d3992e90b828b6bf1e5a710a49a799f2d6977
test/run.js
test/run.js
/** * Module dependencies. */ var jade = require('../') , fs = require('fs'); // test cases var cases = fs.readdirSync('test/cases').filter(function(file){ return ~file.indexOf('.jade'); }).map(function(file){ return file.replace('.jade', ''); }); cases.forEach(function(test){ var name = test.replace(/[-...
/** * Module dependencies. */ var jade = require('../') , fs = require('fs'); // test cases var cases = fs.readdirSync('test/cases').filter(function(file){ return ~file.indexOf('.jade'); }).map(function(file){ return file.replace('.jade', ''); }); cases.forEach(function(test){ var name = test.replace(/[-...
Make testing work on Windows
Make testing work on Windows
JavaScript
mit
jjz/jade,gdibble/jade,ilovezy/jade,cutsin/jade,andreytkachenko/jade,omixen/jade,muthhus/jade,muthhus/jade,harp/jade,tranhieutt/jade,andreytkachenko/jade,cutsin/jade,pugjs/then-jade,ridixcr/jade,angryrobot/jade,Laoujin/jade,derbyparty/derby-jade,Mitrend/jade,jodytate/jade,fredyteheranto/jade,hnag409/jade,cesarmarinhorj/...
04876f32ac6d549d5bb9fcc77f136c51efce0ad3
test/index.js
test/index.js
var chai = require('chai'), expect = chai.expect, sinon = require('sinon'), sinonChai = require("sinon-chai"); chai.use(sinonChai);
var chai = require('chai'), expect = chai.expect, sinon = require('sinon'), sinonChai = require("sinon-chai"); chai.use(sinonChai); var introject = require('../lib'); describe('injectDeps', function() { it('should properly inject deps', function() { var _add = function(a, b) { return a + b; }; ...
Add basic test for injectDeps
Add basic test for injectDeps
JavaScript
mit
elvinyung/introject
ca35ec488a07eb52fd85d5d6e99a99d38376921a
src/views/Tutorial.js
src/views/Tutorial.js
import React from 'react' import '../styles/video.css' const Tutorial = props => <div className='container'> <div className='row' style={{ marginBottom: 0 }}> <div className='col s12 valign-wrapper' style={{ minHeight: 'calc(100vh - 64px)' }} > <div style={{ width: '100%' }}> ...
import React, { Component } from 'react' import ReactDOM from 'react-dom' import '../styles/video.css' class Tutorial extends Component { constructor (props) { super(props) this.state = { topCoord: null } } componentDidMount () { const thisElement = ReactDOM.findDOMNode(this) const top ...
Fix scrollbar showing. Auto-calculate the pixels inside calc().
Fix scrollbar showing. Auto-calculate the pixels inside calc(). The scrollbar fix is actually just line 21
JavaScript
mit
planigan/resource-center,planigan/resource-center,fus-marcom/resource-center,fus-marcom/resource-center
453cfd8ac2435e3af02181d1543d0b43c37d9d93
Gruntfile.js
Gruntfile.js
module.exports = function(grunt) { grunt.initConfig({ copy: { main: { src: [ 'assets/**', '!assets/*/src/**', '!assets/*/src', 'inc/**', 'languages/**', 'CHANGELOG.md', 'schemify.php', 'LICENSE.md', 'readme.txt' ], dest: 'dist/' }, }, makepot: { ...
module.exports = function(grunt) { grunt.initConfig({ copy: { main: { src: [ 'assets/**', '!assets/*/src/**', '!assets/*/src', 'includes/**', 'languages/**', 'CHANGELOG.md', 'composer.json', 'LICENSE.md', 'readme.txt', 'schemify.php' ], dest: 'dist/' ...
Include composer.json in the WP distribution, to help WP-Packagist
Include composer.json in the WP distribution, to help WP-Packagist
JavaScript
mit
stevegrunwell/schemify,stevegrunwell/schemify,stevegrunwell/schemify
97cad04065ca86a8d35fbd2cf376b0b85b8453da
Gruntfile.js
Gruntfile.js
'use strict'; module.exports = function(grunt) { // Load tasks grunt.loadNpmTasks('grunt-wiredep'); grunt.loadNpmTasks('grunt-jslint'); grunt.loadNpmTasks('grunt-jscoverage'); grunt.loadNpmTasks('grunt-mocha-test'); grunt.loadNpmTasks('grunt-coveralls'); grunt.initConfig({ wiredep: ...
'use strict'; module.exports = function(grunt) { // Load tasks grunt.loadNpmTasks('grunt-wiredep'); grunt.loadNpmTasks('grunt-jslint'); grunt.loadNpmTasks('grunt-jscoverage'); grunt.loadNpmTasks('grunt-mocha-test'); grunt.loadNpmTasks('grunt-coveralls'); grunt.initConfig({ wiredep: ...
Make so that grunt test is more human readable and in travis use grunt travis that do coveralls
Make so that grunt test is more human readable and in travis use grunt travis that do coveralls
JavaScript
mit
Cultti/copy-and-paste-server,Cultti/copy-and-paste-server
098e137a8b305de47ce3b5aa54653dd78b6308d0
Gruntfile.js
Gruntfile.js
/* * grunt-contrib-jshint * http://gruntjs.com/ * * Copyright (c) 2015 "Cowboy" Ben Alman, contributors * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { grunt.initConfig({ jshint: { files: ['Gruntfile.js', 'tasks/**/*.js', 'test/**/*.js'], options: { ...
/* * grunt-contrib-jshint * http://gruntjs.com/ * * Copyright (c) 2015 "Cowboy" Ben Alman, contributors * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { grunt.initConfig({ jshint: { files: ['Gruntfile.js', 'tasks/**/*.js', 'test/**/*.js'], options: { ...
Work around issue with coveralls lib.
Work around issue with coveralls lib.
JavaScript
mit
jacob-meacham/grunt-lcov-merge
c226eea75c334aff6938b93773795225cb52d9da
Gruntfile.js
Gruntfile.js
var tm = require('task-master'); module.exports = function(grunt) { tm(grunt, { jit: { travis: 'grunt-travis-matrix', matrix: 'grunt-travis-matrix', mochacov: 'grunt-mocha-cov' } }); grunt.registerTask('mocha', ['mochaTest:test']); grunt.registerTask('default', ['jshint:all', 'mocha',...
var tm = require('task-master'); module.exports = function(grunt) { tm(grunt, { jit: { travis: 'grunt-travis-matrix', matrix: 'grunt-travis-matrix', mochacov: 'grunt-mocha-cov' } }); grunt.registerTask('mocha', ['mochaTest:test']); grunt.registerTask('default', ['browserify:paths', 'j...
Add target to browserify tasks for thoroughness
Add target to browserify tasks for thoroughness
JavaScript
mit
tandrewnichols/expand-path
ffb47027cd5415d13fa1f42c933996887fa06fd6
Gruntfile.js
Gruntfile.js
module.exports = function(grunt) { grunt.initConfig( { pkg: grunt.file.readJSON('package.json'), shell: { rebuild: { command: 'npm install --build-from-source' }, benchmarkNode: { command: 'node benchmark/node/benchmark.js' }, startServer: {...
module.exports = function(grunt) { grunt.initConfig( { pkg: grunt.file.readJSON('package.json'), shell: { rebuild: { command: 'npm install --build-from-source' }, benchmarkNode: { command: 'node benchmark/node/benchmark.js' }, startServer: {...
Reduce gemfire server logging to warning
Reduce gemfire server logging to warning
JavaScript
bsd-2-clause
gemfire/node-gemfire,mross-pivotal/node-gemfire,mross-pivotal/node-gemfire,mross-pivotal/node-gemfire,mross-pivotal/node-gemfire,gemfire/node-gemfire,gemfire/node-gemfire,mross-pivotal/node-gemfire,gemfire/node-gemfire,gemfire/node-gemfire,gemfire/node-gemfire,mross-pivotal/node-gemfire
64dace7072b2cbce6efec72a8cf0d2be4f20d4f3
gatsby-browser.js
gatsby-browser.js
/** * Implement Gatsby's Browser APIs in this file. * * See: https://www.gatsbyjs.org/docs/browser-apis/ */ // You can delete this file if you're not using it
/** * Implement Gatsby's Browser APIs in this file. * * See: https://www.gatsbyjs.org/docs/browser-apis/ */ exports.onInitialClientRender(() => { require("intersection-observer") })
Bring back the intersection observer polyfill
Bring back the intersection observer polyfill Why: * Apparently we need it. Ask Justo.
JavaScript
mit
subvisual/subvisual.co,subvisual/subvisual.co
0231286cedf5ea1bdef3dba838c04d9460f632af
test/entries_tests.js
test/entries_tests.js
const chai = require('chai') const expect = chai.expect const chaiHttp = require('chai-http') chai.use(chaiHttp) const express = require('express') const memstore = require('../database/memstore') const entries = require('../app/routes/entries') describe('Entries', () => { var store var app beforeEach(() => ...
const chai = require('chai') const expect = chai.expect const chaiHttp = require('chai-http') chai.use(chaiHttp) const express = require('express') const memstore = require('../database/memstore') const entries = require('../app/routes/entries') function allowErrorResponse(allowedErrors, promise) { return promise....
Add test to check for error from a router
Add test to check for error from a router Figured out a way to handle error replies from the router when testing with async/await.
JavaScript
mit
mhallendal/node-todo-backend,mhallendal/node-todo-backend
6e6e6eba37dccd220fdd38e6a8c59db60c3304e8
test/js/TinCanTest.js
test/js/TinCanTest.js
/*! Copyright 2013 Rustici Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
/*! Copyright 2013 Rustici Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
Correct unit test assertion for XHR object
Correct unit test assertion for XHR object
JavaScript
apache-2.0
nagyistoce/TinCanJS,EdDixon/TinCanJS,RusticiSoftware/TinCanJS,garemoko/TinCanJS,EdDixon/TinCanJS,garyfeng/TinCanJS,garemoko/TinCanJS,garyfeng/TinCanJS,brianjmiller/TinCanJS,RusticiSoftware/TinCanJS,brianjmiller/TinCanJS,GrahamGoudeau21/TinCanJS,GrahamGoudeau21/TinCanJS,nagyistoce/TinCanJS,FishHooks/TinCanJS,uOttawaMedt...
cbb4608e1923f50d179d4b294b416de917449e81
tasks/fontello_svg.js
tasks/fontello_svg.js
/* * grunt-fontello-svg * https://github.com/chimo/grunt-fontello-svg * * Copyright (c) 2014 chimo * Licensed under the MIT license. */ 'use strict'; var fontello_svg = require('fontello-svg'); module.exports = function(grunt) { // Please see the Grunt documentation for more information regarding task // ...
/* * grunt-fontello-svg * https://github.com/chimo/grunt-fontello-svg * * Copyright (c) 2014 chimo * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { var fontello_svg = require('fontello-svg'); grunt.registerMultiTask('fontello_svg', 'Generate the SVG versions of a Fontel...
Remove dead code, add default options
Remove dead code, add default options
JavaScript
mit
chimo/grunt-fontello-svg
8aece91426c2ad013b2cd2f1b0ea58ec26d4067a
.eslintrc.js
.eslintrc.js
/* * Copyright (c) 2014-2021 Bjoern Kimminich. * SPDX-License-Identifier: MIT */ module.exports = { extends: 'standard-with-typescript', env: { browser: true, node: true, jasmine: true, mocha: true, protractor: true }, globals: { Atomics: 'readonly', SharedArrayBuffer: 'readonly'...
/* * Copyright (c) 2014-2021 Bjoern Kimminich. * SPDX-License-Identifier: MIT */ module.exports = { extends: 'standard-with-typescript', env: { browser: true, node: true, jasmine: true, mocha: true, protractor: true }, globals: { Atomics: 'readonly', SharedArrayBuffer: 'readonly'...
Change @typescript-eslint errors to warnings
Change @typescript-eslint errors to warnings Signed-off-by: Ziyang Li <261a482ee4a4e19131e4e3f6a4a8d274da8aaeca@me.com>
JavaScript
mit
bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop
e112ab015f095bc6b1a3c937dce0e243f21114d7
test-e2e/Dashboard.js
test-e2e/Dashboard.js
module.exports = { 'Test for component appears on the screen': function (browser) { browser .url('http://localhost:8080/') .waitForElementVisible('body', 1000) .assert.containsText('body', 'Dashboard') .end(); } };
module.exports = { 'Test for component appears on the screen': function (browser) { browser .url('http://localhost:8080/') .waitForElementVisible('body', 1000) .assert.containsText('body', 'in-flux/component-router') .end(); } };
Update e2e test for new content
Update e2e test for new content
JavaScript
mit
nkbt/dashboard,nkbt/dashboard
f69220f557e100b6a9f57738290655372422ecb6
.eslintrc.js
.eslintrc.js
// XXX: To uniform the style of an object literals, we enable `quote-props` /*eslint quote-props: [2, "always"] no-magic-numbers: 0 */ 'use strict'; /** * Test ourself :) */ module.exports = { // Load all configs managed in this project // to check them by schemes by theirs. 'extends': [ './co...
// XXX: To uniform the style of an object literals, we enable `quote-props` /*eslint quote-props: [2, "always"] no-magic-numbers: 0 */ 'use strict'; /** * Test ourself :) */ module.exports = { // Load all configs managed in this project // to check them by schemes by theirs. 'extends': [ './co...
Add parserOptions explicitly for this project
Add parserOptions explicitly for this project
JavaScript
mit
saneyuki/eslint-config-fluct,voyagegroup/eslint-config-fluct
3edb03228dab116c3fabdd14499367bbda648475
app/index.js
app/index.js
#!/usr/bin/env node 'use strict'; var path = require('path'); var express = require('express'); var controllers = require('./controllers');
#!/usr/bin/env node 'use strict'; var path = require('path'); var express = require('express'); var app = express(); var controllers = require('./controllers'); app.set('port', parseInt(process.env.NODE_PORT)); app.set('views', path.jon(__dirname, 'views')); app.set('view engine', 'jade'); app.use(express.favicon())...
Implement middlewares to use in app.
[change] Implement middlewares to use in app.
JavaScript
mit
joaodubas/nodejs-meetup-app
f689c0e74ac2b42e3a84e338f227400aa3d5209c
.eslintrc.js
.eslintrc.js
module.exports = { parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true }, }, extends: 'airbnb', env: { node: true, commonjs: true, mocha: true, es6: true }, rules: { strict: [0, 'global'], // required for node, configurable for browser, https://github.com/eslint/...
module.exports = { parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true }, }, extends: 'airbnb', env: { node: true, commonjs: true, mocha: true, es6: true }, /** * {@link https://github.com/benmosher/eslint-plugin-import/issues/275} * {@link https://github.com/...
Add 'electron' to ESLint configuration.
Add 'electron' to ESLint configuration.
JavaScript
mit
MRN-Code/coinstac,MRN-Code/coinstac,MRN-Code/coinstac
20464c8fb2189749514383e572a061097802c523
tasks/helpers/tracker-helper.js
tasks/helpers/tracker-helper.js
import axios from 'axios'; const ignoredStories = ['151262175', '148077489', '151620080']; function url(storyNumber) { return `https://www.pivotaltracker.com/services/v5/projects/1126018/stories/${storyNumber}`; } const privates = new WeakMap(); export default class TrackerHelper { constructor(trackerToken) { ...
import axios from 'axios'; const ignoredStories = ['151262175', '148077489', '151620080', '150190185', '153578787']; function url(storyNumber) { return `https://www.pivotaltracker.com/services/v5/projects/1126018/stories/${storyNumber}`; } const privates = new WeakMap(); export default class TrackerHelper { con...
Add ignored stories that come from Apps Manager tracker
Add ignored stories that come from Apps Manager tracker Signed-off-by: Steven Locke <baaff752d2ae0b1c8049cab727257de91dfbb71f@pivotal.io>
JavaScript
mit
pivotal-cf/pivotal-ui,pivotal-cf/pivotal-ui,pivotal-cf/pivotal-ui
9922c37c48162a9f38f02f6cbbdc03a87f6f473e
addon/helpers/md-remarkable.js
addon/helpers/md-remarkable.js
import Ember from 'ember'; import Remarkable from 'remarkable'; export function mdRemarkable(markdownInput) { var md = new Remarkable(); return new Ember.Handlebars.SafeString(md.render(markdownInput)); } export default Ember.Handlebars.makeBoundHelper(mdRemarkable);
import Ember from 'ember'; import Remarkable from 'remarkable'; export function mdRemarkable(markdownInput) { var md = new Remarkable(); return new Ember.Handlebars.SafeString(md.render(markdownInput)); } export default Ember.Helper.helper(mdRemarkable);
Fix compatibility with ember 2
Fix compatibility with ember 2
JavaScript
mit
maciek134/ember-remarkable,johnotander/ember-remarkable,maciek134/ember-remarkable,johnotander/ember-remarkable
25f81203cd4e9dad01e57e6c94e327e858f7d131
lib/hooks/cors/set-preflight-config.js
lib/hooks/cors/set-preflight-config.js
/** * Module dependencies. */ var _ = require('lodash'); var pathToRegexp = require('path-to-regexp'); /** * @optional {Dictionary} _routeCorsConfig * * @optional {Boolean} isOptionsRoute * if set, use the `access-control-request-method` header * as the method when looking up the route...
/** * Module dependencies. */ var _ = require('lodash'); var pathToRegexp = require('path-to-regexp'); /** * @optional {Dictionary} _routeCorsConfig * * @optional {Boolean} isOptionsRoute * if set, use the `access-control-request-method` header * as the method when looking up the route...
Fix preflight fn to match request path against preflight config path, not the other way around
Fix preflight fn to match request path against preflight config path, not the other way around
JavaScript
mit
rlugojr/sails,rlugojr/sails,balderdashy/sails
faa7e34d919848b9e591ad2a5d47a0793d02c62f
conf/mime-types.js
conf/mime-types.js
"use strict"; /** MIME type definitions consisting of those in `mime-db` plus custom additions and overrides. See <https://github.com/jshttp/mime-db> for details on the format. **/ const db = require('mime-db'); // If you add a new type here, make sure its extensions are also in the // extension whitelist in ./inde...
"use strict"; /** MIME type definitions consisting of those in `mime-db` plus custom additions and overrides. See <https://github.com/jshttp/mime-db> for details on the format. **/ const db = require('mime-db'); // If you add a new type here, make sure its extensions are also in the // extension whitelist in ./inde...
Use `application/x-bat` MIME type for .bat extension
Use `application/x-bat` MIME type for .bat extension Fixes #121.
JavaScript
mit
rgrove/rawgit,rgrove/rawgit
b3f82917dfe9b3c59a2a20b95430234511fc4ed1
lib/clean-host.js
lib/clean-host.js
var URL = require('url'); /** * Utility to cleanup the base host value. Also removes url fragments. * * Works for: * - hostname * - //hostname * - scheme://hostname * - scheme+scheme://hostname * * @param {string} value * @return {String} */ // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) var h...
var URL = require('url'); /** * Utility to cleanup the base host value. Also removes url fragments. * * Works for: * - hostname * - //hostname * - scheme://hostname * - scheme+scheme://hostname * * @param {string} value * @return {String} */ // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) var h...
Use String.prototype.trim() in favour of RegExp to trim a value
Use String.prototype.trim() in favour of RegExp to trim a value
JavaScript
mit
oncletom/tld.js
629b6dde6eda31c0a99747dde19403da60c70c56
SenchaFront/app/view/Main.js
SenchaFront/app/view/Main.js
Ext.define('SenchaFront.view.Main', { extend: 'Ext.NavigationView', xtype: 'main', requires: [ 'Ext.plugin.ListSwipeAction', 'Ext.dataview.List' ], config: { ui: 'sencha', fullscreen: true, id: 'navigationView', items: [ { t...
Ext.define('SenchaFront.view.Main', { extend: 'Ext.NavigationView', xtype: 'main', requires: [ 'Ext.plugin.ListSwipeAction', 'Ext.dataview.List' ], config: { ui: 'sencha', fullscreen: true, id: 'navigationView', items: [ { t...
Add id to navigation bar and removed unnecessary spacer
Add id to navigation bar and removed unnecessary spacer
JavaScript
mit
CEPFU/sencha-front,CEPFU/sencha-front,CEPFU/sencha-front,CEPFU/sencha-front
ff2434eed158e8b0b05e078ba73e093ad56458dd
bot.js
bot.js
const botBuilder = require('claudia-bot-builder') const telegramTemplate = require('claudia-bot-builder').telegramTemplate const request = require('minimal-request-promise') // Searx instance hosted by the non-profit association La Quadrature du Net const defaultInstance = 'https://searx.laquadrature.net/' const sear...
const botBuilder = require('claudia-bot-builder') const telegramTemplate = require('claudia-bot-builder').telegramTemplate const request = require('minimal-request-promise') // Searx instance hosted by the non-profit association La Quadrature du Net const defaultInstance = 'https://searx.laquadrature.net/' const sear...
Replace search loop with mapping function and general improvements.
Replace search loop with mapping function and general improvements.
JavaScript
agpl-3.0
fuerbringer/searxbot
758ff8246dd94d3c4864010b28dea2a490d394d7
src/scenes/artist-wizard.js
src/scenes/artist-wizard.js
const { Markup } = require('telegraf'); const { WizardScene } = require('telegraf-flow'); const artistWizard = new WizardScene('artistWizard', (ctx) => { ctx.reply( 'Send me the artist name please', Markup.removeKeyboard().extra() ); ctx.flow.wizard.next(); }, (ctx, next) => { if (ctx...
const { Markup } = require('telegraf'); const { WizardScene } = require('telegraf-flow'); const backButton = [ '⬅️ Back' ]; const backKeyboard = Markup .keyboard(backButton) .resize() .extra(); const artistWizard = new WizardScene('artistWizard', (ctx) => { ctx.reply('Send me the artist name please', b...
Add "Back" button to artist wizard
Add "Back" button to artist wizard
JavaScript
mit
TheBeastOfCaerbannog/last-fm-bot
3cd3401bf91573e5f495825b22a00f463222289e
frontend/app/js/views/list_notifications.js
frontend/app/js/views/list_notifications.js
exercism.views.ListNotifications = Backbone.View.extend({ template: JST["app/templates/list_notifications.us"], id: "list-notifications", initialize: function(options) { this.listenTo(this.collection, 'add', this.addOne); }, render: function() { this.$el.html(this.template()); return this; },...
exercism.views.ListNotifications = Backbone.View.extend({ template: JST["app/templates/list_notifications.us"], id: "list-notifications", initialize: function(options) { this.listenTo(this.collection, 'add', this.addOne); }, render: function() { this.$el.html(this.template()); return this; },...
Remove stray console.logs that were totally there on purpose
Remove stray console.logs that were totally there on purpose
JavaScript
agpl-3.0
treiff/exercism.io,mscoutermarsh/exercism_coveralls,mhelmetag/exercism.io,RaptorRCX/exercism.io,copiousfreetime/exercism.io,IanDCarroll/exercism.io,treiff/exercism.io,mscoutermarsh/exercism_coveralls,chastell/exercism.io,kizerxl/exercism.io,RaptorRCX/exercism.io,chastell/exercism.io,mhelmetag/exercism.io,mscoutermarsh/...
e18ede905a3b32c13ab08a5aae5139f91cbd57de
src/dataMigration.js
src/dataMigration.js
import packageJson from '../package.json'; import compareVersions from 'semver-compare'; import { SETTINGS_KEYS } from './settings'; export function migrateDataToVersion(database, settings) { let fromVersion = settings.get(SETTINGS_KEYS.APP_VERSION); if (!fromVersion || fromVersion.length === 0) fromVersion = '0.0...
import packageJson from '../package.json'; import compareVersions from 'semver-compare'; import { SETTINGS_KEYS } from './settings'; export function migrateDataToVersion(database, settings) { // Get the current version we are upgrading from let fromVersion = settings.get(SETTINGS_KEYS.APP_VERSION); // If no is v...
Clarify how to perform future migrations
Clarify how to perform future migrations
JavaScript
mit
sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile
215530c5ee2760b4d4aebe702e642d13ebc83a5e
lib/rules_inline/newline.js
lib/rules_inline/newline.js
// Proceess '\n' 'use strict'; module.exports = function newline(state, silent) { var pmax, max, pos = state.pos; if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; } pmax = state.pending.length - 1; max = state.posMax; // ' \n' -> hardbreak // Lookup in pending chars is bad practice! Don...
// Proceess '\n' 'use strict'; module.exports = function newline(state, silent) { var pmax, max, pos = state.pos; if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; } pmax = state.pending.length - 1; max = state.posMax; // ' \n' -> hardbreak // Lookup in pending chars is bad practice! Don...
Improve end-of-line space removal performance
Improve end-of-line space removal performance The performance impact of the previous method was only felt on excessively large lines of empty space surrounded by words. i.e. 'a b \n' but with 20k spaces between a and b.
JavaScript
mit
jonschlinkert/remarkable,PKRoma/remarkable
884a32e257c972f15ee1fb57359188cfa194085e
scripts/trelloDate.js
scripts/trelloDate.js
$(document).ready(function () { // Current date var d = new Date(), month = d.getMonth() + 1, day = d.getDate(), year = d.getYear(); // trello date badge classes // is-due-past, is-due-now, is-due-soon, is-due-future var trelloBoard = $('#board'); trelloBoard.find('....
$(document).ready(function () { var currentDate = new Date(), month = currentDate.getMonth() + 1, day = currentDate.getDate(), year = currentDate.getFullYear(); // Reset to get 00:00:00 currentDate = new Date(month + ' ' + day + ' ' + year); var smallDateRegex = /^[\s]*[\d]{1,2}[...
Test retrive, convert and compare dates
Test retrive, convert and compare dates
JavaScript
mit
MGApcDev/Trello-Enhanced-Date,MGApcDev/Trello-Enhanced-Date
ee248f9a57af246e77793c4136ebdcb455dffcfb
userscript/src/api.js
userscript/src/api.js
import { HUB } from './hub'; import config from './config'; export function post (apiUrl, data) { const payload = JSON.stringify(data); const url = config.API_ROOT + apiUrl; GM_xmlhttpRequest({ method: 'POST', url: url, headers: { 'Content-Type': 'application/json', ...
import { HUB } from './hub'; import config from './config'; export function post (apiUrl, data) { const payload = JSON.stringify(data); const url = config.API_ROOT + apiUrl; GM_xmlhttpRequest({ method: 'POST', url: url, headers: { 'Content-Type': 'application/json', ...
Add comment to send func
Add comment to send func
JavaScript
agpl-3.0
tracking-exposed/facebook,tracking-exposed/facebook
6c74926b339864b648ac428f470dec44b555c28f
app/actions.js
app/actions.js
include('ringo/webapp/response'); exports.index = function index(req) { return skinResponse('skins/chat.html', { title: "CometD Chat (RingoJS version)", contextPath: req.rootPath.slice(1) }); };
var {Response} = require('ringo/webapp/response'); exports.index = function index(req) { return Response.skin('skins/chat.html', { title: "CometD Chat (RingoJS version)", contextPath: req.rootPath.slice(1) }); };
Update to current response module
Update to current response module
JavaScript
mit
garryyao/ringo-cometd-chat
3677dc9a8b5b5d2572d8eaba621360afa94df7e3
services/web/public/es/rich-text.js
services/web/public/es/rich-text.js
import CodeMirror, { Doc } from 'codemirror' import LatexParser from './ide/editor/codemirror/parser' export function init (rootEl) { CodeMirror.defineMode('latex', () => new LatexParser()) CodeMirror.defineMIME('application/x-tex', 'latex') CodeMirror.defineMIME('application/x-latex', 'latex') return CodeMi...
import CodeMirror, { Doc } from 'codemirror' import LatexMode from './ide/editor/codemirror/LatexMode' export function init (rootEl) { CodeMirror.defineMode('latex', () => new LatexMode()) CodeMirror.defineMIME('application/x-tex', 'latex') CodeMirror.defineMIME('application/x-latex', 'latex') return CodeMir...
Rename to use CM naming consistently
Rename to use CM naming consistently
JavaScript
agpl-3.0
sharelatex/sharelatex
7c21fd83672713f12b44e3adec676d3b31276822
src/backend/worker.js
src/backend/worker.js
import { errors } from "./lib/gcloud"; import * as store from "./lib/store"; import * as taskQueue from "./lib/taskqueue"; import * as resolve from "./lib/resolve"; taskQueue.subscribe("trap-topic", "trap-subscription", (err, msg) => { if (err) { return errors.report(err); } const data = msg.data; if (!d...
import { errors } from "./lib/gcloud"; import net from "net"; import { URL } from "url"; import request from "request"; import * as store from "./lib/store"; import * as taskQueue from "./lib/taskqueue"; import * as resolve from "./lib/resolve"; const WHEREABOUTS_URL = process.env.WHEREABOUTS_URL || "http://localhost:...
Resolve IP geolocations with hownetworks/whereabouts
Resolve IP geolocations with hownetworks/whereabouts
JavaScript
mit
HowNetWorks/uriteller
ff97d553a284a4cc9e3700a8c561e1ec3ea44593
Gruntfile.js
Gruntfile.js
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), compress: { main: { options: { archive: 'Geocaching_Utils.zip' }, files: [ { src: ['source/**'], dest: '' } ] } ...
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), compress: { main: { options: { archive: 'GeocachingUtils_<%= pkg.version %>.zip' }, files: [ { src: ['source/**'], dest: '' } ...
Include version from package.json in build output file name
Include version from package.json in build output file name
JavaScript
mpl-2.0
ControlTheBit/geocachingUtils,ControlTheBit/geocachingUtils
d0912954f22575d8189e0b5bcbf1ecd8867b1559
Gruntfile.js
Gruntfile.js
'use strict'; module.exports = function (grunt) { // Show elapsed time at the end require('time-grunt')(grunt); // Load all grunt tasks require('load-grunt-tasks')(grunt); // Project configuration. grunt.initConfig({ mochacli: { src: ['test/*.js'], options: { globals: ['cha...
'use strict'; module.exports = function (grunt) { // Show elapsed time at the end require('time-grunt')(grunt); // Load all grunt tasks require('load-grunt-tasks')(grunt); // Project configuration. grunt.initConfig({ mochaTest: { test: { src: ['test/*.js'], options: { g...
Change test task and add code style tasks
Change test task and add code style tasks
JavaScript
mit
mcanthony/CommonRegexJS,talyssonoc/CommonRegexJS,mcanthony/CommonRegexJS,talyssonoc/CommonRegexJS
d04c8ed55bc58c45bb14234efd5d43f21f426403
test/support/test_helper.js
test/support/test_helper.js
/** * User: simon * Date: 30/08/2011 * Time: 13:52 * Desc: Loads test specific variables */ var _ = require('underscore'); // set environment specific variables global.settings = require(__dirname + '/../../config/settings'); global.environment = require(__dirname + '/../../config/environments/test'); _.ext...
/** * User: simon * Date: 30/08/2011 * Time: 13:52 * Desc: Loads test specific variables */ var _ = require('underscore'); // set environment specific variables global.settings = require(__dirname + '/../../config/settings'); global.environment = require(__dirname + '/../../config/environments/test'); _.ext...
Set NODE_ENV env variable to 'test' during testsuite
Set NODE_ENV env variable to 'test' during testsuite Hushes millstone debugging output
JavaScript
bsd-3-clause
wsw0108/Windshaft,HydroLogic/Windshaft,manueltimita/Windshaft,manueltimita/Windshaft,CartoDB/Windshaft,CartoDB/Windshaft,CartoDB/Windshaft,HydroLogic/Windshaft,manueltimita/Windshaft,wsw0108/Windshaft,HydroLogic/Windshaft,wsw0108/Windshaft
721a03dadef0689d5a31eba91f1264a6affbb120
GoBug/app/assets/javascripts/trip.js
GoBug/app/assets/javascripts/trip.js
$(document).ready(function(){ console.log("ready") $('form').on('click','.remove_fields', function(event){ event.preventDefault(); $(this).prev('input[type=hidden]').val('1'); $(this).closest('fieldset').hide(); }); $('form').on('click','.add_fields', function(event){ event.preventDefault(); ...
$(document).ready(function(){ console.log("ready") $('form').on('click','.remove_fields', function(event){ event.preventDefault(); $(this).prev('input[type=hidden]').val('1'); $(this).closest('fieldset').hide(); }); $('form').on('click','.add_fields', function(event){ event.preventDefault(); ...
Clear input fields properly after submitting form
Clear input fields properly after submitting form
JavaScript
mit
mud-turtles-2014/GoBug,mud-turtles-2014/GoBug
cf3bafeb818754cffb748802147df992ced3f0a0
Lesson9/http/js/app.js
Lesson9/http/js/app.js
angular.module('app', []).controller('AppCtrl', function ($scope, $http) { $scope.results = []; $scope.loadUsers = function() { $http.get('/elements') .success(function(data) { $scope.results = data; }) .error(function(err) { $scope.results = err; }); } $scope.clickElement = function (elemen...
angular.module('app', []).controller('AppCtrl', function ($scope, $http) { $scope.results = []; $scope.loadUsers = function() { $http.get('/elements') .success(function(data) { $scope.results = data; }) .error(function(err) { $scope.results = err; }); } $scope.clickElement = function (elemen...
Refactor put method for elements
Refactor put method for elements
JavaScript
mit
dajvido/NAJ-homework,dajvido/NAJ-homework
0f327f6d14075386019fe0881ea27bf27adf6dc6
Gruntfile.js
Gruntfile.js
module.exports = function(grunt) { 'use strict'; // Add the grunt-mocha-test tasks. grunt.loadNpmTasks('grunt-mocha-test'); // Project configuration. grunt.initConfig({ jshint: { all: ['Gruntfile.js', 'index.js', 'test/*.js'], options: { jshintrc: '....
module.exports = function(grunt) { 'use strict'; // Project configuration. grunt.initConfig({ jshint: { all: ['Gruntfile.js', 'index.js', 'test/*.js'], options: { jshintrc: '.jshintrc' } }, mochaTest: { test: { ...
Remove unreliable integration tests from automated testing
Remove unreliable integration tests from automated testing
JavaScript
mit
whiteout-io/imap-client,dopry/imap-client,whiteout-io/imap-client,dopry/imap-client
c695c5b60f638ea803ca82110841ef5bb7b7133c
server/validations/project.js
server/validations/project.js
const Joi = require('joi'); const PARAMS = { name: Joi.string().required() }; const PAYLOAD = { name: Joi.string().required(), maintainers: Joi.array(), description: Joi.string(), hasLicense: Joi.boolean(), hasLinter: Joi.boolean(), hasReadme: Joi.boolean(), engines: { npm: Joi.string(), node:...
const Joi = require('joi'); const PARAMS = { name: Joi.string().required() }; const PAYLOAD = { name: Joi.string().required(), maintainers: Joi.array(), description: Joi.string(), hasLicense: Joi.boolean(), hasLinter: Joi.boolean(), hasReadme: Joi.boolean(), engines: { npm: Joi.string(), node:...
Add validation rules for limit, offset, and sorting
Add validation rules for limit, offset, and sorting
JavaScript
mit
onmodulus/demographics
cbd0bbb643428f0b566822c2fbc29e2ba8a7fc46
web/static/js/prop_types.js
web/static/js/prop_types.js
// // Reusable, domain-specific prop types // import PropTypes from "prop-types" import STAGES from "../js/configs/stages" import { CATEGORIES as startingCategories } from "../js/configs/retro_configs" const { LOBBY, PRIME_DIRECTIVE, IDEA_GENERATION, VOTING, ACTION_ITEMS, CLOSED } = STAGES export const alert = Prop...
// // Reusable, domain-specific prop types // import PropTypes from "prop-types" import STAGES from "../js/configs/stages" import { CATEGORIES as startingCategories } from "../js/configs/retro_configs" const { LOBBY, PRIME_DIRECTIVE, IDEA_GENERATION, VOTING, ACTION_ITEMS, CLOSED } = STAGES export const alert = Prop...
Remove outdated (React) prop shape property; we no longer aggregate idea w/ user
Remove outdated (React) prop shape property; we no longer aggregate idea w/ user
JavaScript
mit
samdec11/remote_retro,stride-nyc/remote_retro,stride-nyc/remote_retro,stride-nyc/remote_retro
45f726ba254bf6a926997cc4d530c14c8dd7594b
config/setupFile.js
config/setupFile.js
import {jsdom} from 'jsdom';
import {jsdom} from 'jsdom'; // this adds the ability to change the dom size when testing components that render // differently for different dom sizes const documentHTML = '<!doctype html><html><body><div id="root"></div></body></html>'; global.document = jsdom(documentHTML); global.window = document.parentWindow; g...
Update old tests, add tests for utils and DataPackList
Update old tests, add tests for utils and DataPackList
JavaScript
bsd-3-clause
venicegeo/eventkit-cloud,terranodo/eventkit-cloud,venicegeo/eventkit-cloud,venicegeo/eventkit-cloud,terranodo/eventkit-cloud,venicegeo/eventkit-cloud,terranodo/eventkit-cloud,venicegeo/eventkit-cloud,venicegeo/eventkit-cloud,terranodo/eventkit-cloud
11766730c600c81dbd15c68b05dd5f15af668bc6
src/commands/deleteStack.js
src/commands/deleteStack.js
import inquirer from 'inquirer' function deleteStack (cloudformation, argv, utils) { const stackName = argv._[1] inquirer.prompt([ { type: 'confirm', name: 'ok', message: `Are you sure you want to delete ${stackName}?` } ], function (answers) { if (!answers.ok) { return proce...
import inquirer from 'inquirer' function deleteStack (cloudformation, argv, utils) { const stackName = argv._[1] inquirer.prompt([ { type: 'confirm', name: 'ok', message: `Are you sure you want to delete ${stackName}?` }, { type: 'input', name: 'region', message: 'J...
Add region confirmation for delete command
Add region confirmation for delete command
JavaScript
isc
SomeoneWeird/cirrus
997fa9efe56afeb5ac40273197fd398d08f0fa8c
src/configureStore/index.js
src/configureStore/index.js
import { createStore } from 'redux' import reducer from '../reducers' export default () => { const store = createStore(reducer) return store }
import { createStore, applyMiddleware } from 'redux' import thunk from 'redux-thunk' import reducer from '../reducers' export default () => { const store = createStore( reducer, applyMiddleware(thunk) ) return store }
Add thunk middleware to store
Add thunk middleware to store
JavaScript
mit
epicsharp/react-boilerplate,RSS-Dev/live-html,RSS-Dev/live-html,epicsharp/react-boilerplate
bf023979de39f5ff63ca5cc9f7b54e7af6f344d6
app/index.js
app/index.js
'use strict'; var util = require('util'); var path = require('path'); var yeoman = require('yeoman-generator'); var AppengineGenerator = module.exports = function AppengineGenerator(args, options, config) { yeoman.generators.Base.apply(this, arguments); this.args = args; this.pkg = JSON.parse(this.readFileAsStr...
'use strict'; var util = require('util'); var path = require('path'); var yeoman = require('yeoman-generator'); var AppengineGenerator = module.exports = function AppengineGenerator(args, options, config) { yeoman.generators.Base.apply(this, arguments); this.args = args; this.pkg = JSON.parse(this.readFileAsStr...
Set default application name to folder name
Set default application name to folder name Fixes #1
JavaScript
mit
generators/appengine
424b51085fd1a37642bf8d8cf226c6889e276a63
tests/unit/models/instructor-group-test.js
tests/unit/models/instructor-group-test.js
import { moduleForModel, test } from 'ember-qunit'; moduleForModel('instructor-group', 'InstructorGroup', { // Specify the other units that are required for this test. needs: [ 'model:school', 'model:user', 'model:program', 'model:program-year', 'model:offering', 'model:session', ] })...
import { moduleForModel, test } from 'ember-qunit'; import Ember from 'ember'; moduleForModel('instructor-group', 'InstructorGroup', { // Specify the other units that are required for this test. needs: [ 'model:school', 'model:user', 'model:program', 'model:program-year', 'model:offering', ...
Test the courses property on the instructor-group model
Test the courses property on the instructor-group model
JavaScript
mit
djvoa12/frontend,djvoa12/frontend,thecoolestguy/frontend,gabycampagna/frontend,stopfstedt/frontend,thecoolestguy/frontend,jrjohnson/frontend,ilios/frontend,gabycampagna/frontend,jrjohnson/frontend,gboushey/frontend,ilios/frontend,stopfstedt/frontend,gboushey/frontend,dartajax/frontend,dartajax/frontend
4508c9e566699b80aab9fb46da574a31edc3b36f
src/components/utils/utils.js
src/components/utils/utils.js
(function () { 'use strict'; var mod = angular.module('components.utils', []); mod.factory('Utils', ['$window', function Utils($window) { function stringify(obj, prefix) { var str = []; for(var p in obj) { var k = prefix ? prefix + '[' + p + ']' : p, v = obj[p]; str.push(typeof...
(function () { 'use strict'; var mod = angular.module('components.utils', []); mod.factory('Utils', ['$window', function Utils($window) { function stringify(obj, prefix) { var str = []; for(var p in obj) { var k = prefix ? prefix + '[' + p + ']' : p, v = obj[p]; str.push(typeof...
Fix checking type of data (array is recognized as an object)
Fix checking type of data (array is recognized as an object)
JavaScript
apache-2.0
yrezgui/buffer-firefoxos
a89cb04882da0b65aa979d2eacddd3d09789f76f
player/examples/invaders/Assets/invaders_bullet.js
player/examples/invaders/Assets/invaders_bullet.js
var controller = null; var speed = 30; var life = 3000; function start() { controller = Game.getFromScene("Background").ControllerScript; } function update(time) { if(controller.paused) return; var addX = speed*(time/1000) GameObject.translate(0,-addX, 0); life -= time; if(life <= 0) ...
var speed = 30; var life = 3000; function start() { } function update(time) { var addX = speed*(time/1000) GameObject.translate(0,-addX, 0); life -= time; if(life <= 0) GameObject.destroy(); }
Allow bullets to finish travelling - otherwise it looks all silly ;)
Allow bullets to finish travelling - otherwise it looks all silly ;)
JavaScript
lgpl-2.1
cgaebel/gluon,KDE/gluon,KDE/gluon,KDE/gluon,pranavrc/example-gluon,pranavrc/example-gluon,cgaebel/gluon,cgaebel/gluon,pranavrc/example-gluon,cgaebel/gluon,KDE/gluon,pranavrc/example-gluon
c63a3296644765f00caae571b247c35c93cad1ba
lib/index.js
lib/index.js
Object.defineProperty(exports, 'lock', { get() { return require('./lock'); } }); Object.defineProperty(exports, 'tag', { get() { return require('./tag'); } }); Object.defineProperty(exports, 'vary', { get() { return require('./vary'); } }); Object.defineProperty(exports, 'map', { get() { return requir...
Object.defineProperty(exports, 'lock', { get() { return require('./lock'); } }); Object.defineProperty(exports, 'tag', { get() { return require('./tag'); } }); Object.defineProperty(exports, 'map', { get() { return require('./map'); } });
Drop vary from js module
Drop vary from js module
JavaScript
mit
kapouer/upcache
2f9754d7a7377561569b04e8c7b0e3893a8f726f
lib/index.js
lib/index.js
/** * Dependencies * --------------------------------------------------------------------------*/ var Promise = require('bluebird'), _ = require('underscore'); /** * Returns a promise of a document's save operation */ function saveP(doc) { return Promise.promisify(doc.save, doc)() .then(_.first)...
/** * Dependencies * --------------------------------------------------------------------------*/ var Promise = require('bluebird'), _ = require('underscore'); /** * Invokes a promisified version of method on an object */ function invokeP(obj, method_name, args) { return Promise.promisify(obj[method...
Add an invokeP function and use it internally
Add an invokeP function and use it internally [...] I know I'm just throwing probably terrible ideas around at this point.
JavaScript
mit
yamadapc/mongoose-bluebird-utils
4fb2be30629e4e0c005776e8246d8301b513ddc7
lib/index.js
lib/index.js
/** * Module dependencies */ var generate = require('./generate') , reportback = require('reportback')(); /** * Generate module(s) * * @param {Object} scope [description] * @param {Function} cb [description] * @return {[type]} [description] */ module.exports = function (scope, cb) { cb = re...
/** * Module dependencies */ var generate = require('./generate') , reportback = require('reportback')(); /** * Generate module(s) * * @param {Object} scope [description] * @param {Function} cb [description] * @return {[type]} [description] */ module.exports = function (scope, cb) { cb = re...
Allow override of all callbacks for sails-generate
Allow override of all callbacks for sails-generate
JavaScript
mit
anotherpit/sails-generate,konstantinzolotarev/sails-generate
cc980cb810b80440553119a472dd920bc38a6ce1
data/notification-content.js
data/notification-content.js
/* See license.txt for terms of usage */ /** * xxxHonza: TODO docs */ window.addEventListener("click", function(event) { var target = event.target; if (target.id == "start") { console.log("from content " + target.id) self.port.emit("start"); } })
/* See license.txt for terms of usage */ /** * Content script for notification panel. It's only purpose is registering * a listener for 'click' event and sending a message to the chrome scope * if the user clicks on 'Start Pixel Perfect' link. */ window.addEventListener("click", function(event) { var tar...
Update JS docs for notification content script
Update JS docs for notification content script
JavaScript
bsd-3-clause
firebug/pixel-perfect,mbuckley/pixel-perfect,firebug/pixel-perfect,mbuckley/pixel-perfect
c827749d6169ebc3bfc15d985aa7c21b837d91d6
aux/files/js/script.js
aux/files/js/script.js
'use strict'; /*global window: false, document: false, $:false, d3:false, toggle_overview_btn, checkIfUsingChromeLocally, addData*/ $(document).ready(function() { toggle_overview_btn(); // write overview to overview section initTableSorter(); $("[data-toggle='tooltip']").tooltip(); //ToolTip checkIfUsingChrome...
'use strict'; /*global window: false, document: false, $:false, d3:false, toggle_overview_btn, checkIfUsingChromeLocally, addData*/ $(document).ready(function() { checkIfUsingChromeLocally(); toggle_overview_btn(); // write overview to overview section initTableSorter(); $("[data-toggle='tooltip']").tooltip();...
Check if using chrome first
Check if using chrome first
JavaScript
agpl-3.0
wurmlab/genevalidator,wurmlab/genevalidator,wurmlab/genevalidator,wurmlab/genevalidator
e6049f09e7f3ba287eb143ad806da87c58c9ee26
api/providers/elron.js
api/providers/elron.js
const got = require('got'); const cache = require('../utils/cache.js'); const time = require('../utils/time.js'); // Get trips for stop. async function getTrips(id) { const now = time.getSeconds(); return (await cache.use('elron-trips', id, async () => { const data = JSON.parse((await got(`http://elron.ee/...
const got = require('got'); const cache = require('../utils/cache.js'); const time = require('../utils/time.js'); // Get trips for stop. async function getTrips(id) { const now = time.getSeconds(); const trips = JSON.parse((await got(`http://elron.ee/api/v1/stop?stop=${encodeURIComponent(id)}`)).body).data; if...
Make Elron provider count live time (api)
Make Elron provider count live time (api)
JavaScript
agpl-3.0
karlkoorna/Bussiaeg,karlkoorna/Bussiaeg
36258bda3c042ea34f4688c04f00534674deb3a1
routes/routes.js
routes/routes.js
var artistController = require('../controllers/artist-controller'); var genreController = require('../controllers/genre-controller'); module.exports = function(app, passport) { app.get('/auth/facebook', passport.authenticate('facebook', { scope : 'email' })); app.get('/auth/facebook/callback', passport.authenti...
var artistController = require('../controllers/artist-controller'); var genreController = require('../controllers/genre-controller'); module.exports = function(app, passport) { app.get('/auth/facebook', passport.authenticate('facebook', { scope : 'email' })); app.get('/auth/facebook/callback', passport.authenti...
Add catchall route for serving Angular application
Add catchall route for serving Angular application
JavaScript
mit
kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender
ae8a053e6a532d2f4f456462653e827f0f46a25f
server/server.js
server/server.js
Meteor.startup(function () { // Reset Database only in environment dev if (process.env.NODE_ENV === 'development') { KSessions.remove({}); Books.remove({}); datas = Fixtures; // Specific datas for dev environment } else if (process.env.NODE_ENV === 'production') { datas = Datas; // Specific data...
Meteor.startup(function () { // Reset Database only in environment dev if (process.env.NODE_ENV === 'development') { KSessions.remove({}); Books.remove({}); // Specific insert for Books Fixtures.books.forEach(function(rec) { if (Books.findOne(rec._id)) { Books.update(rec._id, rec); ...
Disable data change in prod and pre-prod environment
Disable data change in prod and pre-prod environment
JavaScript
mit
claudeaubry/klub,claudeaubry/klub,claudeaubry/klub
b62ae3d5332399848ce6b52336e6f5db61f00ad1
src/site/profile.js
src/site/profile.js
/* global sauce, jQuery */ sauce.ns('profile', ns => { 'use strict'; const idMatch = location.pathname.match(/\/(?:athletes|pros)\/([0-9]+)/); const athleteId = idMatch ? Number(idMatch[1]) : null; async function load() { if (sauce.patronLevel && sauce.patronLevel >= 10) { const...
/* global sauce, jQuery */ sauce.ns('profile', ns => { 'use strict'; const idMatch = location.pathname.match(/\/(?:athletes|pros)\/([0-9]+)/); const athleteId = idMatch ? Number(idMatch[1]) : null; async function load() { if (sauce.patronLevel && sauce.patronLevel >= 10 && currentAthlete.isL...
Fix issue with trying to show sync icon when logged out.
Fix issue with trying to show sync icon when logged out.
JavaScript
mit
mayfield/strava-sauce,mayfield/strava-sauce
8dffbe1b62945a095ef0570dab4d39d39a46a9fe
app/assets/javascripts/gatemedia/data/index.js
app/assets/javascripts/gatemedia/data/index.js
//= require_self //= require ./string //= require_tree . /* global Data:true */ Data = Ember.Namespace.create({ ajax: function (settings) { return $.ajax(settings); } });
//= require_self //= require ./string //= require_tree . /* global Data:true */ Ember.$.support.cors = true; Data = Ember.Namespace.create({ ajax: function (settings) { return Ember.$.ajax(settings); } });
Add support for IE (CORS)
Add support for IE (CORS)
JavaScript
mit
gatemedia/gatemedia-data,gatemedia/gatemedia-data
cdd0b79b92c246ca6e826cb6af8ad8dc05b91d73
test/UiIcon.spec.js
test/UiIcon.spec.js
import Vue from 'vue'; import UiIcon from '../src/UiIcon.vue'; describe('UiIcon.vue', function() { it('should initialize with correct data/props', function() { const vm = new Vue({ template: '<div><ui-icon icon="mail" :disable-text="true" v-ref:icon></ui-icon></div>', components: { ...
import Vue from 'vue'; import UiIcon from '../src/UiIcon.vue'; describe('UiIcon.vue', function() { it('should initialize with correct data/props', function() { const vm = new Vue({ template: '<div><ui-icon icon="mail" :remove-text="true" v-ref:icon></ui-icon></div>', components: { ...
Rename disableText prop to removeText in UiIcon test
Rename disableText prop to removeText in UiIcon test
JavaScript
mit
miherlosev/Keen-UI,JosephusPaye/keen-ui,JosephusPaye/keen-ui
ca3dde071aee0bd430e797fa44c6ea78744d0c10
models/simple-event.js
models/simple-event.js
var mongoose = require('mongoose'); var Schema = mongoose.Schema; // A simple event is an event which does not contain data associated with it, and // instead just records "it happened", the count field incrementing with each hit. // For many events this is viable enough, and can be optimized to be way faster. var ...
var mongoose = require('mongoose'); var Schema = mongoose.Schema; // A simple event is an event which does not contain data associated with it, and // instead just records "it happened", the count field incrementing with each hit. // For many events this is viable enough, and can be optimized to be way faster. var ...
Set up indexing for simple events.
Set up indexing for simple events.
JavaScript
agpl-3.0
CamiloMM/Noumena,CamiloMM/Noumena,CamiloMM/Noumena
44202da2383d3a5ed8d4874aa7633ed0794ebdd1
public/javascripts/route.js
public/javascripts/route.js
var GtfsEditor = GtfsEditor || {}; (function(G, $, ich) { G.Router = Backbone.Router.extend({ routes: { '': 'showStep', ':step': 'showStep' }, initialize: function () { var router = this; $('#route-nav').on('click', 'a', function (evt) { evt.preventDefault(); rout...
var GtfsEditor = GtfsEditor || {}; (function(G, $, ich) { G.Router = Backbone.Router.extend({ routes: { '': 'showStep', ':step': 'showStep' }, initialize: function () { var router = this; $('#route-nav').on('click', 'a', function (evt) { evt.preventDefault(); rout...
Update the active class for the current step
Update the active class for the current step
JavaScript
mit
piyushbagri/gtfs-editor,5Tsrl/gtfs-editor,dcunited001/gtfs-editor,quasoft/gtfs-editor,5Tsrl/gtfs-editor,markjd84/gtfs-editor,markjd84/gtfs-editor,piyushbagri/gtfs-editor,dcunited001/gtfs-editor,dcunited001/gtfs-editor,conveyal/gtfs-editor,conveyal/gtfs-editor,piyushbagri/gtfs-editor,markjd84/gtfs-editor,conveyal/gtfs-e...
3a4cc0a908cd8d4d2e5faf417499cf73a6a8ad4d
app/scripts/contentscript.js
app/scripts/contentscript.js
'use strict'; var elements = document.querySelectorAll('.record'); if (elements.length) { var line = Array.prototype.filter.call(elements,function(record) { return record.textContent.indexOf('文章網址') !== -1; })[0].textContent; var matched = line.match(/(https*:\/\/[\w\.\/]+)/); if (matched) { window.loc...
'use strict'; var selector = document.location.pathname.startsWith('/m/') ? '.fgG0' : '.record'; var elements = document.querySelectorAll(selector); if (elements.length) { var line = Array.prototype.filter.call(elements,function(record) { return record.textContent.indexOf('文章網址') !== -1; })[0].textContent; v...
Use different selector for disp.cc mobile version
Use different selector for disp.cc mobile version
JavaScript
mit
yurenju/ptt-redirect,yurenju/ptt-redirect
a261fb2281f5e6c30a79e3cb807c5b61bd6853cb
exception.js
exception.js
/** * Creates a JS Error object from an NSException pointer. */ var id = require('./id') , Err = require('vm').runInNewContext('Error') var proto = exports.proto = Err.prototype // Make the Error objects inherit from our id class proto.__proto__ = id.proto exports.wrap = function wrap (pointer) { var w = id.wra...
/** * Creates a JS Error object from an NSException pointer. */ var id = require('./id') , Err = require('vm').runInNewContext('Error') var proto = exports.proto = Err.prototype // Make the Error objects inherit from our id class proto.__proto__ = id.proto exports.wrap = function wrap (pointer) { var w = id.wra...
Put in place a little workaround to get a nice 'name' on the NSException wrap's 'stack' property.
Put in place a little workaround to get a nice 'name' on the NSException wrap's 'stack' property.
JavaScript
mit
TooTallNate/NodObjC,TooTallNate/NodObjC,jerson/NodObjC,telerik/NodObjC,telerik/NodObjC,mralexgray/NodObjC,mralexgray/NodObjC,jerson/NodObjC,jerson/NodObjC
3d42b2335f1839fb3807774f8bcd09ded2848483
src/integrate.js
src/integrate.js
import { newSignal, signalStep } from './signal'; // Euler integration // integrate :: (a -> b -> dt -> a) -> a -> Signal t b -> Signal t a export default (integral, a, s) => runInteg(integral, a, s, 0); const runInteg = (integral, a0, s, t0) => newSignal(t => stepInteg(integral, a0, s.runSignal(t), t, t0)); con...
import { newSignal, signalStep } from './signal'; // Euler integration // integrate :: (a -> b -> dt -> a) -> a -> Signal t b -> Signal t a export default (integral, a, s) => newSignal(t => signalStep(a, runInteg(integral, a, s, t))); const runInteg = (integral, a0, s, t0) => newSignal(t => stepInteg(integral...
Fix cheating on first integral step
Fix cheating on first integral step
JavaScript
mit
briancavalier/catalyst
7b14b5b71750aa55d84e318644de61dc195a19dc
helper/Settings.js
helper/Settings.js
var fs = require('fs'); var Settings = {}; Settings.init = function (){}; Settings.get = function (key){ var tokenFileName = process.env.HOME + '/.unidisk/' + key; var value; try { var stats = fs.statSync(tokenFileName); value = stats.isFile() ? fs.readFileSync( tokenFileName ) : null; } catch (e) { ...
var fs = require('fs'); var Settings = {}; Settings.init = function (){}; Settings.get = function (key){ if (this.table) { return this.table[key]; } var settingsFileName = process.env.HOME + '/.unidisk/' + 'settings.json'; try { var stats = fs.statSync(settingsFileName); var value = stats.isFile...
Integrate all settings into settings.json file.
Integrate all settings into settings.json file.
JavaScript
apache-2.0
weilonge/unidisk,weilonge/unidisk,weilonge/unidisk
58522eaae297be0f687e3fd3384d2c11c203e623
functions.js
functions.js
function queryString (name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } if (queryString("site")) $("ifra...
function queryString (name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } $("iframe").attr("src", "http://...
Set the iframe url on the JS side
Set the iframe url on the JS side
JavaScript
mit
IonicaBizau/IsRespo,IonicaBizau/IsRespo
e2ad67501464ea4ea7bfe8f9b1665ae3773e51c5
src/angular-file-saver.js
src/angular-file-saver.js
/* angular-file-saver * * A AngularJS service that implements the HTML5 W3C saveAs() in browsers that * do not natively support it * * (c) 2015 Philipp Alferov * License: MIT * */ (function() { 'use strict'; angular .module('fileSaver', []) .factory('SaveAs', SaveAs); function SaveAs() { funct...
'use strict'; /* angular-file-saver * * A AngularJS service that implements the HTML5 W3C saveAs() in browsers that * do not natively support it * * (c) 2015 Philipp Alferov * License: MIT * */ angular .module('fileSaver', []) .factory('SaveAs', SaveAs); function SaveAs() { function isBlobInstance (data) ...
Remove IIFE as browserify adds one
Remove IIFE as browserify adds one
JavaScript
mit
alferov/angular-file-saver
e51a09e50d91112ead9c9a729451a7a6af63d9b4
index.es6.js
index.es6.js
var _create = global.document.createNodeIterator; export function createNodeIterator(root, whatToShow, filter = null) { var iter = _create.call(global.document, root, whatToShow, filter, false); return typeof(iter.referenceNode) === 'undefined' ? shim(iter, root) : iter; } export function install() { global.do...
var _create = global.document.createNodeIterator; export function createNodeIterator(root, whatToShow, filter = null) { var iter = _create.call(global.document, root, whatToShow, filter, false); return typeof(iter.referenceNode) === 'undefined' ? shim(iter, root) : iter; } export function install() { global.do...
Normalize for nulling out on IE at the ends
Normalize for nulling out on IE at the ends
JavaScript
mit
tilgovi/node-iterator-shim,tilgovi/dom-node-iterator
9f420170f8948c67c4084fc569363af779dd0b67
api-tester.js
api-tester.js
const assert = require('assert'); const api = { configureStaticApi(apiServerCreator, port) { assert(typeof apiServerCreator === 'function', 'apiServerCreator has to be function to create static api'); assert(port, 'Port has to be specified'); let server; before(() => { return apiServerCreato...
'use strict'; const assert = require('assert'); const api = { configureStaticApi(apiServerCreator, port) { assert(typeof apiServerCreator === 'function', 'apiServerCreator has to be function to create static api'); assert(port, 'Port has to be specified'); let server; before(() => { return ...
Add missing "use strict" to api tester
fix: Add missing "use strict" to api tester Ensures that `const` and `let` can be used properly.
JavaScript
mit
Springworks/node-test-harness
c1a36803b6a8eded848e7cb8af27582ce4daa1c6
assignments/javascript/anagram/anagram_test.spec.js
assignments/javascript/anagram/anagram_test.spec.js
var Anagram = require('./anagram'); describe('Anagram', function() { it("no matches",function() { var detector = new Anagram("diaper"); var matches = detector.match([ "hello", "world", "zombies", "pants"]); expect(matches).toEqual([]); }); xit("detects simple anagram",function() { var detector ...
var Anagram = require('./anagram'); describe('Anagram', function() { it("no matches",function() { var detector = new Anagram("diaper"); var matches = detector.match([ "hello", "world", "zombies", "pants"]); expect(matches).toEqual([]); }); xit("detects simple anagram",function() { var detector ...
Add test for same length, same letters, different letter instance counts
Add test for same length, same letters, different letter instance counts One possible solution to detecting an anagram might be to check to see if the words are the same length and that each letter from the first word is contained in the second word. This additional test would guard against that solution appearing to ...
JavaScript
agpl-3.0
kizerxl/exercism.io,jtigger/exercism.io,mhelmetag/exercism.io,exercistas/exercism.io,RaptorRCX/exercism.io,emilyforst/exercism.io,praveenpuglia/exercism.io,hanumakanthvvn/exercism.io,emilyforst/exercism.io,beni55/exercism.io,beni55/exercism.io,MBGeoff/Exercism.io-mbgeoff,praveenpuglia/exercism.io,mscoutermarsh/exercism...
d7ed7cbfe6f522ab316b396f5d68aa614ea5e046
src/components/App/App.js
src/components/App/App.js
import React, { PropTypes } from 'react'; import ReactDOM from 'react-dom'; import { Link } from 'react-router'; import { createPureComponent } from 'utils/createPureComponent'; export default createPureComponent({ displayName: 'App', renderLink() { const isEditing = this.props.location.pathname === '/edit...
import React, { PropTypes } from 'react'; import ReactDOM from 'react-dom'; import { Link } from 'react-router'; import { createPureComponent } from 'utils/createPureComponent'; export default createPureComponent({ displayName: 'App', renderLink() { const isEditing = this.props.location.pathname === '/edit...
Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "kein editor""""""""
Revert "Revert "Revert "Revert "Revert "Revert "Revert "Revert "kein editor"""""""" This reverts commit 467cab061de0819402d424d2c340c91a445c4f9d.
JavaScript
mit
mattesja/mygame,mattesja/mygame
33f185a0124ee5058e22ad5fa19ea33130d33c7a
public/js/application.js
public/js/application.js
$(document).ready(function () { $(".new-question").click(function() { $(this).addClass("hidden"); $("#new-question").removeClass("hidden"); }); $("#new-question").submit(function(event) { event.preventDefault(); var ajaxRequest = $.ajax({ url: '/questions', method: 'POST', dat...
$(document).ready(function () { $(".new-question").click(function() { $(this).addClass("hidden"); $("#new-question").removeClass("hidden"); }); $("#new-question").submit(function(event) { event.preventDefault(); var ajaxRequest = $.ajax({ url: '/questions', method: 'POST', data...
Fix JS issue to let users post questions and answers
Fix JS issue to let users post questions and answers
JavaScript
mit
gvbilello/gif-overflow,gvbilello/gif-overflow,gvbilello/gif-overflow
c21fe0872fde9529b066ae9024796b33763795f4
js/requests.js
js/requests.js
/** * FCViz * Payload script for loan requests page */ $("#watch_form").find("a.mediumText").each(function(){$(this).before( $(document.createElement("a")).html("+").attr("class","seemore").attr("style", "cursor: pointer") )}); $(".seemore").before("[").after("] "); window.fcVizObserver.disconnect();
/** * FCViz * Payload script for loan requests page */ //We don't need this mutation observer since we are in the requests page window.fcVizObserver.disconnect(); var prependLinkToCell = function(){$(this).before( $(document.createElement("a")).html("+").attr("class","seemore").attr("style", "cursor: pointer"...
Rearrange code a bit for clarity
Rearrange code a bit for clarity
JavaScript
mit
LoneRifle/fcviz
7c8c6715b88c405c6db0b82028a6d881d6932b75
htdocs/components/EG_01_Analytics.js
htdocs/components/EG_01_Analytics.js
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics....
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); //...
Add some Google Analytics Events for testing
Add some Google Analytics Events for testing
JavaScript
apache-2.0
EnsemblGenomes/eg-web-parasite,EnsemblGenomes/eg-web-parasite,EnsemblGenomes/eg-web-parasite,EnsemblGenomes/eg-web-parasite
f4095cf985a775e9bea4096b96cd7ef75dca4695
lib/command/run.js
lib/command/run.js
'use strict'; const getConfig = require('./utils').getConfig; const getTestRoot = require('./utils').getTestRoot; const deepMerge = require('./utils').deepMerge; const fileExists = require('../utils').fileExists; const path = require('path'); const mkdirp = require('mkdirp'); const Config = require('../config'); const ...
'use strict'; const getConfig = require('./utils').getConfig; const getTestRoot = require('./utils').getTestRoot; const deepMerge = require('./utils').deepMerge; const fileExists = require('../utils').fileExists; const path = require('path'); const mkdirp = require('mkdirp'); const Config = require('../config'); const ...
Fix absolute path in output
Fix absolute path in output
JavaScript
mit
Codeception/CodeceptJS,Codeception/CodeceptJS,Codeception/CodeceptJS
cf4015120d09c9b1c5ddd4c6a14e33651f46ebc6
lib/clean.js
lib/clean.js
const argParser = require('minimist') const escodegen = require('escodegen') const fs = require('fs') const parser = require('./parser') const childProcess = require('child_process') const argv = argParser(process.argv.slice(2)) const infile = argv._[0] const outfile = infile.replace(/\.cl$/, '.js') const src = fs.rea...
const argParser = require('minimist') const escodegen = require('escodegen') const fs = require('fs') const parser = require('./parser') const childProcess = require('child_process') const argv = argParser(process.argv.slice(2)) const infile = argv._[0] const outfile = infile.replace(/\.cl$/, '.js') const src = fs.rea...
Update `out` to include comments in js file
Update `out` to include comments in js file
JavaScript
mit
cleanlang/clean,cleanlang/clean,cleanlang/clean
faf3efeac2a30006142009ecdd2a7f3bd27b47c0
lib/index.js
lib/index.js
// Dependencies var Exec = require("child_process").exec , OArgv = require("oargv") , ElectronPath = require("electron-prebuilt") ; /** * Electroner * * @name Electroner * @function * @param {Object} options The path to the main script or an object interpreted * by [`oargv`](https://github.com/IonicaBizau/...
"use strict"; // Dependencies const spawn = require("spawno") , oArgv = require("oargv") , electronPath = require("electron-prebuilt") ; /** * electroner * Starts the Electron process. * * @name electroner * @function * @param {Object} options The path to the main script or an object interpreted * ...
Use spawno instead of exec
Use spawno instead of exec
JavaScript
mit
IonicaBizau/electroner,IonicaBizau/electroner
12df3b80a356eaf64099e0713c69576e76ccac6b
lib/request.js
lib/request.js
var _ = require('lodash'), request = require('request'), savePage = require('./save').page; function getPageFromServer(params, pageResult) { request.get(params, function (error, response, body) { pageResult(error || (response.statusCode !== 200 || !body), arguments); }); } function getMain(params, ca...
var _ = require('lodash'), request = require('request'), savePage = require('./save').page; function getPageFromServer(params, pageResult) { request.get(params, function (error, response, body) { pageResult(error || (response.statusCode !== 200 || !body), arguments); }); } function getMain(params, ca...
Extend params in correct order
Extend params in correct order
JavaScript
mit
germanrio/request-cached
358c9066b7a2de36a7586833175a5bc47a074b26
lib/utils.js
lib/utils.js
/* * Whitespace-JS / utils.js * copyright (c) 2016 Susisu */ "use strict"; function end() { module.exports = Object.freeze({ SPACE, TAB, LF, intToWhitespace, labelToWhitespace }); } const SPACE = " "; const TAB = "\t"; const LF = "\n"; function intToWhitespac...
/* * Whitespace-JS / utils.js * copyright (c) 2016 Susisu */ "use strict"; function end() { module.exports = Object.freeze({ SPACE, TAB, LF, intToWhitespace, labelToWhitespace }); } const SPACE = " "; const TAB = "\t"; const LF = "\n"; function intToWhitespac...
Use Buffer.from() instead of new Buffer()
Use Buffer.from() instead of new Buffer() new Buffer() is now deprecated
JavaScript
mit
susisu/Whitespace-JS
0d19f8ac390f4e7413561a180d29c4ae179f7369
lib/oathbreaker.js
lib/oathbreaker.js
var workQueue = require('./workQueue'); module.exports = function oathbreaker(value) { if (!value || typeof value.then !== 'function') { return null; } if (!value.isRejected) { return value; } if (value.isFulfilled()) { return null; } if (value.isRejected()) { ...
var workQueue = require('./workQueue'); var Promise = require('bluebird'); module.exports = function oathbreaker(value) { if (!value || typeof value.then !== 'function') { return null; } if (!value.isRejected) { return value; } if (value.isFulfilled()) { return null; } ...
Make sure that oathbroken promises trigger the 'Uncaught rejection' error.
Make sure that oathbroken promises trigger the 'Uncaught rejection' error.
JavaScript
mit
bruderstein/unexpected,unexpectedjs/unexpected,alexjeffburke/unexpected,bruderstein/unexpected,alexjeffburke/unexpected
ca14a27999798d12a20b82b8592b2d4e50c68129
lib/view/events.js
lib/view/events.js
/** * Module Dependencies */ var events = require('event'); /** * Exports */ exports.on = function(name, module, cb) { // cb can be passed as // the second or third argument if (typeof module !== 'string') { cb = module; module = undefined; } // if a module is provided // pass in a special...
/** * Module Dependencies */ var events = require('event'); /** * Exports */ exports.on = function(name, module, cb) { // cb can be passed as // the second or third argument if (typeof module !== 'string') { cb = module; module = undefined; } // if a module is provided // pass in a special...
Rework the way the event object is attached and removed from the view object
Rework the way the event object is attached and removed from the view object
JavaScript
mit
quarterto/fruitmachine,quarterto/fruitmachine,ftlabs/fruitmachine
78378f00a89b854e3df2c9392e65551f89cc221d
lib/Execute.js
lib/Execute.js
const { exec } = require('child_process'); const EventEmitter = require('events'); class Execute extends EventEmitter { constructor(options) { super(); let { fullCmd, params } = options; this.fullCmd = fullCmd; this.params = params; } run() { RunCmd(BuildCmd(this.fullCmd, this.params)) ...
const { exec } = require('child_process'); class Execute { constructor(options) { super(); let { fullCmd, params } = options; this.fullCmd = fullCmd; this.params = params; } run() { RunCmd(BuildCmd(this.fullCmd, this.params)) .then((msg) => { this.emit('end', msg); }) ...
Remove EventEmitter to see if that's what caused the messaging error
Remove EventEmitter to see if that's what caused the messaging error
JavaScript
mit
stetsmando/pi-camera