commit
stringlengths
40
40
old_file
stringlengths
4
264
new_file
stringlengths
4
264
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
624
message
stringlengths
15
4.7k
lang
stringclasses
3 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
63cd19e26f0cd5629372fb50c0244986c3ef1bbd
app/client/templates/posts/post_submit.js
app/client/templates/posts/post_submit.js
Template.postSubmit.events({ 'submit form': function(e) { e.preventDefault(); var post = { url: $(e.target).find('[name=url]').val(), title: $(e.target).find('[name=title]').val() }; post.slug = slugify(post.title); post._id = Posts.insert(post); Router.go('postPage', post); }...
Template.postSubmit.events({ 'submit form': function(e) { e.preventDefault(); var post = { url: $(e.target).find('[name=url]').val(), title: $(e.target).find('[name=title]').val() }; post.slug = slugify(post.title); Meteor.call('postInsert', post, function(error, result) { // ...
Stop if there's an error
Stop if there's an error
JavaScript
mit
drainpip/music-management-system,drainpip/music-management-system
e3c9a348450c91830d5e36a792563fffcbe7d992
app/extensions/safe/server-routes/safe.js
app/extensions/safe/server-routes/safe.js
import logger from 'logger'; import { getAppObj } from '../network'; const safeRoute = { method : 'GET', path : '/safe/{link*}', handler : async ( request, reply ) => { try { const link = `safe://${request.params.link}`; const app = getAppObj(); ...
import logger from 'logger'; import { getAppObj } from '../network'; const safeRoute = { method : 'GET', path : '/safe/{link*}', handler : async ( request, reply ) => { try { const link = `safe://${request.params.link}`; const app = getAppObj(); ...
Add content-encoding headers for webfetch response. Set 'chunked'
fix/webFetch-encoding: Add content-encoding headers for webfetch response. Set 'chunked'
JavaScript
mit
joshuef/peruse,joshuef/peruse
9403627fad7d97e27f83643099d264a3b17b9b4a
examples/minimal/app.js
examples/minimal/app.js
// Test functions function multiply (a, b) { 'use strict' return a * b } function divide (a, b) { 'use strict' try { return multiply(add(a, b), a, b) / c } catch (e) { Opbeat.captureException(e) } } document.querySelector('.btn-test4').addEventListener('click', function () { divide(123 / 2) }, f...
// Test functions function multiply (a, b) { 'use strict' return a * b } function divide (a, b) { 'use strict' try { return multiply(add(a, b), a, b) / c } catch (e) { _opbeat('captureException', e) } } document.querySelector('.btn-test4').addEventListener('click', function () { divide(123 / 2) ...
Adjust minimal-example to new API
Adjust minimal-example to new API
JavaScript
mit
opbeat/opbeat-angular,opbeat/opbeat-react,jahtalab/opbeat-js,opbeat/opbeat-js-core,jahtalab/opbeat-js,opbeat/opbeat-react,opbeat/opbeat-js-core,opbeat/opbeat-angular,jahtalab/opbeat-js,opbeat/opbeat-react,opbeat/opbeat-angular
9fd4432e5a4ec9f810bcc44ecebef970af6bf3ed
spec/javascripts/widgets/comment-toggler-spec.js
spec/javascripts/widgets/comment-toggler-spec.js
/* Copyright (c) 2010, Diaspora Inc. This file is * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ describe("Diaspora.Widgets.CommentToggler", function() { var commentToggler; beforeEach(function() { jasmine.Clock.useMock(); spec.loadFixture("as...
/* Copyright (c) 2010, Diaspora Inc. This file is * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ describe("Diaspora.Widgets.CommentToggler", function() { var commentToggler; beforeEach(function() { jasmine.Clock.useMock(); spec.loadFixture("as...
Fix a jasmine test in CommentToggler
Fix a jasmine test in CommentToggler
JavaScript
agpl-3.0
SuperTux88/diaspora,Amadren/diaspora,Flaburgan/diaspora,despora/diaspora,despora/diaspora,spixi/diaspora,SuperTux88/diaspora,Flaburgan/diaspora,geraspora/diaspora,diaspora/diaspora,spixi/diaspora,spixi/diaspora,spixi/diaspora,Muhannes/diaspora,jhass/diaspora,geraspora/diaspora,SuperTux88/diaspora,despora/diaspora,Muhan...
561d5e010f91fef43bda94e7e51af6ed5cbd9792
app/assets/javascripts/custom.js
app/assets/javascripts/custom.js
$(document).on('turbolinks:load', function () { $("#selectImage").imagepicker({ hide_select: true, show_label : true }); var $container = $('.image_picker_selector'); // initialize $container.imagesLoaded(function () { $container.masonry({ columnWidth: 30, ...
$(document).on('turbolinks:load', function () { $("#selectImage").imagepicker({ hide_select: true, show_label : true }); $("#pendingImage").imagepicker({ hide_select: true, show_label : true }); $("#moochedImage").imagepicker({ hide_select: true, s...
Use imagepicker for all forms
Use imagepicker for all forms
JavaScript
mit
ppanagiotis/gamemooch,ppanagiotis/gamemooch,ppanagiotis/gamemooch,ppanagiotis/gamemooch
84bc2383b6c99b0e4696f758b5cb5fa9749fcb14
app/assets/javascripts/editor.js
app/assets/javascripts/editor.js
/** * Wysiwyg related javascript */ // =require ./lib/redactor.js (function($){ $(document).ready( function() { /** * Minimal wysiwyg support */ $('.wysiwyg-minimal').redactor({ airButtons: ['bold', 'italic', 'deleted', '|', 'link'], air: true }); /** * Basic wysiwyg su...
/** * Wysiwyg related javascript */ // =require ./lib/redactor.js (function($){ $(document).ready( function() { /** * Minimal wysiwyg support */ $('.wysiwyg-minimal').redactor({ airButtons: ['bold', 'italic', 'deleted', '|', 'link'], air: true }); /** * Basic wysiwyg su...
Disable convertion to divs, preserve paragraphs.
Disable convertion to divs, preserve paragraphs.
JavaScript
mit
Courseware/coursewa.re,Courseware/coursewa.re
a04c900f0f6aa88872d84f92fada2f4517bba9d4
examples/lightsoff/arrow.js
examples/lightsoff/arrow.js
function pushed_arrow() { if(animating_board) return true; // TODO: Need to check that click count is 1 var direction = (this.flipped ? 1 : -1); if(score.value + direction < 1) return true; score.set_value(score.value + direction); swap_animation(direction); gconf_client.set_int("/apps/lightsoff/score...
function pushed_arrow(actor, event) { if(animating_board) return true; // TODO: Need to check that click count is 1 var direction = (actor.flipped ? 1 : -1); if(score.value + direction < 1) return true; score.set_value(score.value + direction); swap_animation(direction); gconf_client.set_int("/apps/li...
Fix lightsoff to not use signal this..
Fix lightsoff to not use signal this.. svn path=/trunk/; revision=452
JavaScript
lgpl-2.1
danilocesar/seed,danilocesar/seed,danilocesar/seed,danilocesar/seed,danilocesar/seed
b49b4c23636c8264794085b33ffcc702a3d46620
bids-validator/tests/env/load-examples.js
bids-validator/tests/env/load-examples.js
const fs = require('fs') const { promisify } = require('util') const request = require('sync-request') const AdmZip = require('adm-zip') const lockfile = require('lockfile') const lockPromise = promisify(lockfile.lock) const test_version = '1.2.0' const examples_lock = 'bids-validator/tests/data/examples.lockfile' //...
const fs = require('fs') const { promisify } = require('util') const request = require('sync-request') const AdmZip = require('adm-zip') const lockfile = require('lockfile') const lockPromise = promisify(lockfile.lock) const test_version = '1.2.0' const examples_lock = 'bids-validator/tests/data/examples.lockfile' //...
Remove extraneous directory creation in examples environment.
Remove extraneous directory creation in examples environment.
JavaScript
mit
nellh/bids-validator,nellh/bids-validator,Squishymedia/bids-validator,Squishymedia/BIDS-Validator,nellh/bids-validator
4b707d9da54fb68888a5494fcd9d6d64036446c1
scripts/time.js
scripts/time.js
/* * Clock plugin using Moment.js (http://momentjs.com/) to * format the time and date. * * The only exposed property, 'format', determines the * format (see Moment.js documentation) to display time and date. * * Requires 'jquery' and 'moment' to be available through RequireJS. */ define(['jquery', 'moment'], f...
/* * Clock plugin using Moment.js (http://momentjs.com/) to * format the time and date. * * The only exposed property, 'format', determines the * format (see Moment.js documentation) to display time and date. * * Requires 'jquery' and 'moment' to be available through RequireJS. */ define(['jquery', 'moment'], f...
Update for new Moment.js API
Update for new Moment.js API
JavaScript
mit
koterpillar/tianbar,koterpillar/tianbar,koterpillar/tianbar
7a49bcacbb557caca510ea8a044e4a57a62a8733
lib/components/App.js
lib/components/App.js
import React, {Component} from 'react'; import $ from 'jquery'; import CurrentWeatherCard from './CurrentWeatherCard'; export default class App extends Component { constructor(){ super() this.state = { location:'', responseData: null, currentData: null, forecastData: null, hourl...
import React, {Component} from 'react'; import $ from 'jquery'; import CurrentWeatherCard from './CurrentWeatherCard'; export default class App extends Component { constructor(){ super() this.state = { location:'', responseData: null, currentData: null, forecastData: null, hourl...
Add additional property to pass to weatherCard.
Add additional property to pass to weatherCard.
JavaScript
mit
thatPamIAm/weathrly,thatPamIAm/weathrly
40b9521f4e05eed0bf03accf868f5a4e844e3b9f
app/routes/owner/repositories.js
app/routes/owner/repositories.js
import Ember from 'ember'; import TravisRoute from 'travis/routes/basic'; import config from 'travis/config/environment'; export default TravisRoute.extend({ needsAuth: false, titleToken(model) { var name = model.name || model.login; return name; }, model(params, transition) { var options; op...
import Ember from 'ember'; import TravisRoute from 'travis/routes/basic'; import config from 'travis/config/environment'; export default TravisRoute.extend({ needsAuth: false, titleToken(model) { var name = model.name || model.login; return name; }, model(params, transition) { var options; op...
Remove line break in includes params
Remove line break in includes params This was causing a 400 Invalid Request on the organizations page.
JavaScript
mit
fotinakis/travis-web,travis-ci/travis-web,travis-ci/travis-web,fotinakis/travis-web,fotinakis/travis-web,fotinakis/travis-web,travis-ci/travis-web,travis-ci/travis-web
796174d58262bafa0157684ae6e28e455dec82b3
app.js
app.js
import {Component, View, bootstrap} from 'angular2/angular2'; // Annotation section @Component({ selector: 'my-app' }) @View({ inline: '<h1>Hello {{ name }}</h1>' }) // Component controller class MyAppComponent { constructor() { this.name = 'Alice' } } bootstrap(MyAppComponent);
import {Component, Template, bootstrap} from 'angular2/angular2'; // Annotation section @Component({ selector: 'my-app' }) @Template({ inline: '<h1>Hello {{ name }}</h1>' }) // Component controller class MyAppComponent { constructor() { this.name = 'Alice' } } bootstrap(MyAppComponent);
Fix 'template' error replacing View with Template (suggested in blog comments)
Fix 'template' error replacing View with Template (suggested in blog comments)
JavaScript
mit
training-blogs/20150514-ionic-angular-2-series-introduction,training-blogs/20150514-ionic-angular-2-series-introduction,training-blogs/20150514-ionic-angular-2-series-introduction
533833d77577306c8250410dba1ef3332cc4c1e6
handlers/middlewares/addedToGroup.js
handlers/middlewares/addedToGroup.js
'use strict'; // Bot const bot = require('../../bot'); const { replyOptions } = require('../../bot/options'); const { addGroup, managesGroup } = require('../../stores/group'); const { masterID } = require('../../config.json'); const addedToGroupHandler = async (ctx, next) => { const msg = ctx.message; const wasAd...
'use strict'; // Bot const bot = require('../../bot'); const { replyOptions } = require('../../bot/options'); const { admin } = require('../../stores/user'); const { addGroup, managesGroup } = require('../../stores/group'); const { masterID } = require('../../config.json'); const addedToGroupHandler = async (ctx, ne...
Add master to admins when added to group
Add master to admins when added to group
JavaScript
agpl-3.0
TheDevs-Network/the-guard-bot
72bcff83f71a0fd9cb04a05386e43898c6fbf75b
hooks/lib/android-helper.js
hooks/lib/android-helper.js
var fs = require("fs"); var path = require("path"); var utilities = require("./utilities"); module.exports = { addFabricBuildToolsGradle: function() { var buildGradle = utilities.readBuildGradle(); buildGradle += [ "// Fabric Cordova Plugin - Start Fabric Build Tools ", ...
var fs = require("fs"); var path = require("path"); var utilities = require("./utilities"); module.exports = { addFabricBuildToolsGradle: function() { var buildGradle = utilities.readBuildGradle(); buildGradle += [ "", "// Fabric Cordova Plugin - Start Fabric Build Tool...
Fix hook to remove build.gradle config on uninstall.
Fix hook to remove build.gradle config on uninstall.
JavaScript
mit
andrestraumann/FabricPlugin,sarriaroman/FabricPlugin,andrestraumann/FabricPlugin,sarriaroman/FabricPlugin,sarriaroman/FabricPlugin,andrestraumann/FabricPlugin,sarriaroman/FabricPlugin
8d1f37df3b597e5fe53374a3c2ec37d0ca54816e
benchmarks/message-registry.js
benchmarks/message-registry.js
'use babel' import {MessageRegistry} from '../lib/message-registry' import {getLinter, getMessage} from '../spec/common' import {timeNow, timeDiff, getMessages} from './common' const messageRegistry = new MessageRegistry() messageRegistry.debouncedUpdate = function() {} const linter = getLinter() function benchmarkR...
'use babel' import {MessageRegistry} from '../lib/message-registry' import {getLinter, getMessage} from '../spec/common' import {timeNow, timeDiff, getMessages} from './common' const messageRegistry = new MessageRegistry() messageRegistry.debouncedUpdate = function() {} const linter = getLinter() function benchmarkR...
Make benchmark result electron output friendly
:art: Make benchmark result electron output friendly
JavaScript
mit
steelbrain/linter,AtomLinter/Linter,atom-community/linter
c9b1e95d27e9e5bc150576cd02a2e4769a073f8f
public/js/register.js
public/js/register.js
$(function() { $("#register").submit(function() { var password = $("#password").val(); if (password !== $("#confirm").val()) { return false; } var hashedPassword = CryptoJS.SHA256(password).toString(); $("#hashedPassword").val(hashedPassword); return true; }) });
$(function() { $("#register").submit(function() { var password = $("#password").val(); var confirmation = $("#confirm").val(); clearErrors(); if (!passwordValid(password)) { addValidationError("Password must be at least 6 characters long"); return false; } if (!passwordConfirmed(password, confir...
Add password validation to client side
Add password validation to client side Since the password is getting hashed before it's sent to the server I couldn't do any validations on the presence or length of the password on the server side.
JavaScript
mit
jimguys/poemlab,jimguys/poemlab
c2c711f7896ad4cf405e239a4d37dd8112fd288a
chrome-extension/app/scripts/bitbucket.js
chrome-extension/app/scripts/bitbucket.js
var BitBucket = { hasLogin: function () { return !!localStorage['bitbucketLogin'] && !!localStorage['bitbucketRepo']; }, getLastChangeset: function (user, repo, callback, fail) { var url = "https://bitbucket.org/api/1.0/repositories/" + user + "/" + repo + "/changesets/"; $.ajax({ dataType: "j...
var BitBucket = { hasLogin: function () { return !!localStorage['bitbucketLogin'] && !!localStorage['bitbucketRepo']; }, getLastChangeset: function (user, repo, callback, fail) { var url = "https://bitbucket.org/api/1.0/repositories/" + user + "/" + repo + "/changesets/"; $.ajax({ dataType: "j...
Handle 404 from BitBucket API
Handle 404 from BitBucket API
JavaScript
mit
asivokon/mooch-sentinel,asivokon/mooch-sentinel,asivokon/mooch-sentinel,asivokon/mooch-sentinel
3f6b6b1db300809bef2540df1c6f05d53e2482af
seeds/cities.js
seeds/cities.js
var util = require('../src/util/seeds'); exports.seed = function(knex, Promise) { return util.insertOrUpdate(knex, 'cities', { id: 1, name: 'Otaniemi', }) .then(() => util.insertOrUpdate(knex, 'cities', { id: 2, name: 'Tampere', })); }
var util = require('../src/util/seeds'); exports.seed = function(knex, Promise) { return util.removeIfExists(knex, 'cities', { id: 1, name: 'Other', }) .then(() => util.insertOrUpdate(knex, 'cities', { id: 2, name: 'Otaniemi', })) .then(() => util.insertOrUpdate(knex, 'cities', { id: 3, ...
Remove city 'Other' using removeIfExists
Remove city 'Other' using removeIfExists
JavaScript
mit
futurice/wappuapp-backend,futurice/wappuapp-backend,kaupunki-apina/prahapp-backend,kaupunki-apina/prahapp-backend
692aa1ca5d46206e7e8e360412b545f593e4d355
web/client/scripts/controllers/LoginCtrl.js
web/client/scripts/controllers/LoginCtrl.js
'use strict'; angular.module('app').controller('LoginCtrl', function($scope, $uibModal, mafenSession, alertify, PATHS) { 'ngInject'; $scope.mafenSession = mafenSession; $scope.user = {}; $scope.login = function() { $scope.mafenSession.reset(); $scope.mafenSession.connect('ws://127.0.0.1:8000'); ...
'use strict'; angular.module('app').controller('LoginCtrl', function($scope, $uibModal, mafenSession, alertify, PATHS) { 'ngInject'; $scope.mafenSession = mafenSession; $scope.user = {}; $scope.login = function() { $scope.mafenSession.reset(); $scope.mafenSession.connect('ws://mafen.club:8000'); ...
Fix websocket URL from localhost to the real one
Fix websocket URL from localhost to the real one
JavaScript
mit
b0r3d0m/mafen,pil-a/mafen,pil-a/mafen,pil-a/mafen,b0r3d0m/mafen,b0r3d0m/mafen
24d0c3e7822165e860132d5bcdc1e9c2ed9d9a2e
initializers/trailing-history.js
initializers/trailing-history.js
/*global Ember */ var trailingHistory = Ember.HistoryLocation.extend({ setURL: function (path) { var state = this.getState(); path = this.formatURL(path); path = path.replace(/\/?$/, '/'); if (state && state.path !== path) { this.pushState(path); } } }); va...
/*global Ember */ var trailingHistory = Ember.HistoryLocation.extend({ formatURL: function () { return this._super.apply(this, arguments).replace(/\/?$/, '/'); } }); var registerTrailingLocationHistory = { name: 'registerTrailingLocationHistory', initialize: function (container, application) ...
Fix trailing slashes output app-wide
Fix trailing slashes output app-wide closes #2963, closes #2964 - override Ember's `HistoryLocation.formatURL` - remove overridden `HistoryLocation.setURL`
JavaScript
mit
dbalders/Ghost-Admin,kevinansfield/Ghost-Admin,acburdine/Ghost-Admin,acburdine/Ghost-Admin,JohnONolan/Ghost-Admin,airycanon/Ghost-Admin,JohnONolan/Ghost-Admin,dbalders/Ghost-Admin,TryGhost/Ghost-Admin,kevinansfield/Ghost-Admin,TryGhost/Ghost-Admin,airycanon/Ghost-Admin
e9de3d6da5e3cfc03b6d5e39fe92ede9c110d712
webpack_config/server/webpack.prod.babel.js
webpack_config/server/webpack.prod.babel.js
import webpack from 'webpack' import baseWebpackConfig from './webpack.base' import UglifyJSPlugin from 'uglifyjs-webpack-plugin' import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer' import {Plugin as ShakePlugin} from 'webpack-common-shake' import OptimizeJsPlugin from 'optimize-js-plugin' const analyzePlugin...
import webpack from 'webpack' import baseWebpackConfig from './webpack.base' import UglifyJSPlugin from 'uglifyjs-webpack-plugin' import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer' import {Plugin as ShakePlugin} from 'webpack-common-shake' import OptimizeJsPlugin from 'optimize-js-plugin' const plugins = [ ...
Revert "style(webpack_config/server): rewrite prod conf in functional style"
Revert "style(webpack_config/server): rewrite prod conf in functional style" This reverts commit bc707a71f85e918a2d95acd7ce1f15beb191525b.
JavaScript
apache-2.0
Metnew/react-semantic.ui-starter
6bf45d425a47caa83eae07113249c414df6c32c4
jest.config.js
jest.config.js
var semver = require('semver'); function getSupportedTypescriptTarget() { var nodeVersion = process.versions.node; if (semver.gt(nodeVersion, '7.6.0')) { return 'es2017' } else if (semver.gt(nodeVersion, '7.0.0')) { return 'es2016'; } else if (semver.gt(nodeVersion, '6.0.0')) { return 'es2015'; ...
var semver = require('semver'); function getSupportedTypescriptTarget() { var nodeVersion = process.versions.node; if (semver.gt(nodeVersion, '7.6.0')) { return 'es2017' } else if (semver.gt(nodeVersion, '7.0.0')) { return 'es2016'; } else if (semver.gt(nodeVersion, '6.0.0')) { return 'es2015'; ...
Fix deprecated warning for ts-jest
Fix deprecated warning for ts-jest
JavaScript
mit
maxdavidson/structly,maxdavidson/structly
03ed1776047ebe316fef8e077a0d62d6b5587da6
client/views/home/edit/edit.js
client/views/home/edit/edit.js
Template.editHome.helpers({ 'home': function () { // Get Home ID from template data context // convert the 'String' object to a string for the DB query var homeId = this._id; // Get home document var home = Homes.findOne(homeId); return home; } }); Template.editHome.created = function () ...
Template.editHome.created = function () { // Get reference to template instance var instance = this; // Get reference to router var router = Router.current(); // Get Home ID from router parameter var homeId = router.params.homeId; // Subscribe to single home, based on Home ID instance.subscribe('sing...
Remove unused template helper; add comments
Remove unused template helper; add comments
JavaScript
agpl-3.0
GeriLife/wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing
a205caefe68d4c9279aaa86470c30974da226874
Miscellaneous/ebay.highlight-bids.user.js
Miscellaneous/ebay.highlight-bids.user.js
// ==UserScript== // @name eBay - Hilight Items With Bids // @namespace http://mathemaniac.org // @include http://*.ebay.*/* // @grant none // @version 2.3.1 // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js // @description Hilights items that have bids ...
// ==UserScript== // @name eBay - Hilight Items With Bids // @namespace http://mathemaniac.org // @include http://*.ebay.*/* // @grant none // @version 2.3.2 // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js // @description Hilights items that have bids ...
Update eBay highlight script to work with new classes
Update eBay highlight script to work with new classes
JavaScript
mit
Eckankar/userscripts,Eckankar/userscripts
2f2a17f599a3d3de05b61664c6d321494c01e552
server/production.js
server/production.js
/* eslint strict: 0 */ 'use strict'; // Load environment variables require('dotenv-safe').load(); // Load assets const assets = require('./assets'); const express = require('express'); const compression = require('compression'); const cookieParser = require('cookie-parser'); const server = express(); // Set up the r...
/* eslint strict: 0 */ 'use strict'; // Load environment variables require('dotenv-safe').load(); // Load assets const assets = require('./assets'); const express = require('express'); const compression = require('compression'); const cookieParser = require('cookie-parser'); const server = express(); // Set up the r...
Set long time caching for js/css builds.
Set long time caching for js/css builds.
JavaScript
mit
reauv/persgroep-app,reauv/persgroep-app
f4d79cf2e7924ef1dd294e8c37ce54bfc2a73d02
js/controllers/catalog-ctrl.js
js/controllers/catalog-ctrl.js
catalogApp.controller('CatalogCtrl', ['$scope', 'assetService', function($scope, assetService) { $scope.assets = []; $scope.totalHits = 0; $scope.getAssets = function(data) { var promise = assetService.getAssets({ data: data }); promise.then(function(response) { var originalAssets = resp...
catalogApp.controller('CatalogCtrl', ['$scope', 'assetService', function($scope, assetService) { $scope.assets = []; $scope.currentPage = 0; $scope.totalPages = 1; $scope.pageNumbers = []; $scope.pageSize = 20; $scope.totalHits = 0; $scope.pageOffset = 0; var initPagination = function(totalPages) { ...
Add pagination logic, cleanup re-org code
Add pagination logic, cleanup re-org code
JavaScript
mit
satbirjhuti/catalogFeed,satbirjhuti/catalogFeed
1a067a9635585cbb96c80040b2941e92868b07df
browscap.js
browscap.js
"use strict"; module.exports = function Browscap (cacheDir) { if (typeof cacheDir === 'undefined') { cacheDir = './sources/'; } this.cacheDir = cacheDir; /** * parses the given user agent to get the information about the browser * * if no user agent is given, it uses {@see \BrowscapPHP\Helper\Su...
"use strict"; module.exports = function Browscap (cacheDir) { if (typeof cacheDir === 'undefined') { cacheDir = __dirname + '/sources/'; } this.cacheDir = cacheDir; /** * parses the given user agent to get the information about the browser * * if no user agent is given, it uses {@see \BrowscapPH...
Use cache dir based on file location
Use cache dir based on file location
JavaScript
mit
mimmi20/browscap-js
a7da36d8376de9f2eccac11f9e3db35618ecf44a
source/index.js
source/index.js
import normalizeEvents from './tools/normalizeEvents'; import normalizeListener from './tools/normalizeListener'; export default function stereo () { let listeners = {}; let emitter = { on(events, listener) { // Normalize arguments. events = normalizeEvents(events); listener = normalizeListe...
import normalizeEvents from './tools/normalizeEvents'; import normalizeListener from './tools/normalizeListener'; export default function stereo () { let listeners = {}; let emitter = { on(events, listener) { // Normalize arguments. events = normalizeEvents(events); listener = normalizeListe...
Switch from arrays to Sets
Switch from arrays to Sets
JavaScript
mit
stoeffel/stereo,tomekwi/stereo
a0b049a5f396eb9498bd1a8ea8bdb79f64321b97
server/repositories/gameRepository.js
server/repositories/gameRepository.js
const mongoskin = require('mongoskin'); const logger = require('../log.js'); class GameRepository { save(game, callback) { var db = mongoskin.db('mongodb://127.0.0.1:27017/throneteki'); if(!game.id) { db.collection('games').insert(game, function(err, result) { if(err) {...
const mongoskin = require('mongoskin'); const logger = require('../log.js'); class GameRepository { save(game, callback) { var db = mongoskin.db('mongodb://127.0.0.1:27017/throneteki'); if(!game.id) { db.collection('games').insert(game, function(err, result) { if(err) {...
Save the players array correctly when saving game stats
Save the players array correctly when saving game stats
JavaScript
mit
ystros/throneteki,jeremylarner/ringteki,cryogen/gameteki,DukeTax/throneteki,cryogen/throneteki,jbrz/throneteki,gryffon/ringteki,jeremylarner/ringteki,jbrz/throneteki,gryffon/ringteki,Antaiseito/throneteki_for_doomtown,cryogen/throneteki,Antaiseito/throneteki_for_doomtown,cryogen/gameteki,gryffon/ringteki,DukeTax/throne...
40743d988e0ab90d9e54f304a65a5f436db13dbd
server/test/unit/logger/loggerSpec.js
server/test/unit/logger/loggerSpec.js
'use strict'; var chai = require('chai'), expect = chai.expect, sinon = require('sinon'), sinonChai = require('sinon-chai'), logger = require('../../../logger'); chai.use(sinonChai); describe('logger', function () { describe('infoStream', function () { var infoStream = logger.infoStream...
'use strict'; var chai = require('chai'), expect = chai.expect, sinon = require('sinon'), sinonChai = require('sinon-chai'), logger = require('../../../logger'); chai.use(sinonChai); describe('logger', function () { describe('infoStream', function () { var infoStream = logger.infoStream...
Add test for untested empty string branch.
Add test for untested empty string branch.
JavaScript
mit
lxanders/community
f7ea031dac8dedddd9525c42a5c27b34c01f616a
grunt/config/jsx/jsx.js
grunt/config/jsx/jsx.js
'use strict'; var rootIDs = [ "React" ]; var debug = { rootIDs: rootIDs, configFile: "grunt/config/jsx/debug.json", sourceDir: "src", outputDir: "build/modules" }; var jasmine = { rootIDs: [ "all" ], configFile: debug.configFile, sourceDir: "vendor/jasmine", outputDir: "build/jasmine" }; var...
'use strict'; var rootIDs = [ "React", "ReactTransitionGroup" ]; var debug = { rootIDs: rootIDs, configFile: "grunt/config/jsx/debug.json", sourceDir: "src", outputDir: "build/modules" }; var jasmine = { rootIDs: [ "all" ], configFile: debug.configFile, sourceDir: "vendor/jasmine", outputDi...
Add ReactTransitionGroup to the build
Add ReactTransitionGroup to the build
JavaScript
bsd-3-clause
gfogle/react,richiethomas/react,claudiopro/react,chacbumbum/react,sugarshin/react,reactjs-vn/reactjs_vndev,orneryhippo/react,dariocravero/react,szhigunov/react,ashwin01/react,TheBlasfem/react,ridixcr/react,TylerBrock/react,benchling/react,dirkliu/react,haoxutong/react,odysseyscience/React-IE-Alt,gfogle/react,trueadm/re...
2d78ed41e309568eb0307769c58a3bbdad5d75f9
app/assets/javascripts/assessment_form.js
app/assets/javascripts/assessment_form.js
$(document).ready(function() { function updateAssessmentFormState() { var numberOfQuestions = $('#assessment .legend').length; var numberOfCheckedAnswers = $('#assessment input:checked').length; var numberOfUnansweredQuestions = numberOfQuestions - numberOfCheckedAnswers; var unansweredQuestionsBadge...
$(document).ready(function() { function updateAssessmentFormState() { var numberOfQuestions = $('#assessment .legend').length; var numberOfCheckedAnswers = $('#assessment input:checked').length; var numberOfUnansweredQuestions = numberOfQuestions - numberOfCheckedAnswers; var unansweredQuestionsBadge...
Hide (instead of fade out) badge on iPhone
Hide (instead of fade out) badge on iPhone
JavaScript
mit
woople/woople-theme,woople/woople-theme
627ea6e7175d3ec1fb89e0c896e123ed8bd3ee2b
bookWorm.js
bookWorm.js
$(document).ready(function() { onCreatedChrome() }); function onCreatedChrome() { chrome.tabs.onCreated.addListener(function(tab) { alert("hello"); }); }
$(document).ready(function() { onCreatedChrome(); }); function onCreatedChrome() { chrome.tabs.onCreated.addListener(function(tab) { chrome.bookmarks.getChildren("1", (bar) => { chrome.bookmarks.remove(bar[bar.length - 1].id); }); }); }
Make function to eat bookmarks
Make function to eat bookmarks
JavaScript
mit
tmashuang/BookWorm,tmashuang/BookWorm
f98e9ddd8fa02c5d16f7d94c8b811b21e2c39b8f
src/main/resources/web/js/tool-editor/constants.js
src/main/resources/web/js/tool-editor/constants.js
/** * Copyright (c) 2017, 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.o...
/** * Copyright (c) 2017, 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.o...
Update Siddhi quick start guide link
Update Siddhi quick start guide link
JavaScript
apache-2.0
wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics
d602a2a4c9b2aca9ca330768025fd594ad2f0037
lib/helpers.js
lib/helpers.js
var exec = require('child_process').exec, _ = require('lodash') module.exports.asyncIterate = function(array, callback, done) { function iterate(idx) { var current = array[idx] if (current) { callback(current, function() { iterate(idx+1) }, function(err) { done(err) }) ...
var exec = require('child_process').exec, _ = require('lodash') module.exports.asyncIterate = function(array, callback, done) { function iterate(idx) { var current = array[idx] if (current) { callback(current, function() { iterate(idx+1) }, function(err) { done(err) }) ...
Add helper for container “created”-status checking
Add helper for container “created”-status checking
JavaScript
mit
mnylen/pig,mnylen/pig
cb92521b4c237e8a6d7b26f0fe02c26b10187c3a
modifyurl@2ch.user.js
modifyurl@2ch.user.js
// ==UserScript== // @id Modify URL @2ch // @name Modify URL @2ch // @version 0.0.5 // @namespace curipha // @author curipha // @description Modify "ttp://" text to anchor and redirect URIs to direct link. // @include http://*.2ch.net/* // @include http://*.bbs...
// ==UserScript== // @id Modify URL @2ch // @name Modify URL @2ch // @version 0.0.6 // @namespace curipha // @author curipha // @description Modify "ttp://" text to anchor and redirect URIs to direct link. // @include http://*.2ch.net/* // @include http://*.bbs...
Fix the potential XSS in URI-like strings with <, > and "
Fix the potential XSS in URI-like strings with <, > and "
JavaScript
unlicense
curipha/userscripts,curipha/userscripts
c515c365778b609c1e54a24bc670f23d3ef2fac4
lib/message.js
lib/message.js
/** * Creates an instance of `Message`. * * This class is used as a mock when testing Crane handlers, substituted in * place of a `Message` from the underlying message queue adapter. * * @constructor * @api protected */ function Message(cb) { this.queue = '/'; this.headers = {}; this.__cb = cb; } Message...
/** * Creates an instance of `Message`. * * This class is used as a mock when testing Crane handlers, substituted in * place of a `Message` from the underlying message queue adapter. * * @constructor * @api protected */ function Message(cb) { this.topic = '/'; this.headers = {}; this.__cb = cb; } Message...
Set topic rather than queue.
Set topic rather than queue.
JavaScript
mit
jaredhanson/chai-crane-handler
1dabed199a7087054b64896d523983f1539802af
prepublish.js
prepublish.js
'use strict'; var fs = require('fs'); var visitors = require('react-tools/vendor/fbtransform/visitors'); var jstransform = require('jstransform'); var visitorList = visitors.getAllVisitors(); var getJsName = function(filename) { var dot = filename.lastIndexOf("."); var baseName = filename.substring(0, dot); ...
'use strict'; var fs = require('fs'); var visitors = require('react-tools/vendor/fbtransform/visitors'); var jstransform = require('jstransform'); var visitorList = visitors.getAllVisitors(); var getJsName = function(filename) { var dot = filename.lastIndexOf("."); var baseName = filename.substring(0, dot); ...
Replace .jsx requires in .js to be able to require e.g. timeago
Replace .jsx requires in .js to be able to require e.g. timeago
JavaScript
mit
sloria/react-components,quicktoolbox/react-components,sloria/react-components,redsunsoft/react-components,jepezi/react-components,jepezi/react-components,Khan/react-components,redsunsoft/react-components,jepezi/react-components,vasanthk/react-components,sloria/react-components,vasanthk/react-components,quicktoolbox/rea...
3e1f0ab719845969ae82f73713374cd15342d51d
src/Node/Encoding.js
src/Node/Encoding.js
/* global exports */ /* global Buffer */ "use strict"; // module Node.Encoding exports.byteLength = function (str) { return function (enc) { return Buffer.byteLength(str, enc); }; };
/* global exports */ /* global Buffer */ "use strict"; // module Node.Encoding exports.byteLengthImpl = function (str) { return function (enc) { return Buffer.byteLength(str, enc); }; };
Fix foreign import declaration for byteLength
Fix foreign import declaration for byteLength
JavaScript
mit
purescript-node/purescript-node-buffer
5d03539ad1fb34c246b3d7f729256c4370f1ad6d
javascript/mailblock.js
javascript/mailblock.js
(function($) { $(document).ready(function(){ showHideButton(); $('.cms-tabset-nav-primary li').on('click', showHideButton); function showHideButton() { if ($('#Root_Mailblock_set').is(':visible')) { $('#Form_EditForm_action_mailblockTestEmail').show(); } else { $('#Form_EditForm_action_mailb...
(function($) { $(document).ready(function(){ showHideButton(); $('.cms-tabset-nav-primary li').on('click', showHideButton); function showHideButton() { if ($('#Root_Mailblock_set').is(':visible')) { $('#Form_EditForm_action_mailblockTestEmail').show(); ...
Replace all tabs with spaces.
Replace all tabs with spaces.
JavaScript
bsd-3-clause
signify-nz/silverstripe-mailblock,signify-nz/silverstripe-mailblock
fed9ff29a9a2390146666ec19119836fa91cd96a
examples/starters/list/js/controllers.js
examples/starters/list/js/controllers.js
angular.module('listExample.controllers', []) // Controller that fetches a list of data .controller('MovieIndexCtrl', function($scope, MovieService) { // "MovieService" is a service returning mock data (services.js) // the returned data from the service is placed into this // controller's scope so the templ...
angular.module('listExample.controllers', []) // Controller that fetches a list of data .controller('MovieIndexCtrl', function($scope, MovieService,$timeout) { // "MovieService" is a service returning mock data (services.js) // the returned data from the service is placed into this // controller's scope so ...
Add 3 movies in example, looks better
Add 3 movies in example, looks better
JavaScript
mit
Jeremy017/ionic,Jeremy017/ionic,lutrosis81/manup-app,gyx8899/ionic,Gregcop1/ionic,blueElix/ionic,Kryz/ionic,ddddm/ionic,yalishizhude/ionic,nelsonsozinho/ionic,cnbin/ionic,chrisbautista/ionic,thebigbrain/ionic,Jandersolutions/ionic,chinakids/ionic,abcd-ca/ionic,brant-hwang/ionic,Urigo/meteor-ionic,Xeeshan94/ionic,janij/...
af892e2365daa6b213c89b3bacdfaf4da777d1d6
src/js/Enemy.js
src/js/Enemy.js
'use strict'; /** * @description Enemy class => objects the player should avoid * @constructor * @param {number} x position of the enemy on the 'x' axis * @param {number} y position of the enemy on the 'y' axis * @param {number} speed speed factor of the enemy */ var Enemy = function (x,...
'use strict'; /** * @description Enemy class => objects the player should avoid * @constructor * @param {number} x position of the enemy on the 'x' axis * @param {number} y position of the enemy on the 'y' axis * @param {number} speed speed factor of the enemy */ var Enemy = function (x,...
Update the enemy bounds in the enemy class
Update the enemy bounds in the enemy class
JavaScript
mit
zakhttp/super-mario-frogger,zakhttp/super-mario-frogger
d7991bc3af6d3bce7ae1fec107e8497c4b1e25f1
js/components/player.js
js/components/player.js
import React from 'react'; module.exports = React.createClass({ getInitialState: function getInitialState() { return { isPlayingStream: typeof window.orientation === 'undefined', // Should return true if not mobile nowPlayingLabel: 'Offline', }; }, setPlayerState: function setPlayerState() {...
import React from 'react'; module.exports = React.createClass({ getInitialState: function getInitialState() { return { isPlayingStream: typeof window.orientation === 'undefined', // Should return true if not mobile nowPlayingLabel: 'Offline', }; }, onPlayClicked: function onPlayClicked() { ...
Add click listener to play buttotn.
Add click listener to play buttotn.
JavaScript
mit
frequencyasia/website,frequencyasia/website
768f4bf499d00c6a801b018b6a1c656c5800076c
nodejs/lib/hoptoad.js
nodejs/lib/hoptoad.js
var Hoptoad = require('hoptoad-notifier').Hoptoad , env = require('../environment') , shouldReport = env.hoptoad && env.hoptoad.reportErrors; if(shouldReport) Hoptoad.key = env.hoptoad.apiKey; process.addListener('uncaughtException', function(err) { if(shouldReport) Hoptoad.notify(err, function(){}); }); ...
var Hoptoad = require('hoptoad-notifier').Hoptoad , env = require('../environment') , shouldReport = env.hoptoad && env.hoptoad.reportErrors; if(shouldReport) Hoptoad.key = env.hoptoad.apiKey; process.addListener('uncaughtException', function(err) { if(shouldReport) Hoptoad.notify(err, function(){}); con...
Print out uncaught exceptions. Node stops doing this when you add an uncaught exception handler.
Print out uncaught exceptions. Node stops doing this when you add an uncaught exception handler.
JavaScript
mit
iFixit/wompt.com,iFixit/wompt.com,Wompt/wompt.com,iFixit/wompt.com,Wompt/wompt.com,Wompt/wompt.com,iFixit/wompt.com
e0860e4491a2519493426cb1cfdbcca8071467e9
validators/json/load.js
validators/json/load.js
const utils = require('../../utils') const load = (files, jsonFiles, jsonContentsDict, annexed, dir) => { let issues = [] // Read JSON file contents and parse for issues const readJsonFile = (file, annexed, dir) => utils.files .readFile(file, annexed, dir) .then(contents => utils.json.parse(file...
const utils = require('../../utils') class JSONParseError extends Error { constructor(message) { super(message) this.name = 'JSONParseError' } } const load = (files, jsonFiles, jsonContentsDict, annexed, dir) => { let issues = [] // Read JSON file contents and parse for issues const readJsonFile = ...
Reimplement early exit for JSON parse errors.
Reimplement early exit for JSON parse errors.
JavaScript
mit
nellh/bids-validator,Squishymedia/bids-validator,Squishymedia/BIDS-Validator,nellh/bids-validator,nellh/bids-validator
754bd76e3f18246b4b3cf161755fb9919571cc19
app/util.js
app/util.js
function randomFrom(array) { return array[Math.floor(Math.random()*array.length)] } function filter_available(item) { return !item.unreleased } var language_map = { "en_US": "en", "fr_FR": "fr", "ja_JP": "ja", "fr_CA": "fr-ca", "es_ES": "es", "es_MX": "es-mx" } String.prototype.format = function(scop...
function randomFrom(array) { return array[Math.floor(Math.random()*array.length)] } function filter_available(item) { return !item.unreleased } var language_map = { "en_US": "en-us", "fr_FR": "fr", "ja_JP": "ja", "fr_CA": "fr-ca", "es_ES": "es", "es_MX": "es-mx" } String.prototype.format = function(s...
Change en_US code from "en" to "en-us" for consistency
Change en_US code from "en" to "en-us" for consistency
JavaScript
mit
DeviPotato/splat2-calc,DeviPotato/splat2-calc
fea368f1da1c6c3a58ad7bbcf6193d56c5592e68
app/Resources/appify.js
app/Resources/appify.js
/* * This is a template used when TiShadow "appifying" a titanium project. * See the README. */ var TiShadow = require("/api/TiShadow"); var Compression = require('ti.compression'); // Need to unpack the bundle on a first load; var path_name = "{{app_name}}".replace(/ /g,"_"); var target = Ti.Filesystem.getFile(T...
/* * This is a template used when TiShadow "appifying" a titanium project. * See the README. */ Titanium.App.idleTimerDisabled = true; var TiShadow = require("/api/TiShadow"); var Compression = require('ti.compression'); // Need to unpack the bundle on a first load; var path_name = "{{app_name}}".replace(/ /g,"_...
Disable idleTimer on iOS for appified apps
Disable idleTimer on iOS for appified apps
JavaScript
apache-2.0
titanium-forks/dbankier.TiShadow,r8o8s1e0/TiShadow,HazemKhaled/TiShadow,FokkeZB/TiShadow,emilyvon/TiShadow,HazemKhaled/TiShadow,r8o8s1e0/TiShadow,Biotelligent/TiShadow,r8o8s1e0/TiShadow,Biotelligent/TiShadow,HazemKhaled/TiShadow,FokkeZB/TiShadow,emilyvon/TiShadow,emilyvon/TiShadow,titanium-forks/dbankier.TiShadow,titan...
c140b8c985cfc05ce8ae1326e470d9f4e1231a54
lib/metalsmith-metafiles.js
lib/metalsmith-metafiles.js
"use strict"; var MetafileMatcher = require('./metafile-matcher'); // Not needed in Node 4.0+ if (!Object.assign) Object.assign = require('object-assign'); class MetalsmithMetafiles { constructor(options) { options = options || {}; this._initMatcherOptions(options); this._initMatchers(); } _initM...
"use strict"; var MetafileMatcher = require('./metafile-matcher'); // Not needed in Node 4.0+ if (!Object.assign) Object.assign = require('object-assign'); class MetalsmithMetafiles { constructor(options) { options = options || {}; this._initMatcherOptions(options); this._initMatchers(); } _initM...
Remove arrow function to remain compatible with older Node versions
Remove arrow function to remain compatible with older Node versions
JavaScript
mit
Ajedi32/metalsmith-metafiles
14b04b085f0688c37580b7622ef36b062e4d0bcf
app/routes/ember-cli.js
app/routes/ember-cli.js
import Route from '@ember/routing/route'; export default Route.extend({ titleToken() { return 'Ember CLI'; } });
import Route from '@ember/routing/route'; export default Route.extend({ title() { return 'Ember CLI - Ember API Documentation'; } });
Update to return the title Function
Update to return the title Function
JavaScript
mit
ember-learn/ember-api-docs,ember-learn/ember-api-docs
1623ae966b9823088e65870104d9e37d714b23c0
src/reactize.js
src/reactize.js
var Turbolinks = require("exports?this.Turbolinks!turbolinks"); /* Disable the Turbolinks page cache to prevent Tlinks from storing versions of * pages with `react-id` attributes in them. When popping off the history, the * `react-id` attributes cause React to treat the old page like a pre-rendered * page and break...
var Turbolinks = require("exports?this.Turbolinks!turbolinks"); // Disable the Turbolinks page cache to prevent Tlinks from storing versions of // pages with `react-id` attributes in them. When popping off the history, the // `react-id` attributes cause React to treat the old page like a pre-rendered // page and break...
Standardize on “//“ for all JS comments
Standardize on “//“ for all JS comments
JavaScript
apache-2.0
ssorallen/turbo-react,ssorallen/turbo-react,ssorallen/turbo-react
fd20009fcf17de391b398cbb7ce746144fc610c6
js/Search.spec.js
js/Search.spec.js
import React from 'react' import { shallow } from 'enzyme' import { shallowToJson } from 'enzyme-to-json' import Search from './Search' import ShowCard from './ShowCard' import preload from '../public/data.json' test('Search snapshot test', () => { const component = shallow(<Search />) const tree = shallowToJson(c...
import React from 'react' import { shallow } from 'enzyme' import { shallowToJson } from 'enzyme-to-json' import Search from './Search' import ShowCard from './ShowCard' import preload from '../public/data.json' test('Search snapshot test', () => { const component = shallow(<Search />) const tree = shallowToJson(c...
Add test for the search field.
Add test for the search field.
JavaScript
mit
dianafisher/FEM-complete-intro-to-react,dianafisher/FEM-complete-intro-to-react
fdcfa64c627f9522db5f176cc103171df839cad1
ember-cli-build.js
ember-cli-build.js
/* eslint-env node */ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { var app = new EmberAddon(defaults, { // Add options here }); /* This build file specifies the options for the dummy test app of this addon, located in `/tests/dummy` This...
/* eslint-env node */ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function (defaults) { var app = new EmberAddon(defaults, { 'ember-cli-babel': { includePolyfill: true } }); /* This build file specifies the options for the dummy test app of this addon, ...
Fix broken test by including babel polyfill on dummy app
Fix broken test by including babel polyfill on dummy app
JavaScript
mit
scottwernervt/ember-cli-group-by,scottwernervt/ember-cli-group-by
0d7cfde7c85bf6c8275b7db45cc2f2faf911fb41
js/application.js
js/application.js
;(function(){ var G = dijkstra.hexGrid(2); var view = new dijkstra.GraphView(G, document.getElementById('graph'), { placement: function(position){ return { 'x': 100 * position.x, 'y': 100 * position.y }}, radius: 20, between: 0.3, vertex: { ...
;(function(){ var G = dijkstra.hexGrid(2); var view = new dijkstra.GraphView(G, document.getElementById('graph'), { placement: function(position){ return { 'x': 100 * position.x, 'y': 100 * position.y }}, radius: 20, between: 0.3, vertex: { ...
Use charCode instead of keyCode
Use charCode instead of keyCode
JavaScript
mit
dvberkel/Dijkstra,dvberkel/Dijkstra
62bc1ec26ad607e42a2495257b3e0156830b42dd
app/templates/src/main/webapp/scripts/app/account/settings/_settings.controller.js
app/templates/src/main/webapp/scripts/app/account/settings/_settings.controller.js
'use strict'; angular.module('<%=angularAppName%>') .controller('SettingsController', function ($scope, Principal, Auth) { $scope.success = null; $scope.error = null; Principal.identity().then(function(account) { $scope.settingsAccount = account; }); $scope.save...
'use strict'; angular.module('<%=angularAppName%>') .controller('SettingsController', function ($scope, Principal, Auth) { $scope.success = null; $scope.error = null; Principal.identity(true).then(function(account) { $scope.settingsAccount = account; }); $scope....
Refresh data for the user settings page when it is being accessed
Refresh data for the user settings page when it is being accessed Fix #1281
JavaScript
apache-2.0
vivekmore/generator-jhipster,deepu105/generator-jhipster,dynamicguy/generator-jhipster,mosoft521/generator-jhipster,pascalgrimaud/generator-jhipster,ziogiugno/generator-jhipster,atomfrede/generator-jhipster,siliconharborlabs/generator-jhipster,wmarques/generator-jhipster,duderoot/generator-jhipster,maniacneron/generato...
6ce99ce4acbed8c57b672706c4b26dfc063bb04b
extensionloader.js
extensionloader.js
/* Load a block from github.io. Accepts a url as a parameter which can include url parameters e.g. https://megjlow.github.io/extension2.js?name=SUN&ip=10.0.0.1 */ new (function() { var ext = this; var descriptor = { blocks: [ [' ', 'Load extension block %s', 'loadBlock', 'url', 'url'], ], ur...
/* Load a block from github.io. Accepts a url as a parameter which can include url parameters e.g. https://megjlow.github.io/extension2.js?name=SUN&ip=10.0.0.1 */ new (function() { var ext = this; var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(document.currentScript...
Allow a block to be specified for loading
Allow a block to be specified for loading
JavaScript
mit
megjlow/megjlow.github.io
997ef4147d96618cd4f1c57289e98004b7b7eb7d
extra/_buildAll.js
extra/_buildAll.js
const childProcess = require("child_process"); const fs = require("fs"); if (process.argv.length !== 3) { throw new Error("Requires the base path as argument."); } const basePath = process.argv[2]; if (!basePath.match(/[\\\/]$/)) { throw new Error("Path must end with a slash - any slash will do."); } else if ...
const childProcess = require("child_process"); const fs = require("fs"); if (process.argv.length !== 3) { throw new Error("Requires the base path as argument."); } const basePath = process.argv[2]; if (!basePath.match(/[\\\/]$/)) { throw new Error("Path must end with a slash - any slash will do."); } else if ...
Stop relying on `ts-node` from the global scope
Stop relying on `ts-node` from the global scope
JavaScript
lgpl-2.1
WoltLab/WCF,WoltLab/WCF,SoftCreatR/WCF,WoltLab/WCF,SoftCreatR/WCF,SoftCreatR/WCF,SoftCreatR/WCF,WoltLab/WCF
275dc5b09b27d5441814aa423cddaa7472344dbf
src/hooks/usePopover.js
src/hooks/usePopover.js
import React, { useState, useCallback, useRef } from 'react'; /** * Hook which manages popover position over a DOM element. * Pass a ref created by React.createRef. Receive callbacks, */ export const usePopover = () => { const [visibilityState, setVisibilityState] = useState(false); const ref = useRef(React.cre...
import React, { useState, useCallback, useRef } from 'react'; import { useNavigationFocus } from './useNavigationFocus'; /** * Hook which manages popover position over a DOM element. * Pass a ref created by React.createRef. Receive callbacks, */ export const usePopover = navigation => { const [visibilityState, se...
Add use of navigation focus custom hook in usePopOver hook
Add use of navigation focus custom hook in usePopOver hook
JavaScript
mit
sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile
0087fa9db21bf615d3c57480c89a706c8d8e75bf
lib/jsdom/level2/languages/javascript.js
lib/jsdom/level2/languages/javascript.js
var Context = process.binding('evals').Context, // TODO: Remove .Script when bumping req'd node version to >= 5.0 Script = process.binding('evals').NodeScript || process.binding('evals').Script; exports.javascript = function(element, code, filename) { var document = element.ownerDocument, window = docu...
var vm = require('vm'); exports.javascript = function(element, code, filename) { var document = element.ownerDocument, window = document.parentWindow; if (window) { var ctx = window.__scriptContext; if (!ctx) { window.__scriptContext = ctx = vm.createContext({}); ctx.__proto__ = window; ...
Use vm instead of evals binding
Use vm instead of evals binding
JavaScript
mit
iizukanao/jsdom,aduyng/jsdom,jeffcarp/jsdom,jeffcarp/jsdom,tmpvar/jsdom,Zirro/jsdom,evdevgit/jsdom,susaing/jsdom,sebmck/jsdom,Zirro/jsdom,Ye-Yong-Chi/jsdom,mbostock/jsdom,zaucy/jsdom,beni55/jsdom,kesla/jsdom,darobin/jsdom,cpojer/jsdom,mbostock/jsdom,Sebmaster/jsdom,snuggs/jsdom,AshCoolman/jsdom,szarouski/jsdom,janusnic...
dcbba806e6d933f714fec77c1b37c485a43a9e00
tests/unit/controllers/submit-test.js
tests/unit/controllers/submit-test.js
import { moduleFor, test } from 'ember-qunit'; moduleFor('controller:submit', 'Unit | Controller | submit', { // Specify the other units that are required for this test. // needs: ['controller:foo'] needs: [ 'validator:presence', 'validator:length', 'validator:format', 'service:...
import { moduleFor, test } from 'ember-qunit'; moduleFor('controller:submit', 'Unit | Controller | submit', { // Specify the other units that are required for this test. // needs: ['controller:foo'] needs: [ 'validator:presence', 'validator:length', 'validator:format', 'service:...
Add tests for some submit controller actions.
Add tests for some submit controller actions.
JavaScript
apache-2.0
baylee-d/ember-preprints,caneruguz/ember-preprints,baylee-d/ember-preprints,CenterForOpenScience/ember-preprints,CenterForOpenScience/ember-preprints,laurenrevere/ember-preprints,laurenrevere/ember-preprints,caneruguz/ember-preprints
c8e2d1ac9ed72967aa8f8210f8c05f2af8044cab
tests/dummy/app/components/froala-editor.js
tests/dummy/app/components/froala-editor.js
import FroalaEditorComponent from 'ember-froala-editor/components/froala-editor'; export default FroalaEditorComponent.extend({ // eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects options: { key: 'Tvywseoh1irkdyzdhvlvC8ehe==' } });
import FroalaEditorComponent from 'ember-froala-editor/components/froala-editor'; export default FroalaEditorComponent.extend({ // eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects options: { key: '3C3B6eF5B4A3E3E2C2C6D6A3D3xg1kemB-22B-16rF-11dyvwtvze1zdA1H-8vw==' } });
Update editor key for docs site
Update editor key for docs site
JavaScript
mit
froala/ember-froala-editor,froala/ember-froala-editor,Panman8201/ember-froala-editor,Panman8201/ember-froala-editor
8ddadad76536c0445c1da4cd203646509dc30cfd
contribs/gmf/src/proj/epsg21781projection.js
contribs/gmf/src/proj/epsg21781projection.js
goog.provide('gmf.proj.EPSG21781'); goog.require('ol.proj'); if (typeof proj4 == 'function') { proj4.defs('EPSG:21781', '+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 ' + '+k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel' + '+towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs');...
goog.provide('gmf.proj.EPSG21781'); goog.require('ol.proj'); if (typeof proj4 == 'function') { proj4.defs('EPSG:21781', '+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 ' + '+k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel ' + '+towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs')...
Add missing space in proj definition
Add missing space in proj definition
JavaScript
mit
Jenselme/ngeo,kalbermattenm/ngeo,ger-benjamin/ngeo,pgiraud/ngeo,camptocamp/ngeo,ger-benjamin/ngeo,pgiraud/ngeo,Jenselme/ngeo,ger-benjamin/ngeo,Jenselme/ngeo,camptocamp/ngeo,adube/ngeo,camptocamp/ngeo,adube/ngeo,camptocamp/ngeo,adube/ngeo,kalbermattenm/ngeo,kalbermattenm/ngeo,adube/ngeo,camptocamp/ngeo,Jenselme/ngeo,pgi...
5b0082d9aaa6ae25e2ed7a0049b1829b3a9aa242
src/patch_dns_lookup.js
src/patch_dns_lookup.js
// Patch DNS.lookup to resolve all hosts added via Replay.localhost as 127.0.0.1 const DNS = require('dns'); const Replay = require('./'); const originalLookup = DNS.lookup; DNS.lookup = function(domain, options, callback) { if (typeof domain === 'string' && typeof options === 'object' && typeof callback ...
// Patch DNS.lookup to resolve all hosts added via Replay.localhost as 127.0.0.1 const DNS = require('dns'); const Replay = require('./'); const originalLookup = DNS.lookup; DNS.lookup = function(domain, options, callback) { if (typeof domain === 'string' && typeof options === 'object' && typeof callback ...
Support |all| option when shimming DNS.lookup
Support |all| option when shimming DNS.lookup Before, clients attempting an "all" style address lookup, such as the SQL Server database module tedious does in its connector.js when provided a hostname, were liable to error out due to treating the argument as an array when Replay was supplying a string. This might have...
JavaScript
mit
assaf/node-replay
cf06f9680d8494204db1b70fab4f859f91ca684e
graphql/database/charities/__tests__/CharityModel.test.js
graphql/database/charities/__tests__/CharityModel.test.js
/* eslint-env jest */ import tableNames from '../../tables' import Charity from '../CharityModel' jest.mock('../../database') describe('CharityModel', () => { it('implements the name property', () => { expect(Charity.name).toBeDefined() }) it('implements the hashKey property', () => { expect(Charity.h...
/* eslint-env jest */ import uuid from 'uuid/v4' import tableNames from '../../tables' import Charity from '../CharityModel' jest.mock('../../database') describe('CharityModel', () => { it('implements the name property', () => { expect(Charity.name).toBeDefined() }) it('implements the hashKey property', ...
Test using an existing ID.
Test using an existing ID.
JavaScript
mpl-2.0
gladly-team/tab,gladly-team/tab,gladly-team/tab
6e853e6d2eba890ddff29b71a21130e145c747fb
html/directives/validateBitcoinAddress.js
html/directives/validateBitcoinAddress.js
angular.module('app').directive("validateBitcoinAddress", function() { return { require: 'ngModel', link: function(scope, ele, attrs, ctrl) { ctrl.$parsers.unshift(function(value) { // test and set the validity after update. var valid = window.bitcoinAdd...
angular.module('app').directive("validateBitcoinAddress", function() { return { require: 'ngModel', link: function(scope, ele, attrs, ctrl) { ctrl.$parsers.unshift(function(value) { var valid = window.bitcoinAddress.validate(value); ctrl.$setValidity('val...
Clean up comments and validity check
Clean up comments and validity check
JavaScript
mit
atsuyim/OpenBazaar,must-/OpenBazaar,must-/OpenBazaar,saltduck/OpenBazaar,NolanZhao/OpenBazaar,NolanZhao/OpenBazaar,tortxof/OpenBazaar,tortxof/OpenBazaar,must-/OpenBazaar,blakejakopovic/OpenBazaar,habibmasuro/OpenBazaar,bankonme/OpenBazaar,blakejakopovic/OpenBazaar,rllola/OpenBazaar,rllola/OpenBazaar,mirrax/OpenBazaar,b...
246825583b1c778e56bad458f3e4283c9b1c5df6
es2015/total-replies.js
es2015/total-replies.js
"use strict"; let replyCount = 21; let message = `This topic has a total of replies`;
"use strict"; let replyCount = 21; let message = `This topic has a total of ${replyCount} replies`;
Complete the code to use the variable replyCount from inside the template string
Complete the code to use the variable replyCount from inside the template string
JavaScript
mit
var-bin/reactjs-training,var-bin/reactjs-training,var-bin/reactjs-training
5a14bf458e67d893cefe99e7515fdb3b904ab556
src/interfaces/i-tracker-manager.js
src/interfaces/i-tracker-manager.js
'use strict'; const EventEmitter = require('events'); /** * Tracker Manager * @interface */ class ITrackerManager extends EventEmitter { constructor() { super(); if (this.constructor === ITrackerManager) { throw new TypeError('Can not create new instance of interface'); } } /** * Include tracker in...
'use strict'; const EventEmitter = require('events'); /** * Tracker Manager * @interface */ class ITrackerManager extends EventEmitter { constructor() { super(); if (this.constructor === ITrackerManager) { throw new TypeError('Can not create new instance of interface'); } } /** * Include tracker in...
Change interface for make change in implementation
Change interface for make change in implementation
JavaScript
mit
reeFridge/tracker-proxy
733b66e5733800e4abc8dbcf358b3af20e424313
app/components/popover-confirm.js
app/components/popover-confirm.js
import Ember from 'ember'; export default Ember.Component.extend({ classNames: ['popover-confirm'], iconClass: function () { var filename = this.get('filename'), regex, extension; if (filename) { regex = /\.([0-9a-z]+)$/i; extension = filename.match(/\.([0-...
import Ember from 'ember'; export default Ember.Component.extend({ classNames: ['popover-confirm'], iconClass: function () { var filename = this.get('filename'), regex, match, extension; if (filename) { regex = /\.([0-9a-z]+)$/i; match = filename.match(/\.(...
Fix generating icon name for files without extension
Fix generating icon name for files without extension
JavaScript
mit
cowbell/sharedrop,umeshjakhar/sharedrop,cowbell/sharedrop,rogervaas/sharedrop,umeshjakhar/sharedrop,rogervaas/sharedrop
c118153f2f48a271cb8d4859e5c65e22cd59ee5f
app/components/repos-list-item.js
app/components/repos-list-item.js
import Ember from 'ember'; import Polling from 'travis/mixins/polling'; import { colorForState } from 'travis/utils/helpers'; export default Ember.Component.extend(Polling, { routing: Ember.inject.service('-routing'), tagName: 'li', pollModels: 'repo', classNames: ['repo'], classNameBindings: ['selected'], ...
import Ember from 'ember'; import Polling from 'travis/mixins/polling'; import { colorForState } from 'travis/utils/helpers'; export default Ember.Component.extend(Polling, { routing: Ember.inject.service('-routing'), tagName: 'li', pollModels: 'repo', classNames: ['repo'], classNameBindings: ['selected'], ...
Remove click handler overriding default link behavior
Remove click handler overriding default link behavior An [issue](https://github.com/travis-ci/travis-ci/issues/5181) was reported in which the repository sidebar links were not functioning properly. I've tracked it down to the fact that a click handler was registered and automatically performing a redirect to the repo...
JavaScript
mit
fauxton/travis-web,fotinakis/travis-web,travis-ci/travis-web,travis-ci/travis-web,travis-ci/travis-web,travis-ci/travis-web,fotinakis/travis-web,fauxton/travis-web,fauxton/travis-web,fauxton/travis-web,fotinakis/travis-web,fotinakis/travis-web
8aa9ed0a01065affb26bd069fc4afbdcfd9a7cf3
tasks/appium.js
tasks/appium.js
/* * grunt-appium * https://github.com/hungrydavid/grunt-appium * * Copyright (c) 2015 David Adams * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { // Please see the Grunt documentation for more information regarding task // creation: http://gruntjs.com/creating-tasks ...
/* * grunt-appium * https://github.com/hungrydavid/grunt-appium * * Copyright (c) 2015 David Adams * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { // Please see the Grunt documentation for more information regarding task // creation: http://gruntjs.com/creating-tasks ...
Make task async and only quit once process exits
Make task async and only quit once process exits
JavaScript
mit
hungrydavid/grunt-appium
8920390d8a84fdaf0d887a7fccd023ce0855e4bb
components/app/common/Browser.js
components/app/common/Browser.js
import React from 'react'; function Browser() { return ( <div className="c-browser"> <h3>Browser not supported</h3> <p>The browser you are using is out-of-date and not supported by our site.</p> <h4>For the most secure and best experience, we recommend these browsers.</h4> <ul> ...
import React from 'react'; function Browser() { return ( <div className="c-browser"> <h3>Browser not supported</h3> <p>The browser you are using is out-of-date and not is supported by our site.</p> <h4>For the most secure and best experience, we recommend these browsers.</h4> <ul> ...
Fix spelling error in browser change modal
Fix spelling error in browser change modal
JavaScript
mit
resource-watch/resource-watch,resource-watch/resource-watch,resource-watch/resource-watch,resource-watch/resource-watch
308f844589596950fc43b2699bdd33d79f67bcb4
postinstall.js
postinstall.js
'use strict'; var fs = require('fs'); var cp = require('child_process'); var assert = require('assert'); var partialDependencies = { "concat-stream": "^1.4.7", "os-shim": "^0.1.2" }; var fullDependencies = { "concat-stream": "^1.4.7", "os-shim": "^0.1.2", "try-thread-sleep": "^1.0.0" }; var REQUIRES_UPDATE...
'use strict'; var fs = require('fs'); var cp = require('child_process'); var assert = require('assert'); var partialDependencies = { "concat-stream": "^1.4.7", "os-shim": "^0.1.2" }; var fullDependencies = { "concat-stream": "^1.4.7", "os-shim": "^0.1.2", "try-thread-sleep": "^1.0.0" }; var REQUIRES_UPDATE...
Add quotes around the npm_execpath
Add quotes around the npm_execpath [fixes #19]
JavaScript
mit
ForbesLindesay/spawn-sync,terabyte/spawn-sync,bcoe/spawn-sync,tmagiera/spawn-sync
48e5053047d6b48c40a55a69b9f945658b4ef438
lib/Middleware.js
lib/Middleware.js
export default class Middleware { /** * Constructor */ constructor(key, value) { key = key.toLowerCase(); // In case of simple middleware if (key == "middleware") { return this.simpleMiddleware(value); } if (OPTIONS[key]) { return OPTIONS[key].init(value); } } /** *...
export default class Middleware { /** * Constructor */ constructor(key, value) { key = key.toLowerCase(); // In case of simple middleware if (key == "middleware") { return this.simpleMiddleware(value); } if (OPTIONS[key]) { return { key: key, value: OPTIONS[key...
Add the key and value in option
Add the key and value in option
JavaScript
mit
ArthurMialon/StarterApiNodejs
46f8795db8215e2a470b54cfe1e94ebb1888460e
closure/testing/test/arithmetic_es6module_test.js
closure/testing/test/arithmetic_es6module_test.js
// Copyright 2016 The Closure Rules Authors. All rights reserved. // // 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...
// Copyright 2016 The Closure Rules Authors. All rights reserved. // // 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...
Remove use of the import 'goog:...' pattern
Remove use of the import 'goog:...' pattern Support for this is soon to be removed. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177366930
JavaScript
apache-2.0
jart/rules_closure,jart/rules_closure,jart/rules_closure,gramic/rules_closure,gramic/rules_closure,bazelbuild/rules_closure,gramic/rules_closure,gramic/rules_closure,jart/rules_closure,jart/rules_closure,bazelbuild/rules_closure,bazelbuild/rules_closure,bazelbuild/rules_closure
ab7e76c25376e82ca3559b6a088ea213ae227a6e
src/resources/basefield.js
src/resources/basefield.js
export class Basefield { id = ''; label = ''; columns = 8; index = undefined; parent = undefined; init(id = '', {label = '', columns = 8, parent, index} = {}) { this.id = id; this.label = label; this.columns = columns; this.index = index; this.parent = parent; return this; } bi...
export class Basefield { id = ''; label = ''; columns = 8; index = undefined; parent = undefined; init(id = '', {label = '', columns = 8, parent, index} = {}) { this.id = id; this.label = label; this.columns = columns; this.index = index; this.parent = parent; return this; } bi...
Fix not being able to delete first item of list
Fix not being able to delete first item of list
JavaScript
mit
apinf/openapi-designer,apinf/open-api-designer,apinf/open-api-designer,apinf/openapi-designer
204c213882920d4666fb962d8c3bb39ce2fcf988
lib/apply-data.js
lib/apply-data.js
import { handleSuccess, handleFailure } from './assert-promise'; function applyData(object, data) { return new Ember.RSVP.Promise(function(resolve, reject) { if (typeof data === 'function') { var newObject = data.call(object, object); if (!newObject.then) { return resolve(newObject); }...
import { handleSuccess, handleFailure } from './assert-promise'; function applyData(object, data) { return new Ember.RSVP.Promise(function(resolve, reject) { if (typeof data === 'function') { var newObject = data.call(object, object); if (!newObject.then) { return resolve(newObject); }...
Allow `{local: true, id: 123}` specification for relationships (inside `data` hash)
Allow `{local: true, id: 123}` specification for relationships (inside `data` hash)
JavaScript
mit
runtrizapps/ember-testing-grate
8dcb43a4272563971cd22f32106731519451f83a
desktop/app/components/tasks/directive.js
desktop/app/components/tasks/directive.js
angular.module('MainApp') .directive('uaf', () => { // uaf = Update after find return (scope, el, attrs) => { scope.$watch('tasks', (newVal) => { el[0].children[0].children[0].innerHTML = newVal[attrs.uaf]; }, true); }; });
angular.module('MainApp') .directive('uaf', () => // uaf = Update after find (scope, el, attrs) => { scope.$watch('tasks', (newVal) => { el[0].children[0].children[0].innerHTML = newVal[attrs.uaf]; }, true); } );
Fix eslint errors - 6
Fix eslint errors - 6
JavaScript
mit
mkermani144/wanna,mkermani144/wanna
d90c82cea8abeace95e5b97cc0e51debe0b63225
packages/lesswrong/lib/collections/tagRels/views.js
packages/lesswrong/lib/collections/tagRels/views.js
import { TagRels } from './collection.js'; import { ensureIndex } from '../../collectionUtils'; TagRels.addView('postsWithTag', terms => { return { selector: { tagId: terms.tagId, baseScore: {$gt: 0}, }, } }); TagRels.addView('tagsOnPost', terms => { return { selector: { postId: te...
import { TagRels } from './collection.js'; import { ensureIndex } from '../../collectionUtils'; TagRels.addView('postsWithTag', terms => { return { selector: { tagId: terms.tagId, baseScore: {$gt: 0}, }, sort: {baseScore: -1}, } }); TagRels.addView('tagsOnPost', terms => { return { s...
Sort tags by descending relevance
Sort tags by descending relevance
JavaScript
mit
Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2
df3fd41acf43fe5b0401ecb60ae090541c575d59
lib/mainWindow.js
lib/mainWindow.js
import { screen } from 'electron'; /** * Create main window's settings. * @param {Object} rawopts - Configuration options for main window. * @return {Object} The main window configuration. */ function mainWindow(rawopts) { const { width, height } = screen.getPrimaryDisplay().workAreaSize; const opts = Object.a...
import { screen } from 'electron'; /** * Create main window's settings. * @param {Object} rawopts - Configuration options for main window. * @return {Object} The main window configuration. */ function mainWindow(rawopts) { const { width, height } = screen.getPrimaryDisplay().workAreaSize; const opts = Object.a...
Hide main window until ready
Hide main window until ready
JavaScript
mit
JamenMarz/cluster,JamenMarz/vint
c32995e50fc10e50e6808d5f5df51dd203c8a613
src/utils/getUsers.js
src/utils/getUsers.js
import axios from 'axios'; function getUsers() { return axios({ url: '/api/users', timeout: 20000, method: 'get', responseType: 'json' }) .then(function (res) { return res.data; }) } export default getUsers;
import axios from 'axios'; function getUsers() { return axios({ url: '/api/users', timeout: 20000, method: 'get', responseType: 'json' }) .then(function (res) { return res.data; }) } export default getUsers;
Set up getUser axios to get all users
Set up getUser axios to get all users
JavaScript
mit
Keitarokido/tiles,Keitarokido/tiles
8941d15ae95988becf61ba2d05a4eca140dd2486
test/of_test.js
test/of_test.js
import check from './support/check'; describe('of operator', () => { it('turns into an `in` operator', () => { check(` a of b `, ` a in b; `); }); it('works in an expression context', () => { check(` a(b, c.d of e) `, ` a(b, c.d in e); `); }); it('works with ...
import check from './support/check'; describe('of operator', () => { it('turns into an `in` operator', () => { check(` a of b `, ` a in b; `); }); it('works in an expression context', () => { check(` a(b, c.d of e) `, ` a(b, c.d in e); `); }); it('works with ...
Add another test for double negation of `of`.
Add another test for double negation of `of`.
JavaScript
mit
eventualbuddha/decaffeinate,alangpierce/decaffeinate,decaffeinate/decaffeinate,alangpierce/decaffeinate,eventualbuddha/decaffeinate,decaffeinate/decaffeinate,alangpierce/decaffeinate
ebf95a31b0ba193817a28ec16468ef7809ec6953
cronjobs.js
cronjobs.js
var fs = require('fs'); var cronJob = require('cron').CronJob; var config = require('./config'); var data = require('./data'); function init() { writeJSON(); } module.exports = init; function writeJSON() { write(); new cronJob('*/5 * * * *', write, null, true); function write() { data.che...
var fs = require('fs'); var cronJob = require('cron').CronJob; var config = require('./config'); var data = require('./data'); function init() { writeJSON(); } module.exports = init; function writeJSON() { write(); new cronJob('*/5 * * * *', write, null, true); function write() { data.che...
Increase the amount of data points
Increase the amount of data points
JavaScript
mit
cdnperf/cdnperf,bebraw/cdnperf,bebraw/cdnperf,cdnperf/cdnperf
5016ab3b206d1a53fce943d07b0402df7a145aed
server/db/controllers/getMatchesGivenSelfAndOffset.js
server/db/controllers/getMatchesGivenSelfAndOffset.js
const db = require('../db.js'); module.exports = (self, offSet) => { const queryStr = `SELECT teach.teach_id FROM ( ( SELECT users_languages_levels.user AS teach_id FROM users_languages_levels INNER JOIN languages_levels ...
const db = require('../db.js'); module.exports = (self, offSet) => { const queryStr = `SELECT teach.teach_id FROM ( ( SELECT users_languages_levels.user AS teach_id FROM users_languages_levels INNER JOIN languages_levels ...
Add limit and offset in query string
Add limit and offset in query string
JavaScript
mit
VictoriousResistance/iDioma,VictoriousResistance/iDioma
217c40ac2ca61f4a14f41a1a5b3d4f7983910b46
harmless-ransom-note.js
harmless-ransom-note.js
// Harmless Ransom Note /* Rules: Takes two parameters First will be the note we want to write as a string. The second will be the magazine text we have available to make the note out of as a string The purpose of the algorithm is to see if we have enough words in the magazine text to write our note If...
// Harmless Ransom Note /* Rules: Takes two parameters First will be the note we want to write as a string. The second will be the magazine text we have available to make the note out of as a string The purpose of the algorithm is to see if we have enough words in the magazine text to write our note If...
Add pseudocode in notes, begin skeleton of function
Add pseudocode in notes, begin skeleton of function
JavaScript
mit
benjaminhyw/javascript_algorithms
3a4bba37b5f2e46fc8484a9ad1a5142bf9adc183
src/templates/blog-post.js
src/templates/blog-post.js
import React from "react"; import { graphql, Link } from "gatsby"; import Layout from "../app/layout"; import "./blog-post.scss"; export const BLOG_POST_QUERY = graphql` query BlogPostTemplate($slug: String!) { markdownRemark(fields: { slug: { eq: $slug } }) { id excerpt html fields { ...
import React from "react"; import { graphql, Link } from "gatsby"; import Layout from "../app/layout"; import "prismjs/themes/prism-solarizedlight.css"; import "./blog-post.scss"; export const BLOG_POST_QUERY = graphql` query BlogPostTemplate($slug: String!) { markdownRemark(fields: { slug: { eq: $slug } }) { ...
Add styles for code blocks
Add styles for code blocks
JavaScript
mit
yanglinz/personal-site,yanglinz/personal-site
422c9f3f7f937e06179c9aedabda1bedb61a1e2c
js/views/Value.js
js/views/Value.js
jsio('from shared.javascript import Class, bind') jsio('import ui.Component') exports = Class(ui.Component, function(supr){ this._domTag = 'span' this._className = 'Value' this.init = function(jsArgs, viewArgs) { supr(this, 'init') this._itemIds = jsArgs[0] this._property = viewArgs[0] } this._crea...
jsio('from shared.javascript import Class, bind') jsio('import ui.Component') exports = Class(ui.Component, function(supr){ this._domTag = 'span' this._className = 'Value' this.init = function(jsArgs, viewArgs) { supr(this, 'init') this._itemIds = jsArgs[0] this._property = viewArgs[0] } this._crea...
Fix linebreaks only for string values
Fix linebreaks only for string values
JavaScript
mit
marcuswestin/Focus
0e34b6069f2f4e70620eeb40fa44f19e1a93f5e0
datasets.js
datasets.js
/** * Different datasets the tool can use * * The first-level keys are country names, in English, * as they will appear in the app * * The second level names are database identifiers. * These ids are used in the url, so should be as short as possible * * The name of a database will be visible in the app, and m...
/** * Different datasets the tool can use * * The first-level keys are country names, in English, * as they will appear in the app * * The second level names are database identifiers. * These ids are used in the url, so should be as short as possible * * The name of a database will be visible in the app, and m...
Enable the Norwegian kindergartens again (not yet visible due to lack of data in the right repo)
Enable the Norwegian kindergartens again (not yet visible due to lack of data in the right repo)
JavaScript
bsd-3-clause
POI-Importer/POI-Importer.github.io,POI-Importer/POI-Importer.github.io
050a474b6f5e000584bf5a1a8f41e3d9750faf3d
tasks/load-options.js
tasks/load-options.js
/* * grunt-load-options * https://github.com/chriszarate/grunt-load-options * * Copyright (c) 2013 Chris Zarate * Licensed under the MIT license. */ 'use strict'; var requireDirectory = require('require-directory'); module.exports = function(grunt) { grunt.initConfig(requireDirectory(module, './grunt/options...
/* * grunt-load-options * https://github.com/chriszarate/grunt-load-options * * Copyright (c) 2013 Chris Zarate * Licensed under the MIT license. */ 'use strict'; var requireDirectory = require('require-directory'); module.exports = function(grunt) { // Load config options. var options = requireDirectory(...
Resolve options expressed as functions.
Resolve options expressed as functions.
JavaScript
mit
chriszarate/grunt-load-options
3fc6e2976b46dfaa6dc6768884f8c7a959c12996
client/shared/services/metaDataService.js
client/shared/services/metaDataService.js
'use strict'; export default class metaDataService { constructor() { this.pageTitle = ''; } getPageTitle() { return this.pageTitle; } setPageTitle(newTitle) { this.pageTitle = newTitle; } }
'use strict'; export default class metaDataService { constructor($location) { this.pageTitle = ''; this.address = `http://${$location.host()}/`; } getPageTitle() { return this.pageTitle; } setPageTitle(newTitle) { this.pageTitle = newTitle; } } metaDataService...
Add site address to metadata service
Add site address to metadata service
JavaScript
mit
flareair/board_of_shame,flareair/board_of_shame,flareair/board_of_shame
4c869f1077036ededd6c755a600b9200997f56bb
src/widgets/index.js
src/widgets/index.js
// Lazy-loaded modules are assumed on the hosting domain, // so we override the constant at runtime. // __webpack_public_path__ = process.env.NODE_ENV === "production" // ? "https://example.com" // : "http://localhost:3000"; import { camelCase } from "lodash"; (async () => { // For minority of browers, bring in...
import { camelCase } from "lodash"; (async () => { // For minority of browers, bring in heavier polyfills. if (!Object.assign || !Array.from || !window.location.origin) { await import("../polyfills"); } // Iterable list of widget scripts const containers = [...document.querySelectorAll("[data-my-widget]...
Remove __webpack_public_path__ for a "gotcha"
Remove __webpack_public_path__ for a "gotcha"
JavaScript
mit
ericclemmons/performant-3rd-party-widgets,ericclemmons/performant-3rd-party-widgets
765578bfcb878b4fc7668b08ce2fe6fb12721592
helpers/unixToDate.js
helpers/unixToDate.js
module.exports = (function(){ return function unixToDate(unixTime) { console.log(unixTime) var date = new Date(Number(unixTime)); var year = date.getFullYear(); var month; var day; if (date.getMonth().toString().length === 1) { month = "0" + (date.getMonth() + 1).toString(); } else { month = (date...
module.exports = function(unixTime) { var date = new Date(Number(unixTime)) var year = date.getFullYear() var month = constructMonth(date) var day = constructDay(date) return year + '-' + month + '-' + day } function constructMonth(date) { var month = (date.getMonth() + 1).toString() return padFormatting(month...
Refactor date conversion into smaller, more modular methods
Refactor date conversion into smaller, more modular methods
JavaScript
mit
capsul/capsul-api
277eeede63ec0ec591eaa934c2ace2df13592e77
test/special/index.js
test/special/index.js
'use strict'; var _ = require('lodash'); var fs = require('fs'); var hljs = require('../../build'); var jsdom = require('jsdom').jsdom; var utility = require('../utility'); describe('special cases tests', function() { before(function(done) { var filename = utility.buildPath('fixtures', 'index.ht...
'use strict'; var _ = require('lodash'); var bluebird = require('bluebird'); var hljs = require('../../build'); var jsdomEnv = bluebird.promisify(require('jsdom').env); var readFile = bluebird.promisify(require('fs').readFile); var utility = require('../utility'); describe('special cases tests', function(...
Use promises for special case tests
Use promises for special case tests I'm not too sure what is causing tests to fail because locally they pass and on travis `class` is turning into `undefined`.
JavaScript
bsd-3-clause
aurusov/highlight.js,teambition/highlight.js,Sannis/highlight.js,MakeNowJust/highlight.js,carlokok/highlight.js,bluepichu/highlight.js,StanislawSwierc/highlight.js,carlokok/highlight.js,palmin/highlight.js,teambition/highlight.js,carlokok/highlight.js,isagalaev/highlight.js,dbkaplun/highlight.js,tenbits/highlight.js,hi...
97f6eb7ce14fe5baa6533216fa04717e69e7f44b
test/support/index.js
test/support/index.js
var root = null; if (typeof window === 'undefined') { root = global; root.tryc = require('../../'); } else { root = window; root.tryc = require('tryc'); root.__karma__.start = function() { root.__karma__.info({ total: 1 }); root.__karma__.result({ success: true }); root.__karma__.complete(); };...
var root = null; var completed = null; var tests = []; if (typeof window === 'undefined') { root = global; root.tryc = require('../../'); completed = function(){}; } else { root = window; root.tryc = require('tryc'); root.__karma__.start = function() {}; completed = function() { root.__karma__.info(...
Fix issues with the custom test runner
Fix issues with the custom test runner
JavaScript
mit
vesln/tryc
7326ec30d95f8a80b6011aca31f3d57f589309fe
gulpfile.js
gulpfile.js
var gulp = require('gulp'); var uglify = require('gulp-uglify'); var concat = require('gulp-concat'); var sass = require('gulp-sass'); var minify = require('gulp-minify-css'); var del = require('del'); var lint = require('gulp-jshint'); gulp.task('lint', function() { return gulp.src('private/scripts/**/*.js') ...
var gulp = require('gulp'); var uglify = require('gulp-uglify'); var concat = require('gulp-concat'); var sass = require('gulp-sass'); var minify = require('gulp-minify-css'); var del = require('del'); var lint = require('gulp-jshint'); gulp.task('lint', function() { return gulp.src('private/scripts/**/*.js') ...
Use gulp as a listener
Use gulp as a listener
JavaScript
agpl-3.0
blagae/webcomicvault
f506d6f9e71821fe808d2b77d2b5c886591383ed
lib/plugin/theme/renderable/collection.js
lib/plugin/theme/renderable/collection.js
"use strict"; const Renderable = require('./renderable'); class Collection extends Renderable {} Collection.Instance = require('./collectionInstance'); /* const Registry = require('../../../util/registry'); class Collection extends Renderable { addElement(data, element) { if (!data.elementRegistry) { da...
"use strict"; const Renderable = require('./renderable'); class Collection extends Renderable {} Collection.Instance = require('./collectionInstance'); module.exports = Collection;
Remove accidental inclusion of commented-out code
Remove accidental inclusion of commented-out code
JavaScript
mit
coreyp1/defiant,coreyp1/defiant
ff4845f9cd7591fafffe0316b4c80948fbe80008
gulpfile.js
gulpfile.js
const gulp = require('gulp'); const sweetjs = require("gulp-sweetjs"); const sourcemaps = require('gulp-sourcemaps'); const concat = require('gulp-concat-util'); // Macro packages. const match = "sparkler/macros"; const lambda = "lambda-chop/macros"; const bdd = "sweet-bdd"; gulp.task('default', function() { consol...
const gulp = require('gulp'); const sweetjs = require("gulp-sweetjs"); const sourcemaps = require('gulp-sourcemaps'); const concat = require('gulp-concat-util'); // Macro packages. const match = "sparkler/macros"; const lambda = "lambda-chop/macros"; const bdd = "sweet-bdd"; gulp.task('default', function() { consol...
Add lambda-match to plugins macros.
Internal: Add lambda-match to plugins macros.
JavaScript
isc
hagb4rd/tennu,LordWingZero/tennu,Tennu/tennu
eba98196b93eaba09ba8d64a6a7e70ab832ded1c
lib/git-manager.js
lib/git-manager.js
var GithubApi = require('github'), config = require('../config'), Promise = require('promise'), github = new GithubApi({ debug: config.debug, version: '3.0.0' }); github.authenticate({ type: 'oauth', token: config.github.token }); module.exports = { github: github, getAllPulls:...
var GithubApi = require('github'), config = require('../config'), Promise = require('promise'), github = new GithubApi({ debug: config.debug, version: '3.0.0' }); github.authenticate({ type: 'oauth', token: config.github.token }); module.exports = { github: github, getAllPulls:...
Change a variable name for clarity
Change a variable name for clarity
JavaScript
mit
iFixit/pulldasher,iFixit/pulldasher,iFixit/pulldasher,iFixit/pulldasher
3f1d2eec28ec703569637e1d148fb7b668ee1e41
lib/git-wrapper.js
lib/git-wrapper.js
var Q = require('q'); var _ = require('lodash'); var spawn = require('child_process').spawn; module.exports = function(args, options) { var deferred = Q.defer(); options = options || {}; var defaults = { cwd: process.cwd(), verbose: false }; options = _.extend({}, defaults, options)...
var Q = require('q'); var _ = require('lodash'); var spawn = require('child_process').spawn; module.exports = function(args, options) { var deferred = Q.defer(); options = options || {}; var defaults = { cwd: process.cwd(), verbose: false }; options = _.extend({}, defaults, options)...
Fix early cache resolve bug
Fix early cache resolve bug
JavaScript
mit
crowdtap/parachute
eeb287f6029c7116b81ac81af76e055b2e3efa85
commands/misc.js
commands/misc.js
/* Miscellaneous commands */ Settings.addPermissions(['pick', 'randomanswer']); exports.commands = { choose: 'pick', pick: function (arg, by, room, cmd) { var choices = arg.split(","); choices = choices.filter(function (i) {return (toId(i) !== '');}); if (choices.length < 2) return this.pmReply(this.trad('er...
/* Miscellaneous commands */ Settings.addPermissions(['pick', 'randomanswer', 'usage', 'help']); exports.commands = { choose: 'pick', pick: function (arg, by, room, cmd) { var choices = arg.split(","); choices = choices.filter(function (i) {return (toId(i) !== '');}); if (choices.length < 2) return this.pmRe...
Add usage and help commands
Add usage and help commands
JavaScript
mit
ateck5/le_spatula,sama2/Pokemon-Showdown-Node-Bot,awolffromspace/PC-Battle-Server-Bot,TheFenderStory/Mambot,Ecuacion/Espaol-Bot,abulechu/Pokemon-Showdown-Node-Bot,Robophill/Pokemon-Showdown-Node-Bot,Flareninja/Pokemon-Showdown-Node-Bot,Ecuacion/Pokemon-Showdown-Node-Bot,TheFenderStory/Pokemon-Showdown-Node-Bot,Freigeis...
28aed7e4779ad302b0b25b2d321a975179a24602
test/validation_test.js
test/validation_test.js
'use strict'; const assert = require('assert'); const Event = require('../db/models/Event'); describe('Validation of User records', () => { it('should require a name for every event', () => { const validationEvt = new Event({ name: undefined }), validationResult = validationEvt.validateSync(), ...
'use strict'; const assert = require('assert'); const Event = require('../db/models/Event'); describe('Validation of User records', () => { // Tests that records for which no `name` property is defined are marked invalid // and return a validation fallback message: it('should require a name for every event', ...
Write test to catch invalid inserts
test: Write test to catch invalid inserts
JavaScript
mit
IsenrichO/react-timeline,IsenrichO/react-timeline
5f32e2d1ee4cb89dc50b4bcd5126258cbe6f2107
test/common/cycle.js
test/common/cycle.js
'use strict'; /* global describe, it */ let assert = require('assert'); let Cycle = require('../../src/cycle'); describe('Cycle', function () { describe('API', function () { it('should have `applyToDOM`', function () { assert.strictEqual(typeof Cycle.applyToDOM, 'function'); }); it('should have `r...
'use strict'; /* global describe, it */ let assert = require('assert'); let Cycle = require('../../src/cycle'); describe('Cycle', function () { describe('API', function () { it('should have `applyToDOM`', function () { assert.strictEqual(typeof Cycle.applyToDOM, 'function'); }); it('should have `r...
Add test case for svg() (like h() is)
Add test case for svg() (like h() is)
JavaScript
mit
bzalasky/cycle-core,Widdershin/cycle-core,secobarbital/cycle-core,beni55/cycle-core,gdseller/cycle-core,Amirus/cycle-core,secobarbital/cycle-core,richardTowers/cycle-core,beni55/cycle-core,ccapndave/cycle-core,Iced-Tea/cycle-core,Widdershin/cycle-core,Iced-Tea/cycle-core,Amirus/cycle-core