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 |
|---|---|---|---|---|---|---|---|---|---|
8a484b2e8845a48785bf16134c40f843f1452e56 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var zip = require('gulp-zip');
gulp.task('default', ['package'], function() {
// place code for your default task here
});
gulp.task('package', function() {
return gulp.src(['./*', 'vendor/*', '!archive.zip', '!gulpfile.js', '!package.json'], { base: '.' })
.pipe(zip('archive.zip')... | var gulp = require('gulp');
var zip = require('gulp-zip');
gulp.task('default', ['package'], function() {
// place code for your default task here
});
gulp.task('package', function() {
return gulp.src([
'./*',
'vendor/*',
'icons/*',
'!archive.zip',
'!gulpfile.js',
'!package.json'
], { ba... | Add icon files to the archive also | Add icon files to the archive also
| JavaScript | mit | rtc-io/demo-helloworld,rtc-io/demo-helloworld,rtc-io/demo-helloworld |
13ae1035d3e90fc1a6f5715f6f5039c5433577bf | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var gutil = require('gulp-util');
gulp.task('lint', function() {
return gulp.src(['./src/**/*.js', './test/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
function test(srcPath) {
... | var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var gutil = require('gulp-util');
gulp.task('lint', function() {
return gulp.src(['./src/**/*.js', '!./src/static/bower_components{,**}',
'./test/**/*.js'])
.pipe(jshint())
.pipe... | Exclude bower components from linting | Exclude bower components from linting
| JavaScript | bsd-2-clause | jeffcharles/poleland,jeffcharles/poleland,jeffcharles/poleland |
9500c460db0a55b6ae2300375d8cab4257dea646 | scripts/app.js | scripts/app.js | 'use strict';
var React = require('react');
var Table = require('./table.jsx');
var App = React.createClass({
render() {
var config = {
columns: [
{
property: 'name',
editable: true,
header: 'Name',
}... | 'use strict';
var React = require('react');
var Table = require('./table.jsx');
var App = React.createClass({
render() {
var countries = {
'de': 'Germany',
'fi': 'Finland',
'se': 'Sweden'
};
var config = {
columns: [
{
... | Add an example with a country lookup | Add an example with a country lookup
| JavaScript | mit | adjohnson916/reactabular,kaushik94/reactabular,reactabular/reactabular,reactabular/reactabular,rdoh/reactabular,megawidget/reactabular,kaushik94/reactabular,megawidget/reactabular,adjohnson916/reactabular |
8acbf7e3e5269ef9741759247ff50fb9b62de6a2 | source/application/formatKeyForPlatform.js | source/application/formatKeyForPlatform.js | import '../core/String'; // For String#capitalise
import { isApple } from '../ua/UA';
const platformKeys = {
ArrowUp: '↑',
ArrowDown: '↓',
ArrowRight: '→',
ArrowLeft: '←',
Alt: isApple ? '⌥' : 'Alt-',
Cmd: isApple ? '⌘' : 'Ctrl-',
Ctrl: isApple ? '⌃' : 'Ctrl-',
Meta: isApple ? '⌘' : 'M... | import '../core/String'; // For String#capitalise
import { isApple } from '../ua/UA';
const platformKeys = {
ArrowUp: '↑',
ArrowDown: '↓',
ArrowRight: '→',
ArrowLeft: '←',
Alt: isApple ? '⌥' : 'Alt-',
Cmd: isApple ? '⌘' : 'Ctrl-',
Ctrl: isApple ? '⌃' : 'Ctrl-',
Meta: isApple ? '⌘' : 'M... | Enforce platform specific ordering of modifiers | Enforce platform specific ordering of modifiers
| JavaScript | mit | fastmail/overture |
d7993a889961d7e8a15c14d9cd4a6064527404f3 | src/components/entity/ha-entity-marker.js | src/components/entity/ha-entity-marker.js | import Polymer from '../../polymer';
require('../../components/ha-label-badge');
export default new Polymer({
is: 'ha-entity-marker',
properties: {
hass: {
type: Object,
},
entityId: {
type: String,
value: '',
reflectToAttribute: true,
},
state: {
type: Object,... | import Polymer from '../../polymer';
require('../../components/ha-label-badge');
/*
Leaflet clones this element before adding it to the map. This messes up
our Poylmer object and we lose the reference to the `hass` object.
That's why we refer here to window.hass instead of the hass property.
*/
export default new P... | Add comment explaining weird map behavior | Add comment explaining weird map behavior
| JavaScript | apache-2.0 | sdague/home-assistant-polymer,sdague/home-assistant-polymer |
3902bb16040a943041df624d4c05028de0dde8f0 | gulpfile.js | gulpfile.js | const gulp = require('gulp');
const mocha = require('gulp-mocha');
gulp.task('test', () =>
gulp.src('./tests/test-*', {read: false})
.pipe(mocha())
);
gulp.task('watch', () =>
gulp.watch('src/**', ['test'])
);
| const gulp = require('gulp');
const mocha = require('gulp-mocha');
gulp.task('test', () =>
gulp.src('./tests/test-*', {read: false})
.pipe(mocha())
);
gulp.task('watch', () =>
gulp.watch(['src/**', 'tests/**'], ['test'])
);
| Watch for changes in the tests directory | Watch for changes in the tests directory
| JavaScript | mpl-2.0 | thejsninja/syrup |
3c6bcf74ba944d94a9e2b4d45bd1b03c26857d59 | test/issues/load-css/main.js | test/issues/load-css/main.js | define(function(require) {
var test = require('../../test')
var $ = require('../../third-party').jQuery
var count = 0
// normal case
require('./red.css')
test.assert($('#red').width() === 200, '#red width should be 200')
// async case
test.assert($('#blue').width() !== 200, '#blue width should not ... | define(function(require) {
var test = require('../../test')
var $ = require('../../third-party').jQuery
var count = 0
// normal case
require('./red.css')
test.assert($('#red').width() === 200, '#red width should be 200')
// async case
test.assert($('#blue').width() !== 200, '#blue width should not ... | Make load-css test more robust | Make load-css test more robust
| JavaScript | mit | evilemon/seajs,PUSEN/seajs,wenber/seajs,tonny-zhang/seajs,eleanors/SeaJS,FrankElean/SeaJS,zaoli/seajs,judastree/seajs,JeffLi1993/seajs,tonny-zhang/seajs,twoubt/seajs,tonny-zhang/seajs,FrankElean/SeaJS,lee-my/seajs,baiduoduo/seajs,AlvinWei1024/seajs,kaijiemo/seajs,coolyhx/seajs,jishichang/seajs,seajs/seajs,13693100472/s... |
a0db2849f621177d635c648d6046d3b7c4e7450d | app/components/Dashboard/GenresTab/index.js | app/components/Dashboard/GenresTab/index.js | import React from 'react';
import { Tab } from 'semantic-ui-react';
import Img from 'react-image-smooth-loading';
import genreToIcon from './mapGenres';
import styles from './styles.scss';
const bannedGenres = [
'seen live'
];
class GenresTab extends React.Component {
constructor(props) {
super(props);
}
... | import React from 'react';
import { Tab } from 'semantic-ui-react';
import Img from 'react-image-smooth-loading';
import genreToIcon from './mapGenres';
import styles from './styles.scss';
const bannedGenres = [
'seen live'
];
class GenresTab extends React.Component {
constructor(props) {
super(props);
}
... | Fix genre background image URI | Fix genre background image URI
| JavaScript | agpl-3.0 | nukeop/nuclear,nukeop/nuclear,nukeop/nuclear,nukeop/nuclear |
653e3d91acb2240d4331c1521d919fbc5cae9596 | commands/kill.js | commands/kill.js | 'use strict';
const CommandUtil = require('../src/command_util').CommandUtil;
const l10nFile = __dirname + '/../l10n/commands/kill.yml';
const l10n = require('../src/l10n')(l10nFile);
const util = require('util');
exports.command = (rooms, items, players, npcs, Commands) => {
return (args, player) => {
cons... | 'use strict';
const CommandUtil = require('../src/command_util').CommandUtil;
const l10nFile = __dirname + '/../l10n/commands/kill.yml';
const l10n = require('../src/l10n')(l10nFile);
const util = require('util');
exports.command = (rooms, items, players, npcs, Commands) => {
return (args, player) => {
cons... | Add some checks to see if the npc is already fighting... for now. | Add some checks to see if the npc is already fighting... for now.
| JavaScript | mit | shawncplus/ranviermud,seanohue/ranviermud,seanohue/ranviermud |
64716bd98aac8f1b176bba9ddc87c4a9409cc5f9 | servo/servo.js | servo/servo.js | var worker = new Worker('servo-worker.js');
var renderer;
worker.addEventListener("message", function(event) {
var cmd = event.data[0];
var data = event.data[1];
switch(cmd) {
case "log":
console.log("WORKER", data);
break;
case "warn":
console.warn("WORKER", data);
... | var worker = new Worker('servo-worker.js');
var renderer;
worker.addEventListener("message", function(event) {
var cmd = event.data[0];
var data = event.data[1];
switch(cmd) {
case "log":
console.log("WORKER", data);
break;
case "warn":
console.warn("WORKER", data);
... | Set the location bar to an absolute url at startup. | Set the location bar to an absolute url at startup.
| JavaScript | bsd-2-clause | andreasgal/dom.js,modulexcite/dom.js,modulexcite/dom.js,modulexcite/dom.js |
2eda3d73a6d368cc27187154077568424d13de04 | fontawesome.js | fontawesome.js | hexo.extend.tag.register('fa', function(args) {
return '<i class="fa ' + args.map(function(arg) { return 'fa-' + arg; }).join(' ') + '"></i>';
});
| hexo.extend.tag.register('fa', function(args) {
return '<i class="fa ' + args.map(function(arg) { return 'fa-' + arg; }).join(' ') + '"></i>';
});
hexo.extend.tag.register('fas', function(args) {
return '<i class="fas ' + args.map(function(arg) { return 'fa-' + arg; }).join(' ') + '"></i>';
});
hexo.extend.ta... | Add FA 5 prefixes to hexo extended tags | Add FA 5 prefixes to hexo extended tags
| JavaScript | mit | akarzim/hexo-tag-fontawesome |
a87948432f7d93e629e4b0b02f31ac60ddf43827 | src/middleware/verifySettings.js | src/middleware/verifySettings.js | module.exports = {
priority: 5,
process: async container => {
const { client, msg, isPrivate, data, db } = container
try {
if (isPrivate) {
let channel = await client.getDMChannel(msg.author.id)
container.settings = new db.Guild({ id: channel.id })
return container
}
... | module.exports = {
priority: 5,
process: async container => {
const { client, msg, isPrivate, data, db } = container
try {
if (isPrivate) {
const channel = await client.getDMChannel(msg.author.id)
container.settings = new db.Guild({ id: channel.id })
return container
}
... | Fix middleware instantiating new Guild entry | :bug: Fix middleware instantiating new Guild entry
| JavaScript | agpl-3.0 | pyraxo/haru |
c91ea6d47f390acc66051699c32d1eeeabae543e | src/middlewares/redux-pouchdb.js | src/middlewares/redux-pouchdb.js | import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
const storage = store => next => async action => {
const prevState = store.getState();
const result = next(action);... | import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
const applyChanges = async (nextState, prevState) => {
try {
const storedDocument = await getDocument(prevState.p... | Fix pouchdb middleware to handle conflict and retry to update a document | Fix pouchdb middleware to handle conflict and retry to update a document
| JavaScript | mit | nikolay-radkov/EBudgie,nikolay-radkov/EBudgie,nikolay-radkov/EBudgie |
8e503c1b5cd77a60fecd7ffef182ff58ac0bb6ad | app/assets/javascripts/finance.js | app/assets/javascripts/finance.js | Finance = {
currencyOptions: {
symbol: '€',
negativeFormat: "-%s%n",
digitGroupSymbol: '.',
decimalSymbol: ','
}
};
$(document).on("page:change", function(){
var financeTable = $("table.finance-table");
if(financeTable.length > 0){
new FinanceTable(financeTable).create();
}
var busine... | Finance = {
currencyOptions: {
symbol: '€',
negativeFormat: "-%s%n"
}
};
$(document).on("page:change", function(){
var financeTable = $("table.finance-table");
if(financeTable.length > 0){
new FinanceTable(financeTable).create();
}
var businessCaseTable = $("#business_case_table");
if(busi... | Use decimal point money formatting | Use decimal point money formatting
| JavaScript | mit | quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses |
7f42ccce959332d8f20bd93540cb73bc05218b75 | app/scripts/controllers/search.js | app/scripts/controllers/search.js | 'use strict';
/**
* @ngdoc function
* @name ausEnvApp.controller:SearchCtrl
* @description
* # SearchCtrl
* Controller of the ausEnvApp
*/
angular.module('ausEnvApp')
.controller('SearchCtrl', function ($scope,$filter,staticData,selection,spatialFoci) {
$scope.selection = selection;
$scope.loadingPolyg... | 'use strict';
/**
* @ngdoc function
* @name ausEnvApp.controller:SearchCtrl
* @description
* # SearchCtrl
* Controller of the ausEnvApp
*/
angular.module('ausEnvApp')
.controller('SearchCtrl', function ($scope,$filter,staticData,selection,spatialFoci) {
$scope.selection = selection;
$scope.loadingPolyg... | Fix for the never disappearing loading icon | Fix for the never disappearing loading icon
| JavaScript | bsd-2-clause | ANU-WALD/aus-env,ANU-WALD/aus-env,ANU-WALD/aus-env,ANU-WALD/aus-env |
780b3de95e9bd1edcd30eeb2e8178e00f880371f | webpack.config.js | webpack.config.js | var path = require('path');
var webpack = require('webpack');
var Clean = require('clean-webpack-plugin');
var plugins = [
new Clean(['dist'])
];
module.exports = {
entry: path.resolve(__dirname, 'src/index.js'),
plugins: plugins,
externals: {
clappr: 'Clappr',
"clappr-zepto": "clappr-zepto"
},
mo... | var path = require('path');
var webpack = require('webpack');
var Clean = require('clean-webpack-plugin');
var plugins = [
new Clean(['dist'])
];
module.exports = {
entry: path.resolve(__dirname, 'src/index.js'),
plugins: plugins,
externals: {
clappr: 'Clappr'
},
module: {
loaders: [
{
... | Remove "clappr-zepto" external and "publlicPath" from webpack conf | Remove "clappr-zepto" external and "publlicPath" from webpack conf
| JavaScript | mit | tjenkinson/clappr-thumbnails-plugin,tjenkinson/clappr-thumbnails-plugin |
5d86104db40a70ce0f10ebde73bf294e06987ff7 | src/modifiers/changeCurrentBlockType.js | src/modifiers/changeCurrentBlockType.js | import { EditorState } from "draft-js";
const changeCurrentBlockType = (
editorState,
type,
text,
blockMetadata = {}
) => {
const currentContent = editorState.getCurrentContent();
const selection = editorState.getSelection();
const key = selection.getStartKey();
const blockMap = currentContent.getBlock... | import { EditorState } from "draft-js";
const changeCurrentBlockType = (
editorState,
type,
text,
blockMetadata = {}
) => {
const currentContent = editorState.getCurrentContent();
const selection = editorState.getSelection();
const key = selection.getStartKey();
const blockMap = currentContent.getBlock... | Fix changing the current block type | Fix changing the current block type
| JavaScript | mit | withspectrum/draft-js-markdown-plugin |
018cb982fbf7ee88e93e84492f8e040e3f58aa9f | lib/hooks/init/setting_usergroups_fetcher.js | lib/hooks/init/setting_usergroups_fetcher.js | // Register 'usergroups' special setting values fetcher.
// Allows to use `values: usergroups` in setting definitions.
'use strict';
var _ = require('lodash');
module.exports = function (N) {
function usergroups(env, callback) {
N.models.users.UserGroup
.find()
.select('_id short_name')
... | // Register 'usergroups' special setting values fetcher.
// Allows to use `values: usergroups` in setting definitions.
'use strict';
var _ = require('lodash');
module.exports = function (N) {
function usergroups(env, callback) {
N.models.users.UserGroup
.find()
.select('_id short_name')
... | Rename settings' `extensions.values` to `sandbox.selectionListFetchers`. | Rename settings' `extensions.values` to `sandbox.selectionListFetchers`.
| JavaScript | mit | nodeca/nodeca.users |
ad6663a99fb16de6548d8b520495db9add92bed6 | cfgov/unprocessed/js/modules/util/assign.js | cfgov/unprocessed/js/modules/util/assign.js | /* ==========================================================================
Assign
Code copied from the following with moderate modifications :
- https://github.com/maslennikov/shallow-extend
Copyright (c) 2014 Alexey Maslennikov
=====================================================================... | /* ==========================================================================
Assign
Code copied from the following with moderate modifications :
- https://github.com/maslennikov/shallow-extend
Copyright (c) 2014 Alexey Maslennikov
=====================================================================... | Fix for the burea page on Android 4.1 | Fix for the burea page on Android 4.1
| JavaScript | cc0-1.0 | kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh |
be99d62865da1981f4549559e546ae7d26da9b43 | server/routes/index.js | server/routes/index.js | import usersControllers from '../controllers';
import loginControllers from '../controllers';
const usersController = usersControllers.users;
const loginController = loginControllers.login;
module.exports = (app) => {
app.get('/api', (req, res) => res.status(200).send({
message: 'Welcome to the Todos API!',
... | import authControllers from '../controllers';
const usersController = authControllers.users;
const loginController = authControllers.login;
module.exports = (app) => {
app.get('/api', (req, res) => res.status(200).send({
message: 'Welcome to the Todos API!',
}));
app.post('/api/user/signin', loginControlle... | Refactor code using es6 syntax | Refactor code using es6 syntax
| JavaScript | mit | 3m3kalionel/PostIt,3m3kalionel/PostIt |
4c2e94a21e44091ba60809c5ac5cf38196e660ff | server/routes/index.js | server/routes/index.js | import authControllers from '../controllers';
const usersController = authControllers.users;
const loginController = authControllers.login;
const groupsController = authControllers.group;
const messagesController = authControllers.messages;
module.exports = (app) => {
app.get('/api', (req, res) => res.status(200).s... | import authControllers from '../controllers';
const usersController = authControllers.users;
const loginController = authControllers.login;
const groupsController = authControllers.group;
const messagesController = authControllers.messages;
module.exports = (app) => {
app.get('/api', (req, res) => res.status(200).s... | Add route function to retrieve group messages | Add route function to retrieve group messages
| JavaScript | mit | 3m3kalionel/PostIt,3m3kalionel/PostIt |
d4352b498f3d6c65f0454884d596253effb9932b | lib/entry.js | lib/entry.js | /**
* Module dependencies.
*/
var utils = require('./utils');
/**
* `Entry` constructor.
*
* An entry is conceptually a reverse route, used to map from a controller
* action to the URL pattern which dispatches to it.
*
* @api private
*/
function Entry(controller, action, pattern) {
this.controller = contro... | /**
* Module dependencies.
*/
var utils = require('./utils');
/**
* `Entry` constructor.
*
* An entry is conceptually a reverse route, used to map from a controller
* action to the URL pattern which dispatches to it.
*
* @api private
*/
function Entry(controller, action, pattern) {
this.controller = contro... | Fix to support path substitution with 0 value. | Fix to support path substitution with 0 value.
| JavaScript | mit | jaredhanson/chai-locomotive-helpers |
d4d460a83ccff41206c7edb168d4fc48e6cab58a | public/backbone/js/main.js | public/backbone/js/main.js | /* global BackboneWizard, Backbone, $ */
window.BackboneWizard = {
Models: {},
Collections: {},
Views: {},
Controllers: {},
Routers: {},
init: function () {
'use strict';
var self = this;
self.itemList = new BackboneWizard.Collections.ItemList();
self.transact... | /* global BackboneWizard, Backbone, $ */
window.BackboneWizard = {
Models: {},
Collections: {},
Views: {},
Controllers: {},
Routers: {},
init: function () {
'use strict';
var self = this;
self.itemList = new BackboneWizard.Collections.ItemList();
self.transact... | Set root option on history.start. | Set root option on history.start.
| JavaScript | mit | jonkemp/wizard-mvc |
4b4ef938a54219b946d5231620a9b9d55c9c2ef5 | test/directives/faSurfaceSpec.js | test/directives/faSurfaceSpec.js | 'use strict';
describe('faSurface', function() {
var element, $compile, $scope, $famous;
beforeEach(module('famous.angular'));
beforeEach(inject(function(_$compile_, _$rootScope_, _$famous_) {
$compile = _$compile_;
$scope = _$rootScope_.$new();
$famous = _$famous_;
element = $compile('<div></d... | 'use strict';
describe('faSurface', function() {
var element, $compile, $scope, $famous;
var compileFaSurface, getSurfaceProperties;
beforeEach(module('famous.angular'));
beforeEach(inject(function(_$compile_, _$rootScope_, _$famous_) {
$compile = _$compile_;
$scope = _$rootScope_.$new();
$famous... | Set up background-color test for faSurface. | Set up background-color test for faSurface.
| JavaScript | mpl-2.0 | itdoesnmakesense/famous-angular,cloud-envy/famous-angular,Famous/famous-angular,stonegithubs/famous-angular,cloud-envy/famous-angular,Famous/famous-angular,itdoesnmakesense/famous-angular,itdoesnmakesense/famous-angular,03128crz/famous-angular,SuPenguin/famous-angular,juan-rod/famous-angular,Famous/famous-angular,stone... |
3828fe7f6ace0e1d0c086cc91092bc966a6b6c27 | scripts/shBrushDiff.js | scripts/shBrushDiff.js | ;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
this.regexList = [
{ regex: /^\+\+\+ .*$/gm, css: 'color2' }, // new file
{ regex: /^\-\-\- .*$/gm, css: 'color2' }, // old file
{ regex: /^\s.*$/gm, css: 'col... | ;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
this.regexList = [
{ regex: /^\+\+\+ .*$/gm, css: 'color2' }, // new file
{ regex: /^\-\-\- .*$/gm, css: 'color2' }, // old file
{ regex: /^\s.*$/gm, css: 'colo... | Comment on 'unchanged' line for consistency | Comment on 'unchanged' line for consistency
| JavaScript | mit | rackerlabs/SyntaxHighlighter,nullice/syntaxhighlighter,2947721120/syntaxhighlighter,liuxulei/syntaxhighlighter,JulianVolodia/syntaxhighlighter,whouses/syntaxhighlighter,JulianVolodia/syntaxhighlighter,jonesgithub/syntaxhighlighter,tgckpg/BotanJS-SyntaxHighlighter,nullice/syntaxhighlighter,norux/syntaxhighlighter,glabcn... |
54d99cbdeba4bfd9af7f724ce11e61cc76862b39 | test/test-find-cursor-options.js | test/test-find-cursor-options.js | var insert = require('./insert')
insert('find cursor options', [{
hello: 'world1'
}, {
hello: 'world2'
}], function (db, t, done) {
var cursor = db.a.find().limit(1).skip(1)
var runs = 0
cursor.next(function loop (err, doc) {
if (!doc) {
t.equal(runs, 1)
done()
return
}
t.error... | var insert = require('./insert')
insert('find cursor options', [{
hello: 'world1'
}, {
hello: 'world2'
}], function (db, t, done) {
var cursor = db.a.find().sort({_id: 1}).limit(1).skip(1)
var runs = 0
cursor.next(function loop (err, doc) {
if (!doc) {
t.equal(runs, 1)
done()
return
... | Use cursor sort order to avoid tests fail due to sort order | Use cursor sort order to avoid tests fail due to sort order
| JavaScript | mit | mafintosh/mongojs,lionvs/mongojs |
87ae91dde8d70d399f71d5b5ccc941e4959d661c | lib/strings.js | lib/strings.js | 'use strict'
const sanitize = require('sanitize-html')
exports.html = html
exports.duration = duration
const allowedTags = [
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', 'li',
'b', 'i', 'strong', 'em', 'code', 'br', 'div', 'pre'
]
function html (str) {
if (typeof str !== 'string') r... | 'use strict'
const sanitize = require('sanitize-html')
exports.html = html
exports.duration = duration
const allowedTags = [
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', 'li',
'b', 'i', 'strong', 'em', 'code', 'br', 'div', 'pre'
]
function html (str) {
if (typeof str !== 'string') r... | Use Math to transform duration to seconds | Use Math to transform duration to seconds
| JavaScript | mit | michaelnisi/manger |
8125226eac2ae6eb0c8d699ce05054f2cc268b51 | client/actions/Layout.js | client/actions/Layout.js | module.exports = {
toggleMenu: function (context) {
context.dispatch('TOGGLE_LAYOUT_MENU')
},
openMenu: function (context) {
context.dispatch('OPEN_LAYOUT_MENU')
},
closeMenu: function (context) {
context.dispatch('CLOSE_LAYOUT_MENU')
}
}
| module.exports = {
sidebar: {
toggle: function (context) {
context.dispatch('TOGGLE_SIDEBAR')
},
open: function (context) {
context.dispatch('OPEN_SIDEBAR')
},
close: function (context) {
context.dispatch('CLOSE_SIDEBAR')
}
}
}
| Move sidebar layout actions to sidebar object | Move sidebar layout actions to sidebar object
| JavaScript | apache-2.0 | cesarandreu/bshed,cesarandreu/bshed |
84b455c1cc973fb9cebdf7a3b63b42d1ef2afb0f | modules/whois.js | modules/whois.js | 'use strict';
module.exports = function(config, ircbot) {
ircbot.addListener('raw', function(message) {
switch (message.command) {
case 'rpl_whoisidle':
ircbot._addWhoisData(message.args[1], 'signon', new Date(parseInt(message.args[3]) * 1000));
break;
case '338':
ircbot._addWhoisData(message.args... | 'use strict';
module.exports = function(config, ircbot) {
ircbot.addListener('raw', function(message) {
switch (message.command) {
case 'rpl_whoisidle':
ircbot._addWhoisData(message.args[1], 'signon', new Date(parseInt(message.args[3]) * 1000));
break;
case '338':
ircbot._addWhoisData(message.args... | Make sure info.nick is always set | Make sure info.nick is always set
| JavaScript | mit | initLab/irc-notifier |
4d61c920d052e86265c3fa0ed5d5dce608bf1fa7 | lib/radiian.js | lib/radiian.js | #!/usr/bin/env node
(function() {
'use strict';
var program = require('commander');
var packageInfo = require('../package.json');
var openurl = require('openurl');
program
.usage('[options]')
.description('Radiian creates Ansible provisioning files for immutable infrastructure on AWS.\n' +
' Ru... | #!/usr/bin/env node
(function() {
'use strict';
var program = require('commander');
var packageInfo = require('../package.json');
var openurl = require('openurl');
program
.usage('[options]')
.description('Radiian creates Ansible provisioning files for immutable infrastructure on AWS.\n' +
' Ru... | Add more info to bad command warning | Add more info to bad command warning
| JavaScript | bsd-3-clause | radify/radiian,radify/radiian,radify/radiian,radify/radiian |
2e16c9aabf99bda18cf92932efea5f09461de83f | ember-cli-build.js | ember-cli-build.js | /* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon')
module.exports = function (defaults) {
var app = new EmberAddon(defaults, {
babel: {
optional: ['es7.decorators']
},
snippetSearchPaths: ['tests/dummy/app'],
'ember-cli-mocha': {
useLintTree: false
... | /* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon')
module.exports = function (defaults) {
var app = new EmberAddon(defaults, {
babel: {
optional: ['es7.decorators']
},
snippetSearchPaths: ['tests/dummy/app']
})
app.import('bower_components/sinonjs/sinon.js')... | Remove useLintTree from ember-cli-mocha configuration | Remove useLintTree from ember-cli-mocha configuration
| JavaScript | mit | ciena-frost/ember-frost-navigation,ciena-frost/ember-frost-navigation,ciena-frost/ember-frost-navigation |
662c6fa7efce6873437108f7b77e73f0d6c42738 | lib/utils.js | lib/utils.js | var log = require('npmlog')
, gcr = require('./gcr')
, spawn = require('child_process').spawn
, utils = exports
utils.genSSHKey = function(cb) {
var args = [
'-t'
, 'rsa'
, '-f'
, '~/.ssh/gcr'
, '-N'
, '""'
]
var child = spawn('ssh-keygen', args, {
env: process.env
, cwd... | var log = require('npmlog')
, gcr = require('./gcr')
, exec = require('child_process').exec
, utils = exports
utils.genSSHKey = function(cb) {
var cmd = 'ssh-keygen -t rsa -f ~/.ssh/gcr -N ""'
exec(cmd, {
env: process.env
, cwd: process.cwd()
}, function(err, stdout, stderr) {
if (err) return... | Use child_process.exec instead of child_process.spawn | Use child_process.exec instead of child_process.spawn
child_process.spawn will not work with trying to pass an empty password
to `ssh-keygen`
| JavaScript | mit | dashersw/gcr,bushong1/gcr,evanlucas/gcr |
052a6fcbef78b27248d6b6d6c021fadad3d03c19 | src/js/main.js | src/js/main.js | function affirm(elem) {
var id = $(elem).parent().parent().attr('id');
$.get( '/affirm', {fid: id} )
.done( function(data) {
$(elem).remove();
});
}
function start(elem) {
var eid = $(elem).parent().parent().attr('id');
$.get( '/start', {eid: eid} )
.done( function(da... | function affirm(elem) {
var id = $(elem).parent().parent().attr('id');
$.get( '/affirm', {fid: id} )
.done( function(data) {
$(elem).hide('slow', function() { $(elem).remove() });
});
}
function start(elem) {
var eid = $(elem).parent().parent().attr('id');
$.get( '/start', {e... | Remove animation for buttons on view. | Remove animation for buttons on view.
| JavaScript | mit | Intey/OhMyBank,Intey/OhMyBank,Intey/OhMyBank,Intey/OhMyBank |
76b4aeb3ec95df87461bf80eaadf341d545b2362 | config/karmaLaunchers.js | config/karmaLaunchers.js | const customLaunchers = {
// windows
bs_chrome: {
base: "BrowserStack",
browser: "chrome",
browser_version: "63",
os: "Windows",
os_version: "10"
},
bs_firefox: {
base: "BrowserStack",
browser: "firefox",
browser_version: "57",
os: "Windows",
os_version: "10"
},
bs_ie... | const customLaunchers = {
// windows
bs_chrome: {
base: "BrowserStack",
browser: "chrome",
browser_version: "63",
os: "Windows",
os_version: "10"
},
bs_firefox: {
base: "BrowserStack",
browser: "firefox",
browser_version: "57",
os: "Windows",
os_version: "10"
},
bs_ie... | Disable iOS/Android karma tests (for now) | Disable iOS/Android karma tests (for now)
| JavaScript | mit | pshrmn/hickory,pshrmn/hickory |
a3d221b842e9f6c4e172e798ac2dd7b5af9566b6 | ui/scripts/globalSettings.js | ui/scripts/globalSettings.js | (function(cloudStack) {
cloudStack.sections['global-settings'] = {
title: 'Global Settings',
id: 'global-settings',
listView: {
label: 'Global Settings',
actions: {
edit: {
label: 'Change value',
action: function(args) {
var name = args.data.j... | (function(cloudStack) {
cloudStack.sections['global-settings'] = {
title: 'Global Settings',
id: 'global-settings',
listView: {
label: 'Global Settings',
actions: {
edit: {
label: 'Change value',
action: function(args) {
var name = args.data.j... | Add search functionality to global settings | Add search functionality to global settings
| JavaScript | apache-2.0 | wido/cloudstack,GabrielBrascher/cloudstack,jcshen007/cloudstack,argv0/cloudstack,wido/cloudstack,GabrielBrascher/cloudstack,GabrielBrascher/cloudstack,cinderella/incubator-cloudstack,wido/cloudstack,mufaddalq/cloudstack-datera-driver,mufaddalq/cloudstack-datera-driver,wido/cloudstack,DaanHoogland/cloudstack,resmo/cloud... |
3fa1ed671ceb774a956fc1bd9ba2a8c5611c073a | packages/ember-states/lib/router.js | packages/ember-states/lib/router.js | require('ember-states/state');
require('ember-states/route_matcher');
require('ember-states/routable');
Ember.Router = Ember.StateManager.extend({
route: function(path) {
if (path.charAt(0) === '/') {
path = path.substr(1);
}
this.send('routePath', path);
}
});
| require('ember-states/state');
require('ember-states/route_matcher');
require('ember-states/routable');
/**
@class
`Ember.Router` is a state manager used for routing.
A special `Router` property name is recognized on applications:
var app = Ember.Application.create({
Router: Ember.Router.extend(... | Add documentation stub for Ember.Router | Add documentation stub for Ember.Router
| JavaScript | mit | kigsmtua/ember.js,dgeb/ember.js,mrjavascript/ember.js,ebryn/ember.js,qaiken/ember.js,karthiick/ember.js,XrXr/ember.js,lan0/ember.js,lan0/ember.js,jayphelps/ember.js,visualjeff/ember.js,wycats/ember.js,eventualbuddha/ember.js,fivetanley/ember.js,jayphelps/ember.js,cyberkoi/ember.js,thejameskyle/ember.js,emberjs/ember.js... |
3aa71addb476f8a6dc2d3d9c7fa36ac2a13c0549 | examples/simple.js | examples/simple.js | var injector = require('../');
var serveStatic = require('serve-static');
var serveIndex = require('serve-index');
var app = injector();
app.value('port', 8080);
app.use(serveStatic(__dirname));
app.use(serveIndex(__dirname));
app.get('/greet/:name/:age', function(req, res) {
res.send('hello ' + req.params.name... | var injector = require('../');
var serveStatic = require('serve-static');
var serveIndex = require('serve-index');
var bodyParser = require('body-parser');
var logger = require('morgan');
var app = injector();
app.value('port', 3000);
app.use(logger('dev'));
app.use(serveStatic(__dirname));
app.use(bodyParser.json()... | Update examples with more routes and middleware | Update examples with more routes and middleware
| JavaScript | mit | itsananderson/molded |
7f3d37ee5f6ab83a8e7f7dc866da127427416efd | javascripts/yaja-app.js | javascripts/yaja-app.js | var yaja = typeof yaja === 'undefined' ? {} : yaja;
(function (window, yaja, $) {
function App(config) {
this.config = $.extend({
// Define default config values here.
"shortcuts": {
"run": "F5"
}
}, config);
this.input = $('.yaja-input')[0];
this.output = $('.yaja-output')[0];
this.interpr... | var yaja = typeof yaja === 'undefined' ? {} : yaja;
(function (window, yaja, $) {
function App(config) {
this.config = $.extend({
// Define default config values here.
"shortcuts": {
"run": "F5"
}
}, config);
this.input = $('.yaja-input')[0];
this.output = $('.yaja-output')[0];
this.interpr... | Add title attributes to buttons | Add title attributes to buttons
| JavaScript | mit | clee704/yaja,clee704/yaja |
516047eb90cd3216f293502ef4f0ee96c6a6d856 | plugins/ember.js | plugins/ember.js | /**
* Ember.js plugin
*
* Patches event handler callbacks and ajax callbacks.
*/
;(function(window, Raven, Ember) {
'use strict';
// quit if Ember isn't on the page
if (!Ember) {
return;
}
var _oldOnError = Ember.onerror;
Ember.onerror = function EmberOnError(error) {
Raven.captureException(error);
if... | /**
* Ember.js plugin
*
* Patches event handler callbacks and ajax callbacks.
*/
;(function(window, Raven, Ember) {
'use strict';
// quit if Ember isn't on the page
if (!Ember) {
return;
}
var _oldOnError = Ember.onerror;
Ember.onerror = function EmberOnError(error) {
Raven.captureException(error);
if... | Use the same context message. | Use the same context message.
| JavaScript | bsd-2-clause | housinghq/main-raven-js,housinghq/main-raven-js,hussfelt/raven-js,benoitg/raven-js,grelas/raven-js,eaglesjava/raven-js,housinghq/main-raven-js,getsentry/raven-js,eaglesjava/raven-js,Mappy/raven-js,benoitg/raven-js,PureBilling/raven-js,getsentry/raven-js,Mappy/raven-js,iodine/raven-js,danse/raven-js,getsentry/raven-js,c... |
67b36070e3b40218873195fd138f588c89008d5b | ngStorage.js | ngStorage.js | 'use strict';
/**
* @ngdoc overview
* @name ngStorage
*/
angular.module('ngStorage', []).
/**
* @ngdoc object
* @name ngStorage.$localStorage
* @requires $browser
* @requires $window
*/
factory('$localStorage', _storageFactory('localStorage')).
/**
* @ngdoc object
* @name ngStorage.$sessionStorage
* @re... | 'use strict';
/**
* @ngdoc overview
* @name ngStorage
*/
angular.module('ngStorage', []).
/**
* @ngdoc object
* @name ngStorage.$localStorage
* @requires $browser
* @requires $window
*/
factory('$localStorage', _storageFactory('localStorage')).
/**
* @ngdoc object
* @name ngStorage.$sessionStorage
* @re... | Add () as well as undefined handling | Add () as well as undefined handling
| JavaScript | mit | gsklee/ngStorage,castle-it/ngStorage,BaggersIO/ngStorage,brennaman/ngStorage,rbecheras/ngStorage,stefanita/ngStorage,wodka/ngStorage,robinboehm/ngStorage,JulienBier/ngStorage,raynode/ngStorage,grantadesign/ngStorage,bratishchev/ngStorage,cristianbara/ngStorage,Runnable/ngStorage,AyogoHealth/ngStorage,imskojs/ngStorage,... |
c2f4fc93eed712d36f092635453da27436bd43da | src/plugins/docker/index.js | src/plugins/docker/index.js | import * as _commands from './commands';
export const description = 'Setup and manage docker';
export const commands = _commands;
export const hooks = {
'post.default.status'(api) {
return api.runCommand('docker.status');
}
};
| import * as _commands from './commands';
export const description = 'Setup and manage docker';
export const commands = _commands;
export const hooks = {
'post.default.status'(api) {
return api.runCommand('docker.status');
}
};
export const validate = {
'swarm'() {
// There currently isn't any options in... | Validate swarm object in config | Validate swarm object in config
| JavaScript | mit | zodern/meteor-up,zodern/meteor-up |
bbbcdc21f4f1b4427cdaaf4112f2051f89764749 | lib/options.js | lib/options.js | 'use strict';
var getVersion = require('git-repo-version');
var fs = require('fs');
var Y = require('yuidocjs');
module.exports = {
generate: function generateYuidocOptions(){
var config;
var exclusions = [
'.DS_Store',
'.git',
'node_modules',
'vendor',
'bow... | 'use strict';
var getVersion = require('git-repo-version');
var fs = require('fs');
var Y = require('yuidocjs');
module.exports = {
generate: function generateYuidocOptions(){
var config;
var exclusions = [
'.DS_Store',
'.git',
'node_modules',
'vendor',
'bow... | Make addon lookup external data same as YUIDoc tool | Make addon lookup external data same as YUIDoc tool
YUIDoc tool and the addon will both find "external.data" at the top-level
of yuidoc.json, but unfortunately the YUIDoc documentation says it's
support to go in "options". The tool will find it here, but this addon
won't. This fixes that and makes the lookup order the... | JavaScript | mit | VladimirTyrin/ember-cli-yuidoc,greyhwndz/ember-cli-yuidoc,greyhwndz/ember-cli-yuidoc,cibernox/ember-cli-yuidoc,mixonic/ember-cli-yuidoc,mixonic/ember-cli-yuidoc,VladimirTyrin/ember-cli-yuidoc,cibernox/ember-cli-yuidoc |
201a649dcc1ee5c67c839e6a4d3eab0c12069a8c | src/targets/update-model.js | src/targets/update-model.js | var path = require('path'),
TargetBase = require('./base').TargetBase,
TargetUpdateModel = function (options) {
this.init(options);
};
TargetUpdateModel.prototype = Object.create(TargetBase.prototype);
TargetUpdateModel.prototype.MODEL_FILE_PATH = path.join(TargetUpdateModel.prototype.CACHE_DIR, 'm... | var path = require('path'),
TargetBase = require('./base').TargetBase,
TargetUpdateModel = function (options) {
this.init(options);
};
TargetUpdateModel.prototype = Object.create(TargetBase.prototype);
TargetUpdateModel.prototype.MODEL_JSPATH = path.join(process.cwd(), 'model', 'index.js');
TargetU... | Add missed paths to TargetUpdateModel class | Add missed paths to TargetUpdateModel class
| JavaScript | mpl-2.0 | bem-site/bse-admin,bem-site/bse-admin |
380957b8b9bcf148ae7fcc28fc92b75482cdaed8 | public/javascripts/parseMessages.js | public/javascripts/parseMessages.js | function parseMessages(messages, users, callback) {
var allWords = {};
console.log('parseMessages.js - messages', messages);
console.log('parseMessages.js (start) - users', users);
for(var i = 0; i < messages.length; i++) {
var author = users[messages[i].from.name];
var split = messages[i].message.spli... | function parseMessages(messages, users, callback) {
var allWords = {};
console.log('parseMessages.js - messages', messages);
console.log('parseMessages.js (start) - users', users);
for(var i = 0; i < messages.length; i++) {
var author = users[messages[i].from.name];
var split = messages[i].message.spli... | Add global vars for refreshing | Add global vars for refreshing
| JavaScript | mit | davis/wordgraph,davis/wordgraph |
5f79407cb64d1d85b67eff5b890d144b95c7386f | public/app/scripts/controllers/ripple_transactions.js | public/app/scripts/controllers/ripple_transactions.js | 'use strict';
angular.module('publicApp')
.controller('RippleTransactionsCtrl', ['$scope', '$http', '$location', '$route', '$routeParams', 'UserService', function ($scope, $http, $location, $route, $routeParams, $user) {
$scope.user = $user;
function createRippleDeposit(opts) {
$http.post('/api/v1/rip... | 'use strict';
angular.module('publicApp')
.controller('RippleTransactionsCtrl', ['$scope', '$http', '$location', '$route', '$routeParams', 'UserService', function ($scope, $http, $location, $route, $routeParams, $user) {
if (!$user.isLogged) { $location.path('/login') };
$scope.user = $user;
$scope.ripp... | Add angular controller function to create ripple withdrawal | [FEATURE] Add angular controller function to create ripple withdrawal
| JavaScript | isc | xdv/gatewayd,zealord/gatewayd,Parkjeahwan/awegeeks,Parkjeahwan/awegeeks,xdv/gatewayd,crazyquark/gatewayd,whotooktwarden/gatewayd,whotooktwarden/gatewayd,crazyquark/gatewayd,zealord/gatewayd |
1f2256e6cee9e2cb88d7622c684d514e7bd407ae | static/js/moderator.js | static/js/moderator.js | var socket = io();
$('form').accept(function(e){
e.preventDefault();
socket.emit('accept name', 'Valid');
// Disable form after first submission
$('form').unbind('accept');
$('form').accept(function(e){ e.preventDefault(); });
});
$('form').decline(function(e){
e.preventDefault();
socket.emit('decline n... | var socket = io();
$('#accept').click(function(e){
// Prevent JavaScript from doing normal functionality
e.preventDefault();
// Emit a message to accept the current name
socket.emit('accept name', 'Valid');
// Disable form after first submission
$('form').unbind('accept');
$('form').accept(function(e){... | Update Moderator Form Button Functionality | Update Moderator Form Button Functionality
* Update accept button functionality to work with the current button
* Update decline button functionality to work with the current button
* Update comments for functionality
| JavaScript | mit | 2016-ksu-cis-open-house/tree-display,2016-ksu-cis-open-house/tree-display,2016-ksu-cis-open-house/tree-display |
968d01b1dce2cd94669c25186811fefd67832777 | main.js | main.js | //Start up scheduled tasks
require('./cronjobs.js');
require('dotenv').config();
var login = require('facebook-chat-api');
var commandDescriptions = require('./modules.json');
var prefixLen = 1;
var commands = commandDescriptions .map(function(cmd) {
return require('./' + cmd['path']);
});
login({email: process.env.... | //Start up scheduled tasks
require('./cronjobs.js');
require('dotenv').config();
var login = require('facebook-chat-api');
var commandDescriptions = require('./modules.json');
var prefixLen = 1;
var commands = commandDescriptions .map(function(cmd) {
return require('./' + cmd['path']);
});
login({email: process.env.... | Fix single word command parsing | Fix single word command parsing
| JavaScript | mit | UsmannK/sadbot,UsmannK/sadbot |
15f51be92be869a9dbf71cbef9550fc929d891a2 | main.js | main.js | var POKER = require('./lib/poker.js').POKER;
console.log('running main.js');
var card = new POKER.Card(10, 3);
console.log('card: ' + card);
var anotherCard = POKER.cardFromString('As');
console.log('anotherCard: ' + anotherCard);
| var POKER = require('./lib/poker.js').POKER;
var assertCount = 0;
var assertionsPassed = 0;
var tripAces = POKER.handFromString('As Ah Ad Ks 3c'),
flush = POKER.handFromString('7s 6s As Ks 3s'),
straight = POKER.handFromString('7s 6s 4c 3h 5s'),
lowStraight = POKER.handFromString('As 2s 4c 3h 5s');
consol... | Add assertions to test connected runs and flush counts | Add assertions to test connected runs and flush counts
| JavaScript | mit | sbnb/poker-js |
81adaa6bc936d0341fe7ce7d05c605389f996bb6 | postinstall.js | postinstall.js | var fs = require('fs');
fs.createReadStream('./webpack.config.js').pipe(
fs.createWriteStream(__dirname + '\\..\\..\\' + 'webpack.config.js')
); | const fs = require('fs');
const path = require('path');
const destPath = path.join(__dirname, '../..', 'webpack.config.js');
fs.createReadStream('./webpack.config.js').pipe(
fs.createWriteStream(destPath)
); | Make use of path API | Make use of path API
| JavaScript | mit | tralves/nativescript-vue-webpack-template |
4d3323e58fb9bd2d2a122b6f2ee54abbc4c39c41 | vendor/assets/javascripts/jsboot.js | vendor/assets/javascripts/jsboot.js | function Jsboot(app, $) {
var jsb;
app.jsboot = app.jsboot || { callbacks: {} };
jsb = app.jsboot;
// callback functions expect one parameter, a
// data object that is stored in the inline
// application/json script tags
jsb.on = function(key, fun) {
key = key.replace('#', '-');
jsb.callbacks['j... | function Jsboot(app, $) {
var jsb;
app.jsboot = app.jsboot || { callbacks: {} };
jsb = app.jsboot;
// callback functions expect one parameter, a
// data object that is stored in the inline
// application/json script tags
jsb.on = function(key, fun) {
key = key.replace('#', '-');
jsb.callbacks['j... | Handle cases where a boot tag has no data | Handle cases where a boot tag has no data
This is useful if you want to use js boot but don't have data
you need to provide for bootstrapping
| JavaScript | mit | Kajabi/jsboot-rails,Kajabi/jsboot-rails |
ee1fbed4aa3fb4eb9f8a4f209f42f8e8b3792385 | lib/atomic-design-ui.js | lib/atomic-design-ui.js | 'use babel';
'use strict';
import { CompositeDisposable } from 'atom';
export var config = {
useSyntaxColors: {
title: 'Use Syntax Colors',
description: 'Use colors from the active syntax theme (not recommended for light themes)',
type: 'boolean',
default: false,
order: 2
},
lightTreeView: {... | 'use babel';
'use strict';
import { CompositeDisposable } from 'atom';
export var config = {
useSyntaxColors: {
title: 'Use Syntax Colors',
description: 'Use colors from the active syntax theme (not recommended for light themes)',
type: 'boolean',
default: false,
order: 1
},
lightTreeView: {... | Add modular functionality to custom file icons | Add modular functionality to custom file icons
| JavaScript | mit | JonSn0w/Atomic-Design-UI,JonSn0w/Atomic-Design-UI |
fe90cd103f9019ecb206fe082dd08e71c7433185 | src/modules/Sidebar.js | src/modules/Sidebar.js | /*jslint nomen: true, plusplus: true, es5: true, regexp: true */
/*global GS, GSX, GSXUtil, console, $, _ */
var GSXmodules = window.GSXmodules = window.GSXmodules || [];
GSXmodules.push({
name: 'Sidebar',
init: function () {
'use strict';
_.extend(GS.Views.Sidebar.prototype, {
render: _.compose(fu... | /*jslint nomen: true, plusplus: true, es5: true, regexp: true */
/*global GS, GSX, GSXUtil, console, $, _ */
var GSXmodules = window.GSXmodules = window.GSXmodules || [];
GSXmodules.push({
name: 'Sidebar',
init: function () {
'use strict';
_.extend(GS.Views.Sidebar.prototype, {
render: _.compose(fu... | Fix playlist link when user does not have custom path | Fix playlist link when user does not have custom path
close #56
| JavaScript | mit | Ramouch0/GSExtended,ram-one/GSExtended |
0de17fc01fc7ff893d6ad229170ceedc8c53f8b4 | backend/dynamic-web-apps/voting-app/src/tests/integrated/database.spec.js | backend/dynamic-web-apps/voting-app/src/tests/integrated/database.spec.js | const test = require('tape');
const User = require('../../../models/User');
const { connect, add, remove } = require('../../database');
test('connection to database', async (assert) => {
const actual = await connect();
const expected = 0;
assert.equal(actual, expected, 'It should connect to the database without ... | const test = require('tape');
const User = require('../../../models/User');
const { connect, add, remove, findUser } = require('../../database');
test('connection to database', async (assert) => {
const actual = await connect();
const expected = 0;
assert.equal(actual, expected, 'It should connect to the databas... | Test finding usernames in database | Test finding usernames in database
| JavaScript | mit | mkermani144/freecodecamp-projects,mkermani144/freecodecamp-projects |
86b743f96346b66a7b79586823bbb92eeed8a83d | packages/ecmascript/plugin.js | packages/ecmascript/plugin.js | Plugin.registerCompiler({
extensions: ['js'],
}, function () {
return new BabelCompiler({
asyncAwait: true,
modules: true
});
});
| Plugin.registerCompiler({
extensions: ['js'],
}, function () {
return new BabelCompiler({
asyncAwait: true,
modules: true
});
});
Plugin.registerCompiler({
extensions: ['jsx'],
}, function () {
return new BabelCompiler({
asyncAwait: true,
modules: true,
react: true
});
});
| Make ecmascript package enable JSX syntax in .jsx files. | Make ecmascript package enable JSX syntax in .jsx files.
| JavaScript | mit | chasertech/meteor,mjmasn/meteor,AnthonyAstige/meteor,jdivy/meteor,jdivy/meteor,mjmasn/meteor,DAB0mB/meteor,lorensr/meteor,lorensr/meteor,Hansoft/meteor,chasertech/meteor,AnthonyAstige/meteor,jdivy/meteor,mjmasn/meteor,DAB0mB/meteor,Hansoft/meteor,nuvipannu/meteor,Hansoft/meteor,mjmasn/meteor,lorensr/meteor,nuvipannu/me... |
43616619ecfd1fa3c6390f45d87f392fc65d563d | erpnext/stock/doctype/serial_no/serial_no.js | erpnext/stock/doctype/serial_no/serial_no.js | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
cur_frm.add_fetch("customer", "customer_name", "customer_name")
cur_frm.add_fetch("supplier", "supplier_name", "supplier_name")
cur_frm.add_fetch("item_code", "item_name", "item_name")
c... | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
cur_frm.add_fetch("customer", "customer_name", "customer_name")
cur_frm.add_fetch("supplier", "supplier_name", "supplier_name")
cur_frm.add_fetch("item_code", "item_name", "item_name")
c... | Set status button in serial no | Set status button in serial no
| JavaScript | agpl-3.0 | mbauskar/omnitech-demo-erpnext,suyashphadtare/vestasi-update-erp,Aptitudetech/ERPNext,gangadhar-kadam/verve-erp,gangadharkadam/saloon_erp,gmarke/erpnext,gangadharkadam/vlinkerp,indictranstech/trufil-erpnext,rohitwaghchaure/erpnext-receipher,gangadharkadam/johnerp,Tejal011089/osmosis_erpnext,sagar30051991/ozsmart-erp,Ma... |
28e51ed83d18a006080e064341bbf1803333e8f7 | addon/utils/shadow/types/svg-attribute-map.js | addon/utils/shadow/types/svg-attribute-map.js | /*
This acts as both a way to normalize attribute names, but also acts
as a white list for the supported properties.
*/
export default {
'circle': {
'radius': 'r',
'x': 'cx',
'y': 'cy'
},
'group': {
'transform': 'transform'
},
'rect': {
'x': 'x',
'y': 'y',
'height': 'height',
... | /*
This acts as both a way to normalize attribute names, but also acts
as a white list for the supported properties.
*/
export default {
'circle': {
'radius': 'r',
'x': 'cx',
'y': 'cy',
'fill': 'fill',
'stroke': 'stroke',
'stroke-width': 'stroke-width'
},
'group': {
'transform': 'tr... | Support Circle fill in SVG | Support Circle fill in SVG
| JavaScript | mit | RavelLaw/e3,asennikov/e3,elwayman02/e3,asennikov/e3,MattMSumner/e3,RavelLaw/e3,elwayman02/e3,MattMSumner/e3,taras/e3,taras/e3 |
aa813a18a3de400a1c04a8a9d46a9b8c739c2d9e | src/app/services/server.js | src/app/services/server.js | /**
* Created by vytautassugintas on 06/04/16.
*/
(function() {
"use strict";
angular.module("myApp").constant("SERVER", {
"ip": "http://localhost:8080"
})
})(); | /**
* Created by vytautassugintas on 06/04/16.
*/
(function() {
"use strict";
angular.module("myApp").constant("SERVER", {
"ip": "http://openkudos.com/api"
})
})();
| Change URL for the backend | Change URL for the backend
| JavaScript | mit | open-kudos/open-kudos-intern-web,open-kudos/open-kudos-intern-web |
36ca146ddd18461b71f7375b2b8cee064ed4828d | src/app/utilities/api-clients/collections.js | src/app/utilities/api-clients/collections.js | import http from '../http';
export default class collections {
static get(collectionID) {
return http.get(`/zebedee/collectionDetails/${collectionID}`)
.then(response => {
return response;
})
}
static getAll() {
return http.get(`/zebedee/collect... | import http from '../http';
export default class collections {
static get(collectionID) {
return http.get(`/zebedee/collectionDetails/${collectionID}`)
.then(response => {
return response;
})
}
static getAll() {
return http.get(`/zebedee/collect... | Add method to check is content is in another collection | Add method to check is content is in another collection
Former-commit-id: b5590a20f5a01e0fbe3aa4a856e6450a12d5cf8f
Former-commit-id: 7c42e5bbf445bfffb43de66ed823417c51d6e4df
Former-commit-id: 2675c6ef54e4d1ad9118400029a8ead243f426e9 | JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence |
102d0089fe811732c6782786d5a0694ba4688be3 | vitrage_dashboard/dashboard/static/dashboard/project/components/alarms/alarms.directive.js | vitrage_dashboard/dashboard/static/dashboard/project/components/alarms/alarms.directive.js | angular
.module('horizon.dashboard.project.vitrage')
.directive('hzAlarms', hzAlarms);
function hzAlarms() {
var directive = {
templateUrl: STATIC_URL + 'dashboard/project/components/alarms/alarms.html',
restrict: 'E',
scope: {
selected: '='
},
controller: AlarmsController,
controll... | angular
.module('horizon.dashboard.project.vitrage')
.directive('hzAlarms', hzAlarms);
function hzAlarms() {
var directive = {
templateUrl: STATIC_URL + 'dashboard/project/components/alarms/alarms.html',
restrict: 'E',
scope: {
selected: '='
},
controller: AlarmsController,
controll... | Make the alarm list in Vitrage Topology view related to the selected entity | Make the alarm list in Vitrage Topology view related to the selected entity
Change-Id: I1de754ada13262ffa0f7a76de2c1b390f31a36f6
story: #2004725
task: # 28763
| JavaScript | apache-2.0 | openstack/vitrage-dashboard,openstack/vitrage-dashboard,openstack/vitrage-dashboard,openstack/vitrage-dashboard |
070cb26e37c167db37634ef86f0b0f819c36b39e | test/backend-adaptor.test.js | test/backend-adaptor.test.js | var assert = require('chai').assert;
var nodemock = require('nodemock');
var Connection = require('../lib/backend-adaptor').Connection;
suit('Connection', function() {
var connection;
var sender;
setup(function() {
sender = {
emittedMessages: [];
emit: function(tag, message) {
this.emit... | var assert = require('chai').assert;
var nodemock = require('nodemock');
var Connection = require('../lib/backend-adaptor').Connection;
function createSender() {
return nodemock;
}
function createReceiver() {
var mockedSocket = nodemock;
var callbackController = {};
var receiver = {
// mocking receiver
... | Use mocked sended and receiver with nodemock | Use mocked sended and receiver with nodemock
| JavaScript | mit | KitaitiMakoto/express-droonga,droonga/express-droonga,KitaitiMakoto/express-droonga,droonga/express-droonga |
df60819b0cb9aec7a076bd32cbec2797811323e3 | spec.js | spec.js | // Mocha Specification Cases
const assert = require('assert');
const fetchJson = require('./node-fetch-json.js');
////////////////////////////////////////////////////////////////////////////////////////////////////
describe('Module node-fetch-json', () => {
it('loads as a function', () => {
const actu... | // Mocha Specification Cases
const assert = require('assert');
const fetchJson = require('./node-fetch-json.js');
////////////////////////////////////////////////////////////////////////////////////////////////////
describe('Module node-fetch-json', () => {
it('loads as a function', () => {
const actu... | Test added for example in documentation | Test added for example in documentation
{ animal: 'dog', action: 'fetch' }
| JavaScript | mit | pinntech/node-fetch-json,pinntech/node-fetch-json |
420a874785ee91389c39736b3bd60ad7fab79225 | src/webview/css/css.js | src/webview/css/css.js | /* @flow strict-local */
import type { ThemeName } from '../../types';
import cssPygments from './cssPygments';
import cssEmojis from './cssEmojis';
import cssNight from './cssNight';
export default (theme: ThemeName) => `
<link rel='stylesheet' type='text/css' href='./base.css'>
<link rel='stylesheet' type='text/css'... | /* @flow strict-local */
import { Platform } from 'react-native';
import type { ThemeName } from '../../types';
import cssPygments from './cssPygments';
import cssEmojis from './cssEmojis';
import cssNight from './cssNight';
/**
* Fix KaTeX frac-line elements disappearing.
*
* This is a hack, but it's probably bett... | Add hack so `\frac` lines don't disappear. | webview/katex: Add hack so `\frac` lines don't disappear.
KaTeX `.frac-line`s don't show up on some of our Android test devices
and emulators. (This seems to be a perennial problem for KaTeX. See
the commit-internal comments for references.)
Resolve this by forcing all such lines to be 1px wide, disregarding
the TeXb... | JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile |
9dd8d2dea8883f1bfc035f27eea816f0e62f828b | test.js | test.js | 'use strict';
var assert = require('assert');
var callbackify = require('./');
it('should make a sync function pass return to a callback', function () {
function sum (a, b) { return a + b; }
var sumCb = callbackify(sum);
var answer;
sumCb(32, 96, function (err, result) { answer = result; });
assert.equal(answer, ... | 'use strict';
var assert = require('assert');
var callbackify = require('./');
function sum (a, b) { return a + b; }
it('should make a sync function pass return to a callback', function () {
var sumCb = callbackify(sum);
var answer;
sumCb(32, 96, function (err, result) { answer = result; });
assert.equal(answer, ... | Test type checking of wrapped function | Test type checking of wrapped function
| JavaScript | isc | es128/cbify |
7da462d7d21b4dbf286054d6be6a3e851fc775d4 | mock/client.js | mock/client.js | "use strict";
module.exports = function() {
function Client() {
}
Client.prototype.write = function mockWrite() {
return {};
};
return Client;
};
| "use strict";
module.exports = function() {
function Client() {
}
Client.prototype.write = function mockWrite(notification, device) {
return { device };
};
return Client;
};
| Improve the default mock behaviour | Improve the default mock behaviour
It previously just returned an empty object which isn't very useful.
| JavaScript | mit | node-apn/node-apn,argon/node-apn |
db0a7f87ad6dc2bc9ba3475bf3d084eb4da66f45 | routes/report.js | routes/report.js | var FeedsModel = require("./../models").Feeds;
exports.list = function (req, res) {
var result=[];
FeedsModel
.find({FromType: '微博'})
.count(function (err, weibofeeds) {
FeedsModel
.find({FromType: '论坛'})
.count(function (err, forumofeeds) {
... | var FeedsModel = require("./../models").Feeds;
exports.list = function (req, res) {
var result=[];
FeedsModel
.find({FromType: '微博'})
.count(function (err, weibofeeds) {
FeedsModel
.find({FromType: '论坛'})
.count(function (err, forumofeeds) {
... | Add 2DBar chart -by jarrick | Add 2DBar chart -by jarrick
| JavaScript | mit | mz121star/ReUnionWeb |
f6584f9d781857a89631e48412625049246aac3d | index.js | index.js | "use strict";
global.use = function (path) {
return require('./' + path);
};
const Dominion = use('core/server');
const Message = use('core/messages');
const Server = new Dominion();
Server.addComponent(require('./components/sessions'));
Server.addComponent(require('./component... | "use strict";
global.use = function (path) {
if(path === 'config'){
return require.main.require('./' + path);
}else{
return require('./' + path);
}
};
const Dominion = use('core/server');
const Message = use('core/messages');
const Server = new Dominion()... | Update use() function. Use local config | Update use() function. Use local config
| JavaScript | mit | yura-chaikovsky/dominion |
98214c9ddd39accd4dd31221c0ff22b60f1e9cfe | index.js | index.js | // Copyright (c) 2016 Alejandro Blanco <alejandro.b.e@gmail.com>
// MIT License
const bot = require('./src/bggBot');
| // Copyright (c) 2016 Alejandro Blanco <alejandro.b.e@gmail.com>
// MIT License
'use strict';
require('./src/bggBot');
const http = require('http');
const hostname = '0.0.0.0';
const port = 80;
const server = http.createServer(function (req, res) {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/... | Add a web server so heroku has something to return | Add a web server so heroku has something to return
| JavaScript | mit | ablanco/boardgamegeek-telegram-bot |
8bd36b409580b2448139c189bf7db7c6b5bc2aa2 | tests/converters/MusicCSLJson/testBarModel_CSLJson.js | tests/converters/MusicCSLJson/testBarModel_CSLJson.js | define(['modules/converters/MusicCSLJson/BarModel_CSLJson', 'modules/core/BarModel'], function(BarModel_CSLJson, BarModel) {
return {
run: function() {
test("BarModel_CSLJson", function(assert) {
var bar = new BarModel();
var CSLJsonConverter = new BarModel_CSLJson();
var t = CSLJsonConverter.exportTo... | define(['modules/converters/MusicCSLJson/BarModel_CSLJson', 'modules/core/BarModel'], function(BarModel_CSLJson, BarModel) {
return {
run: function() {
test("BarModel_CSLJson", function(assert) {
var bar = new BarModel();
var CSLJsonConverter = new BarModel_CSLJson();
var t = CSLJsonConverter.exportTo... | Remove test bar csl json | Remove test bar csl json
| JavaScript | mit | dmmz/LeadsheetJS,dmmz/LeadsheetJS |
83636aa67e96413f765c55cccfb1ec5bf229fbb6 | test/leveldb-driver-test.js | test/leveldb-driver-test.js | // leveldb-driver-test.js
//
// Testing the leveldb driver
//
// Copyright 2012, StatusNet Inc.
//
// 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/LI... | // leveldb-driver-test.js
//
// Testing the leveldb driver
//
// Copyright 2012, StatusNet Inc.
//
// 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/LI... | Use a standard database location | Use a standard database location
| JavaScript | apache-2.0 | e14n/databank-leveldb |
1a49787bfb12e406542a3afbb1d78a45750910a9 | test/reducers/posts.spec.js | test/reducers/posts.spec.js | import { expect } from 'chai';
import posts from '../../src/js/store/reducers/posts';
import {
addPost,
requestPosts,
receivePosts,
} from '../../src/js/store/actions/posts';
describe('posts reducer', () => {
const post = { title: 'A first post' };
it('returns initial state', () => {
const result = post... | import { expect } from 'chai';
import posts from '../../src/js/store/reducers/posts';
import {
addPost,
requestPosts,
receivePosts,
} from '../../src/js/store/actions/posts';
describe('posts reducer', () => {
const post = { title: 'A first post' };
it('returns initial state', () => {
const result = post... | Fix test for posts reducer requesting posts | Fix test for posts reducer requesting posts
| JavaScript | mit | slavapavlutin/pavlutin-node,slavapavlutin/pavlutin-node |
2d453196b5c19c0718af340893ce2cd2c4424aab | stryker.server-conf.js | stryker.server-conf.js | module.exports = function (config) {
'use strict'
config.set({
files: [
{ pattern: 'data/*.js', mutated: true, included: false },
{ pattern: 'lib/*.js', mutated: true, included: false },
{ pattern: 'models/*.js', mutated: true, included: false },
{ pattern: 'routes/*.js', mutated: true,... | module.exports = function (config) {
'use strict'
config.set({
files: [
{ pattern: 'data/*.js', mutated: true, included: false },
{ pattern: 'lib/*.js', mutated: true, included: false },
{ pattern: 'models/*.js', mutated: true, included: false },
{ pattern: 'routes/*.js', mutated: true,... | Remove unnecessary node_modules/** from sandbox | Remove unnecessary node_modules/** from sandbox
| JavaScript | mit | m4l1c3/juice-shop,m4l1c3/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,m4l1c3/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,m4l1c3/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,m4l1c3/juice-shop |
da30ce7d6500791037139a0afee435fb26d64596 | .jest-config.js | .jest-config.js | const externalTsModules = require('./build//external').externalTsModules
const externalTsModuleMappings = {}
for (const externalTsModule of externalTsModules) {
Object.assign(externalTsModuleMappings, {
[`^${externalTsModule}$`]: `<rootDir>/external/${externalTsModule}/ts`,
[`^${externalTsModule}/l... | const { jsWithTs: tsjPreset } = require('ts-jest/presets')
const externalTsModules = require('./build/external').externalTsModules
const externalTsModuleMappings = {}
for (const externalTsModule of externalTsModules) {
Object.assign(externalTsModuleMappings, {
[`^${externalTsModule}$`]: `<rootDir>/external... | Update jest config to let ts-jest process JS modules | Update jest config to let ts-jest process JS modules
- no longer uses babel-jest, although the aim is to let ts-jest pass it to that afterwards
| JavaScript | mit | WorldBrain/WebMemex,WorldBrain/WebMemex |
7d8c89e50be3a42affd138c9fd8204ab1b347e0e | packages/redux-simple-auth/rollup.config.js | packages/redux-simple-auth/rollup.config.js | import resolve from 'rollup-plugin-node-resolve'
export default {
input: 'src/index.js',
output: {
file: 'lib/index.js',
format: 'cjs'
},
plugins: [resolve()]
}
| import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'
export default {
input: 'src/index.js',
output: {
file: 'lib/index.js',
format: 'cjs'
},
plugins: [resolve(), babel({ exclude: 'node_modules/**' }), commonjs()]
}
| Use babel and commonjs plugin for rollup | Use babel and commonjs plugin for rollup
| JavaScript | mit | jerelmiller/redux-simple-auth |
f67d580abd066f8087f5b88991636a46a64b3d7b | test/test_isoutcdatetime.js | test/test_isoutcdatetime.js | var assert = require("assert");
var dateFormat = require("./../lib/dateformat");
describe("isoUtcDateTime", function () {
it("should correctly format the timezone part", function (done) {
var actual = dateFormat("2014-06-02T13:23:21-08:00", "isoUtcDateTime");
assert.strictEqual(actual, "2014-06-02T21:23:21Z... | var assert = require('assert');
var dateFormat = require('./../lib/dateformat');
describe('isoUtcDateTime', function() {
it('should correctly format the timezone part', function(done) {
var actual = dateFormat('2014-06-02T13:23:21-08:00', 'isoUtcDateTime');
assert.strictEqual(actual, '2014-06-02T21:23:21Z')... | Revert "Minor Formatting Changes for Is OUTC Datetime Test" | Revert "Minor Formatting Changes for Is OUTC Datetime Test"
This reverts commit b63874aca26d4af2ba071bdfd0b03d2da9304fcb.
| JavaScript | mit | felixge/node-dateformat,felixge/node-dateformat |
f850725730510bade51bd44b13a21c2da2793bc1 | Math/Pernicious/pernicious.js | Math/Pernicious/pernicious.js | var Pernicious = function(){}
Pernicious.prototype.is_pernicious = function (num) {
num.toString(10)
};
Pernicious.prototype.isPrime = function(number){
}
module.exports = Pernicious
| var Pernicious = function(){}
Pernicious.prototype.is_pernicious = function (num) {
var b = num.toString(10), prim = [];
for(var i = 0; i < b.length; i++){
if(this.isPrime(b[i])){
prim.push(b[i])
}
}
};
Pernicious.prototype.isPrime = function(n){
if (n < 2) return false;
var q = pars... | Add isPrime function to Pernicious | Add isPrime function to Pernicious
| JavaScript | mit | BrianLusina/JS-Snippets |
6415710a254f6dd4515b397a52b53aa3d7bb8c1b | src/providers/notificationCatcherProvider.js | src/providers/notificationCatcherProvider.js | /* @flow */
import EmailSmtpProvider from './email/smtp'
// Types
import type {ChannelType} from '../index'
import type {EmailRequestType} from '../models/notification-request'
export default class NotificationCatcherProvider {
id: string
provider: EmailSmtpProvider
static getConfig (channels: ChannelType[]) {
... | /* @flow */
import EmailSmtpProvider from './email/smtp'
// Types
import type {ChannelType} from '../index'
import type {EmailRequestType} from '../models/notification-request'
export default class NotificationCatcherProvider {
id: string
provider: EmailSmtpProvider
static getConfig (channels: ChannelType[]) {
... | Add custom config for notifier catcher | Add custom config for notifier catcher
| JavaScript | mit | notifme/notifme-sdk |
46fc69a3416c856136e68dfe2f71e1c43f017042 | api.js | api.js | module.exports = function(app) {
var mongoose = require('mongoose'); // require mongoose (for mongodb integration
var fs = require('fs'); // necessary to read from files
var db = require('./app_api/models/db'); // handles database connection open/close
var routesApi = require('./app_api/routes/index');
app... | module.exports = function(app) {
var mongoose = require('mongoose'); // require mongoose (for mongodb integration
var fs = require('fs'); // necessary to read from files
var db = require('./app_api/models/db'); // handles database connection open/close
var routesApi = require('./app_api/routes/index');
app... | Modify app to expect IP/Port from .config, or use Cloud9 Port/IP if none found. | Modify app to expect IP/Port from .config, or use Cloud9 Port/IP if none found.
| JavaScript | mpl-2.0 | jdthomas718/ClassRat,jdthomas718/ClassRat |
a3052ea797d35f2c06a814576f003c337f9930d6 | app.js | app.js | const MessageHandler = require("./MessageHandler.js");
var appConfig = require("./config.json");
var Discord = require('discord.io');
// Create Discord Bot (based on token in config)
var bot = new Discord.Client({
token: appConfig.api.discord.token,
autorun: true
});
// Handler that will take messages and pas... | const MessageHandler = require("./MessageHandler.js");
var appConfig = require("./config.json");
var Discord = require('discord.io');
// Create Discord Bot (based on token in config)
var bot = new Discord.Client({
token: appConfig.api.discord.token,
autorun: true
});
// Handler that will take messages and pas... | Set discord status on ready instead. | Set discord status on ready instead.
| JavaScript | isc | aeolingamenfel/discord-text-adventure-bot,JiFish/discord-text-adventure-bot |
db5d929afc20f5194964e7470f80659ad973d459 | pub.js | pub.js | // tpl - a general purpose template cli
// (c) 2011 Paul Vorbach. Licensed under MIT.
;(function() {
var fs = require('fs');
var path = require('path');
var append = require('append');
var confdir = require('confdir');
module.exports = function (cb) {
confdir(process.cwd(), 'pub', function(err, dir) {
if (err)... | // tpl - a general purpose template cli
// (c) 2011 Paul Vorbach. Licensed under MIT.
;(function() {
var fs = require('fs');
var path = require('path');
var append = require('append');
var confdir = require('confdir');
module.exports = function (cb) {
confdir(process.cwd(), 'tpl', function(err, dir) {
if (err)... | Use .tpl as the confdir | Use .tpl as the confdir
| JavaScript | mit | pvorb/node-pub |
a3d7f70715b55b2e8a5383abf767280c0aa8c79e | main.js | main.js | requirejs.config({
paths: {
jquery: "http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min",
async: "lib/async",
goog: "lib/goog",
propertyParser: "lib/propertyParser"
}
});
define("gmaps", ["async!http://maps.google.com/maps/api/js?libraries=geometry&sensor=false"], function() {
return window.googl... | requirejs.config({
paths: {
jquery: "http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min",
async: "lib/async",
goog: "lib/goog",
propertyParser: "lib/propertyParser"
}
});
define("gmaps", ["async!http://maps.google.com/maps/api/js?libraries=geometry&sensor=false"], function() {
return window.googl... | Add additional sample gpx files and a means to select the file and the track via request parameter. | Add additional sample gpx files and a means to select the file and the track via request parameter.
| JavaScript | mit | alimfeld/gpxvis.js |
121d889a605ef5ac53577c61df6df30c6bb7d7e6 | main.js | main.js | (() => {
'use strict';
const addressEl = document.getElementsByClassName('address')[0];
function copyAddress() {
const email = atob('IGN0ZXJlZmlua29AZ21haWwuY29tIA==').trim();
// Update the element to have the email and stop listening.
addressEl.textContent = email;
addressEl.classList.remove('l... | (() => {
'use strict';
const addressEl = document.getElementsByClassName('address')[0];
function copyAddress() {
const email = atob('IGN0ZXJlZmlua29AZ21haWwuY29tIA==').trim();
// Update the element to have the email and stop listening.
addressEl.textContent = email;
addressEl.classList.remove('l... | Use select instead of focusing. | Use select instead of focusing.
| JavaScript | mit | cterefinko/terefink.io,cterefinko/terefink.io |
3ee955cbce814608dd876ff9b7c91427a8bb1c10 | main.js | main.js | var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed a... | var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed a... | Replace deprecated use of `bw.openDevTools` | Replace deprecated use of `bw.openDevTools`
| JavaScript | cc0-1.0 | RonanTomasi/electron,RonanTomasi/electron |
a73b4795dce076172ee32756fa8ab7d6da175445 | packages/health-got/index.js | packages/health-got/index.js | const got = require('got');
module.exports = data => {
if (typeof data === 'string') {
data = { url: data };
}
data.method = data.method || 'get';
return {
check: () => got[data.method](data.url, data.options),
data: { url: data.url },
};
};
| const got = require('got');
module.exports = data => {
if (typeof data === 'string') {
data = { url: data };
}
data.method = data.method || 'get';
return {
check: () => got[data.method](data.url, data.options),
data: { method: data.method, url: data.url },
};
};
| Add also the method to the health data | Add also the method to the health data
| JavaScript | mit | maxdome/maxdome-node,maxdome/maxdome-node |
3c8dc2b032e45d481094b27929d33db5d8edbb40 | node-tests/lint-test.js | node-tests/lint-test.js | 'use strict';
const lint = require('mocha-eslint');
lint([
'index.js',
'addon',
'addon-test-support',
'app',
'bin',
'config',
'lib',
'node-tests',
'tests',
'vendor',
]);
| 'use strict';
const lint = require('mocha-eslint');
lint([
'index.js',
'addon',
'addon-test-support',
'app',
'bin',
'config',
'lib',
'node-tests',
'tests/**/*.js',
'!tests/**/node_modules/**/*.js',
'vendor',
]);
| Fix linting tests for symlinked node_modules | Fix linting tests for symlinked node_modules
| JavaScript | mit | dgeb/ember-engines,ember-engines/ember-engines,ember-engines/ember-engines,dgeb/ember-engines |
bf29bcf0ec5205e50764e47dc78d3af6b8690abd | custom/uth/_design/views/uth_lookup/map.js | custom/uth/_design/views/uth_lookup/map.js | function(doc) {
if (doc.type === "child" && doc.scan_status !== 'scan_complete' && doc.domain === "uth-rhd") {
emit([doc.domain, 'VH014466XK', doc.exam_number, doc.scan_time], doc._id);
}
}
| function(doc) {
if (doc.type === "child" && doc.scan_status !== 'scan_complete' && doc.domain === "uth-rhd") {
emit([doc.domain, doc.scanner_serial, doc.exam_number], doc._id);
}
}
| Add scanner serial to view | Add scanner serial to view
| JavaScript | bsd-3-clause | dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare... |
ebae0e9849b69c4dcf9cd0d9084474a0d421fa53 | vendor/spark/spark-config.js | vendor/spark/spark-config.js | //Various Spark config parameters
var apiHostSandbox = 'sandbox.spark.autodesk.com/api/v1',
apiHostProduction = 'api.spark.autodesk.com/api/v1',
apiHost = ENVIRONMENT === 'production' ? apiHostProduction : apiHostSandbox,
endUserAuthorizationEndpoint = apiHost + "/oauth/authorize", // The page of the authorize
pro... | //Various Spark config parameters
var apiHostSandbox = 'sandbox.spark.autodesk.com/api/v1',
apiHostProduction = 'api.spark.autodesk.com/api/v1',
apiHost = ENVIRONMENT === 'production' ? apiHostProduction : apiHostSandbox,
endUserAuthorizationEndpoint = apiHost + "/oauth/authorize", // The page of the authorize
pro... | Change all calls to https | Change all calls to https
| JavaScript | apache-2.0 | spark3dp/webapp-samples,spark3dp/webapp-samples |
31b5bf6a6a4af211eefe2f4dda4e9e3615b2fead | libs/websockets.js | libs/websockets.js | var config = require('config');
var WebSocket = require("ws");
module.exports = (function() {
if (!config.websocket) {
console.error("Websocket not configured");
return;
}
var ws = new WebSocket(config.websocket);
var self = this;
self.connected = false;
ws.on("open", () => {
console.log("Connected to WebS... | const config = require('config');
const Ws = require("ws");
class Websocket {
constructor() {
this.connect();
}
connect() {
const self = this;
this.connected = false;
this.ws = new Ws(config.websocket);
this.ws.on("open", () => {
console.log("Connected to WebSocket " + config.websocket);
self.connec... | Reconnect websocket on disconnect; a bit of a refactor | Reconnect websocket on disconnect; a bit of a refactor
| JavaScript | mit | 10layer/jexpress,10layer/jexpress |
780e62126cd00427663113db98f005106fc9fa61 | frontend/web/js/panel.js | frontend/web/js/panel.js | /**
* Created by tofid on 25.02.15.
*/
/**
* Scroll to element
* @param element
*/
function scrollTo(element, duration) {
duration = duration || 500;
$('html, body').animate({
scrollTop: $(element).offset().top
}, duration);
}
$( ".sidebar-toggle" ).on("click", function() {
var collapsed_... | /**
* Created by tofid on 25.02.15.
*/
/**
* Scroll to element
* @param element
*/
function scrollTo(element, duration) {
duration = duration || 500;
$('html, body').animate({
scrollTop: $(element).offset().top
}, duration);
} | Move JS Collapse sidebar to theme | Move JS Collapse sidebar to theme
| JavaScript | bsd-3-clause | hiqdev/hipanel-core,hiqdev/hipanel-core,hiqdev/hipanel-core,hiqdev/hipanel-core |
813bd32269bea3665bf3dcd9b16acd02e43fcda9 | test/configure.spec.js | test/configure.spec.js | import {Configure} from '../src/configure';
class HttpStub {
get(url) {
}
}
class EventStub {
}
describe('the main configure.js singleton', () => {
var config;
var mockedHttp;
var mockedEvent;
beforeEach(() => {
mockedHttp = new HttpStub();
mockedEvent = new EventStub();
... | import {Configure} from '../src/configure';
class HttpStub {
get(url) {
}
}
class EventStub {
}
describe('the main configure.js singleton', () => {
var config;
var mockedHttp;
var mockedEvent;
beforeEach(() => {
mockedHttp = new HttpStub();
mockedEvent = new EventStub();
... | Call loadConfig method in beforeEach so test can check if called | Test: Call loadConfig method in beforeEach so test can check if called
| JavaScript | mit | Vheissu/Aurelia-Configuration,JoshMcCullough/Aurelia-Configuration,JeroenVinke/Aurelia-Configuration,Vheissu/Aurelia-Configuration |
864bbf8319039cdcd12870741f6b348a46e177e4 | config.js | config.js | var fs = require('fs');
// Require given configuration
if (fs.existsSync(__dirname + '/config/data.js')) {
exports = module.exports = require('./config/data.js');
}
else {
exports = module.exports = {};
}
| var fs = require('fs');
// Require given configuration
if (fs.existsSync(__dirname + '/config/data.js')) {
exports = module.exports = require(__dirname + '/config/data.js');
}
else {
exports = module.exports = {};
}
| Check and then use the same.. | Check and then use the same.. | JavaScript | mit | DualDev/node-transip,DeviaVir/node-transip |
70e20e4389e2274a9f432cbc1975695d814ad266 | pong.js | pong.js | 'use strict';
var canvas = document.querySelector('canvas');
var context = canvas.getContext('2d');
| 'use strict';
var canvas = document.querySelector('canvas');
var context = canvas.getContext('2d');
// Space between the side edge of the canvas and the paddle.
var EDGE_TO_PADDLE = 5;
/**
The paddle at either side of the canvas.
@constructor
@param {boolean} isLeft - If true, construct the left paddle, oth... | Add information for paddles, players, and ball. | Add information for paddles, players, and ball.
| JavaScript | unlicense | luther9/pong,luther9/pong |
06c5a10ec4ee5ef1f54fb83d0ef627878ce5e8ae | src/foam/layout/Section.js | src/foam/layout/Section.js | /**
* @license
* Copyright 2019 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'foam.layout',
name: 'Section',
requires: [
'foam.core.Action',
'foam.core.Property'
],
properties: [
{
class: 'Function',
name: 'isAvailabl... | /**
* @license
* Copyright 2019 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'foam.layout',
name: 'Section',
requires: [
'foam.core.Action',
'foam.core.Property'
],
properties: [
{
class: 'Function',
name: 'isAvailabl... | Remove an unused property set. | Remove an unused property set.
| JavaScript | apache-2.0 | jacksonic/vjlofvhjfgm,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,foam-framework/foam2 |
5adfee5b857363d2f24617bb5586aaba1c8e30c5 | src/dsp/Delay.js | src/dsp/Delay.js | /**
* @depends ../core/AudioletNode.js
*/
var Delay = new Class({
Extends: AudioletNode,
initialize: function(audiolet, maximumDelayTime, delayTime) {
AudioletNode.prototype.initialize.apply(this, [audiolet, 2, 1]);
this.maximumDelayTime = maximumDelayTime;
this.delayTime = new Audiol... | /**
* @depends ../core/AudioletNode.js
*/
var Delay = new Class({
Extends: AudioletNode,
initialize: function(audiolet, maximumDelayTime, delayTime) {
AudioletNode.prototype.initialize.apply(this, [audiolet, 2, 1]);
this.maximumDelayTime = maximumDelayTime;
this.delayTime = new Audiol... | Use an if statement for rounding delay counter rather than modulo | Use an if statement for rounding delay counter rather than modulo
| JavaScript | apache-2.0 | mcanthony/Audiolet,oampo/Audiolet,bobby-brennan/Audiolet,Kosar79/Audiolet,kn0ll/Audiolet,kn0ll/Audiolet,Kosar79/Audiolet,bobby-brennan/Audiolet,Kosar79/Audiolet,mcanthony/Audiolet,oampo/Audiolet |
3d200984b9cd3107716d005689c1d653ef8360d6 | src/actions/seats.js | src/actions/seats.js | /* @flow */
import type { Action } from './types';
import type { SeatData } from '../types';
export function loadSeats(seats: { [id: string]: SeatData }): Action {
return { type: 'LOAD_SEATS', seats };
}
| /* @flow */
import type { Action } from './types';
import type { SeatsMap } from '../reducers/types';
export function loadSeats(seats: SeatsMap ): Action {
return { type: 'LOAD_SEATS', seats };
}
| Use SeatsMap type in loadSeats signature. | Use SeatsMap type in loadSeats signature.
| JavaScript | unknown | lanets/floorplanets,lanets/floorplan-2,lanets/floorplanets,lanets/floorplan-2,lanets/floorplanets,lanets/floorplan-2 |
3a45e6a1f608d8ba91f406da5d70592ce67df902 | server/main.js | server/main.js | Meteor.methods({
updateDoc (name, text, clientId) {
console.log(arguments)
Pads.upsert(
{ name },
{ $set: { text, lock: { time: (new Date).getTime(), clientId } } }
)
}
})
Meteor.publish('pad', (name) => console.log(arguments) || Pads.find({ name }))
| Meteor.methods({
updateDoc (name, text, clientId) {
Pads.upsert(
{ name },
{ $set: { text, lock: { time: (new Date).getTime(), clientId } } }
)
}
})
Meteor.publish('pad', (name) => Pads.find({ name }))
| Remove some console.logs from the server side | Remove some console.logs from the server side
| JavaScript | mit | Kriegslustig/simple-pad,Kriegslustig/simple-pad,Kriegslustig/simple-pad |
3f3d463382c6767d228fecb27a5379547fe804ac | src/interceptor.js | src/interceptor.js | 'use strict';
var angular = require('angular');
module.exports = httpEtagInterceptorFactory;
httpEtagInterceptorFactory.$inject = ['queryStringify'];
function httpEtagInterceptorFactory (queryStringify) {
var etagCache = {};
function buildUrl (url, params) {
var queryString = queryStringify(params);
url... | 'use strict';
var angular = require('angular');
module.exports = httpEtagInterceptorFactory;
httpEtagInterceptorFactory.$inject = ['queryStringify'];
function httpEtagInterceptorFactory (queryStringify) {
var etagCache = {};
function buildUrl (url, params) {
var queryString = queryStringify(params);
url... | Allow for passing an ETag for convenience | Allow for passing an ETag for convenience
| JavaScript | mit | shaungrady/angular-http-etag |
7e745cdb679f999a0a353e2b27cccc0ebc82289e | app/assets/javascripts/publify.js | app/assets/javascripts/publify.js | //= require jquery
//= require jquery_ujs
//= require cookies
//= require rails-timeago
//= require bootstrap
//= require_self
| //= require jquery
//= require jquery_ujs
//= require cookies
//= require rails-timeago
//= require_self
| Remove bootstrap.js from being added into frontend | Remove bootstrap.js from being added into frontend
| JavaScript | mit | moneyadviceservice/publify,moneyadviceservice/publify,moneyadviceservice/publify,moneyadviceservice/publify |
70e6a006b15cfac8c05592a8a7eb6b2973d73c16 | app/assets/javascripts/welcome.js | app/assets/javascripts/welcome.js | // Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
// You can use CoffeeScript in this file: http://coffeescript.org/
ListenFor = (function() {
var displaySectionListener = function(section) {
$(section).on('click', '... | // Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
// You can use CoffeeScript in this file: http://coffeescript.org/
ListenFor = (function() {
var displaySection = function(section) {
$(section).on('click', '.interes... | Rename functions to minimize verbosity | Rename functions to minimize verbosity
| JavaScript | mit | CariWest/cariwest.github.io,CariWest/cariwest.github.io,CariWest/cariwest.github.io |
db7db62217e6337fde13b7275d0bc96946b9e39c | client/views/activities/filters/residents/residents.js | client/views/activities/filters/residents/residents.js | Template.activitiesTableResidentNamesFilter.onRendered(function () {
// Render Bootstrap select widget on resident filter
$('#resident-filter').selectpicker();
});
Template.activitiesTableResidentNamesFilter.helpers({
residentNamesGroupedtByHomes () {
// Get list of homes, sorted alphabetically
const hom... | Template.activitiesTableResidentNamesFilter.onCreated(function () {
// Initialize ReactiveTable filter for residents
this.filter = new ReactiveTable.Filter('residentFilter', ['residentIds']);
});
Template.activitiesTableResidentNamesFilter.events({
"change #resident-filter": function (event, templateInstance) {... | Enable ReactiveTable filter for residentIds field | Enable ReactiveTable filter for residentIds field
| JavaScript | agpl-3.0 | GeriLife/wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing |
3f3b065392517e247f89458127c48f1f7c7119d8 | app/model/articles.js | app/model/articles.js | // model schema for articles
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var articleSchema = Schema({
feed_id: { type: Number, ref: 'Feed' },
url: {type: String, unique: true},
title: String,
summary: String,
// keywords: [{ type: Schema.Types.ObjectId, ref: 'Keyword'} ],
... | // model schema for articles
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var articleSchema = Schema({
feed_id: { type: Schema.Types.ObjectId, ref: 'Feed' },
url: {type: String, unique: true},
title: String,
summary: String,
// keywords: [{ type: Schema.Types.ObjectId, ref: 'Ke... | Use correct type for id | Use correct type for id
| JavaScript | mit | chrisauclair/newsflash |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.