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
7273e0c87852e1209416c77ffee31ca4623718e0
backends/mongoose.js
backends/mongoose.js
module.exports = function(Model, options) { options || (options = {}) options.idAttribute || (options.idAttribute = '_id') var idQuery = function(model) { var query = {}; query[options.idAttribute] = model[options.idAttribute]; }; this.create = function(model, callback) { M...
module.exports = function(Model, options) { options || (options = {}) options.idAttribute || (options.idAttribute = '_id') var idQuery = function(model) { var query = {}; query[options.idAttribute] = model[options.idAttribute]; return query; }; this.create = function(model,...
Fix typo in Mongoose backend
Fix typo in Mongoose backend
JavaScript
mit
cravler/backbone.io
7ee8937c061d4e2e6b4d34da43d2feac87d6a266
Resources/Private/Javascripts/Modules/Module.js
Resources/Private/Javascripts/Modules/Module.js
/** * Defines a dummy module * * @module Modules/Module */ var App; /** * App * @param el * @constructor */ App = function(el) { 'use strict'; this.el = el; }; /** * Function used to to render the App * * @memberof module:Modules/Module * @returns {Object} The App itself. */ App.prototype.render = fu...
/** * Defines a dummy module * * @module Modules/Module */ var App; /** * App * @param el {HTMLELement} The el on which the App initializes itself. * @constructor */ App = function(el) { 'use strict'; this.el = el; }; /** * Function used to to render the App * * @memberof module:Modules/Module * @retu...
Adjust the module example documentation
[TASK] Adjust the module example documentation
JavaScript
mit
t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template
7789bbce4e4b3903c4121aa2d73c8b4b788d7fa0
app/containers/player.js
app/containers/player.js
import React, { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import PlayerLabel from '../components/player-label' class Player extends Component { render () { const { right, color, name } = this.props return ( <div style={{ fontSize: '5vw' }}> ...
import React, { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import PlayerLabel from '../components/player-label' class Player extends Component { render () { const { right, color, name } = this.props return ( <div style={{ fontSize: '5vw' }}> ...
Use proptypes instead of comments
Use proptypes instead of comments
JavaScript
mit
koscelansky/Dama,koscelansky/Dama
7cd93a605fe97858ee4c41c63ef8f95be830bcdd
karma-static-files/test-bundle.js
karma-static-files/test-bundle.js
const testsContext = require.context('../../../src', true, /\.spec\..+$/) testsContext.keys().forEach(testsContext)
/** * Sagui test bundler that finds all test files in a project * for Karma to run them. */ const testsContext = require.context('../../../src', true, /\.spec\..+$/) testsContext.keys().forEach(testsContext)
Document the test bundler 📕
Document the test bundler 📕
JavaScript
mit
saguijs/sagui,saguijs/sagui
c2dab7e604033a1b7859e7b424a305166f7faba2
test/common.js
test/common.js
var assert = require('assert'); var whiskers = exports.whiskers = require('../lib/whiskers'); // uncomment to test minified //var whiskers = exports.whiskers = require('../dist/whiskers.min'); // in each test, declare `common.expected = n;` for n asserts expected exports.expected = 0; var count = 0; var wrapAssert = ...
var assert = require('assert'); exports.whiskers = require('../dist/whiskers.min'); // uncomment to test non-minified code //exports.whiskers = require('../lib/whiskers'); // in each test, declare `common.expected = n;` for n asserts expected exports.expected = 0; var count = 0; var wrapAssert = function(fn) { retu...
Test minified code by default
Test minified code by default
JavaScript
mit
gsf/whiskers.js,gsf/whiskers.js
4d0035386593322fc6f12c86c67af2705a8e3b9b
test/helper.js
test/helper.js
var assert = require('assert'); var hash = require('object-hash'); var Filterable = require("../lib").Filterable; global.assertObjects = function(o1, o2) { //console.log(o1, o2); assert.equal(hash.sha1(o1), hash.sha1(o2)); }; global.filter = new Filterable({ tagsFields: ["description"], fields: { ...
var assert = require('assert'); var util = require('util'); var hash = require('object-hash'); var Filterable = require("../lib").Filterable; global.assertObjects = function(o1, o2) { //console.log(o1, o2); try { assert.equal(hash.sha1(o1), hash.sha1(o2)); } catch(e) { throw ""+JSON.stringi...
Improve display of error in unit tests
Improve display of error in unit tests
JavaScript
apache-2.0
GitbookIO/filterable
91fa94ad45f52a2fd6216f9752cb432003f58d21
test/import.js
test/import.js
'use strict' const mongoose = require('mongoose'); const users = JSON.parse(require('fs').readFileSync(__dirname + '/users.json')); const domains = JSON.parse(require('fs').readFileSync(__dirname + '/domains.json')); if (mongoose.connection.readyState === 0) { mongoose.connect('mongodb://localhost/test'); } let domai...
'use strict' const mongoose = require('mongoose'); const users = JSON.parse(require('fs').readFileSync(__dirname + '/users.json')); const domains = JSON.parse(require('fs').readFileSync(__dirname + '/domains.json')); if (mongoose.connection.readyState === 0) { mongoose.connect('mongodb://localhost/test'); } let domai...
Use let instead of var. Fix indentation
Use let instead of var. Fix indentation
JavaScript
mit
KodeKreatif/dovecot-log-scrapper
e9bdf081c80b2cf2c5b1edc1a63ea45c91454a92
app/users/users.service.js
app/users/users.service.js
{ angular.module('meganote.users') .service('UsersService', [ '$hhtp', 'API_BASE', ($http, API_BASE) => { class UsersService { create (users) { $http.get(API_BASE) .then( res => { console.log(res.data); ...
{ angular.module('meganote.users') .service('UsersService', [ '$hhtp', 'API_BASE', ($http, API_BASE) => { class UsersService { create (user) { return $http.post('${API_BASE}users', { user, }) .then( res => { ...
Make a POST request to create a user.
Make a POST request to create a user.
JavaScript
mit
zachmillikan/meganote,zachmillikan/meganote
56f3c81553cb446fe5d3668a89f9c162ebfb4daf
lib/server/createGraphQLPublication.js
lib/server/createGraphQLPublication.js
import { Meteor } from 'meteor/meteor'; import { subscribe } from 'graphql'; import forAwaitEach from '../common/forAwaitEach'; import { DEFAULT_PUBLICATION, } from '../common/defaults'; export function createGraphQLPublication({ schema, publication = DEFAULT_PUBLICATION, } = {}) { Meteor.publish(publication, ...
import { Meteor } from 'meteor/meteor'; import { subscribe } from 'graphql'; import forAwaitEach from '../common/forAwaitEach'; import { DEFAULT_PUBLICATION, } from '../common/defaults'; export function createGraphQLPublication({ schema, publication = DEFAULT_PUBLICATION, } = {}) { if (!subscribe) { consol...
Add warning when subscribe is not difined
Add warning when subscribe is not difined
JavaScript
mit
Swydo/ddp-apollo
50ac40453e85cc4315d28859962977573e2c1294
lib/generators/templates/model.js
lib/generators/templates/model.js
<%= application_name.camelize %>.<%= class_name %> = DS.Model.extend({ <% attributes.each_index do |idx| -%> <%= attributes[idx][:name].camelize(:lower) %>: <%= if %w(references belongs_to).member?(attributes[idx][:type]) "DS.belongsTo('%s.%s')" % [application_name.camelize, attributes[idx][:name].camelize] e...
<%= application_name.camelize %>.<%= class_name %> = DS.Model.extend({ <% attributes.each_with_index do |attribute, idx| -%> <%= attribute[:name].camelize(:lower) %>: <%= if %w(references belongs_to).member?(attribute[:type]) "DS.belongsTo('%s.%s')" % [application_name.camelize, attribute[:name].camelize] els...
Use brock argument for simple access
Use brock argument for simple access
JavaScript
mit
tricknotes/ember-rails,bterkuile/ember-rails,kongregate/ember-rails,bcavileer/ember-rails,tricknotes/ember-rails,ipmobiletech/ember-rails,maschwenk/ember-rails,maschwenk/ember-rails,emberjs/ember-rails,kongregate/ember-rails,bterkuile/ember-rails,bcavileer/ember-rails,maschwenk/ember-rails,tricknotes/ember-rails,ipmobi...
288df663a89979e9df524ee7d0127a537074efac
app/assets/javascripts/components/ClearInput.js
app/assets/javascripts/components/ClearInput.js
define(['jquery', 'DoughBaseComponent'], function($, DoughBaseComponent) { 'use strict'; var ClearInput, uiEvents = { 'keydown [data-dough-clear-input]' : 'updateResetButton', 'click [data-dough-clear-input-button]' : 'resetForm' }; ClearInput = function($el, config) { var _this = t...
define(['jquery', 'DoughBaseComponent'], function($, DoughBaseComponent) { 'use strict'; var ClearInput, uiEvents = { 'keydown [data-dough-clear-input]' : 'updateResetButton', 'click [data-dough-clear-input-button]' : 'resetForm' }; ClearInput = function($el, config) { this.uiEvents...
Clean up code and add comments
Clean up code and add comments
JavaScript
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
2518ce4554e1d20353c5d1d177c6cb7ee295cca5
app/assets/javascripts/views/export_csv_view.js
app/assets/javascripts/views/export_csv_view.js
// Handles getting info about bulk media thresholds ELMO.Views.ExportCsvView = class ExportCsvView extends ELMO.Views.ApplicationView { get events() { return { 'click #response_csv_export_options_download_media': 'calculateMediaSize' }; } initialize(params) { $(".calculating-info").hide(); ...
// Handles getting info about bulk media thresholds ELMO.Views.ExportCsvView = class ExportCsvView extends ELMO.Views.ApplicationView { get events() { return { 'click #response_csv_export_options_download_media': 'calculateMediaSize' }; } initialize(params) { $(".calculating-info").hide(); ...
Use async/await for ajax request
11804: Use async/await for ajax request
JavaScript
apache-2.0
thecartercenter/elmo,thecartercenter/elmo,thecartercenter/elmo
ed2860839bc5e5d70e07e058b8fda294a1114a01
src/admin/redux/modules/labels.js
src/admin/redux/modules/labels.js
/* @flow */ import { createAction } from 'redux-actions' const { objOf, map } = require('ramda') import { compose } from 'sanctuary' import { get_body } from 'app/http' import type { Action, Reducer } from 'redux' type State = typeof initialState const initialState = { addresses: [] } const reducer: Reducer<State...
/* @flow */ import { createAction } from 'redux-actions' const { objOf, map } = require('ramda') import { compose } from 'sanctuary' import { get_body } from 'app/http' import { PATH_UPDATE } from '../../../shared/redux/modules/route.js' import type { Action, Reducer } from 'redux' type State = typeof initialState ...
Clear label state when navigating away from it.
Clear label state when navigating away from it.
JavaScript
mit
foundersandcoders/sail-back,foundersandcoders/sail-back
1d1f49783873110d9cb810ec5bb2d0ce778ed6a9
src/app/Trigger/TriggerProfile.js
src/app/Trigger/TriggerProfile.js
import React from 'react'; import { Link } from 'react-router'; import classNames from 'classnames'; import Icon from '../../widgets/Icon'; const TriggerProfile = React.createClass({ render() { const { isFollowing, followingIsFetching, onClickFollow, hasFollow } = this.props; re...
import React from 'react'; import { Link } from 'react-router'; import classNames from 'classnames'; import Icon from '../../widgets/Icon'; const TriggerProfile = React.createClass({ render() { const { isFollowing, followingIsFetching, onClickFollow, hasFollow } = this.props; re...
Remove chat icon from trigger profile
Remove chat icon from trigger profile
JavaScript
mit
ryanbaer/busy,ryanbaer/busy,busyorg/busy,Sekhmet/busy,Sekhmet/busy,busyorg/busy
1a6cfc594dd1f2205a67ae4da8de02785d888c2b
src/kit/ui/CollectionComponent.js
src/kit/ui/CollectionComponent.js
import { Component } from 'substance' import ContainerEditor from './_ContainerEditor' import ValueComponent from './ValueComponent' import renderNode from './_renderNode' /** * A component that renders a CHILDREN value. * * Note: I decided to use the name Collection here as from the application point of view a CHI...
import { Component } from 'substance' import ContainerEditor from './_ContainerEditor' import ValueComponent from './ValueComponent' import renderNode from './_renderNode' /** * A component that renders a CHILDREN value. * * Note: I decided to use the name Collection here as from the application point of view a CHI...
Allow to use 'readOnly' as configuration value for container properties.
Allow to use 'readOnly' as configuration value for container properties.
JavaScript
mit
substance/texture,substance/texture
0c1b62fef00487e1d115adc34021632d77910d9f
assets/js/components/adminbar/AdminBarZeroData.js
assets/js/components/adminbar/AdminBarZeroData.js
/** * Admin Bar Zero Data component. * * Site Kit by Google, Copyright 2021 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE...
/** * Admin Bar Zero Data component. * * Site Kit by Google, Copyright 2021 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE...
Use divs to avoid inheriting paragraph styles.
Use divs to avoid inheriting paragraph styles.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
292d030fbc3048bf2c98c4d414537681f5d3493a
src/routes.js
src/routes.js
import React from 'react'; import {IndexRoute, Route} from 'react-router'; import { isLoaded as isAuthLoaded, load as loadAuth } from 'redux/modules/auth'; import { App, Chat, Home, Widgets, About, Login, LoginSuccess, Survey, NotFound, } from 'containers'; export default (store) ...
import React from 'react'; import {IndexRoute, Route} from 'react-router'; import { isLoaded as isAuthLoaded, load as loadAuth } from 'redux/modules/auth'; import { App, Chat, Home, Widgets, About, Login, LoginSuccess, Survey, NotFound, } from 'containers'; export default (store) ...
Use alphabetical route order for easier merging
Use alphabetical route order for easier merging
JavaScript
mit
Boelensman1/championpick2
62f13a4a58f0e5b8f5271c850608da180e5e34bb
examples/official-storybook/webpack.config.js
examples/official-storybook/webpack.config.js
const path = require('path'); module.exports = async ({ config }) => ({ ...config, module: { ...config.module, rules: [ ...config.module.rules, { test: /\.stories\.jsx?$/, use: require.resolve('@storybook/addon-storysource/loader'), include: [ path.resolve(__di...
const path = require('path'); module.exports = async ({ config }) => ({ ...config, module: { ...config.module, rules: [ ...config.module.rules.slice(1), { test: /\.(mjs|jsx?|tsx?)$/, use: [ { loader: 'babel-loader', options: { cach...
CHANGE the loader for most code in the official example, unify js & ts loading
CHANGE the loader for most code in the official example, unify js & ts loading
JavaScript
mit
storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,kadirahq/react-storybook
bb101f3fd5a1585d237b947ef7a00a06ad845708
src/modules/client/client-base.js
src/modules/client/client-base.js
/* @flow */ import './polyfills/requestIdleCallback'; import '../store/stateManager'; import '../store/storeHelpers'; import '../gcm/gcm-client'; import '../history/history-client'; import '../location/location-client'; import '../presence/presence-client'; import '../session/session-client'; import '../socket/socke...
/* @flow */ import './polyfills/requestIdleCallback'; import '../gcm/gcm-client'; import '../history/history-client'; import '../location/location-client'; import '../presence/presence-client'; import '../session/session-client'; import '../socket/socket-client'; import '../store/storeHelpers'; import '../store/stat...
Initialize state after listeners are added
Initialize state after listeners are added
JavaScript
agpl-3.0
belng/pure,Anup-Allamsetty/pure,scrollback/pure,belng/pure,Anup-Allamsetty/pure,scrollback/pure,Anup-Allamsetty/pure,scrollback/pure,Anup-Allamsetty/pure,scrollback/pure,belng/pure,belng/pure
4dcbd25f4dd6c2de5fe23e1b7441100cb5659c43
app/models/route-label.js
app/models/route-label.js
import Ember from 'ember'; import Model from 'ember-data/model'; import attr from 'ember-data/attr'; export default Model.extend({ routeNumber: attr('number'), routeName: attr('string'), });
import Model from 'ember-data/model'; import attr from 'ember-data/attr'; export default Model.extend({ routeNumber: attr('number'), routeName: attr('string'), });
Switch to 'ridership' name for property in sparkline data.
Switch to 'ridership' name for property in sparkline data.
JavaScript
mit
jga/capmetrics-web,jga/capmetrics-web
ba55570a360defbfc9a344e86db64aa4679dc54b
widdershins.js
widdershins.js
var fs = require('fs'); var path = require('path'); var yaml = require('js-yaml'); var converter = require('./index.js'); var argv = require('yargs') .usage('widdershins [options] {input-spec} [output markdown]') .demand(1) .strict() .boolean('yaml') .alias('y','yaml') .describe('yaml','Load ...
var fs = require('fs'); var path = require('path'); var yaml = require('js-yaml'); var converter = require('./index.js'); var argv = require('yargs') .usage('widdershins [options] {input-spec} [[-o] output markdown]') .demand(1) .strict() .boolean('yaml') .alias('y','yaml') .describe('yaml','...
Add -o / --outfile option
Add -o / --outfile option
JavaScript
mit
rbarilani/widdershins,Mermade/widdershins,Mermade/widdershins
a40a6273953c0e18eddcd67919754814461c5dd4
packages/spacebars-compiler/package.js
packages/spacebars-compiler/package.js
Package.describe({ summary: "Compiler for Spacebars template language" }); Package.on_use(function (api) { api.use('spacebars-common'); api.imply('spacebars-common'); // we attach stuff to the global symbol `HTML`, exported // by `htmljs` via `html-tools`, so we both use and effectively // imply it. api...
Package.describe({ summary: "Compiler for Spacebars template language" }); Package.on_use(function (api) { api.use('spacebars-common'); api.imply('spacebars-common'); // we attach stuff to the global symbol `HTML`, exported // by `htmljs` via `html-tools`, so we both use and effectively // imply it. api...
Remove spacebars-compiler -> spacebars test dependency.
Remove spacebars-compiler -> spacebars test dependency. This fixes a circular build-time dependency when building test slices.
JavaScript
mit
michielvanoeffelen/meteor,benstoltz/meteor,dboyliao/meteor,yyx990803/meteor,DCKT/meteor,skarekrow/meteor,meonkeys/meteor,kengchau/meteor,youprofit/meteor,brdtrpp/meteor,jenalgit/meteor,kengchau/meteor,esteedqueen/meteor,vacjaliu/meteor,lieuwex/meteor,lpinto93/meteor,aramk/meteor,qscripter/meteor,GrimDerp/meteor,dandv/m...
2f3673021ca1020c341cf4bdef67f43dd8450119
scripts/facts.js
scripts/facts.js
module.exports = function(robot){ robot.facts = { sendFact: function(response){ var apiUrl = 'http://numbersapi.com/random', fact = ''; response.http(apiUrl).get()(function(err, res, body){ if (!!err) return; response.send('Did you know: ' + body + ' #bocbotfacts'); }); } }; robot.he...
module.exports = function(robot){ robot.facts = { sendFact: function(response){ var apiUrl = 'http://numbersapi.com/random', fact = ''; response.http(apiUrl).get()(function(err, res, body){ if (!!err) return; response.send(body + ' #bocbotfacts'); }); } }; robot.hear(/#(.*)fact/i, fu...
Remove 'Did you know:' from beginning of fact
Remove 'Did you know:' from beginning of fact
JavaScript
mit
BallinOuttaControl/bocbot,BallinOuttaControl/bocbot
e4fa5754912ec1d0b94e668599030c9600422281
lib/auth/auth-key.js
lib/auth/auth-key.js
// telegram.link // Copyright 2014 Enrico Stara 'enrico.stara@gmail.com' // Released under the MIT License // https://github.com/enricostara/telegram-mt-node // AuthKey class // // This class represents the Authentication Key require('requirish')._(module); var utility = require('lib/utility'); f...
// telegram.link // Copyright 2014 Enrico Stara 'enrico.stara@gmail.com' // Released under the MIT License // https://github.com/enricostara/telegram-mt-node // AuthKey class // // This class represents the Authentication Key require('requirish')._(module); var utility = require('lib/utility'); f...
Add the KeyDerivationFunction to AuthKey
Add the KeyDerivationFunction to AuthKey
JavaScript
mit
enricostara/telegram-mt-node,piranna/telegram-mt-node,cgvarela/telegram-mt-node
e3f29fef9cbd98d6fb68d49a396d6260e2797e39
lib/baseInterface.js
lib/baseInterface.js
var EventEmitter = require('events').EventEmitter; var Subscription = require('./subscription'); var ThoonkBaseInterface = function (thoonk) { EventEmitter.call(this); this.thoonk = thoonk; this.redis = this.thoonk.redis; }; ThoonkBaseInterface.prototype = Object.create(EventEmitter.prototype); ThoonkBas...
var EventEmitter = require('events').EventEmitter; var Subscription = require('./subscription'); var ThoonkBaseInterface = function (thoonk) { EventEmitter.call(this); this.thoonk = thoonk; this.redis = this.thoonk.redis; }; ThoonkBaseInterface.prototype = Object.create(EventEmitter.prototype); ThoonkBas...
Fix error callbacks in interfaces
Fix error callbacks in interfaces
JavaScript
mit
andyet/thoonk.js
a67a70ec7693081fa6aa1f94eb9e82cb22b4e7a4
lib/create-styled-component.js
lib/create-styled-component.js
import React from "react"; import R from "ramda"; import T from "prop-types"; export default function createStyledComponent(displayName, use) { return class StyledComponent extends React.Component { static displayName = displayName; static propTypes = { use: T.oneOfType([T.string, T.func]), visu...
import React from "react"; import R from "ramda"; import T from "prop-types"; export default function createStyledComponent(displayName, use) { return class StyledComponent extends React.Component { static displayName = displayName; static propTypes = { use: T.oneOfType([T.string, T.func]), visu...
Add support for "innerRef" prop
Add support for "innerRef" prop
JavaScript
mit
arturmuller/fela-components
058a1e3a32b3dda08bb3f8cd3f3fc695b3b06a8f
services/auth.js
services/auth.js
const jwt = require('jsonwebtoken') const config = require('config') const bcrypt = require('bcrypt') const User = require('./../models/user') const Authenticate = (user) => { return new Promise((resolve, reject) => { User.findOne({ 'where': { 'email': user.email } }) .then((record) => { if (!...
const jwt = require('jsonwebtoken') const config = require('config') const bcrypt = require('bcrypt') const _ = require('lodash') const User = require('./../models/user') const Authenticate = (user) => { return new Promise((resolve, reject) => { User.findOne({ 'where': { 'email': user.email } }) ...
Use database record to sign jwt token without password
Use database record to sign jwt token without password
JavaScript
mit
lucasrcdias/customer-mgmt
f0c6fbfa23714cd0996886bcd76ed4789c85932b
src/__tests__/components/CloseButton.js
src/__tests__/components/CloseButton.js
/* eslint-env jest */ import React from 'react'; import { shallow } from 'enzyme'; import CloseButton from './../../components/CloseButton'; const closeToast = jest.fn(); describe('CloseButton', () => { it('Should call closeToast on click', () => { const component = shallow(<CloseButton closeToast={closeToast}...
/* eslint-env jest */ import React from 'react'; import { shallow } from 'enzyme'; import CloseButton from './../../components/CloseButton'; const closeToast = jest.fn(); describe('CloseButton', () => { it('Should call closeToast on click', () => { const component = shallow(<CloseButton closeToast={closeToast}...
Fix failing test event undefined when shadow rendering
Fix failing test event undefined when shadow rendering
JavaScript
mit
fkhadra/react-toastify,sniphpet/react-toastify,fkhadra/react-toastify,fkhadra/react-toastify,sniphpet/react-toastify,fkhadra/react-toastify
6d59fcf4270230a50a33f61c2d59643798f7e2df
lib/install/filter-invalid-actions.js
lib/install/filter-invalid-actions.js
'use strict' var path = require('path') var validate = require('aproba') var log = require('npmlog') var getPackageId = require('./get-package-id.js') module.exports = function (top, differences, next) { validate('SAF', arguments) var action var keep = [] /*eslint no-cond-assign:0*/ while (action = differenc...
'use strict' var path = require('path') var validate = require('aproba') var log = require('npmlog') var getPackageId = require('./get-package-id.js') module.exports = function (top, differences, next) { validate('SAF', arguments) var action var keep = [] differences.forEach(function (action) { var cmd = ...
Remove extraneous warns when removing a symlink
uninstall: Remove extraneous warns when removing a symlink Don't warn about not acting on a module in a symlink when the module's parent is being removed anyway
JavaScript
artistic-2.0
TimeToogo/npm,midniteio/npm,DaveEmmerson/npm,TimeToogo/npm,yodeyer/npm,princeofdarkness76/npm,ekmartin/npm,ekmartin/npm,lxe/npm,cchamberlain/npm,misterbyrne/npm,yodeyer/npm,segrey/npm,xalopp/npm,princeofdarkness76/npm,kemitchell/npm,princeofdarkness76/npm,yodeyer/npm,kemitchell/npm,misterbyrne/npm,segrey/npm,chadnickbo...
6b9b235b828956915dda289ef845455798c3a281
source/logger.js
source/logger.js
if (Meteor.isServer) { winston = Npm.require('winston'); } Space.Logger = Space.Object.extend(Space, 'Logger', { _logger: null, _state: 'stopped', Constructor() { if (Meteor.isServer) { this._logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)() ...
if(Meteor.isServer) { winston = Npm.require('winston'); } Space.Logger = Space.Object.extend(Space, 'Logger', { _logger: null, _state: 'stopped', Constructor() { if(Meteor.isServer) { this._logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)() ]...
Apply arguments, check message for string
Apply arguments, check message for string
JavaScript
mit
meteor-space/base,meteor-space/base
d4d3cee54f57442c2166bead54a8c20d2be0274d
public/lib/feathers/feathers-client.js
public/lib/feathers/feathers-client.js
import feathers from 'feathers/client'; import io from 'steal-socket.io'; import socketio from 'feathers-socketio/client'; import auth from 'feathers-authentication/client'; import hooks from 'feathers-hooks'; var socket = io({ transports: ['websocket'] }); const app = feathers() .configure(socketio(socket)) .co...
import feathers from 'feathers/client'; import io from 'socket.io-client/dist/socket.io'; import socketio from 'feathers-socketio/client'; import auth from 'feathers-authentication/client'; import hooks from 'feathers-hooks'; var socket = io({ transports: ['websocket'] }); const app = feathers() .configure(socketi...
Use socket.io-client in place of steal-socket.io
Use socket.io-client in place of steal-socket.io
JavaScript
mit
donejs/bitcentive,donejs/bitcentive
ffd02046e61ba52f4ff0f0189efa260f3befeb76
src/component.js
src/component.js
import { select, local } from "d3-selection"; export default function (Component){ var className = Component.className, tagName = Component.tagName, componentLocal = local(); return function (selection, props){ var components = selection .selectAll(className ? "." + className : tagName) ...
import { select, local } from "d3-selection"; export default function (component){ var className = component.className, tagName = component.tagName, render = component.render || function(){}; return function (selection, props){ var components = selection .selectAll(className ? "." + className...
Restructure implementation to meet new tests
Restructure implementation to meet new tests
JavaScript
bsd-3-clause
curran/d3-component
1e2e0af67d1ca051e4b87c77c832e1d6644eb439
spec/javascripts/pdf/page_spec.js
spec/javascripts/pdf/page_spec.js
import Vue from 'vue'; import pdfjsLib from 'vendor/pdf'; import workerSrc from 'vendor/pdf.worker.min'; import PageComponent from '~/pdf/page/index.vue'; import testPDF from '../fixtures/blob/pdf/test.pdf'; const Component = Vue.extend(PageComponent); describe('Page component', () => { let vm; let testPage; p...
import Vue from 'vue'; import pdfjsLib from 'vendor/pdf'; import workerSrc from 'vendor/pdf.worker.min'; import PageComponent from '~/pdf/page/index.vue'; import mountComponent from 'spec/helpers/vue_mount_component_helper'; import testPDF from 'spec/fixtures/blob/pdf/test.pdf'; describe('Page component', () => { c...
Remove waiting from PDF page component test
Remove waiting from PDF page component test
JavaScript
mit
stoplightio/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,stoplightio/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,dreampet/gitlab,dreampet/gitlab,iiet/iiet-git,mmkassem/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,axilleas/gitlabhq,jirutka/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,stopligh...
609e022fe21ca52f678c04bddd4a150e9f112787
app/models/account.js
app/models/account.js
// Example model var mongoose = require('mongoose'), Schema = mongoose.Schema; // Authenticate Schema var Account = new Schema ({ //conflict with node so changed from domain domainProvider: { type: String, default: ''}, uid: { type: String, default: ''}, // Could this be better? //user: { ty...
// Example model var mongoose = require('mongoose'), Schema = mongoose.Schema; // Authenticate Schema var Account = new Schema ({ //conflict with node so changed from domain domainProvider: { type: String, default: ''}, uid: { type: String, default: ''}, // Could this be better? //user: { ty...
Use appropriate model types - continued
Use appropriate model types - continued
JavaScript
mit
RichardVSaasbook/ITCS4155Team4,lestrell/bridgesAPI,squeetus/bridgesAPI,stevemacn/bridgesAPI,lestrell/bridgesAPI,squeetus/bridgesAPI,stevemacn/bridgesAPI
0c496c344830c479413def1cf70c741d142a4193
app/models/comment.js
app/models/comment.js
import DS from 'ember-data'; export default DS.Model.extend({ blocks: DS.attr(), insertedAt: DS.attr('date', { defaultValue() { return new Date(); } }), updatedAt: DS.attr('date'), canvas: DS.belongsTo('canvas'), block: DS.belongsTo('block'), creator: DS.belongsTo('user'), });
import DS from 'ember-data'; import Ember from 'ember'; export default DS.Model.extend({ blocks: DS.attr(), insertedAt: DS.attr('date', { defaultValue() { return new Date(); } }), updatedAt: DS.attr('date'), canvas: DS.belongsTo('canvas'), block: DS.belongsTo('block'), creator: DS.belongsTo('user'), bloc...
Add computed property blockID to fix deprecated binding issues
Add computed property blockID to fix deprecated binding issues
JavaScript
apache-2.0
usecanvas/web-v2,usecanvas/web-v2,usecanvas/web-v2
195fd6df585d9378cfb1331c320f5179d1018248
app/models/service.js
app/models/service.js
import Resource from 'ember-api-store/models/resource'; import { get, computed } from '@ember/object'; import { inject as service } from '@ember/service'; export default Resource.extend({ intl: service(), scope: service(), canEditYaml: true, displayKind: computed('intl.locale', 'kind', function() { const...
import Resource from 'ember-api-store/models/resource'; import { get, computed } from '@ember/object'; import { reference } from 'ember-api-store/utils/denormalize'; import { inject as service } from '@ember/service'; export default Resource.extend({ intl: service(), scope: service(), clusterStore: service(), ...
Fix lb group by issue
Fix lb group by issue
JavaScript
apache-2.0
rancher/ui,vincent99/ui,rancher/ui,lvuch/ui,rancher/ui,vincent99/ui,westlywright/ui,rancherio/ui,vincent99/ui,rancherio/ui,lvuch/ui,lvuch/ui,westlywright/ui,rancherio/ui,westlywright/ui
d1375e032ac0b4cf0fb56501dc0e79c20d6e0d29
app/static/js/init.js
app/static/js/init.js
$(document).ready(function(){ $('#title_inc').tagsInput({'defaultText': '…'}); $('#title_exc').tagsInput({'defaultText': '…'}); $('#link_inc').tagsInput({'defaultText': '…'}); $('#link_exc').tagsInput({'defaultText': '…'}); set_submit(false) $('#rss_url').blur(function(){ url = $(this...
$(document).ready(function(){ $('#title_inc').tagsInput({'defaultText': '…'}); $('#title_exc').tagsInput({'defaultText': '…'}); $('#link_inc').tagsInput({'defaultText': '…'}); $('#link_exc').tagsInput({'defaultText': '…'}); set_submit(false) $('#rss_url').blur(check_url) check_url() }) ...
Fix ajax URL check to run on page load
Fix ajax URL check to run on page load
JavaScript
mit
cuducos/filterss,cuducos/filterss,cuducos/filterss
3e830bd1b65b5f83980c68ec56efe328f3e69781
src/wysihtml5.js
src/wysihtml5.js
/** * @license wysihtml5 v@VERSION * https://github.com/xing/wysihtml5 * * Author: Christopher Blum (https://github.com/tiff) * * Copyright (C) 2011 XING AG * Licensed under GNU General Public License * */ var wysihtml5 = { version: "@VERSION", // namespaces commands: {}, dom: {}, quirks:...
/** * @license wysihtml5 v@VERSION * https://github.com/xing/wysihtml5 * * Author: Christopher Blum (https://github.com/tiff) * * Copyright (C) 2012 XING AG * Licensed under the MIT license (MIT) * */ var wysihtml5 = { version: "@VERSION", // namespaces commands: {}, dom: {}, quirks: ...
Update main js file to reflect new license (thx for pointing this out @stereobit)
Update main js file to reflect new license (thx for pointing this out @stereobit)
JavaScript
mit
mmolhoek/wysihtml,camayak/wysihtml5,vitoravelino/wysihtml,Trult/wysihtml,modulexcite/wysihtml,argenticdev/wysihtml,qualwas72/wysihtml5,StepicOrg/wysihtml5,uxtx/wysihtml,StepicOrg/wysihtml5,mrjoelkemp/wysihtml,Voog/wysihtml,Attamusc/wysihtml,argenticdev/wysihtml,jeffersoncarpenter/wysihtml5,flowapp/wysihtml5,GerHobbelt/...
89dd3fd60f1c35c9c8a50141c0579042919e6d51
static/js/vcs.js
static/js/vcs.js
var $ = $ || function() {}; // Keeps from throwing ref errors. function swapselected(from, to) { $(to).html(options[$(from).val()]); } function detailselected(from, to) { $(to).text(details[$(from).val()]); } $(function() { $("#grp-slct").change( function() { swapselected("#grp-slct", "#subgrp-slct"); }); ...
var $ = $ || function() {}; // Keeps from throwing ref errors. function swapselected(from, to) { $(to).html(options[$(from).val()]); } function detailselected(from, to) { $(to).text(details[$(from).val()]); } $(function() { $("#grp-slct").change( function() { swapselected("#grp-slct", "#subgrp-slct"); }); ...
Add the hidden activity value to the form so we know which activity has been selected.
Add the hidden activity value to the form so we know which activity has been selected.
JavaScript
bsd-3-clause
AeroNotix/django-timetracker,AeroNotix/django-timetracker,AeroNotix/django-timetracker
486a84e01f4e1ea9ab1ab0bf8dbbaaf2b80c4db6
grant.js
grant.js
exports.express = () => { return require('./lib/consumer/express') } exports.koa = () => { var version = parseInt(require('koa/package.json').version.split('.')[0]) return require('./lib/consumer/koa' + (version < 2 ? '' : '2')) } exports.hapi = () => { var version = parseInt(require('hapi/package.json').ver...
exports.express = () => { return require('./lib/consumer/express') } exports.koa = () => { var version = parseInt(require('koa/package.json').version.split('.')[0]) return require('./lib/consumer/koa' + (version < 2 ? '' : '2')) } exports.hapi = () => { var pkg try { pkg = require('hapi/package.json') ...
Add support for @hapi/hapi namespace
Add support for @hapi/hapi namespace
JavaScript
mit
simov/grant
b3fd8d1bc3d4becb398b610f9b62334ac2b213d4
index.js
index.js
#!/usr/bin/env node --harmony var program = require('commander'); var fetch = require('node-fetch'); var base64 = require('base-64'); program .arguments('<uri>') .version('0.0.2') .description('A command line tool to retrieve that URI to the latest artifact from an Artifactory repo') .option('-u, --username <user...
#!/usr/bin/env node --harmony var program = require('commander'); var fetch = require('node-fetch'); var base64 = require('base-64'); async function fetchArtifactList(uri, username, password) { const response = await fetch(uri, { method: 'get', headers: { 'Authorization': 'Basic ' + base64.encode(username + '...
Throw error and exit on failure
Throw error and exit on failure
JavaScript
mit
kmerhi/artifactoid
6ea8681b9224beb02aed1b7d0b61ad00880517c5
index.js
index.js
'use strict'; var objectToString = Object.prototype.toString; var ERROR_TYPE = '[object Error]'; module.exports = isError; function isError(err) { return objectToString.call(err) === ERROR_TYPE; }
'use strict'; var objectToString = Object.prototype.toString; var getPrototypeOf = Object.getPrototypeOf; var ERROR_TYPE = '[object Error]'; module.exports = isError; function isError(err) { while (err) { if (objectToString.call(err) === ERROR_TYPE) { return true; } err = getP...
Fix for all combinations of foreign and inherited
Fix for all combinations of foreign and inherited
JavaScript
mit
Raynos/is-error
2910888dea3d7b8ec0a1312acfcf9f9a3a7f0332
index.js
index.js
var isPatched = false; var slice = Array.prototype.slice; if (isPatched) return; function addColor(string) { var colorName = getColorName(string); var colors = { green: ['\x1B[32m', '\x1B[39m'], red: ['\x1B[1m\x1B[31m', '\x1B[39m\x1B[22m'], yellow: ['\x1B[33m', '\x1B[39m'] } return colors[colorNa...
var isPatched = false; var slice = Array.prototype.slice; if (isPatched) return; function addColor(string) { var colorName = getColorName(string); var colors = { green: ['\x1B[32m', '\x1B[39m'], red: ['\x1B[1m\x1B[31m', '\x1B[39m\x1B[22m'], yellow: ['\x1B[33m', '\x1B[39m'] } return colors[colorNa...
Append timestamp to existing message string
Append timestamp to existing message string - This fixes a race condition that could cause the timestamp to become separated from the rest of the message if there were a lot of calls to a log method roughly at the same time.
JavaScript
mit
coachme/console-time
a100cff62a2ebc0c9bb640b71cee9d54da90cef0
index.js
index.js
export {all} from './lib/all.js' export {one} from './lib/one.js' export {toHast} from './lib/index.js'
/** * @typedef {import('./lib/index.js').Options} Options * @typedef {import('./lib/index.js').Handler} Handler * @typedef {import('./lib/index.js').Handlers} Handlers * @typedef {import('./lib/index.js').H} H */ export {all} from './lib/all.js' export {one} from './lib/one.js' export {toHast} from './lib/index.j...
Add exports of a couple of types
Add exports of a couple of types
JavaScript
mit
wooorm/mdast-util-to-hast,syntax-tree/mdast-util-to-hast
342df768597a9e6cdc8205d8fd19431dcc5af73c
index.js
index.js
/** * Remove initial and final spaces and tabs at the line breaks in `value`. * Does not trim initial and final spaces and tabs of the value itself. * * @param {string} value * Value to trim. * @returns {string} * Trimmed value. */ export function trimLines(value) { return String(value).replace(/[ \t]*\n+...
/** * Remove initial and final spaces and tabs at the line breaks in `value`. * Does not trim initial and final spaces and tabs of the value itself. * * @param {string} value * Value to trim. * @returns {string} * Trimmed value. */ export function trimLines(value) { return String(value).replace(/[ \t]*(\r...
Add support for carriage return, carriage return + line feed
Add support for carriage return, carriage return + line feed
JavaScript
mit
wooorm/trim-lines
314febf7078ea6becc74d46ca562cb442c73c34e
index.js
index.js
/* jshint node: true */ 'use strict'; // var path = require('path'); module.exports = { name: 'ember-power-select', included: function(app) { // Don't include the precompiled css file if the user uses ember-cli-sass if (!app.registry.availablePlugins['ember-cli-sass']) { app.import('vendor/ember-pow...
/* jshint node: true */ 'use strict'; // var path = require('path'); module.exports = { name: 'ember-power-select', included: function(app) { // Don't include the precompiled css file if the user uses ember-cli-sass if (!app.registry.availablePlugins['ember-cli-sass']) { app.import('vendor/ember-pow...
Fix invocation of ember-basic-dropdown's contentFor hook
Fix invocation of ember-basic-dropdown's contentFor hook
JavaScript
mit
esbanarango/ember-power-select,cibernox/ember-power-select,cibernox/ember-power-select,chrisgame/ember-power-select,esbanarango/ember-power-select,esbanarango/ember-power-select,chrisgame/ember-power-select,Dremora/ember-power-select,Dremora/ember-power-select,cibernox/ember-power-select,cibernox/ember-power-select
9014971093b57ca00e7d36bfefeaaba3a3ccc9dd
index.js
index.js
module.exports = { parser: 'babel-eslint', extends: 'airbnb', globals: { before: true, beforeEach: true, after: true, afterEach: true, describe: true, it: true, }, rules: { 'arrow-body-style': [0], 'react/jsx-no-bind': [0], }, };
module.exports = { parser: 'babel-eslint', extends: 'airbnb', globals: { before: true, beforeEach: true, after: true, afterEach: true, describe: true, it: true, }, rules: { 'arrow-body-style': [0], 'react/jsx-no-bind': [0], 'object-shorthand': [0], }, };
Allow long version of object construction.
Allow long version of object construction.
JavaScript
mit
crewmeister/eslint-config-crewmeister
cc4d32b3767a62a4f84f62240280014cff5fbc7e
src/candela/VisComponent/index.js
src/candela/VisComponent/index.js
export default class VisComponent { constructor (el) { if (!el) { throw new Error('"el" is a required argument'); } this.el = el; } render () { throw new Error('"render() is pure abstract"'); } }
export default class VisComponent { constructor (el) { if (!el) { throw new Error('"el" is a required argument'); } this.el = el; } render () { throw new Error('"render() is pure abstract"'); } getSerializationFormats () { return []; } }
Add default getSerializationFormats method in superclass
Add default getSerializationFormats method in superclass
JavaScript
apache-2.0
Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela
82588752c39925c756ae0aeef5346a694a44a1c7
src/commands/rover/PingCommand.js
src/commands/rover/PingCommand.js
const Command = require('../Command') module.exports = class PingCommand extends Command { constructor (client) { super(client, { name: 'ping', properName: 'Ping', description: 'Ping the bot to see API latency', userPermissions: [], throttling: { usages: 1, duration: 10 } // 1 usage...
const Command = require('../Command') module.exports = class PingCommand extends Command { constructor (client) { super(client, { name: 'ping', properName: 'Ping', description: 'Ping the bot to see API latency', userPermissions: [], throttling: { usages: 1, duration: 10 } // 1 usage...
Update ping command to show Discord latency
Update ping command to show Discord latency
JavaScript
apache-2.0
evaera/RoVer
75a66a9bad87cf4c9b9dfea6be5ffbf1559a791d
src/main/webapp/scripts/index.js
src/main/webapp/scripts/index.js
//$("checkbox").click(setLocationCookie); $(document).ready(function() { $('#location-checkbox').change(function() { if(this.checked) { setLocationCookie(); } }); });
//$("checkbox").click(setLocationCookie); $(document).ready(function() { $('#location-checkbox').change(function() { if(this.checked) { setLocationCookie(); } }); $('#blob-input').change(function() { const filePath = $(this).val(); $('#file-path').text(filePath.split('\\').pop()); }); });...
Add js for fake upload button
Add js for fake upload button
JavaScript
apache-2.0
googleinterns/step36-2020,googleinterns/step36-2020,googleinterns/step36-2020
cc13a47514441d2ffd90b041d6ef7a792609e61e
src/js/components/search-input.js
src/js/components/search-input.js
import React from 'react' import { sparqlConnect } from '../sparql/configure-sparql' import { LOADING, LOADED, FAILED } from 'sparql-connect' import { browserHistory } from 'react-router' import { uriToLink } from '../router-mapping' import { connect } from 'react-redux' import { changeKeyword } from '../actions/app-st...
import React, { Component } from 'react' import { sparqlConnect } from '../sparql/configure-sparql' import { LOADING, LOADED, FAILED } from 'sparql-connect' import { browserHistory } from 'react-router' import { uriToLink } from '../router-mapping' import { connect } from 'react-redux' export default class SearchInput...
Use stateful component for search input and remove appState reducer
Use stateful component for search input and remove appState reducer
JavaScript
mit
Antoine-Dreyer/Classification-Explorer,UNECE/Classification-Explorer,Antoine-Dreyer/Classification-Explorer,UNECE/Classification-Explorer
8789732b4ceb906ecc37aa56ba185b52b7c94128
src/server/boot/angular-html5.js
src/server/boot/angular-html5.js
var libPath = require('path'); module.exports = function supportAngularHtml5(server) { var router = server.loopback.Router(); router.all('/*', function(req, res, next) { var reqUrl = req.originalUrl; if (reqUrl.match(/^\/js\/.*/) !== null) { // static javascript resources, skip it next(); ...
var libPath = require('path'); module.exports = function supportAngularHtml5(server) { var router = server.loopback.Router(); router.all('/*', function(req, res, next) { var reqUrl = req.originalUrl; if (reqUrl.match(/^\/js\/.*/) !== null) { // static javascript resources, skip it next(); ...
Add more filter rules to meet requirement.
Add more filter rules to meet requirement.
JavaScript
mit
agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart
b5fdaf6c9d68dc759f9f05d9c7b3b3dcd2a7ff7a
dawn/js/utils/Ansible.js
dawn/js/utils/Ansible.js
import AppDispatcher from '../dispatcher/AppDispatcher'; let runtimeAddress = localStorage.getItem('runtimeAddress') || '127.0.0.1'; let socket = io('http://' + runtimeAddress + ':5000/'); socket.on('connect', ()=>console.log('Connected to runtime.')); socket.on('connect_error', (err)=>console.log(err)); /* * Hack f...
import AppDispatcher from '../dispatcher/AppDispatcher'; let runtimeAddress = localStorage.getItem('runtimeAddress') || '127.0.0.1'; let socket = io('http://' + runtimeAddress + ':5000/'); socket.on('connect', ()=>console.log('Connected to runtime.')); socket.on('connect_error', (err)=>console.log(err)); /* * Hack f...
Add socketio websocket status check
Add socketio websocket status check
JavaScript
apache-2.0
pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral
b88476d0f8ff2ee9a534245b61c672d340c2b941
test/gameSpec.js
test/gameSpec.js
var game = require('../game.js'); var chai = require('chai'); chai.should(); describe('Game', function() { describe('createPack', function() { it('has 52 cards', function() { var p = game.createPack(); p.should.have.lengthOf(52); }); }); describe('shuffle', function() { it('should have ...
var game = require('../game.js'); var chai = require('chai'); chai.should(); describe('Game', function() { describe('createPack', function() { it('has 52 cards', function() { var p = game.createPack(); p.should.have.lengthOf(52); }); }); describe('shuffle', function() { it('should have ...
Add test that draw removes card from deck
Add test that draw removes card from deck
JavaScript
mit
psmarshall/500,psmarshall/500
4e723a8b1f997595373c04af130a15e0c18a07d5
www/js/app.js
www/js/app.js
// We use an "Immediate Function" to initialize the application to avoid leaving anything behind in the global scope (function () { /* ---------------------------------- Local Variables ---------------------------------- */ var service = new EmployeeService(); var homeTpl = Handlebars.compile($("#home.tpl...
// We use an "Immediate Function" to initialize the application to avoid leaving anything behind in the global scope (function () { /* ---------------------------------- Local Variables ---------------------------------- */ var service = new EmployeeService(); var homeTpl = Handlebars.compile($("#home.tpl...
Modify findByName() to call employeeListTpl
Modify findByName() to call employeeListTpl
JavaScript
mit
tlkiong/cordovaTutorial,tlkiong/cordovaTutorial,tlkiong/cordovaTutorial,tlkiong/cordovaTutorial,tlkiong/cordovaTutorial
6a1abab752d4cef30e8433b518648893814754f5
icons.js
icons.js
define(function () { icons = {}; icons.load = function (iconInfo, callback) { if ("uri" in iconInfo) { source = iconInfo.uri; } else if ("name" in iconInfo) { source = "lib/sugar-html-graphics/icons/" + iconInfo.name + ".svg"; } fillColor = iconI...
define(function () { icons = {}; icons.load = function (iconInfo, callback) { if ("uri" in iconInfo) { source = iconInfo.uri; } else if ("name" in iconInfo) { source = "lib/sugar-html-graphics/icons/" + iconInfo.name + ".svg"; } fillColor = iconI...
Improve API to colorize an icon
Improve API to colorize an icon Move the details to this library. Usage example: icons.colorize(myButton, ["#FF0000", "#00FF00"]);
JavaScript
apache-2.0
godiard/sugar-web,sugarlabs/sugar-web
8b38fbec1496431c650677b426662fd708db4b12
src/main/resources/tools/build.js
src/main/resources/tools/build.js
/* * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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/li...
/* * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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/li...
Add full project optimization in comment for testing
Add full project optimization in comment for testing
JavaScript
apache-2.0
wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics
562e2b130db0ee402d0203189aeef65bd0d5ff09
index.js
index.js
window.lovelyTabMessage = (function(){ var hearts = ['❤','💓','💖','💗','💘','💝','💕']; var heart = hearts[Math.floor(Math.random() * (hearts.length))]; var lang = (window && window.navigator && window.navigator.language || 'en'); switch(lang){ case 'en': return 'Come back, i miss y...
window.lovelyTabMessage = (function(){ var stringTree = { comeBackIMissYou: { de: 'Komm zurück, ich vermisse dich.', en: 'Come back, i miss you.' } } // Let's see what lovely options we have to build our very romantic string var lovelyOptions = Object.keys(stringT...
Add some more spice to those lovely messages
Add some more spice to those lovely messages
JavaScript
mit
tarekis/tab-lover
ad5e2272bc1d857fdec6e14f0e8232296fc1aa38
models/raw_feed/model.js
models/raw_feed/model.js
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var config = require('../../config.js'); this.rawFeedModel = { timestamp: {type: Date, default: Date.now}, text: String }; var rawFeedSchema = new Schema(this.rawFeedModel); this.rawFeed = mongoose.model('rawFeed', rawFeedSchema);
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var config = require('../../config.js'); this.rawFeedModel = { timestamp: {type: Date, default: Date.now}, text: String, feedSource: {type: String, enum: ['Twitter', 'Email']} }; var rawFeedSchema = new Schema(this.rawFeedModel); this.rawFeed = mong...
Add data source property to raw feed object
Add data source property to raw feed object
JavaScript
mit
NextCenturyCorporation/EVEREST
e986b22d01bdb50da6145610d962bc9663a5b9e4
index.js
index.js
var isVowel = require('is-vowel'); var khaan = module.exports = { splitAtVowels: function ( word ) { var output = []; var current = ''; for ( var i = 0; i < word.length; i++ ) { var c = word[i]; if ( isVowel( c ) ) { if ( current !== '' ) { output.push( current ); } current = ''; } c...
var isVowel = require('is-vowel'); var khaan = module.exports = { splitAtVowels: function ( word ) { var output = []; var current = ''; for ( var i = 0; i < word.length; i++ ) { var c = word[i]; if ( isVowel( c ) ) { if ( current !== '' ) { output.push( current ); } current = ''; } c...
Use last vowel, instead of first
Use last vowel, instead of first
JavaScript
isc
zuzak/node-khaan
026a8c0f001800c7e4304105af14cf1c1f56e933
index.js
index.js
'use strict'; var through = require('through') var write = function write(chunk) { var self = this //read each line var data = chunk.toString('utf8') var lines = data.split('\n') lines.forEach(function (line) { if (!line) return if (line.match(/^\s*#.*$/)) return self.emit('data', line) }) ...
'use strict'; var through = require('through') var write = function write(chunk) { var self = this //read each line var data = chunk.toString('utf8') var lines = data.split('\n') lines.forEach(function (line) { //generic catch all if (!line) return //skip empty lines if (line.match(/^\s...
Update module to match tests
Update module to match tests
JavaScript
mit
digitalsadhu/env-reader
c897c1047356ba25fdc111b7a997a34e0fc4cc04
index.js
index.js
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-ui-sortable', included: function(app) { this._super.included(app); //app.import(app.bowerDirectory + '/jquery-ui/ui/data.js'); //app.import(app.bowerDirectory + '/jquery-ui/ui/scroll-parent.js'); //app.import(app.bowerDirectory...
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-ui-sortable', included: function(app) { this._super.included(app); app.import(app.bowerDirectory + '/jquery-ui/ui/version.js'); app.import(app.bowerDirectory + '/jquery-ui/ui/data.js'); app.import(app.bowerDirectory + '/jquery-...
Update dependencies to be an exact copy of jquery-ui's custom download option
Update dependencies to be an exact copy of jquery-ui's custom download option
JavaScript
mit
12StarsMedia/ember-ui-sortable,12StarsMedia/ember-ui-sortable
5de5b0c2b772ea307d2fb74828c85401b31f7ea1
modules/finders/index.js
modules/finders/index.js
module.exports = { Reddit: require( './reddit.js' ), Steam: require( './steam.js' ), MiggyRSS: require( './MiggyRSS.js' ), };
/* eslint-disable global-require */ module.exports = { Reddit: require( './reddit.js' ), Steam: require( './steam.js' ), MiggyRSS: require( './MiggyRSS.js' ), };
Make sure the lint passes
Make sure the lint passes
JavaScript
mit
post-tracker/finder
473a265a16f9c51e0c006b3d49d695700770a9e4
packages/core/upload/server/routes/content-api.js
packages/core/upload/server/routes/content-api.js
'use strict'; module.exports = { type: 'content-api', routes: [ { method: 'POST', path: '/', handler: 'content-api.upload', }, { method: 'GET', path: '/files/count', handler: 'content-api.count', }, { method: 'GET', path: '/files', handler: ...
'use strict'; module.exports = { type: 'content-api', routes: [ { method: 'POST', path: '/', handler: 'content-api.upload', }, { method: 'GET', path: '/files', handler: 'content-api.find', }, { method: 'GET', path: '/files/:id', handler: 'co...
REMOVE count route from upload plugin
REMOVE count route from upload plugin
JavaScript
mit
wistityhq/strapi,wistityhq/strapi
c8e3b4a5c321bfd6826e9fc9ea16157549850844
app/initializers/blanket.js
app/initializers/blanket.js
export function initialize(application) { const inject = (property, what) => { application.inject('controller', property, what); application.inject('component', property, what); application.inject('route', property, what); }; inject('config', 'service:config'); inject('session', 'service:session')...
export function initialize(application) { const inject = (property, what) => { application.inject('controller', property, what); application.inject('component', property, what); application.inject('route', property, what); }; inject('config', 'service:config'); inject('session', 'service:session')...
Introduce ember-infinity as a service
Introduce ember-infinity as a service
JavaScript
apache-2.0
ritikamotwani/open-event-frontend,CosmicCoder96/open-event-frontend,CosmicCoder96/open-event-frontend,ritikamotwani/open-event-frontend,ritikamotwani/open-event-frontend,CosmicCoder96/open-event-frontend
683d418fd7bede0da8b5c1d7b1250c50a4b0eca9
test/utils/testStorage.js
test/utils/testStorage.js
export default () => ({ persist: jest.fn(data => Promise.resolve(data)), restore: jest.fn(() => Promise.resolve({ authenticated: { authenticator: 'test' } }) ) })
export default () => ({ persist: jest.fn(), restore: jest.fn(() => ({ authenticated: { authenticator: 'test' } })) })
Update test storage to better mimic actual storage behavior
Update test storage to better mimic actual storage behavior
JavaScript
mit
jerelmiller/redux-simple-auth
c971b63c3cc2b070643f51675f262f518c86325f
src/files/navigation.js
src/files/navigation.js
var sidebarOpen = false; var menuText = ["Menu", "Close"]; var menuElement = document.querySelector(".menu-link"); var sidebarElement = document.querySelector(".sidebar"); var headerElement = document.querySelector("header"); var rAF; menuElement.addEventListener( "click", toggleSidebar, false ); window.addEventListen...
var sidebarOpen = false; var menuText = ["Menu", "Close"]; var menuElement = document.querySelector(".menu-link"); var sidebarElement = document.querySelector(".sidebar"); var mainElement = document.querySelector("main"); var headerElement = document.querySelector("header"); var rAF; mainElement.addEventListener( "cli...
Add ability to close sidebar by clicking outside
Add ability to close sidebar by clicking outside
JavaScript
mit
sveltejs/svelte.technology,sveltejs/svelte.technology
9542380f1530e9cbb680e04ac8694c649e5acab8
scripts/ui.js
scripts/ui.js
'use strict'; const $ = require('jquery'), remote = require('remote'); let main = remote.getCurrentWindow(); $(function(){ $('.tools > div').on('click', (e) => main[e.target.className]()); });
'use strict'; const $ = require('jquery'), remote = require('remote'); let main = remote.getCurrentWindow(); $(function(){ $('.tools > div').on('click', (e) => main[e.target.className]()); let toggleMax = () => $('.app').toggleClass('maximized'); main.on('maximize', toggleMax).on('unmaximize', toggleMax...
Add maxmimize and unmaxmize class toggler.
Add maxmimize and unmaxmize class toggler.
JavaScript
mit
JamenMarz/vint,JamenMarz/cluster
7fff75c2c053e3b4084fddad486a3e03c2afe0fb
assets/js/controls/transport.js
assets/js/controls/transport.js
var Transport = can.Control.extend({ init: function(element, options) { this.status = options.status; element.html(can.view('views/transport.ejs')); }, sendCommand: function(command) { var self = this; can.ajax({ url: '/api/control/' + command, type: 'PUT', success: function(st...
var Transport = can.Control.extend({ init: function(element, options) { this.status = options.status; element.html(can.view('views/transport.ejs')); }, updateStatus: function(status) { this.status.attr(status); }, sendCommand: function(command) { var self = this; can.ajax({ url: '...
Split out status update into its own function.
Split out status update into its own function.
JavaScript
mit
danbee/mpd-client,danbee/mpd-client
4fd9b9584dd1d273274be5734f783d0d4a857a5a
index.js
index.js
'use strict'; module.exports = { fetch: function () { }, update: function () { }, merge: function () { }, };
'use strict'; var options = { repository: 'https://github.com/dorian-marchal/phonegap-boilerplate', branch: 'master', }; /** * Check that the cli is used in a phonegap boilerplate project * @return {bool} true if we are in a pb project, else otherwise */ var checkWorkingDirectory = function () { }; /** ...
Add the base project structure
Add the base project structure
JavaScript
mit
dorian-marchal/phonegap-boilerplate-cli
7adfdc80661f56070acf94ee2e24e9ea42d1c96c
sauce/features/accounts/toggle-splits/settings.js
sauce/features/accounts/toggle-splits/settings.js
module.exports = { name: 'ToggleSplits', type: 'checkbox', default: false, section: 'accounts', title: 'Add a Toggle Splits Button', description: 'Clicking the toggle splits button shows or hides the sub-transactions within a split.' };
module.exports = { name: 'ToggleSplits', type: 'checkbox', default: false, section: 'accounts', title: 'Add a Toggle Splits Button to the Account(s) toolbar', description: 'Clicking the Toggle Splits button shows or hides all sub-transactions within all split transactions. *__Note__: you must toggle splits ...
Add text regsarding the location of the button and that splits must be toggled open before editing a split txn.
Add text regsarding the location of the button and that splits must be toggled open before editing a split txn.
JavaScript
mit
dbaldon/toolkit-for-ynab,toolkit-for-ynab/toolkit-for-ynab,falkencreative/toolkit-for-ynab,toolkit-for-ynab/toolkit-for-ynab,blargity/toolkit-for-ynab,ahatzz11/toolkit-for-ynab,falkencreative/toolkit-for-ynab,falkencreative/toolkit-for-ynab,toolkit-for-ynab/toolkit-for-ynab,ahatzz11/toolkit-for-ynab,dbaldon/toolkit-for...
4c0ead9c25c3062daa8204c007274758aecda144
gulpfile.js
gulpfile.js
'use strict'; var gulp = require('gulp'), jshint = require('gulp-jshint'), mocha = require('gulp-mocha'); var paths = { scripts: ['./*.js', './test/*.js', '!./lib', '!./gulpfile.js'] }; gulp.task('lint', function() { return gulp.src(paths.scripts) .pipe(jshint()) .pipe(jshint.reporter...
'use strict'; var gulp = require('gulp'), jshint = require('gulp-jshint'), mocha = require('gulp-mocha'), qunit = require('./index'); var paths = { scripts: ['./*.js', './test/*.js', '!./lib', '!./gulpfile.js'] }; gulp.task('lint', function() { return gulp.src(paths.scripts) .pipe(jshint(...
Add sample sample qunit gulp tasks for testing.
Add sample sample qunit gulp tasks for testing.
JavaScript
mit
jonkemp/node-qunit-phantomjs
cfa32de7fb24d29cd7fbf52e1d1822f61a6db8c5
index.js
index.js
'use strict'; var fs = require('fs'); var spawnSync = require('child_process').spawnSync; var HttpResponse = require('http-response-object'); require('concat-stream'); require('then-request'); var JSON = require('./lib/json-buffer'); Function('', fs.readFileSync(require.resolve('./lib/worker.js'), 'utf8')); module.e...
'use strict'; var fs = require('fs'); var spawnSync = require('child_process').spawnSync; var HttpResponse = require('http-response-object'); require('concat-stream'); require('then-request'); var JSON = require('./lib/json-buffer'); Function('', fs.readFileSync(require.resolve('./lib/worker.js'), 'utf8')); module.e...
Fix suggested npm install command.
Fix suggested npm install command. Instructions were pointing to the wrong project.
JavaScript
mit
ForbesLindesay/sync-request,ForbesLindesay/sync-request
0c263159c54f9a7cbc6617e02bb9fba762b7bf82
src/scripts/app/play/proofreadings/controller.js
src/scripts/app/play/proofreadings/controller.js
'use strict'; module.exports = /*@ngInject*/ function ProofreadingPlayCtrl( $scope, $state, ProofreadingService, RuleService ) { $scope.id = $state.params.id; function error(e) { console.error(e); $state.go('index'); } function prepareProofReading(pf) { pf.replace(/{+(.+)-(.+)\|(.+)}/g, functi...
'use strict'; module.exports = /*@ngInject*/ function ProofreadingPlayCtrl( $scope, $state, ProofreadingService, RuleService ) { $scope.id = $state.params.id; function error(e) { console.error(e); $state.go('index'); } function prepareProofReading(pf) { pf.replace(/{\+(\w+)-(\w+)\|(\w+)}/g, fu...
Use a regex to parse the syntax
Use a regex to parse the syntax into key, plus, minus, rule number
JavaScript
agpl-3.0
ddmck/Quill-Grammar,ddmck/Quill-Grammar,empirical-org/Quill-Grammar,empirical-org/Quill-Grammar,ddmck/Quill-Grammar,empirical-org/Quill-Grammar
006a8e25c02f800d4b36cc051c46f736fcc940b2
site/src/main/resources/static/js/findpassword.js
site/src/main/resources/static/js/findpassword.js
jQuery(function ($) { function d(event) { event.keyCode === 13 && button.click(); } function click() { image.attr('src', src + (src.indexOf('?') < 0 ? '?' : '&') + '_=' + +new Date()); imgv.val(''); (user.val() ? imgv : user).focus(); } function enable() { b...
jQuery(function ($) { function d(event) { event.keyCode === 13 && button.click(); } function click() { image.attr('src', src + (src.indexOf('?') < 0 ? '?' : '&') + '_=' + +new Date()); imgv.val(''); (user.val() ? imgv : user).focus(); } function enable() { b...
Fix console is undefined on IE 8
Fix console is undefined on IE 8
JavaScript
apache-2.0
zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge
72ca5876f553f595582993e800708b707b956b16
EventTarget.js
EventTarget.js
/** * @author mrdoob / http://mrdoob.com * @author Jesús Leganés Combarro "Piranna" <piranna@gmail.com> */ function EventTarget() { var listeners = {}; this.addEventListener = function(type, listener) { if(!listener) return var listeners_type = listeners[type] if(listeners_type === undefined) ...
/** * @author mrdoob / http://mrdoob.com * @author Jesús Leganés Combarro "Piranna" <piranna@gmail.com> */ function EventTarget() { var listeners = {}; this.addEventListener = function(type, listener) { if(!listener) return var listeners_type = listeners[type] if(listeners_type === undefined) ...
Support for Internet Explorer 8
Support for Internet Explorer 8
JavaScript
mit
ShareIt-project/EventTarget.js
d7c647971190893a30dd61068c1edcf266a32201
Gruntfile.js
Gruntfile.js
var config = require('./Build/Config'); module.exports = function(grunt) { 'use strict'; // Display the execution time of grunt tasks require('time-grunt')(grunt); // Load all grunt-tasks in 'Build/Grunt-Options'. var gruntOptionsObj = require('load-grunt-configs')(grunt, { config : { src: "Build/Grunt-Opt...
var config = require('./Build/Config'); module.exports = function(grunt) { 'use strict'; // Display the execution time of grunt tasks require('time-grunt')(grunt); // Load all grunt-tasks in 'Build/Grunt-Options'. var gruntOptionsObj = require('load-grunt-configs')(grunt, { config : { src: "Build/Grunt-Opt...
Test all grunt tasks on Travis CI
[MISC] Test all grunt tasks on Travis CI
JavaScript
mit
t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template
1c9492dd27e6115c6bc0a8e8305a3165d55c313f
Gruntfile.js
Gruntfile.js
'use strict'; module.exports = function (grunt) { require('time-grunt')(grunt); require('load-grunt-tasks')(grunt); grunt.initConfig({ // Configurable paths config: { lintFiles: [ 'angular-bind-html-compile.js' ] }, jshint: { ...
'use strict'; module.exports = function (grunt) { require('time-grunt')(grunt); require('load-grunt-tasks')(grunt); grunt.initConfig({ // Configurable paths config: { lintFiles: [ '**/*.js', '!*.min.js' ] }, jshint: { ...
Revert "Revert "Added support for multiple files (excluding minified scripts)""
Revert "Revert "Added support for multiple files (excluding minified scripts)"" This reverts commit fde48e384ec241fef5d6c4c80a62e3f32f9cc7ab.
JavaScript
mit
ivanslf/angular-bind-html-compile,incuna/angular-bind-html-compile
903456c8c2203d3b86aab36fc70edb0780cf85f1
index.js
index.js
var Prism = require('prismjs'); var cheerio = require('cheerio'); module.exports = { book: { assets: './node_modules/prismjs/themes', css: [ 'prism.css' ] }, hooks: { page: function (page) { page.sections.forEach(function (section) { var $ = cheerio.load(section.content); ...
var Prism = require('prismjs'); var cheerio = require('cheerio'); var path = require('path'); var cssFile = require.resolve('prismjs/themes/prism.css'); var cssDirectory = path.dirname(cssFile); module.exports = { book: { assets: cssDirectory, css: [path.basename(cssFile)] }, hooks: { page: function...
Use Node resolving mechanism to locate Prism CSS
Use Node resolving mechanism to locate Prism CSS
JavaScript
apache-2.0
gaearon/gitbook-plugin-prism
e5636a64d0e737a63ca7f5e5762c098afbeca578
spec/index.spec.js
spec/index.spec.js
'use strict'; // eslint-disable-next-line no-console console.log(`———————————————————————————————— ${(new Date())} \n\n`); describe('MarkTodoItem', () => { const test_case_mocks = require('./test-case.mocks'); const MarkTodoItem = require('../'); const markTodoItem = MarkTodoItem(); test_case_mocks.forEach...
/* global describe, it, expect */ 'use strict'; // eslint-disable-next-line no-console console.log(`———————————————————————————————— ${(new Date())} \n\n`); describe('MarkTodoItem', () => { const test_case_mocks = require('./test-case.mocks'); const MarkTodoItem = require('../'); const markTodoItem = MarkTodo...
Add ESLint comment for globals: describe, it, expect
Add ESLint comment for globals: describe, it, expect
JavaScript
mit
MelleWynia/mark-todo-item
cff4ad9e8273d3560485b8e459d689088a629d9d
babel.config.js
babel.config.js
module.exports = { "sourceMaps": true, "presets": [ ["@babel/preset-env", { "targets": { "browsers": [ "last 2 Chrome versions", "last 2 Firefox versions", "last 2 Safari versions" ] }, }], "@babel/preset-typescr...
module.exports = { "sourceMaps": true, "presets": [ ["@babel/preset-env", { "targets": [ "last 2 Chrome versions", "last 2 Firefox versions", "last 2 Safari versions" ], }], "@babel/preset-typescript", "@babel/preset-flow", "@babel/...
Remove legacy and stop using deprecated things
Remove legacy and stop using deprecated things
JavaScript
apache-2.0
vector-im/riot-web,vector-im/riot-web,vector-im/riot-web,vector-im/riot-web,vector-im/vector-web,vector-im/riot-web,vector-im/riot-web,vector-im/vector-web,vector-im/vector-web,vector-im/vector-web,vector-im/vector-web
043adbd2ca8d5ba976f3520132e1743844c55abd
browser/react/components/App.js
browser/react/components/App.js
import React from 'react'; import '../../aframeComponents/scene-load'; import '../../aframeComponents/aframe-minecraft'; import AssetLoader from './AssetLoader'; import InitialLoading from './InitialLoading'; export default function App (props) { console.log('props ', props); return ( // AssetLoader is a state...
import React from 'react'; import '../../aframeComponents/scene-load'; import '../../aframeComponents/aframe-minecraft'; import AssetLoader from './AssetLoader'; import InitialLoading from './InitialLoading'; export default function App (props) { console.log('props ', props); return ( // AssetLoader is a state...
Change background of spinner to match login
feat: Change background of spinner to match login
JavaScript
mit
TranscendVR/transcend,TranscendVR/transcend
29d581091804b1f6b4aa55e0b8cc8d96270ab575
index.js
index.js
'use strict'; var assign = require('object-assign'); var chalk = require('chalk'); var ProgressBar = require('progress'); /** * Progress bar download plugin * * @param {Object} res * @api public */ module.exports = function (opts) { return function (res, file) { opts = opts || { info: 'cyan' }; ...
'use strict'; var assign = require('object-assign'); var chalk = require('chalk'); var ProgressBar = require('progress'); /** * Progress bar download plugin * * @param {Object} res * @api public */ module.exports = function (opts) { return function (res, file, cb) { opts = opts || { info: 'cyan' }; ...
Allow other middleware by calling `cb()`
Allow other middleware by calling `cb()`
JavaScript
mit
kevva/download-status
79923a9af19fd1b6b7ecb2ee984736404d8f0504
test/TestServer/UnitTestConfig.js
test/TestServer/UnitTestConfig.js
// Some user-accessible config for unit tests // Format is: { platform:{ ...settings.. } } // numDevices - The number of devices the server will start a test with // Any other devices after that will just be ignored var config = { ios: { numDevices:2 }, android: { numDevices:0 } } module...
// Some user-accessible config for unit tests // Format is: { platform:{ ...settings.. } } // numDevices - The number of devices the server will start a test with (-1 == all devices) // Any other devices after that will just be ignored // Note: Unit tests are designed to require just two devi...
Add android devices back in
Add android devices back in
JavaScript
mit
thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin
dc9375c8faa47f915d24aaf6ebc1e67a431fa1b9
index.js
index.js
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ function accesorString(value) { var depths = value.split("."); var length = depths.length; var result = ""; for (var i = 0; i < length; i++) { result += "[" + JSON.stringify(depths[i]) + "]"; } return result;...
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ function accesorString(value) { var childProperties = value.split("."); var length = childProperties.length; var propertyString = "global"; var result = ""; for (var i = 0; i < length; i++) { propertyString += ...
Check if child property exists prior to adding to property
Check if child property exists prior to adding to property
JavaScript
mit
wuxiandiejia/expose-loader
ecddfbde7f0a484e13b3118615d125796fb8e949
test/api/routes/homeRoute.test.js
test/api/routes/homeRoute.test.js
/** * Copyright (c) 2013-2015 Memba Sarl. All rights reserved. * Sources at https://github.com/Memba */ /* jshint node: true, expr: true */ /* globals describe: false, before: false, it: false */ 'use strict'; var request = require('supertest'), //We cannot define app like this because the server is already ...
/** * Copyright (c) 2013-2015 Memba Sarl. All rights reserved. * Sources at https://github.com/Memba */ /* jshint node: true, expr: true */ /* globals describe: false, before: false, it: false */ 'use strict'; var request = require('supertest'), //We cannot define app like this because the server is already ...
Use config to build paths
Use config to build paths
JavaScript
agpl-3.0
Memba/Memba-Blog,Memba/Memba-Blog,Memba/Memba-Blog
457a6fe779b4921c88d436a35cdf4fb9f0a9d02b
test/generators/root/indexTest.js
test/generators/root/indexTest.js
'use strict'; let path = require('path'); let assert = require('yeoman-generator').assert; let helpers = require('yeoman-generator').test describe('react-webpack-redux:root', () => { let generatorDispatcher = path.join(__dirname, '../../../generators/root'); /** * Return a newly generated dispatcher with give...
'use strict'; let path = require('path'); let assert = require('yeoman-generator').assert; let helpers = require('yeoman-generator').test describe('react-webpack-redux:root', () => { let generatorDispatcher = path.join(__dirname, '../../../generators/root'); /** * Return a newly generated dispatcher with give...
Check that the run script has been written
Check that the run script has been written
JavaScript
mit
stylesuxx/generator-react-webpack-redux,stylesuxx/generator-react-webpack-redux
e64e0e8cd275c108d9766d4062d4eab77984212f
spec/specs.js
spec/specs.js
describe('pingPong', function() { it("is true for a number that is divisible by 3", function() { expect(pingPong(6)).to.equal(true); }); it("is true for a number that is divisible by 5", function() { expect(pingPong(10)).to.equal(true); }); });
describe('pingPong', function() { it("is true for a number that is divisible by 3", function() { expect(pingPong(6)).to.equal(true); }); it("is true for a number that is divisible by 5", function() { expect(pingPong(10)).to.equal(true); }); it("is false for a number that is not divisible by 3 or 5", f...
Add a test for userNumbers not divisible by 3 or 5
Add a test for userNumbers not divisible by 3 or 5
JavaScript
mit
kcmdouglas/pingpong,kcmdouglas/pingpong
fff9513aa9d0590679875ed3c3c4c0b080305c89
app/assets/javascripts/leap.js
app/assets/javascripts/leap.js
//document.observe("dom:loaded", function(){ // if ($('flash_notice')){ // Element.fade.delay(4,'flash_notice'); // } // if ($('q')) { // $('q').activate(); // if ($('search_extended')) { // $('search_extended').observe("click", function(event){ // $('search_form').submit(); // }) // } /...
//document.observe("dom:loaded", function(){ // if ($('flash_notice')){ // Element.fade.delay(4,'flash_notice'); // } // if ($('q')) { // $('q').activate(); // if ($('search_extended')) { // $('search_extended').observe("click", function(event){ // $('search_form').submit(); // }) // } /...
Put the notice fade back in
Put the notice fade back in
JavaScript
agpl-3.0
sdc/leap,sdc/leap,sdc-webteam-deploy/leap,sdc/leap,sdc-webteam-deploy/leap,sdc-webteam-deploy/leap,sdc-webteam-deploy/leap,sdc/leap
e252bd17fbbb174182fb322de6138bc6fe53f599
index.js
index.js
module.exports = (addDays = 0) => { let date = new Date(); date.setDate(date.getDate() + addDays); date.setUTCHours(0); date.setUTCMinutes(0); date.setUTCSeconds(0); date.setUTCMilliseconds(0); return date; };
module.exports = (addDays = 0, sinceDate = new Date()) => { let date = new Date(sinceDate); date.setDate(date.getDate() + addDays); date.setUTCHours(0); date.setUTCMinutes(0); date.setUTCSeconds(0); date.setUTCMilliseconds(0); return date; };
Allow passing in initial date
Allow passing in initial date
JavaScript
mit
MartinKolarik/relative-day-utc
b316098cd7e6985bc17bbda872e9e4beefb2e479
website/src/app/project/experiments/experiment/components/tasks/current-task.service.js
website/src/app/project/experiments/experiment/components/tasks/current-task.service.js
class CurrentTask { constructor() { this.currentTask = null; } get() { return this.currentTask; } set(task) { this.currentTask = task; } } angular.module('materialscommons').service('currentTask', CurrentTask);
class CurrentTask { constructor() { this.currentTask = null; this.onChangeFN = null; } setOnChange(fn) { this.onChangeFN = fn; } get() { return this.currentTask; } set(task) { this.currentTask = task; if (this.onChangeFN) { this....
Add setOnChange that allows a controller to set a function to call when the currentTask changes.
Add setOnChange that allows a controller to set a function to call when the currentTask changes.
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
4db4e1b3f9e13c8faa2449a231669ca047b79572
client/src/Account/index.js
client/src/Account/index.js
import React from 'react'; import { PasswordForgetForm } from '../PasswordForget'; import PasswordChangeForm from '../PasswordChange'; import { AuthUserContext, withAuthorization } from '../Session'; const AccountPage = () => ( <AuthUserContext.Consumer> {authUser => ( <div> <h1>Account: {authUser...
import React from 'react'; import PasswordChangeForm from '../PasswordChange'; import { AuthUserContext, withAuthorization } from '../Session'; const AccountPage = () => ( <AuthUserContext.Consumer> {authUser => ( <div> <h1>Account: {authUser.email}</h1> <PasswordChangeForm /> </div>...
Remove extra form from account page.
Remove extra form from account page.
JavaScript
apache-2.0
googleinterns/Pictophone,googleinterns/Pictophone,googleinterns/Pictophone,googleinterns/Pictophone
8ca1ad8a0ca0644d114e509c7accadd3e1fa460d
lib/post_install.js
lib/post_install.js
#!/usr/bin/env node // adapted based on rackt/history (MIT) var execSync = require('child_process').execSync; var stat = require('fs').stat; function exec(command) { execSync(command, { stdio: [0, 1, 2] }); } stat('dist-modules', function(error, stat) { if (error || !stat.isDirectory()) { exec('npm run ...
#!/usr/bin/env node // adapted based on rackt/history (MIT) var execSync = require('child_process').execSync; var stat = require('fs').stat; function exec(command) { execSync(command, { stdio: [0, 1, 2] }); } stat('dist-modules', function(error, stat) { if (error || !stat.isDirectory()) { exec('npm i ba...
Install Babel before generating `dist-modules`
Install Babel before generating `dist-modules` Otherwise it will rely on globally installed Babel. Not good.
JavaScript
mit
rdoh/reactabular,reactabular/reactabular,reactabular/reactabular
21e70737e4499c164b04095568ff748b6c0ff32a
app/services/scores.service.js
app/services/scores.service.js
(function(){ angular .module("movieMash") .factory("scoreService",scoreService); scoreService.$inject=['localStorageService','$firebaseArray','firebaseDataService']; function scoreService(localStorageService,$firebaseArray,firebaseDataService){ var scoresSyncArray = $firebaseArray(firebaseDataService.scor...
(function(){ angular .module("movieMash") .factory("scoreService",scoreService); scoreService.$inject=['localStorageService','$firebaseArray','firebaseDataService']; function scoreService(localStorageService,$firebaseArray,firebaseDataService){ var scoresSyncArray = $firebaseArray(firebaseDataService.scor...
Fix an bug into the id generation for a score record.
Fix an bug into the id generation for a score record.
JavaScript
mit
emyann/MovieMash,emyann/MovieMash
8a64a017121b4f5e0e32f7ffe3aae3519f3e4697
routes/event.js
routes/event.js
var express = require('express'); var router = express.Router(); var endpoint = require('../app/endpoint'); router.get('/event/:name/:args(*)', function(req, res) { var e = endpoint('http', 'get', req.params.name); e({ args: req.params.args, body: req.body }); }); module.exports = route...
var express = require('express'); var router = express.Router(); var endpoint = require('../app/endpoint'); router.get('/event/:name/:args(*)', function(req, res) { var e = endpoint('http', 'get', req.params.name); if (!e) return res.status(400).send('The requested endpoint has not been defined.'); e({ ...
Check if endpoint handler exists.
Check if endpoint handler exists.
JavaScript
agpl-3.0
CamiloMM/Noumena,CamiloMM/Noumena,CamiloMM/Noumena
7cd44b68d733217e790766e7759e0d83deb623c3
public/load-analytics.js
public/load-analytics.js
if (document.location.hostname === "josephduffy.co.uk") { // Don't load analytics for noanalytics.josephduffy.co.uk or onion service return; } var _paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["disableCookies"]); _paq.push(['trackPageVi...
(function() { if (document.location.hostname === "josephduffy.co.uk") { // Don't load analytics for noanalytics.josephduffy.co.uk or onion service return; } var _paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["disableCookies...
Fix error when no loading analytics
Fix error when no loading analytics
JavaScript
mit
JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk
55c0f4c0908ba79f9d54bb197340358398122548
test/components/streams/DiscoverComponent_test.js
test/components/streams/DiscoverComponent_test.js
import { expect, getRenderedComponent, sinon } from '../../spec_helper' import { routeActions } from 'react-router-redux' // import * as MAPPING_TYPES from '../../../src/constants/mapping_types' import Container, { Discover as Component } from '../../../src/containers/discover/Discover' function createPropsForComponen...
import { expect, getRenderedComponent, sinon } from '../../spec_helper' import { routeActions } from 'react-router-redux' import { Discover as Component } from '../../../src/containers/discover/Discover' function createPropsForComponent(props = {}) { const defaultProps = { dispatch: sinon.spy(), isLoggedIn:...
Clean up some code mess
Clean up some code mess
JavaScript
mit
ello/webapp,ello/webapp,ello/webapp
19a3015ebaf0d9d058eecff620cc38b7f4008a0d
assets/javascripts/resume.js
assets/javascripts/resume.js
--- layout: null --- jQuery(document).ready(function($) { /* Method 2: */ /* var isFirefox = /^((?!chrome|android).)*firefox/i.test(navigator.userAgent); */ $("#btn-print").click(function() { /* Method 1:*/ if (navigator.vendor == "" || navigator.vendor == undefined) { alert("This Browser is not p...
--- layout: null --- jQuery(document).ready(function($) { if (navigator.vendor == "" || navigator.vendor == undefined) { function show_alert(){ alert("This Browser is not printable with this page. If you print with Ctrl + P, errors will appear in the page structure. We recommend 'Google Chrome' or 'Safari'. ...
Update - sáb nov 11 19:54:37 -02 2017
Update - sáb nov 11 19:54:37 -02 2017
JavaScript
mit
williamcanin/williamcanin.github.io,williamcanin/williamcanin.github.io,williamcanin/williamcanin.github.io,williamcanin/williamcanin.github.io
c59f159f18f7a26d000e94e1fe5bd62687e886c5
jest.config.js
jest.config.js
const path = require('path') module.exports = { globals: { 'ts-jest': { tsConfig: '<rootDir>/src/tsconfig.test.json' } }, setupFiles: ['<rootDir>/src/bp/jest-before.ts'], globalSetup: '<rootDir>/src/bp/jest-rewire.ts', setupFilesAfterEnv: [], collectCoverage: false, resetModules: true, ve...
const path = require('path') module.exports = { globals: { 'ts-jest': { tsConfig: '<rootDir>/src/tsconfig.test.json' } }, setupFiles: ['<rootDir>/src/bp/jest-before.ts'], globalSetup: '<rootDir>/src/bp/jest-rewire.ts', setupFilesAfterEnv: [], collectCoverage: false, resetModules: true, ve...
Put proper path to project tests
Put proper path to project tests
JavaScript
agpl-3.0
botpress/botpress,botpress/botpress,botpress/botpress,botpress/botpress
a341760e3945404a64f597580df23dbcfe226a54
app/app.js
app/app.js
'use strict'; // Declare app level module which depends on views, and components angular.module('myApp', [ 'ngRoute', 'drupalService', 'myApp.node_add', 'myApp.node_nid', 'myApp.node', 'myApp.taxonomy_term' ]). config(['$routeProvider', function($routeProvider) { $routeProvider.otherwise({red...
'use strict'; // Declare app level module which depends on views, and components angular .module('myApp', [ 'ngRoute', 'drupalService', 'myApp.node_add', 'myApp.node_nid', 'myApp.node', 'myApp.taxonomy_term', 'myApp.node_lifecycle' ]). config(['$route...
Add two way textarea binding.
Add two way textarea binding.
JavaScript
mit
clemens-tolboom/drupal-8-rest-angularjs,clemens-tolboom/drupal-8-rest-angularjs