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 |
|---|---|---|---|---|---|---|---|---|---|
76819a68b71e2668d465a167fb1b240915d854b5 | .eslintrc.js | .eslintrc.js | module.exports = {
"extends": "airbnb-base/legacy",
"parserOptions": {
"ecmaVersion": 5
},
"env": {
"browser": true,
"node": true
},
"rules": {
"indent": ["error", 2],
"brace-style": ["error", "1tbs"],
"curly": ["error", "all"],
"func-call-spacing": ["error", "never"],
"lineb... | module.exports = {
"root": true,
"extends": "airbnb-base/legacy",
"parserOptions": {
"ecmaVersion": 5
},
"env": {
"browser": true,
"node": true
},
"rules": {
"indent": ["error", 2],
"brace-style": ["error", "1tbs"],
"curly": ["error", "all"],
"func-call-spacing": ["error", "nev... | Set eslint config as root | Set eslint config as root
| JavaScript | mit | Altinn/DesignSystem,Altinn/DesignSystem |
6f1f8ea1ee4e23e0ec60aad59b70ea40f32a2049 | test/replace.js | test/replace.js | var replace = require( "../src/str-replace" );
module.exports = {
replace_all: function( assert ) {
var actual = replace
.all( "/" )
.from( "/home/dir" )
.to( "\\" );
var expected = "\\home\\dir";
assert.strictEqual( actual, expected );
assert.done();
},
replace_all_ignoring_c... | var replace = require( "../src/str-replace" );
module.exports = {
replace_all: function( assert ) {
var actual = replace
.all( "/" )
.from( "/home/dir" )
.to( "\\" );
var expected = "\\home\\dir";
assert.strictEqual( actual, expected );
assert.done();
},
replace_all_ignoring_c... | Test replacing the first substring occurrence | Test replacing the first substring occurrence
| JavaScript | mit | FagnerMartinsBrack/str-replace |
515b82ba7716a5f53773d7778bd5cbff66129915 | test/test-commonjs.js | test/test-commonjs.js | var FILE = require("file");
var ASSERT = require("assert");
var Haml = require("../lib/haml");
FILE.glob("test/*.haml").forEach(function(hamlFile) {
exports["test " + hamlFile] = function() {
var scopeFile = hamlFile.replace(/haml$/, "js");
var htmlFile = hamlFile.replace(/haml$/, "html");
... | var FILE = require("file");
var ASSERT = require("assert");
var Haml = require("../lib/haml");
FILE.glob("test/*.haml").forEach(function(hamlFile) {
exports["test " + hamlFile] = function() {
var scopeFile = hamlFile.replace(/haml$/, "js");
var htmlFile = hamlFile.replace(/haml$/, "html");
... | Trim before testing for equality on unit tests. | Trim before testing for equality on unit tests. | JavaScript | mit | creationix/haml-js,creationix/haml-js |
b0b96ed42801e693cc8103d0069c69e2eecf8c4c | test/viewport.spec.js | test/viewport.spec.js | /* eslint-env node, mocha, browser */
/* global expect */
import viewport from '../viewport';
describe('"viewport"', () => {
it('Should return NULL if no document was found', () => {
expect(viewport({})).to.be.null;
});
it('Should return either the Body or DOM element', () => {
const { body, documentEl... | /* eslint-env node, mocha, browser */
/* global expect */
import viewport from '../viewport';
describe('"viewport"', () => {
const { body, documentElement: html } = document;
const bodyOrHtml = (elm) => elm === body || elm === html;
it('Should return NULL if no document was found', () => {
const fakeDocCom... | Correct testcase to reflect updated isWindow/isDOMDocument methods | viewport: Correct testcase to reflect updated isWindow/isDOMDocument methods
| JavaScript | mit | Tokimon/vanillajs-browser-helpers,Tokimon/vanillajs-browser-helpers,Tokimon/vanillajs-browser-helpers |
ae3b5dbae429b93a4b2bb9a8149d60df9cc96b42 | test/viewport.spec.js | test/viewport.spec.js | import test from 'ava';
test.todo('Write test for utils.inViewport');
| import test from 'ava';
import { inViewport } from '../src/viewport';
window.innerWidth = 1280;
window.innerHeight = 700;
let stub = {
getBoundingClientRect() {
return {
bottom: 232,
height: 108,
left: 196,
right: 1084,
top: 124,
widt... | Add initial tests for inViewport | Add initial tests for inViewport
| JavaScript | mit | camwiegert/in-view,kudago/in-view |
816c89b2f0f2fcf01d2ea9c5e83c2388fa5018b3 | webpack.config.js | webpack.config.js | 'use strict';
const webpack = require('webpack');
const merge = require('webpack-merge');
const validate = require('webpack-validator');
const config = require('./buildConfig');
const BASE_CONFIG = merge({
entry: {
main: `${config.PATHS.src}/index.ts`,
},
plugins: [
new webpack.DefinePlugin({
COMPI... | 'use strict';
const webpack = require('webpack');
const merge = require('webpack-merge');
const validate = require('webpack-validator');
const config = require('./buildConfig');
const BASE_CONFIG = merge({
entry: {
main: `${config.PATHS.src}/index.ts`,
},
plugins: [
new webpack.DefinePlugin({
COMPI... | Move vendor chunk to BASE_CONFIG | Move vendor chunk to BASE_CONFIG
| JavaScript | mit | mpalmr/webpack-mithril-typescript-example,mpalmr/webpack-mithril-typescript-example,mpalmr/webpack-mithril-typescript-example |
3f2706bc631aefa0cb4897d2249999e0591a62ff | webpack.config.js | webpack.config.js | var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, 'views/js');
var APP_DIR = path.resolve(__dirname, 'jsx');
var config = {
entry: {
index: APP_DIR + '/index.jsx',
}
output: {
path: BUILD_DIR,
filename: '[name]-bundle.js'
}
};
... | var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, 'views/js');
var APP_DIR = path.resolve(__dirname, 'jsx');
var config = {
entry: {
app: APP_DIR + '/app.jsx',
},
output: {
path: BUILD_DIR,
filename: '[name]-bundle.js'
},
... | Load JSX from jsx folder | Load JSX from jsx folder
| JavaScript | bsd-3-clause | tealeg/helloxl,tealeg/helloxl |
310beff5d29a87d60a9d1de3059b54c2f105d321 | webpack.config.js | webpack.config.js | module.exports = {
entry: "./src/exports.js",
output: {
filename: 'bundle.js',
library: 'ModelViewer',
libraryTarget: 'var'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
... | module.exports = {
entry: "./src/exports.js",
output: {
filename: 'bundle.js',
library: 'ModelViewer',
libraryTarget: 'var'
},
module: {
rules: [
{
test: /\.js$/,
exclude: function(modulePath)
{
... | Fix bug where production build fails because of gl-matrix being ES6. | Fix bug where production build fails because of gl-matrix being ES6.
| JavaScript | mit | flowtsohg/mdx-m3-viewer,flowtsohg/mdx-m3-viewer,flowtsohg/mdx-m3-viewer |
27bde0dd3f5823098a961bdcad32e4ec221636c5 | webpack.config.js | webpack.config.js | 'use strict';
var webpack = require('webpack');
var plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new webpack.optimize.OccurenceOrderPlugin()
];
if (process.env.NODE_ENV === 'production') {
plugins.push(
new webpack.optimize.UglifyJsPlugin({
... | 'use strict';
var webpack = require('webpack');
var plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new webpack.optimize.OccurenceOrderPlugin()
];
if (process.env.NODE_ENV === 'production') {
plugins.push(
new webpack.optimize.UglifyJsPlugin({
... | Change browser build to UMD | Change browser build to UMD
| JavaScript | mit | jquense/redux,jquense/redux,janraasch/redux,frodereinertsen/redux,doerme/redux,pletcher/redux,Ryan-McBride/redux,brentvatne/redux,mazicky/redux,dalinaum/redux,gsklee/redux,usufruct/redux,vincentfretin/redux,janraasch/redux,przeor/redux,PatrickEifler/redux,kolodny/redux,pbarnes/redux,chicoxyzzy/redux,ptkach/redux,sapegi... |
8d995e286972297b6ac63292d27edf081111c777 | webpack.config.js | webpack.config.js | const ExtractTextPlugin = require('extract-text-webpack-plugin')
const externals = require('webpack-node-externals')
const path = require('path')
const eslintRule = {
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader'
}
module.exports = [
{
entry: './client',
output: {
path: path.re... | const ExtractTextPlugin = require('extract-text-webpack-plugin')
const externals = require('webpack-node-externals')
const path = require('path')
const eslintRule = {
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader'
}
module.exports = [
{
entry: './client',
output: {
path: path.re... | Revert "Fix order of eslint-loader" | Revert "Fix order of eslint-loader"
This reverts commit 58b53a99e486c39ad1b8d44bb8a3de82764c659e.
| JavaScript | mit | nickmccurdy/rose,nickmccurdy/rose,nicolasmccurdy/rose,nicolasmccurdy/rose |
70a477a69fcd739bb6f23defac7612a2a638a889 | webpack.config.js | webpack.config.js | module.exports = {
entry: "./src/app.js",
output: {
path: "./build",
filename: "bundle.js",
publicPath: 'http://localhost:8090/assets'
},
module: {
loaders: [
{ test: /\.scss$/, loader: "style!css!sass" },
{ test: /\.css$/, loader: "style!css" },
{ test: /\.(png|jpg)$/, loader:... | var webpack = require('webpack');
module.exports = {
entry: "./src/app.js",
output: {
path: "./build",
filename: "bundle.js",
publicPath: 'http://localhost:8090/assets'
},
module: {
loaders: [
{ test: /\.scss$/, loader: "style!css!sass" },
{ test: /\.css$/, loader: "style!css" },
... | Add plugin to ignore moment.js language packs. | Add plugin to ignore moment.js language packs.
| JavaScript | mit | slwen/lastfm-app,slwen/lastfm-app |
922c0a08eb28621fda716724856cdf1dfd7ce0b3 | sample/start-sample.js | sample/start-sample.js | var app = require('./app');
var config = require('../config.json');
app.listen(config.port);
| var app = require('./app');
var config = require('../config.json');
app.listen(config.port, err => {
if (err) {
console.error(err)
} else {
console.log('Started sample server at https://localhost:' + config.port)
}
});
| Print sample server URL at startup | Print sample server URL at startup
| JavaScript | mit | reaktor/node-tupas |
7cd44c5bf480db537c76c3b06f09e83674623261 | test/fixtures/with-directory.js | test/fixtures/with-directory.js | import tempy from 'tempy'
import fs from 'fs-extra'
export default function (test) {
test.beforeEach(async (t) => {
const directory = tempy.directory()
await fs.ensureDir(directory)
Object.assign(t.context, {directory})
})
test.afterEach.always(async (t) => {
const {directory} = t.context
aw... | import {temporaryDirectory} from 'tempy'
import fs from 'fs-extra'
export default function (test) {
test.beforeEach(async (t) => {
const directory = temporaryDirectory()
await fs.ensureDir(directory)
Object.assign(t.context, {directory})
})
test.afterEach.always(async (t) => {
const {directory} ... | Fix breaking usages of an updated version of tempy | test(withDirectory): Fix breaking usages of an updated version of tempy
| JavaScript | mit | vinsonchuong/create-npm |
bfc4d28a8cfba5779f1feae49d914daa9217491d | tests/integration/components/intercom-launcher/component-test.js | tests/integration/components/intercom-launcher/component-test.js | import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('intercom-launcher',
'Integration | Component | intercom launcher', {
integration: true
});
test('it renders', function(assert) {
this.set('intercomAppID', 'foobar');
this... | import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('intercom-launcher',
'Integration | Component | intercom launcher', {
integration: true
});
test('it renders with a #customer-intercom-link', function(assert) {
this.set('int... | Add comment on intercom link ID | Add comment on intercom link ID
| JavaScript | apache-2.0 | usecanvas/web-v2,usecanvas/web-v2,usecanvas/web-v2 |
e923a2fa684b136bf7c0c54f3fa2acacb88d31a4 | Libraries/Sample/Sample.android.js | Libraries/Sample/Sample.android.js | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* Stub of Sample for Android.
*
* @format
* @flow
*/
'use strict';
const warning = require('fbjs/lib/warning');
const Sample... | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* Stub of Sample for Android.
*
* @format
* @flow
*/
'use strict';
const warning = require('fbjs/lib/warning');
const Sample... | Use libdefs for fbjs instead of types from node_modules | Use libdefs for fbjs instead of types from node_modules
Summary:
When code depends on a module from fbjs, its types come from the node_modules
directory. This is problematic when Flow is deployed, since we can't codemod the
parts that come from node_modules.
Reviewed By: dsainati1
Differential Revision: D15547035
f... | JavaScript | mit | janicduplessis/react-native,hoangpham95/react-native,pandiaraj44/react-native,janicduplessis/react-native,exponentjs/react-native,hammerandchisel/react-native,arthuralee/react-native,facebook/react-native,hoangpham95/react-native,arthuralee/react-native,janicduplessis/react-native,myntra/react-native,exponentjs/react-n... |
08b4680f062a814392d8d6317f85e77fe6c1361e | background.js | background.js | chrome.webRequest.onBeforeSendHeaders.addListener(
function(details) {
details.requestHeaders.push({
name: "X-Molotov-Agent",
value: "{\"app_id\":\"electron_app\",\"app_build\":2,\"app_version_name\":\"1.0.0\",\"type\":\"desktop\",\"os\":\"\",\"os_version\":\"\",\"manufacturer\":\"\"... | chrome.webRequest.onBeforeSendHeaders.addListener(
function(details) {
details.requestHeaders.push({
name: "X-Molotov-Agent",
value: "{\"app_id\":\"electron_app\",\"app_build\":3,\"app_version_name\":\"1.2.2\",\"type\":\"desktop\",\"electron_version\":\"1.4.12\",\"os\":\"Unknown\",\"... | Update "X-Molotov-Agent" header for Molotov version 1.2.2. | Update "X-Molotov-Agent" header for Molotov version 1.2.2.
| JavaScript | bsd-2-clause | jleroy/MoloChrome,jleroy/MoloChrome |
e61502edef16dcdad0d9691a156528e4ff76987e | app.js | app.js | var express = require('express');
var logger = require('morgan');
var bodyParser = require('body-parser');
var index = require('./routes/index');
var app = express();
if (process.env.NODE_ENV !== 'test') {
app.use(logger('dev'));
}
app.use(bodyParser.json());
app.use('/', index);
// catch 404 and forward to erro... | var express = require('express');
var logger = require('morgan');
var bodyParser = require('body-parser');
var index = require('./routes/index');
var app = express();
if (process.env.NODE_ENV !== 'test') {
app.use(logger('dev'));
}
app.use(bodyParser.json());
app.use('/', index);
// catch 404 and forward to erro... | Return JSON in error handlers | Return JSON in error handlers
| JavaScript | mit | seishun/omni-assignment |
9015ec8e6c39f21a57f54612fd9dc651e374534d | routes/settings/users/index.js | routes/settings/users/index.js | import AuthenticatedRoute from 'ghost/routes/authenticated';
import PaginationRouteMixin from 'ghost/mixins/pagination-route';
import styleBody from 'ghost/mixins/style-body';
var paginationSettings,
UsersIndexRoute;
paginationSettings = {
page: 1,
limit: 20,
status: 'active'
};
UsersIndexRoute = Aut... | import AuthenticatedRoute from 'ghost/routes/authenticated';
import PaginationRouteMixin from 'ghost/mixins/pagination-route';
import styleBody from 'ghost/mixins/style-body';
var paginationSettings,
UsersIndexRoute;
paginationSettings = {
page: 1,
limit: 20,
status: 'active'
};
UsersIndexRoute = Aut... | Add self to list of filtered users for editors | Add self to list of filtered users for editors
Closes #4412
| JavaScript | mit | acburdine/Ghost-Admin,dbalders/Ghost-Admin,airycanon/Ghost-Admin,JohnONolan/Ghost-Admin,kevinansfield/Ghost-Admin,TryGhost/Ghost-Admin,acburdine/Ghost-Admin,kevinansfield/Ghost-Admin,TryGhost/Ghost-Admin,JohnONolan/Ghost-Admin,airycanon/Ghost-Admin,dbalders/Ghost-Admin |
33157270a83a46075048744fe50d84905776f081 | server/seo/sitemaps.js | server/seo/sitemaps.js |
sitemaps.add('/reports.xml', function() {
var out = [], reports = Reports.find({}).fetch();
_.each(reports, function(report) {
out.push({
page: 'rapport/' + report._id + '/' + slugify(report.project.name),
lastmod: new Date(2014, 6, 20, 0, 0, 0, 0)
});
});
return out;
});
sitemaps.add('/si... |
sitemaps.add('/reports.xml', function() {
var out = [], reports = Reports.find({}).fetch();
_.each(reports, function(report) {
out.push({
page: 'rapport/' + report._id + '/' + slugify(report.project.name),
lastmod: report.lastModifiedAt == undefined ? new Date(2014, 6, 20, 0, 0, 0, 0) : report.last... | Use lastModifiedAt in the sitemap if possible | Use lastModifiedAt in the sitemap if possible
| JavaScript | apache-2.0 | bompi88/concept,bompi88/concept,bompi88/concept |
45abbb724874dd07cd5c7d404fd16cbc042f98b8 | web/js/cache.js | web/js/cache.js | /*
* Copyright (C) Sam Parkinson 2014
*
* This file is part of ASLO.
*
* ASLO is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | /*
* Copyright (C) Sam Parkinson 2014
*
* This file is part of ASLO.
*
* ASLO is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | Fix issue with js caching | Fix issue with js caching
| JavaScript | agpl-3.0 | samdroid-apps/aslo,samdroid-apps/aslo,samdroid-apps/aslo |
0c4437c14851fd25fb450e387b7cf1b10132a126 | app/src/index.js | app/src/index.js | import React from 'react';
import ReactDOM from 'react-dom';
import { CrossStorageHub } from 'cross-storage';
import App from './App';
CrossStorageHub.init([
{ origin: /\.appbase.io$/, allow: ['get'] },
{ origin: /hardcore-hoover-0d4fea.netlify.com$/, allow: ['get'] },
{ origin: /localhost:135$/, allow: ['get'] },... | import React from 'react';
import ReactDOM from 'react-dom';
import { CrossStorageHub } from 'cross-storage';
import App from './App';
CrossStorageHub.init([
{ origin: /\.appbase.io$/, allow: ['get'] },
{ origin: /localhost:1359$/, allow: ['get'] },
{ origin: /localhost:1358$/, allow: ['get'] },
]);
ReactDOM.rend... | Update permission for local development | Update permission for local development | JavaScript | mit | appbaseio/dejaVu,appbaseio/dejaVu |
d9195eb796369dd08951bcd16841af84fe8413e9 | JS/tabs.js | JS/tabs.js | (function() {
'use strict'
angular
.module('webApp')
.controller('boneController', boneController)
.directive('boneTab', boneTab);
boneController.$inject = ['$http'];
function boneController($http) {
var vm = this;
vm.test = "test";
vm.info = [];
$http.get('../JSON/data.json').... | (function() {
'use strict'
angular
.module('webApp')
.controller('boneController', boneController)
.directive('boneTab', boneTab);
boneController.$inject = ['$http'];
function boneController($http) {
var vm = this;
vm.info = [];
$http.get('../JSON/data.json').then(function(response)... | Remove logging and redundant js | Remove logging and redundant js
| JavaScript | mit | Nikki1993/zmed,Nikki1993/zmed |
b78c9eb54ebfea06ddb67d8ee719ce88cd531a82 | test/lib/generators/marionette_dust/install/templates/app/assets/javascripts/app.js | test/lib/generators/marionette_dust/install/templates/app/assets/javascripts/app.js | var Class = new Marionette.Application();
Class.addRegions({
//Add application regions here
});
//Navigate to specific route
Class.navigate = function (route, options) {
options || (options = {});
Backbone.history.navigate(route, options);
};
//Returns current route
Class.getCurrentRoute = function () {
retu... | var Class = new Marionette.Application();
Class.addRegions({
//Add application regions here
});
//Navigate to specific route
Class.navigate = function (route, options) {
options || (options = {});
Backbone.history.navigate(route, options);
};
//Returns current route
Class.getCurrentRoute = function () {
retu... | Test Fixes - Fixes tests related to the generator | Test Fixes
- Fixes tests related to the generator
| JavaScript | mit | roperzh/marionette_dust-rails,roperzh/marionette_dust-rails |
ca6b0bd2d6090bfc8723a76b43f4534902b43995 | ember/tests/integration/artist-test.js | ember/tests/integration/artist-test.js | import Ember from 'ember';
import { test } from 'ember-qunit';
import startApp from '../helpers/start-app';
var App;
module("Artist recommendation tests", {
setup: function() {
App = startApp();
},
teardown: function() {
Ember.run(App, App.destroy);
Ember.$.mockjax.clear();
}
});
test("no similar ... | import Ember from 'ember';
import { test } from 'ember-qunit';
import startApp from '../helpers/start-app';
var App;
module("Artist recommendation tests", {
setup: function() {
App = startApp();
},
teardown: function() {
Ember.run(App, App.destroy);
Ember.$.mockjax.clear();
}
});
test("no similar ... | Fix mocked URL in artists test | Fix mocked URL in artists test
| JavaScript | bsd-3-clause | FreeMusicNinja/freemusic.ninja,FreeMusicNinja/freemusic.ninja |
6866dcca1933775220e5faf9a2cbc3fed2aa92fa | src/parsers/guides/legend-gradient-labels.js | src/parsers/guides/legend-gradient-labels.js | import {Perc, Label, GuideLabelStyle} from './constants';
import guideMark from './guide-mark';
import {TextMark} from '../marks/marktypes';
import {LegendLabelRole} from '../marks/roles';
import {addEncode} from '../encode/encode-util';
var alignExpr = 'datum.' + Perc + '<=0?"left"'
+ ':datum.' + Perc + '>=1?"right... | import {Perc, Label, GuideLabelStyle} from './constants';
import guideMark from './guide-mark';
import {TextMark} from '../marks/marktypes';
import {LegendLabelRole} from '../marks/roles';
import {addEncode} from '../encode/encode-util';
var alignExpr = 'datum.' + Perc + '<=0?"left"'
+ ':datum.' + Perc + '>=1?"right... | Fix legend gradient label text to use update set. | Fix legend gradient label text to use update set.
| JavaScript | bsd-3-clause | vega/vega-parser |
c0f62eacb8b6cbdcdb4b3b83d72de6b97c265b48 | scripts/plugins/jquery.popline.list.js | scripts/plugins/jquery.popline.list.js | /*
jquery.popline.list.js 0.1.0-dev
Version: 0.1.0-dev
Updated: Aug 11th, 2014
(c) 2014 by kenshin54
*/
;(function($) {
$.popline.addButton({
orderedList: {
iconClass: "fa fa-list-ol",
mode: "edit",
action: function(event) {
document.execCommand("InsertOrderedList");
}
... | /*
jquery.popline.list.js 0.1.0-dev
Version: 0.1.0-dev
Updated: Aug 11th, 2014
(c) 2014 by kenshin54
*/
;(function($) {
var firefoxCleanupCheck = function(tag) {
var focusNode = $.popline.utils.selection().focusNode();
var node = $.popline.utils.findNodeWithTags(focusNode, tag);
return node ? t... | Fix ol/ul bug under firefox. | Fix ol/ul bug under firefox.
| JavaScript | mit | kenshin54/popline,roryok/popline,ztx1491/popline,ztx1491/popline,kenshin54/popline,roryok/popline |
456fa03b834a71f539c244ac1b0dcce9dd1f213d | demo/scripts/index.js | demo/scripts/index.js | (function init() {
document.getElementById("input1").addEventListener("input", calc);
document.getElementById("input2").addEventListener("input", calc);
calc();
})();
function calc() {
var str1 = document.getElementById("input1").value;
var str2 = document.getElementById("input2").value;
var da... | (function init() {
document.getElementById("input1").addEventListener("input", calc);
document.getElementById("input2").addEventListener("input", calc);
calc();
})();
function calc() {
var str1 = document.getElementById("input1").value;
var str2 = document.getElementById("input2").value;
var da... | Fix result's grammar issue. Show a message when inputs are invalid. | Fix result's grammar issue. Show a message when inputs are invalid.
| JavaScript | mit | zzpxyx/date-calc,zzpxyx/date-calc,zzpxyx/date-calc,zzpxyx/date-calc |
eea6df8acad698b96efaf91c88e022d7545df70e | child-process.js | child-process.js | const child = require('child_process');
const forkCount = parseInt(process.argv[2]);
const forkCalls = parseInt(process.argv[3])
const intervalTime = parseInt(process.argv[4]);
for (var i = 0 ; i < forkCount; i++){
process.stdout.write(`Process: ${i} at work`);
let childProcess = child.fork('get-request.js',['www... | const child = require('child_process');
const forkCount = parseInt(process.argv[2]);
const forkCalls = parseInt(process.argv[3])
const intervalTime = parseInt(process.argv[4]);
const targetURI = 'www.google.com';
for (var i = 0 ; i < forkCount; i++){
process.stdout.write(`Process: ${i} at work`);
let childProcess... | Add targetURI variable to make it easer to change the variable which controls the url which is pinged. | Add targetURI variable to make it easer to change the variable which controls the url which is pinged.
| JavaScript | mit | jaydurant/Parareq |
7234c9dd96df02321b6a35e30c60e1dca5aa620d | lib/__tests__/findJsModulesFor-test.js | lib/__tests__/findJsModulesFor-test.js | import path from 'path';
import Configuration from '../Configuration';
import FileUtils from '../FileUtils';
import ModuleFinder from '../ModuleFinder';
import findJsModulesFor from '../findJsModulesFor';
jest.mock('../ModuleFinder');
jest.mock('../FileUtils');
beforeEach(() => {
ModuleFinder.getForWorkingDirector... | import path from 'path';
import Configuration from '../Configuration';
import FileUtils from '../FileUtils';
import ModuleFinder from '../ModuleFinder';
import findJsModulesFor from '../findJsModulesFor';
jest.mock('../ModuleFinder');
jest.mock('../FileUtils');
beforeEach(() => {
ModuleFinder.getForWorkingDirector... | Remove extra args to findJsModulesFor | Remove extra args to findJsModulesFor
| JavaScript | mit | trotzig/import-js,trotzig/import-js,trotzig/import-js,Galooshi/import-js |
ecd1a950f1869848dd0a75960d64fa223bd659c2 | addon/components/form-controls/ff-currency.js | addon/components/form-controls/ff-currency.js | import FormControlsFfInputComponent from './ff-input';
import { arg } from 'ember-arg-types';
import { string } from 'prop-types';
import { action } from '@ember/object';
export default class FormControlsFfCurrencyComponent extends FormControlsFfInputComponent {
@arg(string)
prefix = '$ ';
@action
handleChang... | import FormControlsFfInputComponent from './ff-input';
import { arg } from 'ember-arg-types';
import { string } from 'prop-types';
import { action } from '@ember/object';
export default class FormControlsFfCurrencyComponent extends FormControlsFfInputComponent {
@arg(string)
prefix = '$ ';
@action
handleChang... | Fix redefinition of value on currency input | Fix redefinition of value on currency input
| JavaScript | mit | Foodee/ember-foxy-forms,Foodee/ember-foxy-forms |
4aca0ce2de0976c3b2850c3003c65937dc87a358 | virun.js | virun.js | console.log("Helllo world");
var virus = document.querySelector("div");
virus.style.top = "400px";
var x = 1;
var y = 0;
var vy = 0;
var velocity = .1; // px per millisecond
var startTime = Date.now();
var clickTime;
timer = setInterval(function animate() {
var t = Date.now() - startTime;
x = velocity * t;
virus... | var virus = document.querySelector("div");
var x = 1;
var y = 0;
var vy = 0;
var ay = 0;
var vx = .1; // px per millisecond
var startTime = Date.now();
var clickTime;
timer = setInterval(function animate() {
var t = Date.now() - startTime;
x = vx * t;
y = vy * t + 400;
virus.style.left = x + "px";
virus.styl... | Add acceleration, leads to more natural movement when Ufo is clicked and falls | Add acceleration, leads to more natural movement when Ufo is clicked and falls
| JavaScript | mit | BOZ2323/virun,BOZ2323/virun |
5f9121656011d9288c2cf7d1bfb00128fc9a77b4 | lib/index.js | lib/index.js | require('./style.scss')
var Game = require("./game")
var canvas = document.getElementById('canvas')
var context = canvas.getContext('2d');
var game = new Game(canvas, context)
game.setup();
requestAnimationFrame(function test() {
if (!game.snake.isDead()) {
game.gameLoop()
setTimeout(function(){
requ... | require('./style.scss');
var Game = require("./game");
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var game = new Game(canvas, context);
game.setup();
requestAnimationFrame(function test() {
if (!game.snake.isDead()) {
game.gameLoop();
setTimeout(function(){
... | Add local storage for high scores | Add local storage for high scores
| JavaScript | mit | kjs222/gametime,kjs222/gametime |
e493437e1c49171699c79658d849ca8d2b1056ac | web/src/views/Guilds.js | web/src/views/Guilds.js | import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import './Guilds.scss'
import API from '../api'
import Guild from '../components/Guild'
export default class Guilds extends Component {
state = {
guilds: null,
}
async componentDidMount() {
const guilds = await API.get('/a... | import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import './Guilds.scss'
import API from '../api'
import Notice from '../components/Notice'
import Guild from '../components/Guild'
export default class Guilds extends Component {
state = {
guilds: null,
error: null,
}
async... | Handle and display guild list fetching errors | Handle and display guild list fetching errors
| JavaScript | mit | slice/dogbot,sliceofcode/dogbot,slice/dogbot,sliceofcode/dogbot,slice/dogbot |
978b2ec64c51c08b48811476cf879ebe6e8ebebc | src/js/client/index.js | src/js/client/index.js | import safeEval from 'safe-eval';
import dir from 'node-dir';
import path from 'path';
import {ipcRenderer} from 'electron';
console.log(__dirname);
console.log(process.cwd());
import {scripts} from './../../client/util/';
const babel = require('babel-core');
const babelOptions = {
presets: ['es2015']
}
let script =... | import safeEval from 'safe-eval';
import dir from 'node-dir';
import path from 'path';
import {ipcRenderer} from 'electron';
import {scripts} from './../../client/util/';
import {setUserRequire} from './../../client/util/';
import lib from './../../client/lib/';
const babel = require('babel-core');
const babelOptions ... | Add execution of user script to renderer process | Add execution of user script to renderer process
| JavaScript | mit | simonlovesyou/AutoRobot |
72aab5a479c52299c6c719ec64c20e1665acf787 | src/lib/class-names.js | src/lib/class-names.js | const cls = {
main: 'ps',
element: {
thumb: x => `ps__thumb-${x}`,
rail: x => `ps__rail-${x}`,
consuming: 'ps__child--consume',
},
state: {
focus: 'ps--focus',
active: x => `ps--active-${x}`,
scrolling: x => `ps--scrolling-${x}`,
},
};
export default cls;
/*
* Helper methods
*/
con... | const cls = {
main: 'ps',
element: {
thumb: x => `ps__thumb-${x}`,
rail: x => `ps__rail-${x}`,
consuming: 'ps__child--consume',
},
state: {
focus: 'ps--focus',
active: x => `ps--active-${x}`,
scrolling: x => `ps--scrolling-${x}`,
},
};
export default cls;
/*
* Helper methods
*/
con... | Add active check in timeout | Add active check in timeout
Fix #704.
| JavaScript | mit | utatti/perfect-scrollbar,utatti/perfect-scrollbar |
4020b6e800c777ff8c77ed2558e7b6522d67048d | lib/commands.js | lib/commands.js | 'use strict';
var buildPolicyString = require('./utils')['buildPolicyString'];
module.exports = {
'csp-headers': {
name: 'csp-headers',
description: 'Generate Content-Security-Policy headers',
works: 'insideProject',
availableOptions: [
{
name: 'environment',
type: String,
... | 'use strict';
var buildPolicyString = require('./utils')['buildPolicyString'];
var chalk = require('chalk');
module.exports = {
'csp-headers': {
name: 'csp-headers',
description: 'Generate Content-Security-Policy headers',
works: 'insideProject',
availableOptions: [
{
name: 'environmen... | Add preamble with settings for some famous web servers | Add preamble with settings for some famous web servers
Makes it simple to configure the headers for the Apache and Nginx
without reading it up on the net.
Output the headers with level 'ERROR' so that it's written out when
using the `--silent` option.
| JavaScript | mit | rwjblue/ember-cli-content-security-policy,rwjblue/ember-cli-content-security-policy |
75d77a08a21e30d874957f92b3b59dab02adb3c3 | src/js/components/header.js | src/js/components/header.js | import React, { Component } from 'react'
import VoudeOnibusPng from '../../img/voudeonibus.png'
import VoudeOnibusHorizontalPng from '../../img/voudeonibus-horizontal.png'
export default class About extends Component {
render () {
const imgs = `${VoudeOnibusHorizontalPng} 640w, ${VoudeOnibusPng} 800w`
retur... | import React, { Component } from 'react'
import VoudeOnibusPng from '../../img/voudeonibus.png'
import VoudeOnibusHorizontalPng from '../../img/voudeonibus-horizontal.png'
const imgs = `${VoudeOnibusHorizontalPng} 640w, ${VoudeOnibusPng} 800w`
export default class About extends Component {
render () {
return (... | Move `const imgs` from `render` | Move `const imgs` from `render`
| JavaScript | mit | voudeonibus/web.voudeonibus.com,voudeonibus/web.voudeonibus.com |
1a6edb5c2b58098111494b8d1b0af29b8a1d0abb | src/bin/commit-link-dependencies.js | src/bin/commit-link-dependencies.js | import {exec} from 'node-promise-es6/child-process';
import fs from 'node-promise-es6/fs';
async function run() {
const {linkDependencies = {}} = await fs.readJson('package.json');
for (const dependencyName of Object.keys(linkDependencies)) {
const dependencyPath = linkDependencies[dependencyName];
const ... | import {exec} from 'node-promise-es6/child-process';
import fs from 'node-promise-es6/fs';
async function run() {
const {linkDependencies = {}} = await fs.readJson('package.json');
for (const dependencyName of Object.keys(linkDependencies)) {
const dependencyPath = linkDependencies[dependencyName];
const ... | Add logging statement for debugging Travis CI | Add logging statement for debugging Travis CI
| JavaScript | mit | vinsonchuong/npm-integration |
503bff85dc2981023760c6f42f619c1aeac920a9 | tests/dummy/mirage/scenarios/default.js | tests/dummy/mirage/scenarios/default.js | /* eslint no-shadow: "off" */
import moment from 'moment';
export default function(server) {
const user = server.create('user');
const session = server.create('session');
const offerings = server.createList('offering', 2, {
session
});
const now = moment().hour(8).minute(0).second(0);
server.create('us... | export default function() {
}
| Remove scenarios we never use | Remove scenarios we never use
| JavaScript | mit | ilios/common,ilios/common |
e74855ba6571c616a658e3d720f37bd76c75bd68 | app/assets/javascripts/cable.js | app/assets/javascripts/cable.js | //= require action_cable
//= require_self
//= require_tree ./channels
(function() {
this.App || (this.App = {});
App.cable = ActionCable.createConsumer();
}).call(this);
| //= require action_cable
//= require_self
(function() {
this.App || (this.App = {});
App.cable = ActionCable.createConsumer();
}).call(this);
| Fix small require JS error | Fix small require JS error
| JavaScript | mit | drews256/andrewstuntz,drews256/andrewstuntz,drews256/andrewstuntz |
8487b17ae7a0954653715f06bf54a4e170a4ca25 | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: ['**/*.js', '!**/node_modules/**'],
options: {
newcap: false
}
},
generation: {
all: {
src: ['lib/components/*.js'],
docs: {
markdown: {
byName: {dest: 'docs/markdow... | module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: ['**/*.js', '!**/node_modules/**'],
options: {
newcap: false
}
},
generation: {
docs: {
src: ['lib/components/*.js'],
docs: {
markdown: {
byName: {dest: 'docs/markdo... | Tweak watch task configs: separate linting from help generation, and add the templates to the files that trigger help generation | Tweak watch task configs: separate linting from help generation, and add the templates to the files that trigger help
generation
| JavaScript | mit | graememcc/funkierJS,graememcc/funkierJS |
8d53debba111623e5a804a61b72939136fb99ff3 | Gruntfile.js | Gruntfile.js | /* jshint node: true */
module.exports = function (grunt) {
'use strict';
// Force use of Unix newlines
grunt.util.linefeed = '\n';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
src: {
options: {
jshintrc: true,
ignores: 'node_modules/**'
... | /* jshint node: true */
module.exports = function (grunt) {
'use strict';
// Force use of Unix newlines
grunt.util.linefeed = '\n';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
src: {
options: {
jshintrc: true,
ignores: 'node_modules/**'
... | Use File Array Format for zip task | Use File Array Format for zip task
To build for individual platform, use humanized task name. For example, `grunt dist chrome`.
| JavaScript | agpl-3.0 | openfaux/openfaux-client,openfaux/openfaux-client,openfaux/openfaux-client,openfaux/openfaux-client |
28fd2cd446cc7a3726654305127b9853e7ec1480 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: [
'src/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
watch: {
all: {
files: [
'src.*.js'
],
tasks: ['default']
}
},
simplemocha... | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: [
'src/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
watch: {
all: {
files: [
'src/*.js',
'test/*.js'
],
tasks: ['default']
}... | Add all src and test files to watch | Add all src and test files to watch
| JavaScript | mit | jlewallen/spotify-web-api-node,erezny/spotify-web-api-node,christophior/spotify-web-api-node,JMPerez/spotify-web-api-node,UnbounDev/spotify-web-api-node,thelinmichael/spotify-web-api-node |
6ccafde6e821725dc28a43fa4c36bc500086a62d | src/app/twitter/tweets/GearTweet.js | src/app/twitter/tweets/GearTweet.js | const TwitterPostBase = require('./TwitterPostBase');
const { captureGearScreenshot } = require('@/app/screenshots');
const { readData, getTopOfCurrentHour } = require('@/common/utilities');
class GearTweet extends TwitterPostBase {
getKey() { return 'gear'; }
getName() { return 'Gear'; }
getMerchandises(... | const TwitterPostBase = require('./TwitterPostBase');
const { captureGearScreenshot } = require('@/app/screenshots');
const { readData, getTopOfCurrentHour } = require('@/common/utilities');
class GearTweet extends TwitterPostBase {
getKey() { return 'gear'; }
getName() { return 'Gear'; }
getMerchandises(... | Revert "Fix a mistake, this should use the specified tweet time" | Revert "Fix a mistake, this should use the specified tweet time"
This reverts commit 25d711124e330c784fb4d0ebba1d46fa58f82e7b. | JavaScript | mit | misenhower/splatoon2.ink,misenhower/splatoon2.ink,misenhower/splatoon2.ink |
5c5658b1dfc9e6386c3743d69eaddfdbffd8d0e5 | app/api/timestamp.js | app/api/timestamp.js | 'use strict';
var moment = require('moment');
module.exports = function(app) {
app.get('/:query', function(req, res) {
var date = req.params.query;
var unix = null;
var natural = null;
// Check for initial unix time
if (+date >= 0) {
unix = +date;
... | 'use strict';
var moment = require('moment');
module.exports = function(app) {
app.get('/:query', function(req, res) {
var date = req.params.query;
var unix = null;
var natural = null;
// Check for initial unix time
if (+date >= 0) {
unix = +date;
... | Use json instead of string | Use json instead of string
| JavaScript | apache-2.0 | Rafase282/Timestamp-API,Rafase282/Timestamp-API |
5c09d2a775993229191fef38f4c64c3ce9f7b84e | app/assets/javascripts/timeSync.js | app/assets/javascripts/timeSync.js | class TimeSync {
constructor() {
this.ts = undefined;
}
init() {
if (!this.ts) {
this.ts = timesync.create({
server: '/timesync',
interval: 60000
});
}
}
now() {
this.init();
return parseInt(this.ts.now().toFixed());
}
timestamp() {
this.init();
r... | class TimeSync {
constructor() {
this.ts = undefined;
}
init() {
if (!this.ts) {
this.ts = timesync.create({
server: '/timesync',
interval: 60000,
repeat: 1
});
}
}
now() {
this.init();
return parseInt(this.ts.now().toFixed());
}
timestamp() {
... | Set timesync repeat to 1 | Set timesync repeat to 1
| JavaScript | agpl-3.0 | marincelo/stoperica,marincelo/stoperica,marincelo/stoperica |
74ceda1dbaaac38a75d94afb7ca99056c94eb132 | _temp/hud/src/index.js | _temp/hud/src/index.js | 'use strict';
// DEV TIME CODE
if (FAKE_SERVER) {
require('fake');
}
// DEV TIME CODE
require('./index.scss');
var $ = require('$jquery');
var util = require('lib/util');
var state = require('./state');
var repository = require('./repository');
var sections = require('./sections/section');
//var details = args.... | 'use strict';
// DEV TIME CODE
if (FAKE_SERVER) {
require('fake');
}
// DEV TIME CODE
require('./index.scss');
var $ = require('$jquery');
var util = require('lib/util');
var state = require('./state');
var repository = require('./repository');
var sections = require('./sections/section');
//var details = args.... | Change logic of where href is set for the root anchor | Change logic of where href is set for the root anchor
| JavaScript | unknown | Glimpse/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype,avanderhoorn/Glimpse.Client.Prototype,avanderhoorn/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype |
bbc76214a0bc317269221b0cac83e275f084443b | src/layout/crossing-reduction/index.js | src/layout/crossing-reduction/index.js | 'use strict';
import cross from './cross';
import baryCenter from './bary-center';
const crossAll = (g, layers) => {
let count = 0;
for (let i = 1; i < layers.length; ++i) {
count += cross(g, layers[i - 1], layers[i]);
}
return count;
};
const crossingReduction = (g, layers) => {
const n = layers.lengt... | 'use strict';
import baryCenter from './bary-center';
const crossingReduction = (g, layers) => {
const n = layers.length,
repeat = 8;
for (let loop = 0; loop < repeat; ++loop) {
for (let i = 1; i < n; ++i) {
baryCenter(g, layers[i - 1], layers[i]);
}
for (let i = n - 1; i > 0; --i) {
... | Disable crossing count in crossing reduction | Disable crossing count in crossing reduction
| JavaScript | mit | likr/eg-graph,likr/egraph |
b1283bc25ce57c077cc33b1342ffb949cd7615c8 | automagic_snippets_from_text.js | automagic_snippets_from_text.js | // Create a base snippet with the selected text
scimoz = ko.views.manager.currentView.scimoz;
var snip =
ko.projects.addSnippetFromText(scimoz.selText);
//create a date to be used as a unique name on the snippet
var d = new Date();
// Create a unique default name string
var defaultName = "New Snippet - " + d.toLoca... | /**
* Create a snippet from selected text, add a name and automatically open
* properties to add keybinding.
*
* A popup UI allows creation of the snippet name
*
* Type: keybound
* Usage: Add a keybinding of your liking in it's properties
*
* @source https://github.com/Komodo/macros
* @author C... | Add comment header for style points. | Add comment header for style points.
| JavaScript | mpl-2.0 | Komodo/macros,Komodo/macros |
89dbbf454bb7ab2f086f32f3f0eba8cf68306525 | client/components/BorrowedBooks.js | client/components/BorrowedBooks.js | import React from 'react';
import { Link } from 'react-router-dom';
const BorrowedBooks = (props) => {
const { books } = props;
if (!books.length) {
return (
<div className="row center">
<p className="grey-text">You have no borrowed books </p>
</div>
);
}
return (
<... | import React from 'react';
import { Link } from 'react-router-dom';
const BorrowedBooks = (props) => {
const {
books, returnBook, user, isSendingRequest, returnRequests,
} = props;
console.log(props);
if (!books.length) {
return (
<div className="row center">
<p className="grey-tex... | Add method to return book in component | Add method to return book in component
| JavaScript | mit | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books |
9765c44388ed48649f2866225150abca1f9ef2e9 | App/Styles/NavigationStyle.js | App/Styles/NavigationStyle.js | import React from 'react-native'
import { Fonts, Metrics, Colors } from '../Themes/'
const NavigationStyle = React.StyleSheet.create({
titleWrapper: {
flex: 1,
padding: Metrics.baseMargin,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center'
},
navTitle: {
color: Colors... | import React from 'react-native'
import { Fonts, Metrics, Colors } from '../Themes/'
const NavigationStyle = React.StyleSheet.create({
titleWrapper: {
flex: 1,
padding: Metrics.baseMargin,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center'
},
navTitle: {
color: Colors... | Fix nav bar back style | Fix nav bar back style
| JavaScript | mit | OTGApps/ReactCheckoutHelper,OTGApps/ReactCheckoutHelper,OTGApps/ReactCheckoutHelper |
364fca23671fe055b4ecaaa8f09c344005bce284 | lib/checkers/mongodb.js | lib/checkers/mongodb.js | /*jshint esnext: true */
var mongodb = require('mongodb');
/**
* Health check a mongodb resource.
*
* @param {Object} setup: http check setup with fields:
* - uri: a resource URI
* - connectTimeout: MongoDB connect timeout in milliseconds
* - TODO databases: an array of database names that should exist, OK when ... | /*jshint esnext: true */
var mongodb = require('mongodb');
/**
* Health check a mongodb resource.
*
* @param {Object} setup: http check setup with fields:
* - uri: a resource URI
* - connectTimeout: MongoDB connect timeout in milliseconds
* @param {Function} cb: standard cb(err, result) callback
*/
function che... | Drop databases setup field, not needed since database name can be added to connection string. | Drop databases setup field, not needed since database name can be added to connection string.
| JavaScript | mit | cliffano/health |
9b68d0cb4c53dcf83794a4858c3893ccdbd39045 | src/modules/core/services/sp.service.js | src/modules/core/services/sp.service.js | angular
.module('ngSharepoint')
.provider('$sp', function() {
var siteUrl = '';
var connMode = 'JSOM'; //possible values: JSOM, REST
var token = false;
var autoload = true;
return {
setSiteUrl: function (newUrl) {
siteUrl = newUrl;
},
setConnectionMode: function(newConnMode) { //Only JSOM Supp... | angular
.module('ngSharepoint')
.provider('$sp', $spProvider);
function $spProvider() {
var siteUrl = '';
var connMode = 'JSOM';
var token = false;
var autoload = true;
var provider = {
setSiteUrl: setSiteUrl,
setConnectionMode: setConnectionMode,
setAccessToken: setAccessToken,
setAutoload: setAutoloa... | Use named functions for better readability | Use named functions for better readability
| JavaScript | apache-2.0 | maxjoehnk/ngSharepoint |
b200247a594a596851a03110c6df8011eb4b1b9f | lib/browser.js | lib/browser.js | var RTCIceCandidate = mozRTCIceCandidate || webkitRTCIceCandidate || RTCIceCandidate;
var RTCPeerConnection = mozRTCPeerConnection || webkitRTCPeerConnection || RTCPeerConnection;
var RTCSessionDescription = mozRTCSessionDescription || webkitRTCSessionDescription || RTCSessionDescription;
... | var RTCIceCandidate = window.mozRTCIceCandidate || window.webkitRTCIceCandidate || window.RTCIceCandidate;
var RTCPeerConnection = window.mozRTCPeerConnection || window.webkitRTCPeerConnection || window.RTCPeerConnection;
var RTCSessionDescription = window.mozRTCSessionDescription || windo... | Fix bug to allow to detect correctly native implementations | Fix bug to allow to detect correctly native implementations
| JavaScript | bsd-2-clause | siphontv/node-webrtc,vshymanskyy/node-webrtc,lresc/node-webrtc,siphontv/node-webrtc,lresc/node-webrtc,vshymanskyy/node-webrtc,lresc/node-webrtc,ssaroha/node-webrtc,siphontv/node-webrtc,diffalot/node-webrtc,markandrus/node-webrtc,martindale/node-webrtc,vshymanskyy/node-webrtc,markandrus/node-webrtc,siphontv/node-webrtc,... |
885e13314ed02e71126af2d188e9f6fe6649b513 | src/js/stores/Pages.js | src/js/stores/Pages.js | import axios from 'axios'
import { observable, action } from 'mobx'
import { API_URL } from '../constants'
export default class PagesStore {
allowedPages = ['about', 'contacts', 'home', 'portfolio']
sessionsStore;
@observable pages = []
constructor(sessionsStore) {
this.sessionsStore = sessionsStore
... | import axios from 'axios'
import { observable, action } from 'mobx'
import { API_URL } from '../constants'
export default class PagesStore {
allowedPages = ['about', 'contacts', 'guides', 'home', 'open-source', 'portfolio']
sessionsStore;
@observable pages = []
constructor(sessionsStore) {
this.session... | Add guides and open source static pages | Add guides and open source static pages
| JavaScript | mit | appdev-academy/appdev.academy-react,appdev-academy/appdev.academy-react,appdev-academy/appdev.academy-react |
67455f1fdc2d481018dc05bb318ccf0b1b38665a | sbin/removeExpiredAlerts.js | sbin/removeExpiredAlerts.js | // To remove expired alerts from the alerta database run this script from cron like so:
// * * * * * /usr/bin/mongo --quiet monitoring /opt/alerta/sbin/removeExpiredAlerts.js
now = new Date();
db.alerts.remove({ 'status': 'CLOSED', 'expireTime': { $lt: now }});
| // To remove expired alerts from the alerta database run this script from cron like so:
// * * * * * /usr/bin/mongo --quiet monitoring /opt/alerta/sbin/removeExpiredAlerts.js
now = new Date();
db.alerts.remove({'status': 'CLOSED'});
db.alerts.remove({'expireTime': { $lt: now }});
| Remove expired OR closed alerts | Remove expired OR closed alerts
| JavaScript | apache-2.0 | guardian/alerta,guardian/alerta,mrkeng/alerta,skob/alerta,0312birdzhang/alerta,mrkeng/alerta,skob/alerta,skob/alerta,mrkeng/alerta,guardian/alerta,0312birdzhang/alerta,skob/alerta,guardian/alerta,0312birdzhang/alerta,mrkeng/alerta |
906f8f2f5c01d0a57e72f245ea08018e8844e68a | sbin/removeExpiredAlerts.js | sbin/removeExpiredAlerts.js | // To mark expired and old alerts in the alerta database run this script from cron like so:
// * * * * * /usr/bin/mongo --quiet monitoring /opt/alerta/sbin/removeExpiredAlerts.js
now = new Date();
db.alerts.update({ 'status': 'OPEN', 'expireTime': { $lt: now }}, { $set: {'status': 'EXPIRED' });
ago = new Date(new Date... | // To mark expired and old alerts in the alerta database run this script from cron like so:
// * * * * * /usr/bin/mongo --quiet monitoring /opt/alerta/sbin/removeExpiredAlerts.js
now = new Date();
db.alerts.update({ status: 'OPEN', expireTime: { $lt: now }}, { $set: { status: 'EXPIRED' }, $push: { history: {status: 'EX... | Fix history update to expired alerts cron | Fix history update to expired alerts cron
| JavaScript | apache-2.0 | mrkeng/alerta,guardian/alerta,guardian/alerta,mrkeng/alerta,skob/alerta,skob/alerta,skob/alerta,0312birdzhang/alerta,guardian/alerta,0312birdzhang/alerta,mrkeng/alerta,skob/alerta,guardian/alerta,mrkeng/alerta,0312birdzhang/alerta |
f0a6b2b00543131661090a89a3d6814c760bf817 | app/assets/javascripts/interactivity.js | app/assets/javascripts/interactivity.js | function recipeSearch(input) {
$.ajax({
url: "/recipes",
data: input,
}).done(function(recipeItemPartial) {
$(recipeItemPartial).appendTo(".main-searchbar");
});
}
var throttledSearch = _.throttle(recipeSearch, 300);
$(document).ready(function() {
$(".form-control").keyup(function(event){
... | function recipeSearch(input) {
$.ajax({
url: "/recipes",
data: input,
}).done(function(recipeItemPartial) {
$(recipeItemPartial).appendTo(".main-searchbar");
});
}
var throttledSearch = _.throttle(recipeSearch, 300);
$(document).ready(function() {
$('input').focus();
$(".form-control").keyup... | Add blinky cursor upon page load | Add blinky cursor upon page load
| JavaScript | mit | mastein109/InstaChef,mastein109/InstaChef,mastein109/InstaChef |
a5c0287b0afa3d2657a0d23dd70058be82dfb5b1 | api/routes/login.js | api/routes/login.js | const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
const User = require('../models/user.js');
const jwt = require('jsonwebtoken');
const jwtConfig = require('../jwt_config');
router.post('/', (request, response) => {
const username = request.body.username;
... | const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
const User = require('../models/user.js');
const jwt = require('jsonwebtoken');
const jwtConfig = require('../jwt_config');
router.post('/', (request, response) => {
const username = request.body.username;
... | Set expiration time for JWT to 1 day | Set expiration time for JWT to 1 day
| JavaScript | mit | SimonKinds/couples-diary,SimonKinds/couples-diary,SimonKinds/couples-diary |
67ec2e092099b9b46ebe3ab421fe2b2dd8eb0bca | components/content.js | components/content.js | import React from 'react'
import PropTypes from 'prop-types'
export const Content = ({ children, clouds }) => (
<main>
{children}
<style jsx>{`
@import 'colors';
main {
background-color: $white;
padding: 2em 0 10em;
display: flex;
flex-direction: column;
... | import React from 'react'
import PropTypes from 'prop-types'
export const Content = ({ children, clouds }) => (
<main>
{children}
<style jsx>{`
@import 'colors';
main {
background-color: $white;
padding: 2em 0 10em;
display: flex;
flex-direction: column;
... | Move clouds down a little | Move clouds down a little
| JavaScript | mit | sgmap/inspire,sgmap/inspire |
eec13478883b4c247cf1746ceb86a2e859afbcd7 | src/State.js | src/State.js | /* @flow */
export class Employee {
name: string;
balance: number;
constructor(name: string) {
this.name = name;
this.balance = 0.0;
}
};
export class Snack {
name: string;
price: number;
constructor(name: string, price: number) {
this.name = name;
this.price = price;
}
};
expor... | /* @flow */
export class Employee {
name: string;
balance: number;
constructor(name: string, balance: number) {
this.name = name;
this.balance = balance;
}
};
export class Snack {
name: string;
price: number;
constructor(name: string, price: number) {
this.name = name;
this.price = p... | Mark one person as having money | Mark one person as having money
| JavaScript | mit | RobotDisco/snack-tracker-to,RobotDisco/snack-tracker-to |
b7c24304a858b810fd93b2cda311cf3e5486a0f9 | models/users.js | models/users.js | const knex = require('../database')
module.exports.findOne = (username) => new Promise((resolve, reject) => {
knex('users').select().where({username})
// success
.then(user => {
if (user) { resolve(user[0]) }
else { resolve(null) }
})
// error
.catch(err => reject(err))
})
module.e... | const knex = require('../database')
module.exports.findOne = (username) => new Promise((resolve, reject) => {
knex('users').select().where({username})
// success
.then(user => {
if (user) { resolve(user[0]) }
else { resolve(null) }
})
// error
.catch(err => reject(err))
})
module.e... | Add a function to create a new user | Add a function to create a new user
| JavaScript | mit | byteBridge/transcriptus-api |
31bb2406947efa96d119ab661a29bcff220753df | src/index.js | src/index.js | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribu... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribu... | Remove version property from Log4js | Remove version property from Log4js
| JavaScript | apache-2.0 | mobilexag/log4js,peterjuras/log4js,peterjuras/log4js |
07fa0116bfea39d4f22b6dfe9f8c5baf14751815 | src/index.js | src/index.js | import { default as Banner } from './components/Banner'
import { default as Button } from './components/Button'
import { default as DeleteButton } from './components/DeleteButton'
import { default as DeviceStatusGauge } from './components/DeviceStatusGauge'
import { default as Divider } from './components/Divider'
impo... | import { default as Banner } from './components/Banner'
import { default as Button } from './components/Button'
import { default as CodeWithCopy } from './components/CodeWithCopy'
import { default as DeleteButton } from './components/DeleteButton'
import { default as DeviceStatusGauge } from './components/DeviceStatusG... | Add CodeWithCopy component to module exports | Add CodeWithCopy component to module exports
Connects to #1289
change-type: patch
| JavaScript | mit | resin-io-modules/resin-components,resin-io-modules/resin-components,resin-io-modules/resin-components |
e853e86af71c772959247de7e84c882f218d5cad | app/controllers/addbook.js | app/controllers/addbook.js | var args = arguments[0] || {};
// Access the existing books collection.
var myBooks = Alloy.Collections.books;
// When window opens, focus the title field.
$.addbook.addEventListener('open', function(e) {
$.titleInput.focus();
Ti.API.error('window got opened. focus text field');
});
function addBook(e) {
Ti.AP... | var args = arguments[0] || {};
// Access the existing books collection.
var myBooks = Alloy.Collections.books;
// When window opens, focus the title field.
$.addbook.addEventListener('open', function(e) {
$.titleInput.focus();
Ti.API.error('window got opened. focus text field');
});
// Add the book to the collec... | Add book to table view after it gets added | Add book to table view after it gets added
| JavaScript | apache-2.0 | danielhanold/alloyfavebooks,danielhanold/alloyfavebooks |
0df6f90b582171b83b248bb11b23e423e6fac93e | config/environment.js | config/environment.js | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'ember-bedspacemanagement',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
... | /* jshint node: true */
module.exports = function (environment) {
var ENV = {
modulePrefix: 'ember-bedspacemanagement',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
... | Update app config to enable mocks | BM-306: Update app config to enable mocks
| JavaScript | mit | UKHomeOffice/removals_dashboard,UKHomeOffice/removals_dashboard,UKHomeOffice/removals_dashboard |
06cb4a9ef57c1579408908e14baebf64d891fe16 | src/Oro/Bundle/EmailBundle/Resources/public/js/app/views/email-attachment-link-view.js | src/Oro/Bundle/EmailBundle/Resources/public/js/app/views/email-attachment-link-view.js | /*jslint nomen: true*/
/*global define*/
define([
'jquery',
'underscore',
'orotranslation/js/translator',
'backbone',
'oroui/js/messenger',
'oroui/js/app/views/base/view'
], function ($, _, __, Backbone, messenger, BaseView) {
'use strict';
var EmailAttachmentLink;
/**
* @expo... | /*jslint nomen: true*/
/*global define*/
define([
'jquery',
'underscore',
'orotranslation/js/translator',
'backbone',
'oroui/js/messenger',
'oroui/js/app/views/base/view',
'oroui/js/mediator'
], function ($, _, __, Backbone, messenger, BaseView, mediator) {
'use strict';
var EmailAt... | Refresh attachment grid after click on attachment link on email | CRM-2906: Refresh attachment grid after click on attachment link on email
| JavaScript | mit | geoffroycochard/platform,trustify/oroplatform,Djamy/platform,Djamy/platform,orocrm/platform,northdakota/platform,northdakota/platform,geoffroycochard/platform,geoffroycochard/platform,trustify/oroplatform,northdakota/platform,orocrm/platform,Djamy/platform,morontt/platform,orocrm/platform,morontt/platform,ramunasd/plat... |
8bb7ed7665951ec23d69d8d1334e76b9ad4cef73 | build/buildSystem.js | build/buildSystem.js | /* eslint-disable no-console */
const writeLine = (line) => console.log(line);
/* eslint-enable no-console */
const runTask = async (task) => {
const startTime = Date.now();
writeLine(`Starting ${task.name}`);
await new Promise(task)
.catch((err) => {
writeLine(err);
proce... | /* eslint-disable no-console */
const writeLine = (line) => console.log(line);
/* eslint-enable no-console */
const runTask = async (task) => {
const startTime = Date.now();
writeLine(`Starting ${task.name}`);
return new Promise(task)
.catch((err) => {
writeLine(err);
proc... | Fix job timer during build. | Fix job timer during build.
| JavaScript | mit | birkett/a-birkett.co.uk |
23b105fcffe3ad2a4caa9ac9903f20ed4bb50cec | src/auth/auth.middleware.js | src/auth/auth.middleware.js | var jwt = require('jwt-simple');
var moment = require('moment');
var config = require('../../config/config');
var authMiddleware = {};
authMiddleware.ensureAuthenticated = function (req, res, next) {
if (!req.headers.authorization) {
return res.status(401).send({message: 'Please make sure your request has... | var jwt = require('jwt-simple');
var moment = require('moment');
var config = require('../../config/config');
var authMiddleware = {};
authMiddleware.ensureAuthenticated = function (req, res, next) {
if (!req.headers.authorization) {
return res.status(401).send({message: 'Please make sure your request ha... | Handle case when token is not valid | Handle case when token is not valid
| JavaScript | mit | AdapTeach/code-exam |
09a0c7a6b13c44797350e2caba71a98d00c1e720 | client/config/webpack.base.conf.js | client/config/webpack.base.conf.js | var path = require('path');
const webpack = require('webpack')
const baseConfig = module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: path.resolve(__dirname, '../dist'),
publicPath: '/'
},
resolve: {
extens... | var path = require('path');
const webpack = require('webpack')
const baseConfig = module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: path.resolve(__dirname, '../dist'),
publicPath: '/'
},
resolve: {
extens... | Remove unneccesary webpack node_modules path adjustment | Remove unneccesary webpack node_modules path adjustment
| JavaScript | mit | ProgBot/frc-scouting-app,ProgBot/frc-scouting-app |
4f8007f810e6b620e5626a9464801322f2500cd4 | test/unit/setup/webpack.config.test.js | test/unit/setup/webpack.config.test.js | const path = require('path');
const projectRoot = path.resolve(__dirname, '../../../');
module.exports = {
// use inline sourcemap for karma-sourcemap-loader
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue',
},
{
test: /\.js$/,
loader: 'babel',
inc... | const path = require('path');
const projectRoot = path.resolve(__dirname, '../../../');
module.exports = {
// use inline sourcemap for karma-sourcemap-loader
module: {
resolve: {
extensions: ['.js', '.vue']
},
loaders: [
{
test: /\.vue$/,
loader: 'vue',
},
{
... | Add resolve property to webpack config | Add resolve property to webpack config
| JavaScript | mit | eddyerburgh/avoriaz,eddyerburgh/avoriaz,eddyerburgh/avoriaz |
6b7fc0194a52a0d065e12c41d29277b8a8efe782 | test/publishing/dependency-check.js | test/publishing/dependency-check.js | 'use strict';
var dependencies = require('../../package.json').dependencies;
var dependencyNames = Object.keys(dependencies);
var packages = dependencyNames.filter(function (d) {
// Remove scoped packages
return d[0] !== '@';
});
describe('Shared dependency', function () {
packages.forEach(function (pkgName) {
... | 'use strict';
var execSync = require('child_process').execSync;
var dependencies = require('../../package.json').dependencies;
var dependencyNames = Object.keys(dependencies);
var dependencyPackages = dependencyNames.map(function (depName) {
var depPackages = {};
var depVersion = dependencies[depName];
var cmd =... | Use npm view to get all nested dependencies | Use npm view to get all nested dependencies
| JavaScript | mit | braintree/braintree-web-drop-in,braintree/braintree-web-drop-in,braintree/braintree-web-drop-in |
94e9ed29711e50485e9c3478bdbab2b6483f3437 | core/local/steps/scan_folder.js | core/local/steps/scan_folder.js | /* @flow */
const logger = require('../../logger')
const log = logger({
component: 'scanFolder'
})
/*::
import type Buffer from './buffer'
import type { Producer } from './producer'
*/
// This step
module.exports = function (buffer /*: Buffer */, opts /*: { producer: Producer } */) /*: Buffer */ {
return buffer.... | /* @flow */
const logger = require('../../logger')
const log = logger({
component: 'scanFolder'
})
/*::
import type Buffer from './buffer'
import type { Producer } from './producer'
*/
// When a directory that was not in the synchronized dir is moved to it,
// atom/Watcher emits a single event for the added direct... | Add a comment to explain scanFolder | Add a comment to explain scanFolder
| JavaScript | agpl-3.0 | cozy-labs/cozy-desktop,cozy-labs/cozy-desktop,cozy-labs/cozy-desktop,cozy-labs/cozy-desktop |
4c7cf911899ce824c96ba11734c6e9388b9f888a | Templates/HttpTrigger/index.js | Templates/HttpTrigger/index.js | module.exports = function (context, req) {
context.log('Node.js HTTP trigger function processed a request. Name=' + req.query.name);
if (typeof req.query.name == 'undefined') {
context.res = {
status: 400,
body: "Please pass a name on the query string"
}
}
else ... | module.exports = function (context, req) {
context.log('Node.js HTTP trigger function processed a request. Name=' + req.originalUrl);
if (typeof req.query.name == 'undefined') {
context.res = {
status: 400,
body: "Please pass a name on the query string"
}
}
else... | Use URI instead of query string | Use URI instead of query string
| JavaScript | mit | soninaren/azure-webjobs-sdk-templates,davidlai-msft/azure-webjobs-sdk-templates,Azure/azure-webjobs-sdk-templates,mattchenderson/azure-webjobs-sdk-templates,Azure/azure-webjobs-sdk-templates,Azure/azure-webjobs-sdk-templates,Azure/azure-webjobs-sdk-templates,mattchenderson/azure-webjobs-sdk-templates,Azure/azure-webjob... |
890e03aafbf2fefc6d27c2d7d0d54479b0285f70 | gulp/utils/command.js | gulp/utils/command.js | 'use strict';
const { spawn } = require('child_process');
const PluginError = require('plugin-error');
// Execute a shell command
const execCommand = function (command) {
const [commandA, ...args] = command.trim().split(/ +/);
const child = spawn(commandA, args, { stdio: 'inherit' });
// eslint-disable-next-l... | 'use strict';
const { env } = require('process');
const { spawn } = require('child_process');
const PluginError = require('plugin-error');
// Execute a shell command
const execCommand = function (command) {
const [commandA, ...args] = command.trim().split(/ +/);
const envA = getEnv();
const child = spawn(comma... | Fix ./node_modules/.bin not being in $PATH for Gulp | Fix ./node_modules/.bin not being in $PATH for Gulp
| JavaScript | apache-2.0 | autoserver-org/autoserver,autoserver-org/autoserver |
93a264cc70674f6d63b7373f0b0200c27567ee89 | js/game.js | js/game.js | // Game Controller
// A checkers board has 64 squares like a chess board but it only uses 32 squares all the same color
// Each player has 12 pieces and pieces that make until the last squares on the enemy side is promoted
// Promoted piece also moves on diagonals with no limit of squares if it is free
// The moves are... | // Game Controller
// A checkers board has 64 squares like a chess board but it only uses 32 squares all the same color
// Each player has 12 pieces and pieces that make until the last squares on the enemy side is promoted
// Promoted piece also moves on diagonals with no limit of squares if it is free
// The moves are... | Delete flattenBoard prototype and initialize flattenBoard as a variable | Delete flattenBoard prototype and initialize flattenBoard as a variable
| JavaScript | mit | RenanBa/checkers-v1,RenanBa/checkers-v1 |
480c10d5576450a603e4dbc0c211c15da395775a | test/assertTheUnexpected.js | test/assertTheUnexpected.js | var assert = require('../lib/assertTheUnexpected');
var expect = require('unexpected');
describe('assertTheUnexpected', function () {
describe('deepEqual', function () {
it('should compare objects with loosely equal property (lhs)', function () {
expect(function () {
assert.deepEqual({ a: 1 }, { a:... | var assert = require('../lib/assertTheUnexpected');
var expect = require('unexpected');
describe('assertTheUnexpected', function () {
describe('deepEqual', function () {
it('should compare objects with loosely equal property (lhs)', function () {
expect(function () {
assert.deepEqual({ a: 1 }, { a:... | Check the unwated exception string case. | Check the unwated exception string case.
| JavaScript | bsd-3-clause | alexjeffburke/assert-the-unexpected |
3e5676a945453585b9bc05c3bd22d2aefc678183 | gulpfile.js | gulpfile.js | var gulp = require("gulp");
var sass = require("gulp-sass");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass({
// includePaths: require('node-bourbon').with('other/path', 'another/path')
// - or -
includePaths: require('node-bourbon').... | var gulp = require("gulp");
var sass = require("gulp-sass");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
.pipe(gulp.dest('dist'));
});
| Remove bourbon options for new version | Remove bourbon options for new version
| JavaScript | mit | erdoganbulut/hipster-grid-system |
00d095ab29cee7b93b269158b894229cc63ca28b | gulp/watch.js | gulp/watch.js | 'use strict';
var gulp = require('gulp');
gulp.task('watch', ['jade', 'wiredep', 'styles'], function () {
gulp.watch('app/styles/**/*.sass', ['styles']);
gulp.watch('app/scripts/**/*.js', ['scripts']);
gulp.watch('app/images/**/*', ['images']);
gulp.watch('bower.json', ['wiredep']);
gulp.start('watch:jade'... | 'use strict';
var gulp = require('gulp');
gulp.task('watch', ['jade', 'wiredep', 'styles'], function () {
gulp.watch('app/styles/**/*.sass', ['styles']);
gulp.watch('bower.json', ['wiredep']);
gulp.start('watch:jade');
});
| Remove other irrelevant steps from gulp serve. | Remove other irrelevant steps from gulp serve.
| JavaScript | mit | tvararu/angular-famous-playground |
d4d32f7d745eb0bbefbd2e1760dfe7fa329d83f9 | bin/emcc-path.js | bin/emcc-path.js | #!/usr/bin/env node
// This script prints out the absolute path to the emcc wrapper script in
// this directory. node-gyp make_global_settings CXX and LINK require
// absolute paths to the compiler.
process.stdout.write(require.resolve('nbind/bin/emcc'));
| #!/usr/bin/env node
// This script prints out the absolute path to the emcc wrapper script in
// this directory. node-gyp make_global_settings CXX and LINK require
// absolute paths to the compiler.
process.stdout.write(require('path').resolve(__dirname, 'emcc'));
| Fix loading asm.js code without running "npm link nbind". | Fix loading asm.js code without running "npm link nbind".
| JavaScript | mit | charto/nbind,charto/nbind,charto/nbind,charto/nbind,charto/nbind,charto/nbind |
ea7b0d2cf7322a7d38760d654b2bdeb931ddb1cd | bin/sitespeed.js | bin/sitespeed.js | #!/usr/bin/env node
/*eslint no-console: 0*/
'use strict';
const cli = require('../lib/support/cli'),
sitespeed = require('../lib/sitespeed'),
Promise = require('bluebird');
if (process.env.NODE_ENV !== 'production') {
require('longjohn');
}
Promise.config({
warnings: true,
longStackTraces: true
});
pro... | #!/usr/bin/env node
/*eslint no-console: 0*/
'use strict';
const cli = require('../lib/support/cli'),
sitespeed = require('../lib/sitespeed'),
Promise = require('bluebird');
if (process.env.NODE_ENV !== 'production') {
require('longjohn');
}
Promise.config({
warnings: true,
longStackTraces: true
});
pro... | Fix syntax error (return outside function). | Fix syntax error (return outside function).
Need to fix this for code to be parsable by prettier.
| JavaScript | mit | sitespeedio/sitespeed.io,JeroenVdb/sitespeed.io,beenanner/sitespeed.io,JeroenVdb/sitespeed.io,JeroenVdb/sitespeed.io,sitespeedio/sitespeed.io,beenanner/sitespeed.io,sitespeedio/sitespeed.io,sitespeedio/sitespeed.io,beenanner/sitespeed.io |
1864b372420d0516c46bb2117105c5ec5668c2d7 | addon/utils/render-tooltip.js | addon/utils/render-tooltip.js | /**
A utility to attach a tooltip to a DOM element.
@submodule utils
@method renderTooltip
@param {Element} domElement The DOM element, not jQuery element, to attach the tooltip to
@param {Object} options The tooltip options to render the tooltip with. For supported options, see the tooltipSupportedProperties array in... | /**
A utility to attach a tooltip to a DOM element.
@submodule utils
@method renderTooltip
@param {Element} domElement The DOM element, not jQuery element, to attach the tooltip to
@param {Object} options The tooltip options to render the tooltip with. For supported options, see the tooltipSupportedProperties array in... | Allow duration to be provided as a string | Allow duration to be provided as a string
| JavaScript | mit | zenefits/ember-tooltips,sir-dunxalot/ember-tooltips,maxhungry/ember-tooltips,maxhungry/ember-tooltips,zenefits/ember-tooltips,sir-dunxalot/ember-tooltips |
3839878007be52b7aeeab536ca2394f2df351706 | modules/mixins/match-media-base.js | modules/mixins/match-media-base.js | var React = require('react');
var debounce = require('lodash/function/debounce');
var matchers = {};
var mediaChangeCallback;
var onMediaChange = function () {
mediaChangeCallback();
};
var MatchMediaBase = {
childContextTypes: {
mediaQueries: React.PropTypes.object
},
getChildContext: function () {
... | var React = require('react');
var debounce = require('lodash/function/debounce');
var matchers = {};
var mediaChangeCallback;
var onMediaChange = function () {
mediaChangeCallback();
};
var MatchMediaBase = {
childContextTypes: {
mediaQueries: React.PropTypes.object
},
getChildContext: function () {
... | Fix for prerender, ensure window exists | Fix for prerender, ensure window exists
| JavaScript | mit | jurgob/radium,dabbott/radium,Cottin/radium,yetone/radium,FormidableLabs/radium,clessg/radium,andyhite/radium,KenPowers/radium,haridusenadeera/radium,andyhite/radium,haridusenadeera/radium,basarat/radium,azazdeaz/radium,KenPowers/radium,lexical-labs/radium,yetone/radium,Cottin/radium,bencao/radium,MicheleBertoli/radium,... |
bdc8230b976029255fb7ef78972292b176b81577 | src/filters/calendarDate.js | src/filters/calendarDate.js | 'use strict';
var angular = require('angular');
angular
.module('mwl.calendar')
.filter('calendarDate', function(calendarHelper, calendarConfig) {
function calendarDate(date, format, getFromConfig) {
if (getFromConfig === true) {
format = calendarConfig.dateFormats[format];
}
retu... | 'use strict';
var angular = require('angular');
angular
.module('mwl.calendar')
.filter('calendarDate', function(calendarHelper, calendarConfig) {
function calendarDate(date, format, getFromConfig) {
if (getFromConfig === true) {
format = calendarConfig.dateFormats[format];
}
retu... | Add comment as to why the filter is stateful | Add comment as to why the filter is stateful
| JavaScript | mit | AladdinSonni/angular-bootstrap-calendar,abrahampeh/angular-bootstrap-calendar,yukisan/angular-bootstrap-calendar,mattlewis92/angular-bootstrap-calendar,seawenzhu/angular-bootstrap-calendar,plantwebdesign/angular-bootstrap-calendar,asurinov/angular-bootstrap-calendar,LandoB/angular-bootstrap-calendar,polarbird/angular-b... |
7754edb8947c8f1e8509d9bac058bb9754915eb6 | app/views/index.js | app/views/index.js | import Ember from 'ember';
import config from '../config/environment';
export default Ember.View.extend({
injectMarkup: function() {
console.log(command);
var content = Ember.$('#index-content').clone();
var source = $(this.$().children()[0]).clone();
content.find('#package-source-placeholder').repl... | import Ember from 'ember';
export default Ember.View.extend({
injectMarkup: function() {
var content = Ember.$('#index-content').clone();
var source = Ember.$(this.$().children()[0]).clone();
content.find('#package-source-placeholder').replaceWith(source);
var command = Ember.$(this.$().children()[... | Append content instead of replacing and clean up lint errors. | Append content instead of replacing and clean up lint errors.
| JavaScript | apache-2.0 | Stift/Klondike,jochenvangasse/Klondike,davidvmckay/Klondike,fhchina/Klondike,themotleyfool/Klondike,jochenvangasse/Klondike,fhchina/Klondike,themotleyfool/Klondike,themotleyfool/Klondike,davidvmckay/Klondike,jochenvangasse/Klondike,fhchina/Klondike,Stift/Klondike,davidvmckay/Klondike,Stift/Klondike |
1aa4a4edbfc0d6d8ad3495261a8b588ae52e739a | logging.js | logging.js | const fs = require('fs');
const sysout = console.log;
function toFile(log) {
fs.appendFile("./latest.log", log);
}
const out = log => {
sysout(log);
toFile(log);
};
console.log = log => {
let d = new Date();
log = `[${d.toString()} LOG] ${log}`;
out(log);
};
console.info = console.log;
console.e... | const fs = require('fs');
const sysout = console.log;
function toFile(log) {
fs.appendFile("./latest.log", log, () => {});
}
const out = log => {
sysout(log);
toFile(log);
};
console.log = log => {
let d = new Date();
log = `[${d.toString()} LOG] ${log}`;
out(log);
};
console.info = console.log;... | Fix the async deprecation error in node7 | Fix the async deprecation error in node7
| JavaScript | mit | Lunar-Skies/Hamster |
e1283f28e5fe1ef2a9e6ff8fa443eeaefd79d368 | src/scope.js | src/scope.js | //
// Copyright 2015 Google Inc. 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 by applica... | //
// Copyright 2015 Google Inc. 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 by applica... | Set testing to window if testing enabled | Set testing to window if testing enabled
| JavaScript | apache-2.0 | css-typed-om/typed-om,wilddamon/typed-om,css-typed-om/typed-om,samthor/typed-om,samthor/typed-om,wilddamon/typed-om,anthony-huang/typed-om,anthony-huang/typed-om |
fb6d7e2fb3b179b6f78d2bd07f60b977cb60801b | src/store.js | src/store.js | import hashHistory from 'react-router/lib/hashHistory';
import { routerMiddleware } from 'react-router-redux';
import Raven from 'raven-js';
import createRavenMiddleware from 'raven-for-redux';
import thunkMiddleware from 'redux-thunk';
import promiseMiddleware from 'redux-simple-promise';
import { createStore, applyMi... | import hashHistory from 'react-router/lib/hashHistory';
import { routerMiddleware } from 'react-router-redux';
import Raven from 'raven-js';
import createRavenMiddleware from 'raven-for-redux';
import thunkMiddleware from 'redux-thunk';
import promiseMiddleware from 'redux-simple-promise';
import { createStore, applyMi... | Fix local development when redux tools unavailable | Fix local development when redux tools unavailable
| JavaScript | apache-2.0 | mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools |
1a1e8565da60d70551716b92042945596b2f1e66 | app/edit-contribution/route.js | app/edit-contribution/route.js | import Ember from 'ember'
import AuthenticatedRouteMixin
from 'ember-simple-auth/mixins/authenticated-route-mixin'
const { Route, inject } = Ember
export default Route.extend(AuthenticatedRouteMixin, {
currentUser: inject.service(),
model({ id }) {
return this.store.findRecord('contribution', id)
},
a... | import Ember from 'ember'
import AuthenticatedRouteMixin
from 'ember-simple-auth/mixins/authenticated-route-mixin'
const { Route, inject } = Ember
export default Route.extend(AuthenticatedRouteMixin, {
currentUser: inject.service(),
model({ id }) {
return this.store.findRecord('contribution', id)
},
a... | Make sure the challenge is loaded in the edit-contribution form too | Make sure the challenge is loaded in the edit-contribution form too
| JavaScript | mit | opensource-challenge/opensource-challenge-client,opensource-challenge/opensource-challenge-client |
8ed3e776fadb2535c073e67a89455da99420af1f | app/components/ExampleTree.js | app/components/ExampleTree.js | import React, { Component } from 'react';
import { Link } from 'react-router';
import Header from '../containers/Header';
import Visualizer from './Visualizer';
import { flatten, augment, pause, highlight } from '../utils/vertTreeUtils';
import * as structures from '../utils/TreeStructures';
export default class Examp... | import React, { Component } from 'react';
import Header from '../containers/Header';
import Visualizer from './Visualizer';
import { flatten, augment, pause, highlight } from '../utils/vertTreeUtils';
import * as structures from '../utils/TreeStructures';
export default class ExampleTree extends Component {
construc... | Allow example tree component to display any data structure | Allow example tree component to display any data structure
| JavaScript | mit | ivtpz/brancher,ivtpz/brancher |
e4fb7e75645bb05d6acdaee11fcc03410c022aee | app/pages/PageWrapper.spec.js | app/pages/PageWrapper.spec.js | import { shallow } from 'enzyme';
import React from 'react';
import Grid from 'react-bootstrap/lib/Grid';
import PageWrapper from './PageWrapper';
describe('pages/PageWrapper', () => {
const defaultProps = {
className: 'test-page',
title: 'Test title',
};
function getWrapper(extraProps) {
return sh... | import { shallow } from 'enzyme';
import React from 'react';
import Grid from 'react-bootstrap/lib/Grid';
import PageWrapper from './PageWrapper';
describe('pages/PageWrapper', () => {
const defaultProps = {
className: 'test-page',
title: 'Test title',
};
function getWrapper(extraProps) {
return sh... | Remove not needed test from PageWrapper | Remove not needed test from PageWrapper
| JavaScript | mit | fastmonkeys/respa-ui |
a1ad95957a0c623d69393b013a2355bc79bfe490 | karma.conf.js | karma.conf.js | const reporters = ['mocha', 'coverage']
if (process.env.COVERALLS_REPO_TOKEN) {
reporters.push('coveralls')
}
module.exports = function (config) {
config.set({
singleRun: true,
browsers: ['Firefox'],
frameworks: ['mocha'],
reporters,
coverageReporter: {
dir: 'build/coverage',
report... | const reporters = ['mocha', 'coverage']
if (process.env.COVERALLS_REPO_TOKEN) {
reporters.push('coveralls')
}
module.exports = function (config) {
config.set({
singleRun: true,
browsers: ['Firefox'],
frameworks: ['mocha'],
reporters,
coverageReporter: {
dir: 'build/coverage',
report... | Switch unit test stubs to sinon-chrome-webextensions.min.js | Switch unit test stubs to sinon-chrome-webextensions.min.js
| JavaScript | cc0-1.0 | lidel/ipfs-firefox-addon,lidel/ipfs-firefox-addon,lidel/ipfs-firefox-addon |
567317db207c3cc3333110770738e59ffac7cbdd | lib/common.js | lib/common.js | var crypto = require('crypto');
exports.randomValueHex = function(len) {
return crypto.randomBytes(Math.ceil(len/2))
.toString('hex') // convert to hexadecimal format
.slice(0,len); // return required number of characters
};
exports.randomInt = function (low, high) {
return Math.floor(Math... | var crypto = require('crypto');
/**
* Returns random hex string of the given length.
* @param {int} length Length of the generated string.
* @returns {string}
*/
exports.randomValueHex = function(length) {
return crypto.randomBytes(Math.ceil(length/2))
.toString('hex') // convert to hexadecimal f... | Add comments and refactor variable names. | Add comments and refactor variable names.
| JavaScript | mit | MattiLehtinen/ai-nibbles-server |
988e89245f6f06303406a7589908f4a13dc2e03c | lib/mixins.js | lib/mixins.js | "use strict";
const P = require('bluebird');
const redis = require('redis');
const HyperSwitch = require('hyperswitch');
const Redis = superclass => class extends superclass {
constructor(options) {
super(options);
if (!options.redis) {
throw new Error('Redis options not provided to t... | "use strict";
const P = require('bluebird');
const redis = require('redis');
const HyperSwitch = require('hyperswitch');
const Redis = superclass => class extends superclass {
constructor(options) {
super(options);
if (!options.redis) {
throw new Error('Redis options not provided to t... | Use arguments instead of the spread operator | Use arguments instead of the spread operator
| JavaScript | apache-2.0 | wikimedia/change-propagation,Pchelolo/change-propagation,wikimedia/change-propagation,Pchelolo/change-propagation,d00rman/restbase-mod-queue-kafka |
b1ed7d1d1681205365cce24f7448f41c91af46ff | lib/plugin.js | lib/plugin.js | import loadPath from './loadPath';
export default plugin;
/**
* Fetch a plugin (much like "require")
* @param {String} path - Path to plugin.
* @return {Multi} The package that was requested.
*/
function plugin(path) {
path = loadPath('plugin', path);
return require(path);
}
| import loadPath from './loadPath';
import app from 'app';
export default plugin;
/**
* Fetch a plugin (much like "require")
* @param {String} path - Path to plugin.
* @return {Multi} The package that was requested.
*/
function plugin(path) {
let pack = {};
path = loadPath('plugin', path);
pack = fs.readFile... | Add loading of main process. | Add loading of main process.
| JavaScript | mit | JamenMarz/cluster,JamenMarz/vint |
d14430267f7988fb1b114388cbbcb2592c84e654 | esm/list.js | esm/list.js | import { setChildren } from './setchildren.js';
import { ensureEl } from './util.js';
import { unmount } from './unmount.js';
import { ListPool } from './listpool.js';
export const list = (parent, View, key, initData) => {
return new List(parent, View, key, initData);
};
export class List {
constructor (parent, V... | import { setChildren } from './setchildren.js';
import { ensureEl } from './util.js';
import { unmount } from './unmount.js';
import { ListPool } from './listpool.js';
export const list = (parent, View, key, initData) => {
return new List(parent, View, key, initData);
};
export class List {
constructor (parent, V... | Add white space for readability, use for...of | Add white space for readability, use for...of
| JavaScript | mit | pakastin/redom,redom/redom |
5d1fb07c7a7cc110bdfb57df88347bb9e4df8cc0 | mbz-shortcuts.user.js | mbz-shortcuts.user.js | /* global $ _ requests sidebar */
'use strict';
// ==UserScript==
// @name MusicBrainz: Shortcuts
// @namespace mbz-joseffriedrich
// @author Josef Friedrich
// @version 1
// @downloadURL https://raw.githubusercontent.com/Josef-Friedrich/greasemonkey-user-scripts/master/mbz-shortcuts.user.js
// @... | /* global $ _ requests sidebar */
'use strict';
// ==UserScript==
// @name MusicBrainz: Shortcuts
// @namespace mbz-joseffriedrich
// @author Josef Friedrich
// @version 2
// @downloadURL https://raw.githubusercontent.com/Josef-Friedrich/greasemonkey-user-scripts/master/mbz-shortcuts.user.js
// @... | Use jquery to add attributes | Use jquery to add attributes
| JavaScript | mit | Josef-Friedrich/greasemonkey-user-scripts,Josef-Friedrich/greasemonkey-user-scripts |
f5aa937ea3ef9e08ab3bd7a735347d1fe7d62aef | package.js | package.js | Package.describe({
"summary": "Add feature flagging to Meteor"
});
Package.on_use(function (api) {
api.use('coffeescript', ['server', 'client']);
api.use(['deps','handlebars','jquery'], 'client');
api.use('underscore', 'server');
api.add_files('server/server_flag.coffee', 'server')
api.add_file... | Package.describe({
"summary": "Add feature flagging to Meteor"
});
Package.on_use(function (api) {
api.use('coffeescript', ['server', 'client']);
api.use(['deps','handlebars','jquery'], 'client');
api.use('underscore', 'server');
api.use('accounts-base', ['client'])
api.add_files('server/server... | Add dependency on accounts-base API for client | Add dependency on accounts-base API for client
| JavaScript | mit | recursivefaults/meteor-feature-flag |
aba3b1fc7e578ae2d41873b21ad6883eaeaac013 | samples/webpack/statusconsole/webpack.config.js | samples/webpack/statusconsole/webpack.config.js | const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
}
]
}
}; | const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
}
]
},
externals: {
fs: ... | Fix to status console webpack | Fix to status console webpack
Resolves "Error: Can't resolve 'fs'" in the statusConsole build
| JavaScript | epl-1.0 | ibm-watson-iot/iot-nodejs |
1aafb6945c9be885eb6bb5fd6db72d97a565e4bf | plugins/file-open-save/core/src/main/javascript/app/shared/directives/focus.directive.js | plugins/file-open-save/core/src/main/javascript/app/shared/directives/focus.directive.js | /*!
* Copyright 2017 Pentaho Corporation. 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 by a... | /*!
* Copyright 2017 Pentaho Corporation. 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 by a... | Fix for input box focus | [BACKLOG-18075] Fix for input box focus
| JavaScript | apache-2.0 | pavel-sakun/pentaho-kettle,flbrino/pentaho-kettle,TatsianaKasiankova/pentaho-kettle,stepanovdg/pentaho-kettle,AlexanderBuloichik/pentaho-kettle,pentaho/pentaho-kettle,stepanovdg/pentaho-kettle,lgrill-pentaho/pentaho-kettle,ccaspanello/pentaho-kettle,aminmkhan/pentaho-kettle,ddiroma/pentaho-kettle,rmansoor/pentaho-kettl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.