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 |
|---|---|---|---|---|---|---|---|---|---|
9da51749c48c09bcd443b3a32ea51734dc34d60a | src/pages/_document.js | src/pages/_document.js | /* eslint-disable react/no-danger */
import Document, { Head, Main, NextScript } from 'next/document'
import React from 'react'
// The document (which is SSR-only) needs to be customized to expose the locale
// data for the user's locale for React Intl to work in the browser.
export default class IntlDocument extends... | /* eslint-disable react/no-danger */
import Document, { Head, Main, NextScript } from 'next/document'
import React from 'react'
// The document (which is SSR-only) needs to be customized to expose the locale
// data for the user's locale for React Intl to work in the browser.
export default class IntlDocument extends... | Update polyfill url to include default | Update polyfill url to include default | JavaScript | agpl-3.0 | uzh-bf/klicker-react,uzh-bf/klicker-react |
423bbaf03c83313d327b6c84e6b77ad6787de9e4 | generators/client/templates/src/main/webapp/app/account/social/_social.service.js | generators/client/templates/src/main/webapp/app/account/social/_social.service.js | (function() {
'use strict';
angular
.module('<%=angularAppName%>')
.factory('SocialService', SocialService);
SocialService.$inject = ['$document'];
function SocialService ($document) {
var socialService = {
getProviderSetting: getProviderSetting,
getPro... | (function() {
'use strict';
angular
.module('<%=angularAppName%>')
.factory('SocialService', SocialService);
SocialService.$inject = ['$document', '$http', '$cookies'];
function SocialService ($document, $http, $cookies) {
var socialService = {
getProviderSetting: ... | Use $cookies to retrive CSRF cookie token value | Use $cookies to retrive CSRF cookie token value
| JavaScript | apache-2.0 | rifatdover/generator-jhipster,baskeboler/generator-jhipster,JulienMrgrd/generator-jhipster,ziogiugno/generator-jhipster,vivekmore/generator-jhipster,vivekmore/generator-jhipster,mosoft521/generator-jhipster,gmarziou/generator-jhipster,baskeboler/generator-jhipster,dimeros/generator-jhipster,PierreBesson/generator-jhips... |
a47277dc01719beb91bbe71e5bfcf33eefbfa2b9 | server.js | server.js | const Hapi = require('@hapi/hapi');
const routes = require('./routes');
const auth = require('./auth');
module.exports = async (elastic, config, cb) => {
const server = new Hapi.Server({ port: config.port, routes: { cors: true, log: { collect: true } } });
server.route(routes(elastic, config));
if (config.auth... | const Hapi = require('@hapi/hapi');
const routes = require('./routes');
const auth = require('./auth');
module.exports = async (elastic, config, cb) => {
const server = new Hapi.Server({ port: config.port, routes: { cors: { origin: "ignore" }, log: { collect: true } } });
server.route(routes(elastic, config));
... | Enable CORS ignore orgin header | Enable CORS ignore orgin header
| JavaScript | mit | TheScienceMuseum/collectionsonline,TheScienceMuseum/collectionsonline |
9ba37879aab75e4817ab7673a144521a86464580 | src/server/xhr-proxy.js | src/server/xhr-proxy.js | // Copyright (c) Microsoft Corporation. All rights reserved.
var http = require('http'),
url = require('url');
module.exports.attach = function (app) {
app.all('/xhr_proxy', function proxyXHR(request, response) {
var requestURL = url.parse(unescape(request.query.rurl));
request.headers.host =... | // Copyright (c) Microsoft Corporation. All rights reserved.
var http = require('http'),
https = require('https'),
url = require('url');
module.exports.attach = function (app) {
app.all('/xhr_proxy', function proxyXHR(request, response) {
var requestURL = url.parse(unescape(request.query.rurl));
... | Support for HTTPS in XHR proxy. | Support for HTTPS in XHR proxy.
| JavaScript | mit | TimBarham/cordova-simulate,Microsoft/taco-simulate-server,Microsoft/taco-simulate-server,TimBarham/cordova-simulate |
44d44c1a110f66a5cfd51608d3fb463cc87705f0 | gulpfile.js | gulpfile.js | var gulp = require("gulp");
var browserify = require("browserify");
var source = require("vinyl-source-stream");
var buffer = require("vinyl-buffer");
var reactify = require("reactify");
var watch = require("gulp-watch");
var plumber = require("gulp-plumber");
var uglify = require('gulp-uglify');
gulp.task("browserify... | var gulp = require("gulp");
var browserify = require("browserify");
var source = require("vinyl-source-stream");
var buffer = require("vinyl-buffer");
var reactify = require("reactify");
var watch = require("gulp-watch");
var plumber = require("gulp-plumber");
var uglify = require('gulp-uglify');
gulp.task("browserify... | Change to show error message when browserify failed | Change to show error message when browserify failed
| JavaScript | mit | Sixeight/iwai,Sixeight/iwai,Sixeight/iwai |
7c867bc44d695ab15ecf63bdcf71db4088893551 | sketch.js | sketch.js | const WIDTH = 800;
const HEIGHT = 600;
var setup = function() {
createCanvas(WIDTH, HEIGHT);
background(0);
fill(255);
angleMode(DEGREES);
stroke(255);
strokeWeight(1);
strokeCap(SQUARE);
}
var draw = function() {
translate(200, 200);
rotate(45);
rect(-50, -25, 100, 50);
}
| const WIDTH = 800;
const HEIGHT = 600;
var setup = function() {
createCanvas(WIDTH, HEIGHT);
background(0);
fill(255);
angleMode(DEGREES);
stroke(255);
strokeWeight(1);
strokeCap(SQUARE);
}
var draw = function() {
push();
translate(200, 200);
rotate(45);
rect(-50, -25, 100, 50);
pop();
pu... | Use push and pop for different rectangles | Use push and pop for different rectangles
| JavaScript | mit | SimonHFrost/my-p5,SimonHFrost/my-p5 |
dbc8ad8b2a0bcd6229585910611808ae7c29791d | js/songz.js | js/songz.js | const songs = [...document.querySelectorAll('.songList li')];
const currentSong = document.querySelector('#currentSong');
songs.map((s) => {
s.addEventListener('click', () => {
currentSong.setAttribute('src', "https://archive.org/download/plays_some_standards/" + s.textContent.toLowerCase().replace(/\s/g, '_') + ... | const songs = [...document.querySelectorAll('.songList li')];
const currentSong = document.querySelector('#currentSong');
songs.map((s) => {
s.addEventListener('click', () => {
currentSong.setAttribute('src', "https://archive.org/download/plays_some_standards/" + s.textContent.toLowerCase().replace(/\s/g, '_') + ... | Add underline to playing song. | Add underline to playing song. | JavaScript | mpl-2.0 | ryanpcmcquen/ryanpcmcquen.github.io,ryanpcmcquen/ryanpcmcquen.github.io |
14537e283e19802f2decfae2f269caf0c8860b20 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var elm = require('gulp-elm');
var plumber = require('gulp-plumber');
var del = require('del');
var browserSync = require('browser-sync');
// builds elm files and static resources (i.e. html and css) from src to dist folder
var paths = {
dest: 'dist',
elm: 'src/*.elm',
staticAss... | var gulp = require('gulp');
var elm = require('gulp-elm');
var plumber = require('gulp-plumber');
var del = require('del');
var browserSync = require('browser-sync');
// builds elm files and static resources (i.e. html and css) from src to dist folder
var paths = {
dest: 'dist',
elm: 'src/*.elm',
staticAss... | Disable notification in browser-sync as it caused issues with layout | Disable notification in browser-sync as it caused issues with layout
| JavaScript | mit | martin-kolinek/elm-dashboard,martin-kolinek/elm-dashboard |
14909c3d779edddad99b5f08ad5b17a4802abc13 | app/assets/javascripts/profile.js | app/assets/javascripts/profile.js | const checkStatus = () => {
fetch("/load_status", {
credentials: "same-origin"
})
.then(response => {
return response.text();
})
.then(data => {
document.getElementById("repo-alert").style.display = "block";
if (data === "true") {
document.getElementById("repo-load-info").i... | const checkStatus = () => {
fetch("/repositories/load_status", {
credentials: "same-origin"
})
.then(response => {
return response.text();
})
.then(data => {
document.getElementById("repo-alert").style.display = "block";
if (data === "true") {
document.getElementById("repo-... | Use correct load_status path in JS | Use correct load_status path in JS
| JavaScript | mit | schneidmaster/gitreports.com,schneidmaster/gitreports.com,schneidmaster/gitreports.com |
c67221a0661795471bc5c650292d3e6321e623a8 | gulpfile.js | gulpfile.js | var gulp = require('gulp')
var browserify = require('browserify')
var source = require('vinyl-source-stream')
var serve = require('gulp-serve')
var concat = require('gulp-concat')
// Static file server
gulp.task('server', serve({
root: ['example', 'dist'],
port: 7000
}))
gulp.task('build', function () {
return ... | var gulp = require('gulp')
var source = require('vinyl-source-stream')
var serve = require('gulp-serve')
var rename = require('gulp-rename')
var browserify = require('browserify')
var buffer = require('vinyl-buffer')
var uglify = require('gulp-uglify')
var taskListing = require('gulp-task-listing')
// Static file serv... | Add gulp release script to generate minified build. | Add gulp release script to generate minified build. | JavaScript | mit | opbeat/opbeat-react,opbeat/opbeat-angular,opbeat/opbeat-react,opbeat/opbeat-angular,opbeat/opbeat-js-core,jahtalab/opbeat-js,opbeat/opbeat-react,opbeat/opbeat-js-core,jahtalab/opbeat-js,jahtalab/opbeat-js,opbeat/opbeat-angular |
b9f206997eed1fbadfdeea81dd165fb17750f6a4 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var less = require('gulp-less');
var plumber = require("gulp-plumber");
var browserSync = require('browser-sync').create();
gulp.task('run', function() {
browserSync.init({
server: "./"
});
gulp.watch(['komforta.less', 'less/*.less'], ['compile']);
gulp.watch('*.css').on('change... | var gulp = require('gulp');
var less = require('gulp-less');
var plumber = require("gulp-plumber");
var browserSync = require('browser-sync').create();
gulp.task('run', function() {
browserSync.init({
server: "./"
});
gulp.watch(['komforta.less', 'less/*.less'], ['compile']);
gulp.watch('*.css').on('change... | Add settings when error occured | Add settings when error occured
| JavaScript | mit | rochefort/hatena-blog-theme-komforta,rochefort/hatena-blog-theme-komforta |
9f4144ee6c33e14aa5e824b117450083c3296ec9 | target.js | target.js | Target = function(x, y) {
this.x = x;
this.y = y;
this.life = 11;
this.size = 12;
return this;
}
Target.prototype.render = function() {
var x = this.x - gCamera.x;
var y = this.y - gCamera.y;
// Only render if within the camera's bounds
if (gCamera.isInView(this)) {
renderPath([['a... | Target = function(x, y, type) {
this.x = x;
this.y = y;
this.life = 11;
this.size = 12;
this.type = typeof type === 'string' ? type : 'circle';
return this;
}
Target.prototype.render = function() {
var x = this.x - gCamera.x;
var y = this.y - gCamera.y;
// Only render if within the came... | Update Target to accept different types | Update Target to accept different types
| JavaScript | mit | peternatewood/shmup,peternatewood/shmup,peternatewood/shmup |
89ad381b6aa24b12ab02c3de9a049806bd1bd20a | patches/promise.js | patches/promise.js | 'use strict';
function PromiseWrap() {}
module.exports = function patchPromise() {
const hooks = this._hooks;
const state = this._state;
const Promise = global.Promise;
const oldThen = Promise.prototype.then;
Promise.prototype.then = wrappedThen;
function makeWrappedHandler(fn, handle, uid) {
if ('f... | 'use strict';
function PromiseWrap() {}
module.exports = function patchPromise() {
const hooks = this._hooks;
const state = this._state;
const Promise = global.Promise;
/* As per ECMAScript 2015, .catch must be implemented by calling .then, as
* such we need needn't patch .catch as well. see:
* http:/... | Add comment explaining why it is unnecessary to patch .catch | Add comment explaining why it is unnecessary to patch .catch
| JavaScript | mit | AndreasMadsen/async-hook |
d2d24f2c3a0daf1db0bc75f598fce9e17d87e675 | tests/dummy/app/app.js | tests/dummy/app/app.js | import Ember from 'ember';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
let App;
Ember.MODEL_FACTORY_INJECTIONS = true;
App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePre... | import Ember from 'ember';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
let App;
App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
});
loadInitializers(Ap... | Fix Model Factory Injections Deprecation | Fix Model Factory Injections Deprecation
Fix ember-metal.model-factory-injections deprecation by removing
code that set the MODEL_FACTORY_INJECTIONS flag, which is no longer
needed.
| JavaScript | mit | OCTRI/ember-i18next,OCTRI/ember-i18next |
ca287bf5f22637d98af2ea9c78b499c7fc058766 | busstops/static/js/global.js | busstops/static/js/global.js | /*jslint browser: true*/
if (navigator.serviceWorker && location.protocol === 'https://') {
try {
navigator.serviceWorker.register('/serviceworker.js', {
scope: '/'
});
window.addEventListener('load', function () {
if (navigator.serviceWorker.controller) {
... | /*jslint browser: true*/
if (navigator.serviceWorker && location.host !== 'localhost:8000') {
navigator.serviceWorker.register('/serviceworker.js', {
scope: '/'
});
window.addEventListener('load', function () {
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.co... | Revert "catch service worker error?" | Revert "catch service worker error?"
This reverts commit c14cfe8917c1f1c23ccd4bbd25a7b40d6c5d6b2b.
| JavaScript | mpl-2.0 | jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk |
96a7e42c5ee0226dee571e9aa0ef9774d2eb4c77 | topics/about_numbers.js | topics/about_numbers.js |
module("About Numbers (topics/about_numbers.js)");
test("types", function() {
var typeOfIntegers = typeof(6);
var typeOfFloats = typeof(3.14159);
equal(__, typeOfIntegers === typeOfFloats, 'are ints and floats the same type?');
equal(__, typeOfIntegers, 'what is the javascript numeric type?');
equ... |
module("About Numbers (topics/about_numbers.js)");
test("types", function() {
var typeOfIntegers = typeof(6);
var typeOfFloats = typeof(3.14159);
equal(true, typeOfIntegers === typeOfFloats, 'are ints and floats the same type?');
equal('number', typeOfIntegers, 'what is the javascript numeric type?');... | Complete numbers tests to pass | Complete numbers tests to pass
| JavaScript | mit | supportbeam/javascript_koans,supportbeam/javascript_koans |
6c66286a761072fd7b69aabd85a7d75a93b7c80c | lib/initial.js | lib/initial.js | /*!
* stylus-initial
* Copyright (c) 2014 Pierre-Antoine "Leny" Delnatte <info@flatland.be>
* (Un)Licensed
*/
"use strict";
var utils = require( "stylus" ).utils,
rInitial = /([a-z\-]+)\s*:\s*(initial);/gi,
oInitialValues = require( "./values.json" );
var plugin = function() {
return function( stylus... | /*!
* stylus-initial
* Copyright (c) 2014 Pierre-Antoine "Leny" Delnatte <info@flatland.be>
* (Un)Licensed
*/
"use strict";
var utils = require( "stylus" ).utils,
rInitial = /([a-z\-]+)\s*:\s*(initial);/gi,
oInitialValues = require( "./values.json" );
var plugin = function() {
return function( stylus... | Refactor the code to be a pre-processing task. | Refactor the code to be a pre-processing task.
| JavaScript | unlicense | leny/stylus-initial |
28141a5f615c5d11151e850beb7b6541045daeab | src/utils/general.js | src/utils/general.js | const getTaggedTemplateLiteralContent = require('./tagged-template-literal').getTaggedTemplateLiteralContent
const getCSS = (node) => `
.selector {
${getTaggedTemplateLiteralContent(node)}
}
`
const getKeyframes = (node) => `
@keyframes {
${getTaggedTemplateLiteralContent(node)}
}
`
exports.getKeyframes = getKey... | const getTaggedTemplateLiteralContent = require('./tagged-template-literal').getTaggedTemplateLiteralContent
const getCSS = (node) => `.selector {${getTaggedTemplateLiteralContent(node)}}\n`
const getKeyframes = (node) => `@keyframes {${getTaggedTemplateLiteralContent(node)}}\n`
exports.getKeyframes = getKeyframes
e... | Fix whitespace in generated CSS | Fix whitespace in generated CSS
| JavaScript | mit | styled-components/stylelint-processor-styled-components |
56f1f0c255d80f21d55828ba0c7d40bdeb62431b | src/main/webapp/js/app.js | src/main/webapp/js/app.js | 'use strict';
/* App Module */
angular.module('nestorshop', ['nestorshopServices']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/products', {templateUrl: 'partials/product-list.html', controller: ProductListCtrl}).
when('/products/:productId', {templateUrl: 'partials/... | 'use strict';
/* App Module */
angular.module('nestorshop', ['nestorshopServices'], function($httpProvider) {
// Use x-www-form-urlencoded Content-Type
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
// Override $http service's default transformReques... | Change POST of angular to send values in FormData (for jersey to read) | Change POST of angular to send values in FormData (for jersey to read)
By default it sends parameters as Request Payload, and jersey ignores
them.
Read :
http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/
| JavaScript | apache-2.0 | nestorpina/nestor-shop,IGZnestorpina/nestor-shop,nestorpina/nestor-shop,IGZnestorpina/nestor-shop,nestorpina/nestor-shop,IGZnestorpina/nestor-shop |
93c7fafada259af365e9f98a2d9a139f528052ae | config/dev.js | config/dev.js | // Rollup plugins.
import babel from 'rollup-plugin-babel'
import cjs from 'rollup-plugin-commonjs'
import globals from 'rollup-plugin-node-globals'
import replace from 'rollup-plugin-replace'
import resolve from 'rollup-plugin-node-resolve'
export default {
dest: 'build/app.js',
entry: 'src/index.js',
format: '... | // Rollup plugins.
import babel from 'rollup-plugin-babel'
import cjs from 'rollup-plugin-commonjs'
import globals from 'rollup-plugin-node-globals'
import replace from 'rollup-plugin-replace'
import resolve from 'rollup-plugin-node-resolve'
export default {
dest: 'build/app.js',
entry: 'src/index.js',
format: '... | Include create-react-class in Rollup configuration :newspaper:. | Include create-react-class in Rollup configuration :newspaper:.
| JavaScript | mit | yamafaktory/babel-react-rollup-starter,yamafaktory/babel-react-rollup-starter |
a65fae011bce4e2ca9a920b51a0fc681ee21c178 | components/hoc/with-errors.js | components/hoc/with-errors.js | import React from 'react'
import PropTypes from 'prop-types'
import hoist from 'hoist-non-react-statics'
import ErrorPage from '../../pages/_error'
export default Page => {
const Extended = hoist(class extends React.Component {
static propTypes = {
error: PropTypes.object
}
static defaultProps = ... | import React from 'react'
import PropTypes from 'prop-types'
import hoist from 'hoist-non-react-statics'
import ErrorPage from '../../pages/_error'
export default Page => {
const Extended = hoist(class extends React.Component {
static propTypes = {
error: PropTypes.object
}
static defaultProps = ... | Set server statusCode on error | Set server statusCode on error
| JavaScript | mit | sgmap/inspire,sgmap/inspire |
d6a80dc1d374a88d771c3bd7aad0cad91c67bd03 | core/server/api/sandstorm.js | core/server/api/sandstorm.js | // # Sandstorm API
// RESTful API for the Sandstorm resource
var capnp = require('capnp'),
url = require('url'),
sandstorm;
var HackSession = capnp.importSystem("hack-session.capnp");
var publicIdPromise;
var initPromise = function () {
if (!publicIdPromise) {
var connection =... | // # Sandstorm API
// RESTful API for the Sandstorm resource
var capnp = require('capnp'),
url = require('url'),
_ = require('lodash'),
sandstorm;
var HackSession = capnp.importSystem("hack-session.capnp");
var publicIdPromise;
var initPromise = function () {
if (!pub... | Fix bug in returning autoUrl for Sandstorm | Fix bug in returning autoUrl for Sandstorm
| JavaScript | mit | jparyani/GhostSS,jparyani/GhostSS,jparyani/GhostSS |
f95b32c8678ca2814dca9b502a7bb592fb287c24 | web/static/js/reducers/idea.js | web/static/js/reducers/idea.js | const idea = (state = [], action) => {
switch (action.type) {
case "SET_IDEAS":
return action.ideas
case "ADD_IDEA":
return [...state, action.idea]
case "UPDATE_IDEA":
return state.map(idea => {
return (idea.id === action.ideaId) ? Object.assign({}, idea, action.newAttributes) : ... | const idea = (state = [], action) => {
switch (action.type) {
case "SET_IDEAS":
return action.ideas
case "ADD_IDEA":
return [...state, action.idea]
case "UPDATE_IDEA":
return state.map(idea => {
return (idea.id === action.ideaId) ? { ...idea, ...action.newAttributes } : idea
... | Use spread operator rather than Object.assign | Use spread operator rather than Object.assign
| JavaScript | mit | stride-nyc/remote_retro,samdec11/remote_retro,stride-nyc/remote_retro,stride-nyc/remote_retro,tnewell5/remote_retro,tnewell5/remote_retro |
35ad895d4885e3caf9cc7c3073c78bd2c13ad32d | samples/VanillaJSTestApp/app/b2c/authConfig.js | samples/VanillaJSTestApp/app/b2c/authConfig.js | // Config object to be passed to Msal on creation
const msalConfig = {
auth: {
clientId: "e760cab2-b9a1-4c0d-86fb-ff7084abd902",
authority: "https://fabrikamb2c.b2clogin.com/fabrikamb2c.onmicrosoft.com/b2c_1_susi",
knownAuthorities: ["fabrikamb2c.b2clogin.com"]
},
cache: {
ca... | // Config object to be passed to Msal on creation
const msalConfig = {
auth: {
clientId: "5dac5d6d-225c-4a98-a5e4-e29c82c0c4c9",
authority: "https://public.msidlabb2c.com/tfp/cpimtestpartners.onmicrosoft.com/b2c_1_signupsignin_userflow",
knownAuthorities: ["public.msidlabb2c.com"]
},
... | Update with lab app registration | Update with lab app registration
| JavaScript | mit | AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication... |
109da2da9a35318d59060400833d4378c7622b6f | app/assets/javascripts/application.js | app/assets/javascripts/application.js | /* global $ */
/* global GOVUK */
// Warn about using the kit in production
if (
window.sessionStorage && window.sessionStorage.getItem('prototypeWarning') !== 'false' &&
window.console && window.console.info
) {
window.console.info('GOV.UK Prototype Kit - do not use for production')
window.sessionStorage.setI... | /* global $ */
/* global GOVUK */
// Warn about using the kit in production
if (window.console && window.console.info) {
window.console.info('GOV.UK Prototype Kit - do not use for production')
}
$(document).ready(function () {
// Use GOV.UK shim-links-with-button-role.js to trigger a link styled to look like a bu... | Fix JS error in Safari’s Private Browsing mode | Fix JS error in Safari’s Private Browsing mode
Safari in Private Browsing mode sets a session storage quota of 0 which means that attempts to write to it result in a QuotaExceededError being thrown, breaking JavaScript on the rest of the page.
The existing code is flawed in that it sets `prototypeWarning` to true but... | JavaScript | mit | dwpdigitaltech/hrt-prototype,gavinwye/govuk_prototype_kit,dwpdigitaltech/hrt-prototype,joelanman/govuk_prototype_kit,benjeffreys/hmcts-idam-proto,joelanman/govuk_prototype_kit,benjeffreys/hmcts-idam-proto,alphagov/govuk_prototype_kit,alphagov/govuk_prototype_kit,hannalaakso/accessible-timeout-warning,joelanman/govuk_pr... |
3d782cc9f93ae645ef9eb4f8fafbf57117aa111c | lib/init.js | lib/init.js | var _ = require('lodash');
module.exports = function(grunt) {
var module = {};
module.domain = function() {
return process.env.GRUNT_DRUPAL_DOMAIN || grunt.config('config.domain') || require('os').hostname();
};
// Ensure a default URL for the project.
module.siteUrls = function() {
return grunt.co... | var _ = require('lodash');
module.exports = function(grunt) {
var module = {};
module.domain = function() {
return process.env.GRUNT_DRUPAL_DOMAIN || grunt.config('config.domain') || require('os').hostname();
};
// Ensure a default URL for the project.
module.siteUrls = function() {
return grunt.co... | Remove stray variable breaking defaultUrl calculation. | Remove stray variable breaking defaultUrl calculation.
| JavaScript | mit | AndBicScadMedia/grunt-drupal-tasks,EvanLovely/grunt-drupal-tasks,phase2/grunt-drupal-tasks,EvanLovely/grunt-drupal-tasks,AndBicScadMedia/grunt-drupal-tasks,phase2/grunt-drupal-tasks,EvanLovely/grunt-drupal-tasks,phase2/grunt-drupal-tasks,AndBicScadMedia/grunt-drupal-tasks,AndBicScadMedia/grunt-drupal-tasks,EvanLovely/g... |
980fc6cfc3702645eafd18dc46d9a399ca7fb3ad | lib/mime.js | lib/mime.js | /*!
* YUI Mocha
* Copyright 2011 Yahoo! Inc.
* Licensed under the BSD license.
*/
/**
* @module mime
*/
/**
* File extension to MIME type map.
*
* Used by `serve.js` when streaming files from disk.
*
* @property contentTypes
* @type object
*/
this.contentTypes = {
"css": "text/css",
"html": "text/htm... | /*!
* YUI Mocha
* Copyright 2011 Yahoo! Inc.
* Licensed under the BSD license.
*/
/**
* @module mime
*/
/**
* File extension to MIME type map.
*
* Used by `serve.js` when streaming files from disk.
*
* @property contentTypes
* @type object
*/
this.contentTypes = {
"css": "text/css",
"html": "text/htm... | Use same .xml MIME type as rgrove/combohandler. | Use same .xml MIME type as rgrove/combohandler.
| JavaScript | bsd-3-clause | reid/onyx,reid/onyx |
1b3faf12cf97bc2a534c941a59ac026ab49e0565 | src/numbers.js | src/numbers.js | 'use strict';
/**
*
* @param {integer } digit
* @returns {string} Returns Nepali converted string of given digit or numbers.
* @example
*
* numbers(2090873)
* // => २०९०८७३
*
* numbers()
* // => false
*
*/
function numbers (digit) {
if(!digit) {
console.log("@numbers: Yuck, got nothin... | 'use strict';
/**
*
* @param {integer } digit
* @returns {string} Returns Nepali converted string of given digit or numbers.
* @example
*
* numbers(2090873)
* // => २०९०८७३
*
* numbers()
* // => false
*
*/
function numbers (digit) {
const isdigit = parseInt(digit, 10);
if(typeof isdigit !... | Check typeof of given value | Check typeof of given value
| JavaScript | mit | shekhardesigner/NepaliDateConverter |
452ff1c3ce7ae04695f640b8b4e642f724d6be55 | lib/util.js | lib/util.js | 'use strict';
/**
* Retrieve a localized configuration value or the default if the localization
* is unavailable.
*
* @param {String} configuration value
* @param {String} language
* @param {Object} Hexo configuration object
* @param {String} Hexo locals object
* @returns {*} localized or default configuratio... | 'use strict';
/**
* Retrieve a localized configuration value or the default if the localization
* is unavailable.
*
* @param {String} configuration value
* @param {String} language
* @param {Object} Hexo configuration object
* @param {String} Hexo locals object
* @returns {*} localized or default configuratio... | Check for undefined localized values | Check for undefined localized values
Fixes #2.
| JavaScript | mit | ahaasler/hexo-multilingual |
3984d6e214a81837361a3a65a405b84344b54120 | app/modules/main/directives/Header.js | app/modules/main/directives/Header.js | 'use strict';
header.$inject = ['$rootScope', '$state', 'AuthService'];
function header($rootScope, $state, AuthService) {
return {
name: 'header',
template: require('./templates/header.html'),
scope: true,
link: function link(scope) {
scope.toggled = false;
... | 'use strict';
header.$inject = ['$rootScope', '$state', 'AuthService'];
function header($rootScope, $state, AuthService) {
return {
name: 'header',
template: require('./templates/header.html'),
scope: true,
link: function link(scope) {
scope.toggled = false;
... | Set logout button to reload state if current state is 'home' | Set logout button to reload state if current state is 'home'
| JavaScript | mit | zdizzle6717/hapi-angular-stack,zdizzle6717/hapi-angular-stack |
1ef82c281c5df2ded7dd4f1954fc0beb34e53899 | tasks/sismd.js | tasks/sismd.js | /* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
marked.setOptions({
breaks : true,
highlight: function(code, lang) {
var result = hljs.highlight(lang, co... | /* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
var renderer = new marked.Renderer();
var oldLink = renderer.link;
renderer.link = function(href, title, text) {
if (... | Fix a bug in documentation generation | Fix a bug in documentation generation
| JavaScript | bsd-3-clause | sis-cmdb/sis-ui,sis-cmdb/sis-ui |
ad25532c3601d23df11a23b8295cfc753a79e2ec | spec/javascripts/fixtures/educatorsViewJson.js | spec/javascripts/fixtures/educatorsViewJson.js | export default {
"id": 101,
"email": "hugo@demo.studentinsights.org",
"admin": false,
"full_name": "Teacher, Hugo",
"staff_type": null,
"schoolwide_access": false,
"grade_level_access": [],
"restricted_to_sped_students": false,
"restricted_to_english_language_learners": false,
"can_view_restricted_n... | export default {
"id": 101,
"email": "hugo@demo.studentinsights.org",
"admin": false,
"full_name": "Teacher, Hugo",
"staff_type": null,
"schoolwide_access": false,
"grade_level_access": [],
"restricted_to_sped_students": false,
"restricted_to_english_language_learners": false,
"can_view_restricted_n... | Fix lint error in JS fixture | Fix lint error in JS fixture
| JavaScript | mit | studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights |
cbec8ddeaa98e7510e2616f18f64df8340dd97e0 | src/item-button.js | src/item-button.js | import { select } from 'd3';
import Item from './item';
export default class ButtonItem extends Item {
constructor() {
super();
this._root
.classed('button', true)
.styles({
'background': '#FFF',
'cursor': 'pointer',
'height': '3em',
'justify-content': 'center'
... | import Item from './item';
export default class ButtonItem extends Item {
constructor() {
super();
this._root
.classed('button', true)
.styles({
'background': '#FFF',
'cursor': 'pointer',
'height': '3em',
'justify-content': 'center',
'padding': '0.5em 0'
... | Add padding to button item | Add padding to button item
| JavaScript | mit | scola84/node-d3-list |
e0b595bb8e631c29add7d486db9dc84285bab3f3 | public/js/admin.js | public/js/admin.js | window.admin = {};
$(document).ready(function() {
$("#admin-feedback").on("tabOpened", function() {
window.api.get("admin/feedback/getList", function(resp) {
$("#admin-feedback-list").text("");
for (var feedbackIndex in resp.feedback) {
var feedbackItem = resp.feedback[feedbackIndex];
var $feedbackLi ... | window.admin = {};
$(document).ready(function() {
$("#admin-feedback").on("tabOpened", function() {
window.api.get("admin/feedback/getList", function(resp) {
$("#admin-feedback-list").text("");
for (var feedbackIndex in resp.feedback) {
var feedbackItem = resp.feedback[feedbackIndex];
var $feedbackLi ... | Add username to feedback entries | Add username to feedback entries | JavaScript | mit | MyHomeworkSpace/MyHomeworkSpace,PlanHubMe/PlanHub,MyHomeworkSpace/MyHomeworkSpace,PlanHubMe/PlanHub,MyHomeworkSpace/MyHomeworkSpace |
44d11c878d7085b3ec320041f3182156497be91b | src/tests/setup.js | src/tests/setup.js | import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import 'jest-enzyme'; // better matchers
Enzyme.configure({
adapter: new Adapter(),
});
| import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import 'jest-enzyme'; // better matchers
Enzyme.configure({
adapter: new Adapter(),
});
if (process.env.CI) {
// Hide all console output
console.log = jest.fn();
console.warn = jest.fn();
console.error = jest.fn();
}
| Disable console output in Travis | Disable console output in Travis
| JavaScript | agpl-3.0 | sMteX/WoWAnalyzer,fyruna/WoWAnalyzer,enragednuke/WoWAnalyzer,ronaldpereira/WoWAnalyzer,anom0ly/WoWAnalyzer,sMteX/WoWAnalyzer,Juko8/WoWAnalyzer,hasseboulen/WoWAnalyzer,FaideWW/WoWAnalyzer,yajinni/WoWAnalyzer,Juko8/WoWAnalyzer,hasseboulen/WoWAnalyzer,Juko8/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,sMteX/WoWAnalyzer,ronaldperei... |
a0bfebc24d8eec171cbca7696a3823c388b543c1 | src/components/Activity.js | src/components/Activity.js | import React, { Component, PropTypes } from 'react';
import moment from 'moment';
class Activity extends Component {
render() {
const { timestamp, activity, deleteActivity } = this.props;
return (
<div className="row row--middle">
<div className="col--2">
<p>{moment(+timestamp).form... | import React, { Component, PropTypes } from 'react';
import moment from 'moment';
class Activity extends Component {
render() {
const { timestamp, activity, deleteActivity } = this.props;
return (
<div className="row row--middle">
<div className="col--4">
<p>
{activity.d... | Remove date string from activity | Remove date string from activity
| JavaScript | mit | mknudsen01/today,mknudsen01/today |
9a26b6c509419f91726a4b31c93931540ddd33f0 | src/components/GameList.js | src/components/GameList.js | import React from 'react';
import '../styles/games.css';
export default class GameList extends React.Component {
constructor(props) {
super(props);
this.state = {games: []};
}
componentWillReceiveProps(nextProps) {
let games = [];
nextProps.games.forEach(game => {
... | import React from 'react';
import '../styles/games.css';
export default class GameList extends React.Component {
constructor(props) {
super(props);
this.state = {games: []};
}
componentWillReceiveProps(nextProps) {
let games = [];
nextProps.games.forEach(game => {
... | Call onSelect event when a game is clicked. | Call onSelect event when a game is clicked.
| JavaScript | mit | Julzso23/player.me-one-click-share,Julzso23/player.me-one-click-share |
2e0235e8495dd47dcbf15fd2bd6e012d5d615054 | bin/codeclimate.js | bin/codeclimate.js | #!/usr/bin/env node
var Formatter = require("../formatter");
var client = require('../http_client');
process.stdin.resume();
process.stdin.setEncoding("utf8");
var input = "";
process.stdin.on("data", function(chunk) {
input += chunk;
});
process.stdin.on("end", function() {
formatter = new Formatter... | #!/usr/bin/env node
var Formatter = require("../formatter");
var client = require('../http_client');
process.stdin.resume();
process.stdin.setEncoding("utf8");
var input = "";
process.stdin.on("data", function(chunk) {
input += chunk;
});
process.stdin.on("end", function() {
formatter = new Formatter... | Add ability to print to stdout instead of POSTing | Add ability to print to stdout instead of POSTing
| JavaScript | mit | kyroskoh/javascript-test-reporter,therebelbeta/javascript-test-reporter,codeclimate/javascript-test-reporter,buildkite/javascript-test-reporter |
6b701f707390938a069ab5742a15668e5c03f91d | src/custom-rx-operators.js | src/custom-rx-operators.js | import {Observable, Disposable} from 'rx';
Observable.prototype.subUnsub = function(onSub=null, onUnsub=null) {
return Observable.create((subj) => {
if (onSub) onSub();
let d = this.subscribe(subj);
return Disposable.create(() => {
if (onUnsub) onUnsub();
d.dispose();
});
});
};
... | import {Observable, Disposable} from 'rx';
Observable.prototype.subUnsub = function(onSub=null, onUnsub=null) {
return Observable.create((subj) => {
if (onSub) onSub();
let d = this.subscribe(subj);
return Disposable.create(() => {
if (onUnsub) onUnsub();
d.dispose();
});
});
};
... | Add an operator to delay failures | Add an operator to delay failures
| JavaScript | mit | surf-build/surf,surf-build/surf,surf-build/surf,surf-build/surf |
18a6a22170a2f0d4adb304351cd2c073942586b1 | reporters/tap.js | reporters/tap.js | /**
* Results formatter for --format=tap
*
* @see http://podwiki.hexten.net/TAP/TAP.html?page=TAP
* @see https://github.com/isaacs/node-tap
*/
var Producer = require('tap').Producer;
module.exports = function(results) {
// public API
return {
render: function() {
var metrics = results.getMetricsNames(),
... | /**
* Results formatter for --format=tap
*
* @see http://podwiki.hexten.net/TAP/TAP.html?page=TAP
* @see https://github.com/isaacs/node-tap
*/
var Producer = require('tap').Producer;
module.exports = function(results) {
// public API
return {
render: function() {
var metrics = results.getMetricsNames(),
... | Format YAMLish properly to make it work in Jenkins | Format YAMLish properly to make it work in Jenkins
| JavaScript | bsd-2-clause | william-p/phantomas,ingoclaro/phantomas,william-p/phantomas,gmetais/phantomas,ingoclaro/phantomas,william-p/phantomas,macbre/phantomas,ingoclaro/phantomas,macbre/phantomas,gmetais/phantomas,gmetais/phantomas,macbre/phantomas |
0d1917939110865a62136dc6d66fac5749574881 | app/controllers/application.js | app/controllers/application.js | import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service(),
isExpanded: true,
isNotLogin: Ember.computed('this.currentPath', function() {
if (this.currentPath !== 'login') {
return true;
} else {
return false;
}
})... | import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service(),
isExpanded: true,
isNotLogin: Ember.computed('currentPath', function() {
return this.get('currentPath') !== 'login';
}),
sizeContainer: function() {
var winWidth = Ember.$(window).wi... | Fix display artifact that prevented sidebar from showing after login, until page was refreshed | Fix display artifact that prevented sidebar from showing after login, until page was refreshed
[#LEI-294]
| JavaScript | apache-2.0 | abought/experimenter,abought/experimenter |
f9faf808f414ae53d372fe3ad5b4c6ca9b6e86c9 | src/webroot/js/fancybox.js | src/webroot/js/fancybox.js | /**
* Call the fancybox for displaying organism details in a lightbox
*/
$(".fancybox").fancybox({
maxWidth: 1000,
maxHeight: 800
}); | /**
* Call the fancybox for displaying organism details in a lightbox
*/
$(".fancybox").fancybox({
minWidth: 1000,
maxWidth: 1000,
maxHeight: 800,
minHeight: 800
}); | Set size of fancy box | Set size of fancy box
| JavaScript | mit | molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec |
88207533c117a9ccc89f0d0b0e4a74fb97b6c821 | scripts/offsets.js | scripts/offsets.js | 'use strict';
const exec = require('child_process').execSync;
const ios = require('./contours-ios.json');
const web = require('./contours-web.json');
const fs = require('fs');
var offsets = {};
for (let font in web) {
const offset = {
x: web[font].x - ios[font].x,
y: web[font].y - ios[font].y
... | "use strict";
const exec = require("child_process").execSync;
const ios = require("./contours-ios.json");
const web = require("./contours-web.json");
const fs = require("fs");
var offsets = {};
for (let font in web) {
const offset = {
x: web[font].x - ios[font].x,
y: web[font].y - ios[font].y,
... | Update script to add top inset | Update script to add top inset
| JavaScript | mit | ninjaprox/TextContour,ninjaprox/TextContour,ninjaprox/TextContour,ninjaprox/TextContour |
0c0fa72464530d3a9896a18d9b752626835dc1b2 | ui/src/registrator/PrihlaskyDohlasky/Platby/NovaPlatbaInputContainer.js | ui/src/registrator/PrihlaskyDohlasky/Platby/NovaPlatbaInputContainer.js | import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import InputContainer from '../Input/InputContainer';
import { inputChanged } from './PlatbyActions';
import {
formatValue,
inputOptions,
inputValid,
isInputEnabled,
isInputVisible
} from './platbyReducer';
const mapStateToProps = (st... | import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import InputContainer from '../Input/InputContainer';
import { inputChanged } from './PlatbyActions';
import {
formatValue,
inputOptions,
inputValid,
isInputEnabled,
isInputVisible
} from './platbyReducer';
const mapStateToProps = (st... | Unify component name and filename. | Unify component name and filename.
| JavaScript | mit | ivosh/jcm2018,ivosh/jcm2018,ivosh/jcm2018 |
4ed6fd92ad2f2b3b4088842d544e2154c4302b49 | src/rules/accessible-emoji.js | src/rules/accessible-emoji.js | /**
* @fileoverview Enforce emojis are wrapped in <span> and provide screenreader access.
* @author Ethan Cohen
*/
// ----------------------------------------------------------------------------
// Rule Definition
// ----------------------------------------------------------------------------
import emojiRegex fro... | /**
* @fileoverview Enforce emojis are wrapped in <span> and provide screenreader access.
* @author Ethan Cohen
*/
// ----------------------------------------------------------------------------
// Rule Definition
// ----------------------------------------------------------------------------
import emojiRegex fro... | Return just a boolean from find | Return just a boolean from find
| JavaScript | mit | evcohen/eslint-plugin-jsx-a11y,jessebeach/eslint-plugin-jsx-a11y |
0d56522d9ae59d9d62c6787421cfcc4daf489a92 | src/util/define-properties.js | src/util/define-properties.js | export default function (obj, props) {
Object.keys(props).forEach(function (name) {
const desc = Object.getOwnPropertyDescriptor(obj, name);
if (!desc || desc.configurable) {
Object.defineProperty(obj, name, props[name]);
}
});
} | export default function (obj, props) {
Object.keys(props).forEach(function (name) {
const prop = props[name];
const descrptor = Object.getOwnPropertyDescriptor(obj, name);
const isDinosaurBrowser = name !== 'arguments' && name !== 'caller' && 'value' in prop;
const isConfigurable = !descrptor || descr... | Make defining properties more robust for opera 12 or any browser that thinks things are non-configurable. | Make defining properties more robust for opera 12 or any browser that thinks things are non-configurable.
| JavaScript | mit | chrisdarroch/skatejs,skatejs/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs |
65b9ec6e02399db66b51a4a15f3c52fe2ee04b9a | src/app/main/main.controller.js | src/app/main/main.controller.js | class MainController {
constructor(_, $scope, $state, $log, SocketService) {
'ngInject';
this._ = _;
this.$log = $log;
this.$state = $state;
this.$scope = $scope;
this.SocketService = SocketService;
this.name = '';
this.password = '';
this.errorMessage = '';
this.processing = ... | class MainController {
constructor(_, $scope, $state, $log, SocketService) {
'ngInject';
this._ = _;
this.$log = $log;
this.$state = $state;
this.$scope = $scope;
this.SocketService = SocketService;
this.name = '';
this.password = '';
this.errorMessage = '';
this.processing = ... | Save game_id when joining game | Save game_id when joining game
| JavaScript | mit | hendryl/Famous-Places-Mobile,hendryl/Famous-Places-Mobile |
b42d2aa652b987865d3a6f55f601b98f21a76137 | lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/size/legend-size-types.js | lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/size/legend-size-types.js | var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carous... | var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
var styleHelper = require('builder/helpers/style');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('bui... | Refactor bubble legend compatibility rules with styles for clarity | Refactor bubble legend compatibility rules with styles for clarity
| JavaScript | bsd-3-clause | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb |
52c04555ff2c5c7e4f41eaa3cd422e9d386dfdee | lib/index.js | lib/index.js |
var math = require('mathjs');
var ERROR_RESPONSE = 'I can\'t calculate that!';
module.exports = function(argv, response) {
var respBody;
try {
var expression = argv.slice(1).join('');
respBody = math.eval(expression).toString();
} catch(e) {
console.error(e);
respBody = ERROR_RESPONSE;
}
... |
var math = require('mathjs');
var ERROR_RESPONSE = 'I can\'t calculate that!';
module.exports = function(argv, response) {
var respBody = ERROR_RESPONSE;
try {
var expression = argv.slice(1).join('');
var result = math.eval(expression);
if (typeof result === 'function') {
console.error('Someh... | Check for weird function results | Check for weird function results
| JavaScript | mit | elvinyung/scalk |
3b53fc0ff2a2ecb022f35926d37a1a0f140ae640 | lib/utils.js | lib/utils.js | 'use strict';
module.exports = {
getAuthorizedAclMethods,
};
function getAuthorizedAclMethods(Model) {
let authorizedMethods = [];
let acls = Model.definition.settings.acls || [];
acls.forEach((acl) => {
if (acl.permission === 'ALLOW' && acl.property) {
if (!Array.isArray(acl.property)) {
a... | 'use strict';
module.exports = {
getAuthorizedAclMethods,
};
function getAuthorizedAclMethods(Model) {
let authorizedMethods = [];
let acls = Model.settings.acls || [];
acls.forEach((acl) => {
if (acl.permission === 'ALLOW' && acl.property) {
if (!Array.isArray(acl.property)) {
acl.property... | Use Model.settings.acls to get the acls | Use Model.settings.acls to get the acls
Use `Model.settings.acls` to get the acls instead of `Model.definition.settings.acl`. `Model.definition` is an artifact created by datasource-juggler, but it wouldn't exists if you just use `loopback.createModel()`. | JavaScript | mit | devsu/loopback-setup-remote-methods-mixin |
ff5f0558be982d50aa74991051b676ec4c263482 | src/main/webapp/resources/js/pages/samples/edit.js | src/main/webapp/resources/js/pages/samples/edit.js | $(document).ready(function(){
/**
* Serialize metadata to json for submission
*/
$("#edit-form").submit(function(){
var metadata = {};
$("#other-metadata").find(".metadata-entry").each(function(){
var entry = $(this);
var key = entry.find(".metadata-key").val();... | $(document).ready(function(){
/**
* Serialize metadata to json for submission
*/
$("#edit-form").submit(function(){
var metadata = {};
$("#other-metadata").find(".metadata-entry").each(function(){
var entry = $(this);
var key = entry.find(".metadata-key").val();... | Check to see if there is actually metadata to add. | Check to see if there is actually metadata to add.
| JavaScript | apache-2.0 | phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida |
494ecc627106cb7f9532f88db97b5d2f45fa23dc | src/main/webapp/components/BuilderDataTable.js | src/main/webapp/components/BuilderDataTable.js | import * as React from 'react';
const HEADERS = ['no', 'text', 'log'];
/**
* Table responsible for storing the data for a builder.
*
* @param {Object[]} props.buildSteps - The build steps for a given builder.
* @param {string} props.buildSteps[].step_number - The relative order of the build step.
* @param {strin... | import * as React from 'react';
import {getFields} from './utils/getFields';
// The target fields to be extracted from each build step
// and displayed on each row.
const BUILD_STEP_FIELDS = ['step_number', 'text', 'logs'];
// Headers to display at the top of the table.
const HEADERS = ['no.', 'text', 'log'];
/**
*... | Read build step fields from array, Update comments | Read build step fields from array, Update comments
| JavaScript | apache-2.0 | googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020 |
a658a63b42244b826fbe2daee2b7509749681623 | src/dialog-action-directives.js | src/dialog-action-directives.js | function dialogClose() {
return {
restrict: 'EA',
require: '^dialog',
scope: {
returnValue: '=?return'
},
link(scope, element, attrs, dialog) {
element.on('click', function() {
scope.$apply(() => {
dialog.close(scope... | function dialogClose() {
return {
restrict: 'EA',
require: '^dialog',
scope: {
returnValue: '=?return'
},
link(scope, element, attrs, dialog) {
element.on('click', function() {
scope.$apply(() => {
dialog.close(scope... | Fix injection in show dialog button directive | Fix injection in show dialog button directive
| JavaScript | mit | olympicsoftware/oly-dialog,olympicsoftware/oly-dialog |
5bbc62fe150789c63b557fab36b56781ba329f0b | app/components/Feed/context.js | app/components/Feed/context.js | // @flow
import React from 'react';
import { Link } from 'react-router';
import type { AggregatedActivity } from './types';
export function lookupContext(
aggregatedActivity: AggregatedActivity,
key: string
) {
return aggregatedActivity.context[key];
}
export const contextRender = {
'users.user': (context: Ob... | // @flow
import React from 'react';
import { Link } from 'react-router';
import type { AggregatedActivity } from './types';
export function lookupContext(
aggregatedActivity: AggregatedActivity,
key: string
) {
return aggregatedActivity.context[key];
}
export const contextRender = {
'users.user': (context: Ob... | Add support for notifications on gallery.gallerypicture | Add support for notifications on gallery.gallerypicture
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp |
c0002c7f3a62e90b62e9f821b4f13c80bdbae324 | chat.js | chat.js | var chat = angular.module('chat', ['btford.socket-io']);
var channel = new Channel('hellas');
var me = null;
chat.factory('chatServer', function (socketFactory) {
var url = '/';
if (location.port != '') {
url = ':' + location.port + '/';
}
return socketFactory({ioSocket: io.connect(url)})
});... | var chat = angular.module('chat', ['btford.socket-io']);
var channel = new Channel('hellas');
var me = null;
chat.factory('chatServer', function (socketFactory) {
var url = '/';
if (location.port != '') {
url = ':' + location.port + '/';
}
return socketFactory({ioSocket: io.connect(url)})
});... | Join channel and register on reconnect | Join channel and register on reconnect
| JavaScript | mit | gtklocker/ting,odyvarv/ting-1,odyvarv/ting-1,sirodoht/ting,gtklocker/ting,odyvarv/ting-1,dionyziz/ting,dionyziz/ting,mbalamat/ting,sirodoht/ting,sirodoht/ting,mbalamat/ting,mbalamat/ting,dionyziz/ting,gtklocker/ting,VitSalis/ting,gtklocker/ting,dionyziz/ting,sirodoht/ting,VitSalis/ting,VitSalis/ting,odyvarv/ting-1,VitS... |
3f855c3b1e7b0a6ce546fa9e422fd478a5eb1f1c | modules/recent-activity/server/controllers/recent-activity.controller.js | modules/recent-activity/server/controllers/recent-activity.controller.js | 'use strict';
// =========================================================================
//
// Controller for orgs
//
// =========================================================================
var path = require('path');
var DBModel = require (path.resolve('./modules/core/server/controllers/core.dbmodel.... | 'use strict';
// =========================================================================
//
// Controller for orgs
//
// =========================================================================
var path = require('path');
var DBModel = require (path.resolve('./modules/core/server/controllers/core.dbmodel.... | Fix news & announcements to be reverse sorted. | Fix news & announcements to be reverse sorted.
| JavaScript | apache-2.0 | logancodes/esm-server,logancodes/esm-server,logancodes/esm-server |
b2a119f8d4685e96a2bf338ab1a933b9bba13b27 | unit/poller/index.js | unit/poller/index.js | var mqtt = require('mqtt');
var SensorTag = require('sensortag');
var client = mqtt.connect('mqtt://tree:tree@m11.cloudmqtt.com:19539');
client.on('connect', function () {
client.publish('sensor', "foo");
SensorTag.discoverAll(function (sensorTag) {
console.log('Sensor found: ' + sensorTag);
sensorTag.connectAn... | var mqtt = require('mqtt');
var SensorTag = require('sensortag');
var client = mqtt.connect('mqtt://tree:tree@m11.cloudmqtt.com:19539');
client.on('connect', function () {
SensorTag.discoverAll(function (sensorTag) {
console.log('Sensor found: ' + sensorTag);
sensorTag.connectAndSetUp(function (error) {
if (e... | Send temperature, humidity to server | Send temperature, humidity to server
| JavaScript | mit | jphacks/KB_12,jphacks/KB_12,jphacks/KB_12,jphacks/KB_12,mikoim/mori,mikoim/mori,jphacks/KB_12,mikoim/mori,mikoim/mori,mikoim/mori |
da5e854055509992103561f5134dea0ef094bec9 | test/components/Posts.spec.js | test/components/Posts.spec.js | import { expect } from 'chai';
import { shallow } from 'enzyme';
import React from 'react';
import Posts from '../../src/js/components/Posts';
import PostPreview from '../../src/js/components/PostPreview';
describe('<Posts/>', () => {
const posts = [
{ id: 0, title: 'First Post' },
{ id: 1, title: 'Second Po... | import { expect } from 'chai';
import { shallow, mount } from 'enzyme';
import React from 'react';
import { MemoryRouter as Router } from 'react-router-dom';
import Posts from '../../src/js/components/Posts';
import PostPreview from '../../src/js/components/PostPreview';
describe('<Posts/>', () => {
const posts = [
... | Test passing tag to <Posts> | Test passing tag to <Posts>
| JavaScript | mit | slavapavlutin/pavlutin-node,slavapavlutin/pavlutin-node |
37eae0ebce6e466319ac991a2b810b7a260ffb7d | src/views/Browse.js | src/views/Browse.js | import React from 'react';
import { connect } from 'react-redux';
import { fetchRecipes, setSearchTerm } from '../actions/';
import Header from '../components/Header';
import SearchHeader from '../components/SearchHeader';
import Card from '../components/Card';
class Browse extends React.Component {
constructor(prop... | import React from 'react';
import { connect } from 'react-redux';
import { fetchRecipes, setSearchTerm } from '../actions/';
import Header from '../components/Header';
import SearchHeader from '../components/SearchHeader';
import Card from '../components/Card';
class Browse extends React.Component {
constructor(prop... | Change the browse page layout temporarily | Change the browse page layout temporarily
| JavaScript | mit | hihuz/meny,hihuz/meny |
930326fafe7a14b472fece345572c184de542a6e | lib/auths/index.js | lib/auths/index.js | const gatherResources = require('../utils/gatherResources')
const auth = [
'options',
'token'
]
module.exports = gatherResources(auth, __dirname)
| const gatherResources = require('../utils/gatherResources')
const auth = [
'options',
'token',
'oauth2',
'couchdb'
]
module.exports = gatherResources(auth, __dirname)
| Include oauth2 and couchdb auth in `integreat.auths()` | Include oauth2 and couchdb auth in `integreat.auths()`
| JavaScript | isc | kjellmorten/integreat |
098185af723d83e2ace531d0644b1cda414d8bcd | lib/tasks/serve.js | lib/tasks/serve.js | 'use strict';
module.exports = function(gulp, $, config, _) {
var proxyTarget = _.get(config, 'proxy.url', config.consts.proxy.url);
var proxyPrefixes = _.get(config, 'proxy.prefixes', config.consts.proxy.prefixes);
var proxy = $.httpProxy.createProxyServer({
target: proxyTarget
});
function isProxiedPrefix... | 'use strict';
module.exports = function(gulp, $, config, _) {
var proxyTarget = _.get(config, 'proxy.url', config.consts.proxy.url);
var proxyPrefixes = _.get(config, 'proxy.prefixes', config.consts.proxy.prefixes);
var proxy = $.httpProxy.createProxyServer({
target: proxyTarget
});
function isProxiedPrefix... | Set middleware function to be definable | Set middleware function to be definable
| JavaScript | mit | akullpp/akGulp,akullpp/myGulp |
2223e83d7ea673bad92f89df32da4ee72bdac360 | backend/src/routes/users/index.js | backend/src/routes/users/index.js | const express = require('express')
const ERRORS = require('../../errors')
const User = require('../../models/User')
const utils = require('../../utils')
const router = express.Router()
router.post('/', register)
function register(req, res, next) {
const { body: { username, password } } = req
if (!username || !... | const express = require('express')
const ERRORS = require('../../errors')
const User = require('../../models/User')
const utils = require('../../utils')
const router = express.Router()
/*
* Endpoint: [POST] /users
* Header:
* <None>
* Body: {username, password}
* Response:
* 201 (JSON) The created user with... | Add meta-comments + backbone of authenticate method | Add meta-comments + backbone of authenticate method
| JavaScript | mit | 14Plumes/Hexode,KtorZ/Hexode,KtorZ/Hexode,14Plumes/Hexode,KtorZ/Hexode,14Plumes/Hexode |
3b3f61946d2c8bc79fbccc171035612293209c58 | functions/strings/hex2bin.js | functions/strings/hex2bin.js | function hex2bin(s) {
// discuss at: http://phpjs.org/functions/hex2bin/
// original by: Dumitru Uzun (http://duzun.me)
// example 1: bin2hex('44696d61');
// returns 1: 'Dima'
// example 2: bin2hex('00');
// returns 2: '\x00'
var ret = [], i = 0, l;
s += '';
for ( l = s.length ; i < l; i+=... | function hex2bin(s) {
// discuss at: http://phpjs.org/functions/hex2bin/
// original by: Dumitru Uzun (http://duzun.me)
// example 1: bin2hex('44696d61');
// returns 1: 'Dima'
// example 2: bin2hex('00');
// returns 2: '\x00'
// example 3: bin2hex('2f1q')
// returns 3: false
var ret = []... | Return FALSE if non-hex char detected | Return FALSE if non-hex char detected
Return FALSE if non-hex char detected - same behaviour as PHP version of hex2bin(). | JavaScript | mit | revanthpobala/phpjs,praveenscience/phpjs,strrife/phpjs,davidgruebl/phpjs,w35l3y/phpjs,VicAMMON/phpjs,Mazbaul/phpjs,J2TeaM/phpjs,cigraphics/phpjs,praveenscience/phpjs,janschoenherr/phpjs,VicAMMON/phpjs,ajenkul/phpjs,cigraphics/phpjs,VicAMMON/phpjs,ajenkul/phpjs,mojaray2k/phpjs,imshibaji/phpjs,Mazbaul/phpjs,FlorinDragota... |
805a979307583490d89197c8a82e7ba9fcae27ce | client/common/actions/index.js | client/common/actions/index.js | import types from '../constants/ActionTypes'
import utils from '../../shared/utils'
function replaceUserInfo(userInfo) {
return {
type: types.REPLACE_USER_INFO,
userInfo
}
}
function clearUserInfo() {
return {type: types.CLEAR_USER_INFO}
}
function fetchUserInfo() {
return dispatch =>... | import types from '../constants/ActionTypes'
import utils from '../../shared/utils'
function replaceUserInfo(userInfo) {
return {
type: types.REPLACE_USER_INFO,
userInfo
}
}
function clearUserInfo() {
return {type: types.CLEAR_USER_INFO}
}
function fetchUserInfo() {
return dispatch =>... | Update action fetchUserInfo ajax type to get | Update action fetchUserInfo ajax type to get
| JavaScript | mit | qiuye1027/screenInteraction,qiuye1027/screenInteraction,chikara-chan/react-isomorphic-boilerplate,chikara-chan/react-isomorphic-boilerplate |
3480bf8a6de2c0dd46b7b5e0a1e2a968ae4e603c | client/js/util/eventemitter.js | client/js/util/eventemitter.js | 'use strict';
/**
* @constructor
*/
function EventEmitter() {
this.eventHandlers = {};
}
EventEmitter.prototype.emit = function(event) {
if (!this.eventHandlers[event]) {
return;
}
var argsOut = [];
for (var i = 1; i < arguments.length; ++i) {
argsOut.push(arguments[i]);
}
for (var j = 0; j < ... | 'use strict';
/**
* @constructor
*/
function EventEmitter() {
this.eventHandlers = {};
}
EventEmitter.prototype.emit = function(event) {
if (!this.eventHandlers[event]) {
return;
}
var argsOut = [];
for (var i = 1; i < arguments.length; ++i) {
argsOut.push(arguments[i]);
}
for (var j = 0; j ... | Make addEventListener return this for function chaining. | Make addEventListener return this for function chaining.
| JavaScript | agpl-3.0 | exjam/rosebrowser,exjam/rosebrowser,brett19/rosebrowser,brett19/rosebrowser |
b7d6033ada80ac9979c084cc357e2c541a05ee62 | server/config/config.units.js | server/config/config.units.js | var units = {
datacenter: {
unitName: 'adminsys',
unitStats: {
attack: 10,
security: 50,
power: 5
}
},
personal_computer: {
unitName: 'zombie_computer',
unitStats: {
attack: 50,
security: 0,
power... | var units = {
datacenter: {
unitStats: {
name: 'SysAdmin',
attack: 0,
security: 25,
power: 500,
price: 2000
}
},
personal_computer: {
unitStats: {
name: 'Zombie computer',
attack: 10,
secu... | Change unit object format (server side) | Change unit object format (server side)
| JavaScript | mit | romain-grelet/HackersWars,romain-grelet/HackersWars |
1d7da8b90ffc9d685a247e426c696d85b38201c4 | assets/js/racer.js | assets/js/racer.js | function Game(){
this.$track = $('#racetrack');
this.finishLine = this.$track.width() - 54;
}
function Player(id){
this.player = $('.player')[id - 1];
this.position = 10;
}
Player.prototype.move = function(){
this.position += 20;
};
Player.prototype.updatePosition = function(){
$player = $(this.player);
... | function Game(){
this.$track = $('#racetrack');
this.finishLine = this.$track.width() - 54;
}
function Player(id){
this.player = $('.player')[id - 1];
this.position = 10;
}
Player.prototype.move = function(){
this.position += 20;
};
Player.prototype.updatePosition = function(){
$player = $(this.player);
... | Create checkWinner Function that alerts when a player has reached the finish line | Create checkWinner Function that alerts when a player has reached the finish line
| JavaScript | mit | SputterPuttRedux/basic-javascript-racer,SputterPuttRedux/basic-javascript-racer |
0c467864aa4bac65bae58116b150020a074d091f | admin/client/App/sagas/index.js | admin/client/App/sagas/index.js | import { takeLatest, delay } from 'redux-saga';
import { fork, select, put, take } from 'redux-saga/effects';
import * as actions from '../screens/List/constants';
import updateParams from './updateParams';
import { loadItems } from '../screens/List/actions';
/**
* Load the items
*/
function * loadTheItems () {
yi... | import { takeLatest, delay } from 'redux-saga';
import { fork, select, put, take } from 'redux-saga/effects';
import * as actions from '../screens/List/constants';
import updateParams from './updateParams';
import { loadItems } from '../screens/List/actions';
/**
* Load the items
*/
function * loadTheItems () {
yi... | Fix list not loading on second open | Fix list not loading on second open
Closes #3369
| JavaScript | mit | danielmahon/keystone,benkroeger/keystone,linhanyang/keystone,naustudio/keystone,Pop-Code/keystone,naustudio/keystone,danielmahon/keystone,trentmillar/keystone,jstockwin/keystone,matthewstyers/keystone,ONode/keystone,w01fgang/keystone,alobodig/keystone,frontyard/keystone,jstockwin/keystone,trentmillar/keystone,vokal/key... |
3934fbf1024d52b8b8429a5d073b7b8526521d25 | src/hello-world.js | src/hello-world.js | // ./src/hello-world.js
var console = require('gulp-messenger');
console.success('Hello World!'); | // ./src/hello-world.js
var console = require('gulp-messenger');
console.success('Hello World!');
console.log('This is added in master branch') | Create merge conflict in master branch | Create merge conflict in master branch
| JavaScript | mit | mikeerickson/gitflow |
f658e382b0974c53edc828efac5d4f182fbd3c08 | app/assets/javascripts/users.js | app/assets/javascripts/users.js | $( ".users-show, .users-sample" ).ready( function() {
$( "#stats-area" ).tabs({
// Ajax request stuff, mostly pulled from jQuery UI's docs.
beforeLoad: function( event, ui ) {
// There's no need to do a fresh Ajax request each time the tab
// is clicked. If the tab has been loaded already, skip t... | $( ".users-show, .users-sample" ).ready( function() {
$( "#stats-area" ).tabs({
// Ajax request stuff, mostly pulled from jQuery UI's docs.
beforeLoad: function( event, ui ) {
// There's no need to do a fresh Ajax request each time the tab
// is clicked. If the tab has been loaded already (or is ... | Load Topics in background when stats page opens | Load Topics in background when stats page opens
| JavaScript | mit | steve-mcclellan/j-scorer,steve-mcclellan/j-scorer,steve-mcclellan/j-scorer |
3a4aae6cfb1f664afd8943a1a49d3de0062eb2b9 | app/js/helpers.js | app/js/helpers.js | function filter(arr) {
var filteredArray = [], prev;
arr.sort();
for (var i = 0; i < arr.length; i++) {
if (arr[i] !== prev) {
filteredArray.push(arr[i]);
}
prev = arr[i];
}
return filteredArray
}
function rarefy(pattern) {
arr = [];
matches = [];
merged = [];
str = text.doc;
elem... | function filter(arr) {
var filteredArray = [], prev;
arr.sort();
for (var i = 0; i < arr.length; i++) {
if (arr[i] !== prev) {
filteredArray.push(arr[i]);
}
prev = arr[i];
}
return filteredArray
}
function rarefyXMLTextContent(pattern) {
arr = [];
matches = [];
merged = [];
str = te... | Rename helper methods for clarity | Rename helper methods for clarity
| JavaScript | mit | bdfinlayson/annotation-tool,bdfinlayson/annotation-tool |
bcb666e596c694f432340e780aff05530b0df40a | src/series/line.js | src/series/line.js | (function(d3, fc) {
'use strict';
fc.series.line = function() {
// convenience functions that return the x & y screen coords for a given point
var x = function(d) { return line.xScale.value(line.xValue.value(d)); };
var y = function(d) { return line.yScale.value(line.yValue.value(d)); ... | (function(d3, fc) {
'use strict';
fc.series.line = function() {
// convenience functions that return the x & y screen coords for a given point
var x = function(d) { return line.xScale.value(line.xValue.value(d)); };
var y = function(d) { return line.yScale.value(line.yValue.value(d)); ... | Add interpolation support to the Line series component | Add interpolation support to the Line series component
| JavaScript | mit | alisd23/d3fc-d3v4,bjedrzejewski/d3fc,fxcebx/d3fc,djmiley/d3fc,fxcebx/d3fc,janakerman/d3-financial-components,alisd23/d3fc-d3v4,djmiley/d3fc,fxcebx/d3fc,bjedrzejewski/d3fc,janakerman/d3-financial-components,djmiley/d3fc,bjedrzejewski/d3fc,alisd23/d3fc-d3v4 |
f54167b6ce911acd2a4ecd05db25f11558ed870f | IoradWebWidget/scripts/app.js | IoradWebWidget/scripts/app.js | if (ioradWebWidget.util.common.isFreshdeskKnowledgebase()) {
ioradWebWidget.freshdesk.runApp(jQuery, window);
}
if (ioradWebWidget.util.common.isDeskKnowledgebase()) {
ioradWebWidget.desk.runApp(jQuery, window);
}
| //if (ioradWebWidget.util.common.isFreshdeskKnowledgebase()) {
// ioradWebWidget.freshdesk.runApp(jQuery, window);
//}
ioradWebWidget.freshdesk.runApp(jQuery, window); | Make freshdesk widget run on customized domain support portals. | Make freshdesk widget run on customized domain support portals.
| JavaScript | mit | iorad/integrations,iorad/integrations,iorad/integrations |
2aecea32c53f551069b43ac6e2e9da3831a9b667 | client/packages/settings-dashboard-extension-worona/src/dashboard/reducers/index.js | client/packages/settings-dashboard-extension-worona/src/dashboard/reducers/index.js | import { isDev, getDevelopmentPackages } from 'worona-deps';
import { map } from 'lodash';
import { combineReducers } from 'redux';
import * as deps from '../deps';
const env = isDev ? 'dev' : 'prod';
const mapPkg = pkg => ({ ...pkg, main: pkg.cdn && pkg.cdn.dashboard[env].main.file });
const create = collection => c... | import { isDev, getDevelopmentPackages } from 'worona-deps';
import { map } from 'lodash';
import { combineReducers } from 'redux';
import * as deps from '../deps';
const env = isDev ? 'dev' : 'prod';
const mapPkg = pkg => ({ ...pkg, main: pkg.cdn && pkg.cdn.dashboard[env].main.file });
const createSetting = collecti... | Remove mapPkg from settings collections. | Remove mapPkg from settings collections.
| JavaScript | mit | worona/worona-dashboard,worona/worona-dashboard,worona/worona,worona/worona,worona/worona-core,worona/worona,worona/worona-core |
f1aa082977ee0679cfa1e96d3fa3a2e3fdefa8fe | src/actions/sessionActions.js | src/actions/sessionActions.js | import fetch from 'isomorphic-fetch'
export function signUpUser(register, history) {
return(dispatch) => {
const options = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
user: {
first_name: register.name,
email: register.em... | import fetch from 'isomorphic-fetch'
export function signUpUser(register, history) {
return(dispatch) => {
const options = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
user: {
first_name: register.name,
email: register.em... | Change jwt storage from session to local | Change jwt storage from session to local
| JavaScript | mit | snsavage/timer-react,snsavage/timer-react |
88f0989207c048b60a72cca136bc5d912c77ebd3 | src/App.js | src/App.js | import DicewareOptions from './DicewareOptions'
import React, { PureComponent } from 'react'
export default class App extends PureComponent {
state = {
length: 6
}
handleLengthChange = event => this.setState({ length: parseInt(event.target.value, 10) })
handlePossibleItemsChange = possibleItems => this.se... | import DicewareOptions from './DicewareOptions'
import React, { PureComponent } from 'react'
export default class App extends PureComponent {
state = {
length: 6
}
handleLengthChange = event => this.setState({ length: parseInt(event.target.value, 10) })
handlePossibleItemsChange = possibleItems => this.se... | Clean up result math and notation | Clean up result math and notation
| JavaScript | isc | nickmccurdy/password-entropy,nickmccurdy/password-entropy |
962dd6226d16428acf12993eb35c6b90d29bc109 | js/bitazza.js | js/bitazza.js | 'use strict';
// Bitazza uses Alphapoint, also used by ndax
// In order to use private endpoints, the following are required:
// - 'apiKey'
// - 'secret',
// - 'uid' (userId in the api info)
// - 'login' (the email address used to log into the UI)
const ndax = require ('./ndax.js');
// -----------------------------... | 'use strict';
// Bitazza uses Alphapoint, also used by ndax
// In order to use private endpoints, the following are required:
// - 'apiKey'
// - 'secret',
// - 'uid' (userId in the api info)
// - 'login' (the email address used to log into the UI)
// - 'password' (the password used to log into the UI)
const ndax = re... | Add 'password' to comment on required credentials | Add 'password' to comment on required credentials
| JavaScript | mit | ccxt/ccxt,ccxt/ccxt,ccxt/ccxt,ccxt/ccxt,ccxt/ccxt |
dbaaef857da2f402700e254f0ee0d63bb56b6870 | karma.conf.js | karma.conf.js | module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon-chrome', 'karma-typescript'],
files: [
'src/ts/**/*.ts'
],
exclude: [
'src/ts/constants.ts'
],
preprocessors: {
'src/ts/**/*.ts': ['karma-typescript']
},
client: {
c... | module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon-chrome', 'karma-typescript'],
files: [
'src/ts/**/*.ts'
],
exclude: [
'src/ts/constants.ts'
],
preprocessors: {
'src/ts/**/*.ts': ['karma-typescript']
},
client: {
c... | Use common ts compiler options in karma test and webpack build | chore(test): Use common ts compiler options in karma test and webpack build
| JavaScript | mit | xtangle/ZoundCloud,xtangle/ZoundCloud |
6e6a449ddda27c2471a72b436fb7074ac5ae7403 | lib/loaders/utils/to-code.js | lib/loaders/utils/to-code.js | /* eslint-disable no-use-before-define */
function toCodeArray(array) {
return `[${array.map(item => toCode(item)).join(",")}]`
}
function toCodeObject(object) {
return `{${Object.keys(object).map(key => `"${key}": ${toCode(object[key])}`).join(",")}}`
}
function toCode(values) {
if (Array.isArray(values)) {
... | /* eslint-disable no-use-before-define */
function toCodeArray(array) {
return `[${array.map(item => toCode(item)).join(",")}]`
}
function toCodeObject(object) {
return `{${Object.keys(object).map(key => `"${key}": ${toCode(object[key])}`).join(",")}}`
}
// Convert an arbitrary object, array, or primitive into a... | Add comment our `toCode` function | Add comment our `toCode` function
| JavaScript | mit | mavenlink/mavenlink-ui-concept,ahuth/mavenlink-ui-concept |
f4489c9b6cc45d41bd0ee41c7988af369dc249d9 | src/majesty.js | src/majesty.js | (function($) {
$.fn.majesty = function() {
var findDependents = function(rootElement) {
return rootElement.find('[data-depends-on]');
};
var findMatches = function(searchValue, elements) {
searchValue = $.trim(searchValue);
if(searchValue === '') {
return $([]);
}
... | (function($) {
var findDependents = function(rootElement) {
return rootElement.find('[data-depends-on]');
};
var findMatches = function(searchValue, elements) {
searchValue = $.trim(searchValue);
if(searchValue === '') {
return $([]);
}
// Hack for now. Probably use regex later
... | Move functions outside of plugin block | Move functions outside of plugin block
| JavaScript | mit | craigerm/majesty-js |
7106e052ff1e92dd7792908798c595b4bc4f6410 | lib/server.js | lib/server.js | var connections = {};
var expire = function(id) {
Presences.remove(id);
delete connections[id];
};
var tick = function(id) {
connections[id].lastSeen = Date.now();
};
Meteor.startup(function() {
Presences.remove({});
});
Meteor.onConnection(function(connection) {
// console.log('connectionId: ' + connecti... | var connections = {};
var presenceExpiration = 10000;
var expire = function(id) {
Presences.remove(id);
delete connections[id];
};
var tick = function(id) {
connections[id].lastSeen = Date.now();
};
Meteor.startup(function() {
Presences.remove({});
});
Meteor.onConnection(function(connection) {
// conso... | Set presenceExpiration outside of package | Set presenceExpiration outside of package
| JavaScript | mit | minden/meteor-presence |
649509ca76845e45825ee75f6841d1cb894ff1e4 | scripts/transform/comments.js | scripts/transform/comments.js | 'use strict';
function makeFrontMatter(ast, dependencies) {
var value = [
'es6id: ',
'description: >'
];
var includes;
if (dependencies.length) {
includes = dependencies.map(function(file) {
return file + '.js';
}).join(', ');
value.push('includes: [' + includes + ']');
}
value = '---\n' + value.jo... | 'use strict';
var licenseYearPattern = /\bcopyright (\d{4})\b/i;
function makeFrontMatter(ast, dependencies) {
var value = [
'es6id: ',
'description: >'
];
var includes;
if (dependencies.length) {
includes = dependencies.map(function(file) {
return file + '.js';
}).join(', ');
value.push('includes: ... | Include license in transformed file | Include license in transformed file
Infer the year from the source file's code comments.
| JavaScript | mit | bocoup/test262-v8-machinery,bocoup/test262-v8-machinery |
986faef86b65b9ab7471077da321020ee5164cf8 | src/set-env.js | src/set-env.js | const {webpack} = require('@webpack-blocks/webpack2');
/**
* Sets environment variables with all possible ways.
*/
module.exports = (options = {}) => {
const {
nodeEnv = 'development',
babelEnv = 'development',
} = options;
process.env.NODE_ENV = nodeEnv;
process.env.BABEL_ENV = bab... | const {webpack} = require('@webpack-blocks/webpack2');
/**
* Sets environment variables with all possible ways.
*/
module.exports = (options = {}) => {
const {
nodeEnv,
babelEnv,
} = options;
process.env.NODE_ENV = nodeEnv;
process.env.BABEL_ENV = babelEnv;
return () => ({
... | Set setEnv defaults to undefined | Set setEnv defaults to undefined
| JavaScript | mit | fugr-ru/webpack-custom-blocks |
9df8d7dca7a9f881eca551551b856f8cdf5ae6a4 | simul/app/components/login.js | simul/app/components/login.js | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TextInput,
TouchableHighlight,
} from 'react-native';
class Login extends Component{
constructor(){
super();
this.state = {
name: "",
username: "",
password_digest: "",
location: "",
bio: "",
... | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TextInput,
TouchableHighlight,
} from 'react-native';
class Login extends Component{
constructor(){
super();
this.state = {
name: "",
username: "",
password_digest: "",
location: "",
bio: "",
... | Create onLoginPressed function and add to render function | Create onLoginPressed function and add to render function
| JavaScript | mit | sf-red-pandas-2016/simul-react-native,sf-red-pandas-2016/simul-react-native,sf-red-pandas-2016/simul-react-native |
94a9cefb34e1adcdae67a9402e8a6745f9e85496 | klets-server/routes/messages/messages-controller.js | klets-server/routes/messages/messages-controller.js | var HttpError = require('../../lib/http-error');
var messageRepo = require('../../repository/message-repo');
module.exports.create = function (req, res, next) {
var message = req.body.message;
checkDefined(message, 'message');
checkDefined(message._id, 'message._id');
checkDefined(message.userName, 'me... | var HttpError = require('../../lib/http-error');
var messageRepo = require('../../repository/message-repo');
module.exports.create = function (req, res, next) {
var message = req.body.message;
checkDefined(message, 'message');
checkDefined(message._id, 'message._id');
checkDefined(message.userName, 'me... | Allow Cross Origin requests on create message endpoint | Allow Cross Origin requests on create message endpoint
| JavaScript | mit | rhmeeuwisse/KletsApp,rhmeeuwisse/KletsApp |
4c2067c2609ad7af84e0384c39b0452341fb0358 | config/configuration.js | config/configuration.js | /**
* @file Defines the provider settings.
*
* Will set the path to Mongo, and applications id
* Most of the configuration can be done using system environment variables.
*/
// Load environment variables from .env file
var dotenv = require('dotenv');
dotenv.load();
// node_env can either be "development" or "pro... | /**
* @file Defines the provider settings.
*
* Will set the path to Mongo, and applications id
* Most of the configuration can be done using system environment variables.
*/
// Load environment variables from .env file
var dotenv = require('dotenv');
dotenv.load();
// node_env can either be "development" or "pro... | Add redis and mongo URL in config | Add redis and mongo URL in config
| JavaScript | mit | AnyFetch/gcontacts-provider.anyfetch.com |
d47521a1d9281c2a89cf78bd8902c112ae16e38e | live-examples/js-examples/classes/classes-static.js | live-examples/js-examples/classes/classes-static.js | class ClassWithStaticMethod {
static staticMethod() {
return 'static method has been called.';
}
}
console.log(ClassWithStaticMethod.staticMethod());
// expected output: "static method has been called."
| class ClassWithStaticMethod {
static staticProperty = "someValue";
static staticMethod() {
return 'static method has been called.';
}
}
console.log(ClassWithStaticMethod.staticProperty);
// output: "someValue"
console.log(ClassWithStaticMethod.staticMethod());
// output: "static method has been called."
| Update example to include static property | Update example to include static property
| JavaScript | cc0-1.0 | mdn/interactive-examples,mdn/interactive-examples,mdn/interactive-examples |
8dc31229b164225e2aa8d84f499b7bc0ef9be9f2 | ui/main.js | ui/main.js |
// Blank the document so the 404 page doesn't show up visibly.
document.documentElement.style.display = 'none';
// Can't use DOMContentLoaded, calling document.write or document.close inside it from
// inside an extension causes a crash.
onload = function() {
document.write(
"<!DOCTYPE html>" +
"<... |
// Blank the document so the 404 page doesn't show up visibly.
document.documentElement.style.display = 'none';
// Can't use DOMContentLoaded, calling document.write or document.close inside it from
// inside an extension causes a crash.
onload = function() {
document.write(
"<!DOCTYPE html>" +
"<... | Add a <title>. We should make it dynamic eventually so history works. | Add a <title>. We should make it dynamic eventually so history works.
| JavaScript | bsd-3-clause | esprehn/chromium-codereview,esprehn/chromium-codereview |
22c91010c17691aceb15523cfa052b60cdc47d23 | app.js | app.js | var pg = require('pg');
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 3000 });
server.start(function () {
console.log('Server running at:', server.info.uri);
});
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
re... | var pg = require('pg');
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 3000 });
server.start(function () {
console.log('Server running at:', server.info.uri);
});
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
re... | Remove duplicate route for / | Remove duplicate route for /
| JavaScript | bsd-2-clause | SpotScore/spotscore |
e76026335f7d999168fa377bc6b9f76295f4c7f1 | cli.js | cli.js | #!/usr/bin/env node
'use strict';
var chalk = require('chalk');
var meow = require('meow');
var process = require('process');
var allPrograms = [
'atom',
'bash',
'bin',
'git',
'gnome-terminal',
'vim',
'vscode'
];
var cli = meow({
help: [
'Usage: dotfiles install [<program>]',
'',
'where <program... | #!/usr/bin/env node
'use strict';
var chalk = require('chalk');
var meow = require('meow');
var process = require('process');
var allPrograms = [
'atom',
'bash',
'bin',
'git',
'gnome-terminal',
'vim',
'vscode'
];
var cli = meow({
help: [
'Usage: dotfiles install [<program>...]',
'',
'where <prog... | Allow install of multiple programs | Allow install of multiple programs
Fixes #26
| JavaScript | mit | Tyriar/dotfiles,Tyriar/tyr-tools,Tyriar/tyr-tools,Tyriar/dotfiles,Tyriar/dotfiles |
581b9393ac0e0c6a505bedaaf6cbb7d30c0e4f4f | app/components/application/emoji-react-demo.js | app/components/application/emoji-react-demo.js | const script = String.raw`<script type="text/javascript">
var emojis = "tada, fire, grinning"
var selector = "body"
var url = window.location.href.replace(/(http:\/\/|https:\/\/)/gi, '').replace(/^\/|\/$/g, '');
var iframe = document.createElement("iframe")
iframe.src = "https://emojireact.com/embed?emojis="... | import autosize from "autosize"
const script = String.raw`<script type="text/javascript">
var emojis = "tada, fire, grinning"
var selector = "body"
var url = window.location.href.replace(/(http:\/\/|https:\/\/)/gi, '').replace(/^\/|\/$/g, '');
var iframe = document.createElement("iframe")
iframe.src = "http... | Fix issue where demo text does not autosize textarea. | Fix issue where demo text does not autosize textarea.
Closes #8
| JavaScript | mit | EagerIO/InstantPlugin,EagerIO/InstantPlugin |
9702cf0a66e26860102b2a091bc1d1600d200e57 | app/instance-initializers/in-app-livereload.js | app/instance-initializers/in-app-livereload.js | import Ember from 'ember';
const { run } = Ember;
export function initialize(app) {
let config = app.container.lookupFactory('config:environment');
let env = config.environment;
if (config.cordova && config.cordova.reloadUrl &&
(env === 'development' || env === 'test')) {
let url = config.cordova.rel... | import Ember from 'ember';
const { run } = Ember;
export function initialize(app) {
let config = app.resolveRegistration('config:environment');
let env = config.environment;
if (config.cordova && config.cordova.reloadUrl &&
(env === 'development' || env === 'test')) {
let url = config.cordova.reloadU... | Use resolveRegistration rather than container.lookupFactory to lookup the environment. | Use resolveRegistration rather than container.lookupFactory to lookup the environment.
| JavaScript | mit | isleofcode/ember-cordova,isleofcode/corber,isleofcode/ember-cordova,isleofcode/corber |
e3adf790c0b87f32b83f9b1199268ab8374c9eb8 | src/components/DeviceChart.js | src/components/DeviceChart.js | import React, { PropTypes } from 'react';
import rd3 from 'rd3';
const BarChart = rd3.BarChart;
const barData = [
{
name: 'Series A',
values: [
{ x: 1, y: 91 },
{ x: 2, y: 290 },
{ x: 3, y: 30 },
{ x: 4, y: 50 },
{ x: 5, y: 90 },
{ x: 6, y: 100 },
],
},
];
export cl... | import React, { PropTypes } from 'react';
import rd3 from 'rd3';
const BarChart = rd3.BarChart;
export class DeviceChart extends React.Component {
constructor(props) {
super(props);
this.state = {
barData: [
{
values: [
{ x: 1, y: 91 },
{ x: 2, y: 290 },
... | Add data to bar chart | Add data to bar chart
| JavaScript | mit | Bucko13/kinects-it,brnewby602/kinects-it,brnewby602/kinects-it,Kinectsit/kinects-it,Bucko13/kinects-it,Kinectsit/kinects-it |
d0eace4d14f980d2afd1d8967b0cc9a9cd9a4468 | lib/core/config.js | lib/core/config.js | var async = require('async');
var _ = require('lodash');
var readTOML = require('./utils').readTOML;
var fileExists = require('./utils').fileExists;
var defaults = {
account: {
username: 'admin',
password: 'password',
channel: '#riotgames'
},
irc: {
address: '199.9.253.199'
},
server: {
... | var async = require('async');
var _ = require('lodash');
var readTOML = require('./utils').readTOML;
var fileExists = require('./utils').fileExists;
var defaults = {
account: {
username: 'admin',
password: 'password',
channel: '#riotgames'
},
irc: {
address: '199.9.253.199'
},
server: {
... | Fix incorrect use of `_.defaults` | Fix incorrect use of `_.defaults`
| JavaScript | mit | KenanY/nwitch |
2b86f1e677ff9630159f264d4d89ca73b9fbfd9f | apps/federatedfilesharing/js/settings-admin.js | apps/federatedfilesharing/js/settings-admin.js | $(document).ready(function() {
$('#fileSharingSettings input').change(function() {
var value = 'no';
if (this.checked) {
value = 'yes';
}
OC.AppConfig.setValue('files_sharing', $(this).attr('name'), value);
});
$('.section .icon-info').tipsy({gravity: 'w'});
});
| $(document).ready(function() {
$('#fileSharingSettings input').change(function() {
var value = 'no';
if (this.checked) {
value = 'yes';
}
OC.AppConfig.setValue('files_sharing', $(this).attr('name'), value);
});
});
| Remove unneeded usage of tipsy | Remove unneeded usage of tipsy
* tooltip is already initialized
| JavaScript | agpl-3.0 | jbicha/server,endsguy/server,Ardinis/server,pmattern/server,pixelipo/server,andreas-p/nextcloud-server,pmattern/server,endsguy/server,pixelipo/server,Ardinis/server,michaelletzgus/nextcloud-server,nextcloud/server,xx621998xx/server,whitekiba/server,Ardinis/server,nextcloud/server,jbicha/server,xx621998xx/server,pmatter... |
566b86d0c11e8def2e018c0bfcae1ca8c7efb4f4 | lib/getGeoFiles.js | lib/getGeoFiles.js | 'use strict';
var fs = require('fs');
var path = require('path');
var nodedir = require('node-dir');
var unzipGeoStream = require('./unzipGeoStream');
function discover(input, counter, callback, silent, afterProcessingCb){
var ext = path.extname(input);
if(ext){
if(ext === '.zip') return unzipGeoStream(inpu... | 'use strict';
var fs = require('fs');
var path = require('path');
var nodedir = require('node-dir');
var unzipGeoStream = require('./unzipGeoStream');
function discover(input, counter, callback, silent, afterProcessingCb){
var ext = path.extname(input);
if(ext){
if(ext === '.zip') return unzipGeoStream(inpu... | Allow .csvs to be processed | Allow .csvs to be processed
| JavaScript | cc0-1.0 | awolfe76/grasshopper-loader,awolfe76/grasshopper-loader,cfpb/grasshopper-loader,cfpb/grasshopper-loader |
952b351d8a7be859c22f79ea5d2225acf87b3ccb | rng.js | rng.js | function get(i){
return document.getElementById(i)
}
function random_number(){
if(value('repeat')<1){
get('repeat').value=1
}
i=value('repeat')-1;
range=parseInt(value('range'))+1;
do{
result+=Math.floor(Math.random()*range+value('base'))+' '
}while(i--);
get('result').innerHTML=result;
result=''
}
functio... | function random_number(){
save();
i=value('repeat')-1;
range=parseInt(value('range'))+1;
do{
result+=Math.floor(Math.random()*range+value('base'))+' '
}while(i--);
get('result').innerHTML=result;
result=''
}
function reset(){
if(confirm('Reset settings?')){
get('base').value=0;
get('range').value=10;
ge... | Save input values to localStorage | Save input values to localStorage
| JavaScript | cc0-1.0 | iterami/RNG.htm,iterami/RNG.htm |
79adb264ac417a93ca252e66750076fd937142f1 | lib/request-jwt.js | lib/request-jwt.js | var TokenCache = require('./token-cache'),
tokens = new TokenCache();
/**
* Returns a JWT-enabled request module.
* @param request The request instance to modify to enable JWT.
* @returns {Function} The JWT-enabled request module.
*/
exports.requestWithJWT = function (request) {
if (!request) {
// use the req... | var TokenCache = require('./token-cache'),
tokens = new TokenCache();
/**
* Returns a JWT-enabled request module.
* @param request The request instance to modify to enable JWT.
* @returns {Function} The JWT-enabled request module.
*/
exports.requestWithJWT = function (request) {
if (!request) {
// use the req... | Use the Authorization request header field to send the token. | Use the Authorization request header field to send the token.
Per http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-14#section-2.1
this is the recommended approach which must be supported by all servers.
| JavaScript | mit | extrabacon/google-oauth-jwt,0xPIT/google-oauth-jwt |
1634fe192df5994ce9ce4b323de89f5351fbfffb | htdocs/components/00_jquery_togglebutton.js | htdocs/components/00_jquery_togglebutton.js | /*
* Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
*
* 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.o... | /*
* Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
*
* 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.o... | Send button state for toggle buttons. | Send button state for toggle buttons.
| JavaScript | apache-2.0 | Ensembl/ensembl-webcode,Ensembl/ensembl-webcode,Ensembl/ensembl-webcode,Ensembl/ensembl-webcode,Ensembl/ensembl-webcode |
7e894bf4593a3ce542ae8bfd9af05835712497e7 | src/Our.Umbraco.Nexu.Web/App_Plugins/Nexu/controllers/related-links-app-controller.js | src/Our.Umbraco.Nexu.Web/App_Plugins/Nexu/controllers/related-links-app-controller.js | (function () {
'use strict';
function RelatedLinksAppController($scope) {
var vm = this;
vm.relations = $scope.model.viewModel;
var currentVariant = _.find($scope.content.variants, function(v) { return v.active });
vm.culture = currentVariant.language.culture;
... | (function () {
'use strict';
function RelatedLinksAppController($scope) {
var vm = this;
vm.relations = $scope.model.viewModel;
var currentVariant = _.find($scope.content.variants, function (v) { return v.active });
if (currentVariant.language) {
vm.culture =... | Make sure content app works when there are no variants | Make sure content app works when there are no variants
| JavaScript | mit | dawoe/umbraco-nexu,dawoe/umbraco-nexu,dawoe/umbraco-nexu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.