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 |
|---|---|---|---|---|---|---|---|---|---|
0fc7bf2d43daa540e46a6e5124c69770e5617037 | src/ProcessedTweetList.js | src/ProcessedTweetList.js | /**
* ProcessedTweetList - Stores tweets/dms by room_id so we don't accidentally
* repeat any messages. Please note that the cache and slice size values are
* per room, not the total size of all stored rooms.
*
* @class
* @param {number} [128] cacheSize How many messages to store before cleanup occurs
* @param ... | /**
* ProcessedTweetList - Stores tweets/dms by room_id so we don't accidentally
* repeat any messages. Please note that the cache and slice size values are
* per room, not the total size of all stored rooms.
*
* @class
* @param {number} [128] cacheSize How many messages to store before cleanup occurs
* @param ... | Fix tweets not being stored in list | Fix tweets not being stored in list
| JavaScript | apache-2.0 | Half-Shot/matrix-appservice-twitter |
c7862997d1a13cc9426b36a8ff379bf898cafc05 | src/routes/index.js | src/routes/index.js | 'use strict';
const express = require('express');
const cors = require('cors');
const path = require('path');
const MockCtrl = require('../controllers/MockCtrl');
module.exports = function({Configuration, Logger, app}) {
// Configuration middlewares
for (let middleware of Configuration.get('middlewares')) {
a... | 'use strict';
const express = require('express');
const cors = require('cors');
const path = require('path');
const MockCtrl = require('../controllers/MockCtrl');
module.exports = function({Configuration, Logger, app}) {
// Configuration middlewares
for (let middleware of Configuration.get('middlewares')) {
a... | Modify the way middlewares are initialized so they can use Mockiji's logger and config | Modify the way middlewares are initialized so they can use Mockiji's logger and config
| JavaScript | apache-2.0 | NijiDigital/mockiji,NijiDigital/mockiji,NijiDigital/mockiji |
2a69115fc4aa78c3c0b5f06cecc4f545c849bf03 | src/server/index.js | src/server/index.js | /*
* src/server/index.js
*/
import express from 'express';
import routes from './routes';
const app = express();
app.get('/happysad', routes.happysad.fn);
app.listen(8083, function (err) {
if (err)
return console.log(err);
console.log('running express on localhost:8083');
});
| /*
* src/server/index.js
*/
require('babel/polyfill');
import express from 'express';
import routes from './routes';
const app = express();
app.get('/happysad', routes.happysad.fn);
app.listen(8083, function (err) {
if (err)
return console.log(err);
console.log('running express on localhost:8083');
});
| Fix for babel polyfill not loading on server | Fix for babel polyfill not loading on server
| JavaScript | mit | teebszet/happysad,teebszet/happysad |
25e27164e877113531ee871d423d322e4a67d925 | public/audio.js | public/audio.js | var audio = new AudioContext || new webkitAudioContext;
function playRadarPing() {
var osc = audio.createOscillator();
var gain = audio.createGain();
var time = audio.currentTime;
gain.connect(audio.destination);
osc.connect(gain);
osc.type = 'triangle';
gain.gain.setValueAtTime(0.2, time);
gain.gain... | var audio = new AudioContext || new webkitAudioContext;
function playTone(audio, freq, type) {
var osc = audio.createOscillator();
var gain = audio.createGain();
var time = audio.currentTime;
if (freq) {
osc.frequency.setValueAtTime(freq, time);
}
else {
var freq = osc.frequency.value;
}
if (... | Add function to play tone and adjust gain based on frequency | Add function to play tone and adjust gain based on frequency
| JavaScript | mit | peternatewood/socket-battle,peternatewood/socket-battle |
0e57e1db39102e6b815b44f434501a3f1197be84 | test/no-functions.js | test/no-functions.js | var assert = require('assert');
var common = require('./util/common.js');
var Understudy = require('../').Understudy;
var actor = new Understudy();
actor.before('no-functions', function () {
throw new Error('before shouldn\'t be reached');
});
assert.throws(function () {
actor.perform('no-functions', 'INVALID AC... | var assert = require('assert');
var common = require('./util/common.js');
var Understudy = require('../').Understudy;
var actor = new Understudy();
actor.before('no-functions', function () {
throw new Error('before shouldn\'t be reached');
});
actor.after('no-functions', function () {
throw new Error('after shou... | Add explicit errors for `after` and `action` | Add explicit errors for `after` and `action`
| JavaScript | mit | NealEhardt/understudy |
1f4f8db1b87f726b861eb9ccc42709b1d2806c16 | react-config.js | react-config.js | var baseConfig = require('./index'),
extend = require('extend');
var reactConfig = {
"ecmaFeatures": {
"jsx": true
},
"env": {
"browser": true,
"es6": true,
"jest": true,
"node": true
},
"plugins": [
"react"
]
};
module.exports = extend(true, baseConfig, reactConfig);
| var baseConfig = require('./index'),
extend = require('extend');
var reactConfig = {
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"env": {
"browser": true,
"es6": true,
"jest": true,
"node": true
},
"plugins": [
"react"
]
};
module.exports = extend(true, baseConfig, react... | Allow es6 modules - set modules to true for emcaFeatures | Allow es6 modules
- set modules to true for emcaFeatures
| JavaScript | apache-2.0 | Brightspace/eslint-config-brightspace |
807f836ae11b19ca2f8089c809dbe75a36b0921e | Resources/test/test_survey.js | Resources/test/test_survey.js | (function(){
describe('survey model', function() {
it('checks if the model is empty', function() {
model = require('models/survey');
model.truncate();
expect(model.isEmpty()).toBeTruthy();
model.newRecord().save();
expect(model.isEmpty()).toBeFalsy();
});
});
})(); | (function() {
describe('survey model', function() {
var model;
beforeEach(function() {
model = require('models/survey');
model.truncate();
});
afterEach(function() {
model.truncate();
});
it('checks if the model is empty', function() {
expect(model.isEmpty()).toBeTruthy();
model.newRecor... | Write jasmine specs for the Survey Model. | Write jasmine specs for the Survey Model.
| JavaScript | mit | nilenso/ashoka-survey-mobile,nilenso/ashoka-survey-mobile |
5e5472507e7a879950f35d60fa1d364463bdd704 | serios/api/permissionchecker.js | serios/api/permissionchecker.js | /*
This file handles all authentication checking used in the API using promises.
It serves as wrapper of the identity management which uses callbacks.
*/
module.exports = {
checkPermission: function (authorization_token) {
return new Promise(function (resolve, reject) {
// this is a dummy ve... | /*
This file handles all authentication checking used in the API using promises.
It serves as wrapper of the identity management which uses callbacks.
*/
module.exports = {
checkPermission: function (authorization_token) {
/*return new Promise(function (resolve, reject) {
// this is a dummy ... | Remove permission checks for now | Remove permission checks for now
| JavaScript | apache-2.0 | SEDARI/serios |
01e88cb439c5b53bb4f114ddf58d0d9ff0c55d17 | routes/index.js | routes/index.js | var express = require('express')
var router = express.Router()
router.get('/', function (req, res, next) {
console.log('Cookies: ', req.cookies)
if (Object.keys(req.cookies).indexOf('username') !== -1) {
return res.redirect('/studies')
} else {
res.render('index', { title: 'Choose a new username / Enter ... | var express = require('express')
var router = express.Router()
router.get('/', function (req, res, next) {
console.log('Cookies: ', req.cookies)
if (Object.keys(req.cookies).indexOf('username') !== -1) {
return res.redirect('/studies')
} else {
res.render('index', { title: 'Choose a new username / Enter ... | Handle xpress deprecate warning regarding req.param() | Handle xpress deprecate warning regarding req.param()
| JavaScript | mit | sleutho/HstWebApp,sleutho/HstWebApp |
4165610cfd6c59b083bc721a826e4fa463b864c4 | wwwroot/app/src/services/RecipeService.js | wwwroot/app/src/services/RecipeService.js | import uuid from 'uuid';
export default class RecipeService {
static addUniqueIdsForIngredients(ingredients) {
return ingredients.map(ingredient => ({id: uuid.v4(), name: ingredient }));
}
static processRecipe(recipe) {
return { ...recipe, ingredients: RecipeService.addUniqueIdsForIngredie... | import uuid from 'uuid';
export default class RecipeService {
static addUniqueIdsForIngredients(ingredients) {
return ingredients.map(ingredient => ({id: uuid.v4(), name: ingredient, canBeDeleted: true }));
}
static processRecipe(recipe) {
return { ...recipe, ingredients: RecipeService.add... | Set canBeDeleted for ingredients of recipes fetched | Set canBeDeleted for ingredients of recipes fetched
| JavaScript | mit | AlinCiocan/FoodPlanApp,AlinCiocan/PlanEatSave,AlinCiocan/FoodPlanApp,AlinCiocan/PlanEatSave,AlinCiocan/FoodPlanApp,AlinCiocan/PlanEatSave |
ef4a04f8cdaa5719247e803abe02e3858b625beb | test/Tracker.spec.js | test/Tracker.spec.js | import { expect } from 'chai';
import { Tracker } from '../src';
describe('Tracker', () => {
before() => {
window.scrollTo(0, 0);
document.getElementById('container').innerHTML = '';
timer = setInterval(() => window.scrollBy(0, 50), 50);
});
after(() => clearInterval(timer));
afterEach(() => isTra... | import { expect } from 'chai';
import { Tracker } from '../src';
describe('Tracker', () => {
it('Should not be undefined', () => expect(Tracker).to.not.be.undefined);
});
| Test (Tracker): Remove DOM tests | Test (Tracker): Remove DOM tests
| JavaScript | mit | kettanaito/sentinel-dom,kettanaito/sentinel-dom,kettanaito/sentinel-dom |
e97d8de5e698751a02328fe29806e9961a783dfe | client/templates/bets/create.js | client/templates/bets/create.js | Template.createBetForm.helpers({
photo: function(){
return Session.get("photo");
}
})
Template.createBetForm.events({
"submit .create-bet" : function(event){
event.preventDefault();
var title = event.target.betTitle.value,
wager = event.target.betWager.value,
user = Meteor.user(),
... | Template.createBetForm.helpers({
photo: function(){
return Session.get("photo");
}
})
Template.createBetForm.events({
"submit .create-bet" : function(event){
event.preventDefault();
var title = event.target.betTitle.value,
wager = event.target.betWager.value,
user = Meteor.user(),
... | Insert data into Images collection | Insert data into Images collection
| JavaScript | mit | nmmascia/webet,nmmascia/webet |
2dd5ea550f7c7fea90979107a773012a3f233e18 | kolibri/plugins/user/assets/src/app.js | kolibri/plugins/user/assets/src/app.js | const KolibriModule = require('kolibri_module');
const coreActions = require('kolibri.coreVue.vuex.actions');
const router = require('kolibri.coreVue.router');
const Vue = require('kolibri.lib.vue');
const RootVue = require('./vue');
const actions = require('./actions');
const store = require('./state/store');
const ... | const KolibriModule = require('kolibri.coreModules.kolibriModule');
const coreActions = require('kolibri.coreVue.vuex.actions');
const router = require('kolibri.coreVue.router');
const Vue = require('kolibri.lib.vue');
const RootVue = require('./vue');
const actions = require('./actions');
const store = require('./st... | Update user plugin to use deduped kolibri module. | Update user plugin to use deduped kolibri module.
| JavaScript | mit | aronasorman/kolibri,MingDai/kolibri,benjaoming/kolibri,jonboiser/kolibri,rtibbles/kolibri,indirectlylit/kolibri,lyw07/kolibri,christianmemije/kolibri,jonboiser/kolibri,learningequality/kolibri,jonboiser/kolibri,lyw07/kolibri,lyw07/kolibri,aronasorman/kolibri,mrpau/kolibri,learningequality/kolibri,MingDai/kolibri,indire... |
1d34c71d8439500cf885624c2e206ffa10b8684d | config/convertsql.js | config/convertsql.js | var fs = require('fs');
var log4js = require('log4js');
var logger = log4js.getLogger('Converter');
var inputFile = process.argv[2];
if(!inputFile){
printUsage();
}
/**
*
* If user have not input the path of text file,
* It will show the correct usage of script.
*
*/
function printUsage(){
var out = ... | var fs = require('fs');
var log4js = require('log4js');
var logger = log4js.getLogger('Converter');
var inputFile = process.argv[2];
var defaultSelectRec = parseInt(process.argv[3]);
var defaultUpdateRec = parseInt(process.argv[4]);
if(!defaultSelectRec){
defaultSelectRec = 1;
}
if(!defaultUpdateRec){
defa... | Add default select and update record option | Add default select and update record option
| JavaScript | apache-2.0 | dollars0427/SQLwatcher |
de4a002a9527a84c03a2b5b06deafd4e0d7cccfc | src/components/Timetable/ModuleTable.js | src/components/Timetable/ModuleTable.js | import React, { PropTypes } from 'react';
import { Table, TableBody, TableRow, TableRowColumn } from 'material-ui/Table';
const ModuleTable = ({
modules,
removeModule,
}) => (
<Table
selectable={false}
style={{ tableLayout: 'auto' }}
>
<TableBody
displayRowCheckbox={false}
>
{module... | import React, { PropTypes } from 'react';
import ActionDelete from 'material-ui/svg-icons/action/delete';
import IconButton from 'material-ui/IconButton';
import { List, ListItem } from 'material-ui/List';
import { red700 } from 'material-ui/styles/colors';
const ModuleTable = ({
modules,
removeModule,
}) => (
... | Use list instead of table for module table | Use list instead of table for module table
| JavaScript | mit | momomods/momomods,momomods/momomods |
c399f15e2e27a45af941ea4064d87ceb83faeb11 | vivo-vantagens.js | vivo-vantagens.js | var tds = document.querySelectorAll("tr > td.disponibilidade");
for (i = 0; i < tds.length; i++) {
if (tds[i].innerHTML.trim() == "Esgotado"){
var tr = tds[i].parentElement;
tr.parentElement.removeChild(tr);
}
}
| var tds = document.querySelectorAll("tr > td.disponibilidade");
var availability = "";
for (i = 0; i < tds.length; i++) {
availability = tds[i].innerHTML.trim();
if (availability == "Esgotado" || availability == "reservas encerradas") {
var tr = tds[i].parentElement;
tr.parentElement.removeChild(tr);
}... | Update to avoid status different of available. | Update to avoid status different of available. | JavaScript | mit | rodrigopinto/vivo-vantagens-chrome |
8e3358f28d9153094a1c0d16bbefecd69ce3d621 | api/feed/pending/matchExec.js | api/feed/pending/matchExec.js | (function () {
var cogClass = function () {};
cogClass.prototype.exec = function (params, request, response) {
var oops = this.utils.apiError;
var sys = this.sys;
var userID = params.id;
var userKey = params.key;
var pages = sys.pages;
pages.reset();
... | (function () {
var cogClass = function () {};
cogClass.prototype.exec = function (params, request, response) {
var oops = this.utils.apiError;
var sys = this.sys;
var userID = params.id;
var userKey = params.key;
var pages = sys.pages;
pages.reset();
... | Drop trashed items from dynamic pending feed | Drop trashed items from dynamic pending feed
| JavaScript | unlicense | fbennett/newswriter |
ea6e370c8d409dc17b39db9938295cb05cc113ca | demo/server.js | demo/server.js | const bodyParser = require('body-parser')
const express = require('express');
const hellosign = require('hellosign-sdk');
const path = require('path');
const app = express();
app.use(bodyParser.json());
app.use(express.static(__dirname + '/dist'));
app.post('/create-signature-request', (req, res) => {
const { apiK... | const bodyParser = require('body-parser')
const express = require('express');
const hellosign = require('hellosign-sdk');
const app = express();
app.use(bodyParser.json());
app.use(express.static(__dirname + '/dist'));
app.post('/create-signature-request', (req, res) => {
const { apiKey, clientId } = req.body;
... | Remove unnecesasry dependency from demo | [DEV-3932] Remove unnecesasry dependency from demo
| JavaScript | isc | HelloFax/hellosign-embedded |
c48cb16fa28b67dea27f4aa23295b34793a3b9b1 | webpack.config.js | webpack.config.js | const webpack = require('webpack');
const path = require('path');
const libraryName = 'react-to-mdl';
// export config
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: {
layout: './src/layout',
index: './src/index'
},
externals: [
'classnames',
'material-design-lite',
'rea... | const webpack = require('webpack');
const path = require('path');
const libraryName = 'react-to-mdl';
// export config
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: {
button: './src/button',
card: './src/card',
dataTable: './src/dataTable',
grid: './src/grid',
layout: './sr... | Add button, card, dataTable, grid, layout, menu, spinner, tabs and textfield "sub modules" to bundle | Add button, card, dataTable, grid, layout, menu, spinner, tabs and textfield "sub modules" to bundle
| JavaScript | mit | iporaitech/react-to-mdl,iporaitech/react-to-mdl |
8aba6965ba53cec1e8f570adf6320c28c4ebf8b0 | webpack.config.js | webpack.config.js | /* global __dirname, require, module*/
const path = require("path");
const yargs = require("yargs");
const env = yargs.argv.env; // use --env with webpack 2
const shouldExportToAMD = yargs.argv.amd;
let libraryName = "Navigo";
let outputFile, mode;
if (shouldExportToAMD) {
libraryName += ".amd";
}
if (env === "b... | /* global __dirname, require, module*/
const path = require("path");
const yargs = require("yargs");
const env = yargs.argv.env; // use --env with webpack 2
const shouldExportToAMD = yargs.argv.amd;
let libraryName = "Navigo";
let outputFile, mode;
if (shouldExportToAMD) {
libraryName += ".amd";
}
if (env === "b... | Convert arrow functions to function markup | Convert arrow functions to function markup
Without this, navigo will not run in IE11. | JavaScript | mit | krasimir/navigo |
7c194ac6d9b1f8a5f50682366c5fd5a06eb0366d | webpack.config.js | webpack.config.js | require('webpack');
module.exports = {
entry: {
main:'./src/frontend/components/App.jsx',
admin: './src/frontend/components/admin/AdminDashboard.jsx',
networkAdmin: './src/frontend/components/admin/NetworkAdminDashboard.jsx',
},
output: {
path: './public/javascript',
... | var webpack = require('webpack');
module.exports = {
entry: {
main:'./src/frontend/components/App.jsx',
admin: './src/frontend/components/admin/AdminDashboard.jsx',
networkAdmin: './src/frontend/components/admin/NetworkAdminDashboard.jsx',
},
output: {
path: './public/javasc... | Add minify stage when not dev | Add minify stage when not dev
| JavaScript | agpl-3.0 | rabblerouser/core,rabblerouser/core,rabblerouser/core |
00a7bfa53799eb8b9c425fb11baba37e9f416331 | webpack.config.js | webpack.config.js | var path = require('path');
var webpack = require('webpack');
var babelSettings = JSON.stringify({
presets: ['es2015', 'react']
});
module.exports = {
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents r... | var path = require('path');
var webpack = require('webpack');
var babelSettings = JSON.stringify({
presets: ['es2015', 'react']
});
module.exports = {
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents r... | Make browserHistory routing actually work. | Make browserHistory routing actually work.
| JavaScript | unlicense | patlillis/stella,patlillis/stella |
b9a819c9aa7e59bbd0199b647f1a482b539b7bff | webpack.config.js | webpack.config.js | const path = require("path");
module.exports = {
context: __dirname,
entry: "./frontend/entry.js",
output: {
path: path.join(__dirname, 'app', 'assets', 'javascripts'),
filename: "bundle.js"
},
resolve: {
extensions: ["*", ".js", ".jsx"]
},
devtool: 'source-maps',
module: {
loaders: [
... | const path = require("path");
module.exports = {
context: __dirname,
entry: "./frontend/swappin_app.jsx",
output: {
path: path.join(__dirname, 'app', 'assets', 'javascripts'),
filename: "bundle.js"
},
resolve: {
extensions: ["*", ".js", ".jsx"]
},
devtool: 'source-maps',
module: {
loade... | Fix webpack not transpiling .jsx files | Fix webpack not transpiling .jsx files
| JavaScript | mit | PGilbertSchmitt/SwappingApp,PGilbertSchmitt/SwappingApp,PGilbertSchmitt/SwappingApp |
8a008d13267bf2b47c6ec78f68eef85e55671197 | server/config/route.config.js | server/config/route.config.js | 'use strict';
const controllers = require('../controllers/base.controller');
const csrf = require('csurf') ({ cookie: true });
module.exports = (app) => {
app
.get('/', controllers.home.index)
.get('/about', controllers.home.about)
.get('/user/register', controllers.user.register)
... | 'use strict';
const controllers = require('../controllers/base.controller');
const csrf = require('csurf') ({ cookie: true });
const authorize = (req, res) => {
if (!req.user) {
res.redirect('/');
}
}
module.exports = (app) => {
app
.get('/', controllers.home.index)
.get('/about',... | Add authorize middleware for routs requiring logged user | Add authorize middleware for routs requiring logged user
| JavaScript | mit | FriendlySource/DeveloperScope,FriendlySource/DeveloperScope |
9a105ae3ed869045e70aa3301d893e27ae629b1c | scripts/main.js | scripts/main.js | $().ready(function() {
}); | $().ready(function() {
var lastSlideIndex = +$("[data-slide]:last").attr("data-slide");
var currentSlide = getCurrentSlideNumber();
$("[data-slide]").hide();
$("body").keydown(function(event) {
switch(event.keyCode) {
case 37:
previousSlide();
break... | Add support for slides in all the pages | Add support for slides in all the pages
| JavaScript | apache-2.0 | tfKamran/trainings,tfKamran/trainings |
df992f790d8b46c445ee83a637f7fdb5e647c93f | test/events/submitSpec.js | test/events/submitSpec.js | describe("form submit event", function () {
$.fixture("options");
subject(function () {
return new Awesomplete("#inside-form", { list: ["item1", "item2", "item3"] });
});
beforeEach(function () {
spyOn(Awesomplete.prototype, "close");
this.subject.input.focus();
this.subject.open();
});
it("closes com... | describe("form submit event", function () {
$.fixture("options");
subject(function () {
return new Awesomplete("#inside-form", { list: ["item1", "item2", "item3"] });
});
beforeEach(function () {
spyOn(Awesomplete.prototype, "close");
this.subject.input.focus();
this.subject.open();
// prevent full pag... | Fix tests run in Firefox | Fix tests run in Firefox
| JavaScript | mit | eggpi/awesomplete,vlazar/awesomplete,LeaVerou/awesomplete,bsvobodny/awesomplete,bchcheng/awesomplete,bsvobodny/awesomplete,eggpi/awesomplete,vlazar/awesomplete,bchcheng/awesomplete,LeaVerou/awesomplete |
400d2059634df2bb746af152ba9071d108829779 | src/main.js | src/main.js | /* global chrome*/
import Vue from 'vue';
import App from './App';
import router from './router';
import Vuex from 'vuex';
import Buefy from 'buefy';
window.addEventListener('unload', () => {
chrome.runtime.sendMessage({
from: 'app',
type: 'loadEvent',
loadState: 'unload',
});
});
Vue.config.productio... | /* global chrome*/
import Vue from 'vue';
import App from './App';
import router from './router';
import Vuex from 'vuex';
import Buefy from 'buefy';
import VsNotify from '@/components/vs-notify';
window.addEventListener('unload', () => {
chrome.runtime.sendMessage({
from: 'app',
type: 'loadEvent',
loadS... | Use vs-notify and add vuex store | Use vs-notify and add vuex store
| JavaScript | mit | nextgensparx/quantum-router,nextgensparx/quantum-router |
9423916b02edca23ea6284093428954958d8c9c8 | server/migrations/20170622145849-create-user.js | server/migrations/20170622145849-create-user.js | 'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
username: {
type: Sequelize.STRING
},
... | module.exports = {
up(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
username: {
type: Sequelize.STRING
},
password: {
... | Refactor code using es6 es6 syntax | Refactor code using es6 es6 syntax
| JavaScript | mit | 3m3kalionel/PostIt,3m3kalionel/PostIt |
f08eb409f692f296b837ea9e8c4d8a6683c15389 | app/core/src/navigation/index.js | app/core/src/navigation/index.js | // @flow
import * as React from 'react';
import { withMappedNavigationAndConfigProps as withMappedProps } from 'react-navigation-props-mapper';
import { StackNavigator } from '@kiwicom/mobile-navigation';
import HomepageStack from './HomepageStack';
import HotelsPackageWrapper from '../screens/HotelsPackageWrapper';
... | // @flow
import * as React from 'react';
import { withMappedNavigationAndConfigProps as withMappedProps } from 'react-navigation-props-mapper';
import {
StackNavigator,
StackNavigatorOptions,
} from '@kiwicom/mobile-navigation';
import { Color } from '@kiwicom/mobile-shared';
import { Translation } from '@kiwicom/... | Add TabNavigator to the core package | Add TabNavigator to the core package
Basically the idea is to get closer and closer to the final application.
| JavaScript | mit | mrtnzlml/native,mrtnzlml/native |
f14ceb3a654ed98440725a64df23c22a18547185 | utils/expressions.js | utils/expressions.js | export default {
default: [
'呵呵', '哈哈', '吐舌', '啊', '酷', '怒', '开心', '汗', '泪', '黑线',
'鄙视', '不高兴', '真棒', '钱', '疑问', '阴险', '吐', '咦', '委屈', '花心',
'呼', '笑眼', '冷', '太开心', '滑稽', '勉强', '狂汗', '乖', '睡觉', '惊哭',
'升起', '惊讶', '喷', '爱心', '心碎', '玫瑰', '礼物', '彩虹', '星星月亮', '太阳',
'钱币', '灯泡', '咖啡'... | export default {
default: [
'呵呵', '哈哈', '吐舌', '啊', '酷', '怒', '开心', '汗', '泪', '黑线',
'鄙视', '不高兴', '真棒', '钱', '疑问', '阴险', '吐', '咦', '委屈', '花心',
'呼', '笑眼', '冷', '太开心', '滑稽', '勉强', '狂汗', '乖', '睡觉', '惊哭',
'升起', '惊讶', '喷', '爱心', '心碎', '玫瑰', '礼物', '星星月亮', '太阳', '音乐',
'灯泡', '蛋糕', '彩虹'... | Modify the expression of sequence and sequence consistent maps | feat: Modify the expression of sequence and sequence consistent maps
| JavaScript | mit | yinxin630/fiora,yinxin630/fiora,yinxin630/fiora |
e20d585687df062cb5db4c520437af93bb8bfc3c | Resources/view/handheld/CreateIssueView.js | Resources/view/handheld/CreateIssueView.js | rhok.view.createIssue = function() {
var createButton = Ti.UI.createButton({
systemButton : Ti.UI.iPhone.SystemButton.ADD,
title : 'Add issue'
});
createButton.addEventListener('click', function() {
rhok.controller.issueController.createIssue();
view.close();
});
var cancelButton = Ti.UI.createButton(... | rhok.view.createIssue = function() {
var createButton = Ti.UI.createButton({
systemButton : Ti.UI.iPhone.SystemButton.ADD,
left: 100,
width : 80,
height: 30,
title : 'Add issue'
});
createButton.addEventListener('click', function() {
rhok.controller.issueController.createIssue();
view.close();
});
... | Make sure buttons don't overlap | Make sure buttons don't overlap
| JavaScript | apache-2.0 | DiUS/rhok-iphone |
d6cb57952af92470a654b3d27e0cfa5d52eb03e0 | test/toDate-test.js | test/toDate-test.js | import { HOUR_IN_PIXELS } from '../src/Constants';
import toDate from '../src/toDate';
it('sets the right hour', () => {
const expected = new Date();
expected.setHours(4, 0, 0, 0);
expect(toDate(new Date(), HOUR_IN_PIXELS * 4, 'Europe/Stockholm')).toEqual(expected);
});
it('sets the right minute', () => {
con... | import momentTimezone from 'moment-timezone';
import { HOUR_IN_PIXELS } from '../src/Constants';
import toDate from '../src/toDate';
it('sets the right hour', () => {
const expected = momentTimezone.tz('2017-05-01T07:33:11.722Z', 'Europe/Stockholm')
.hours(4).minutes(0).seconds(0)
.milliseconds(0)
.toDa... | Make toDate test less dependent on local time | Make toDate test less dependent on local time
| JavaScript | mit | trotzig/react-available-times,trotzig/react-available-times |
c682913446198890efada73bca6011d994a87e09 | firefox/main.js | firefox/main.js | var data = require("sdk/self").data;
var ss = require("sdk/simple-storage");
var clipboard = require("sdk/clipboard");
var text_entry = require("sdk/panel").Panel({
width: 510,
height: 370,
contentURL: data.url("popup.html"),
contentScriptFile: data.url("helper.js")
});
text_entry.port.on("copy", function(tex... | var data = require("sdk/self").data;
var ss = require("sdk/simple-storage");
var clipboard = require("sdk/clipboard");
var Panel = require("sdk/panel").Panel;
var ToggleButton = require('sdk/ui/button/toggle').ToggleButton;
var panel, button;
panel = Panel({
width: 510,
height: 370,
contentURL: data.url("popup.... | Attach panel to button in Firefox | Attach panel to button in Firefox
| JavaScript | mit | dokxpi/emoji-helper,johannhof/emoji-helper,jackunion/emoji-helper,dokxpi/emoji-helper,dokxpi/emoji-helper,johannhof/emoji-helper,jackunion/emoji-helper,jackunion/emoji-helper |
aefcd4208405101b01f920cc6934aff5d881fc5f | source/import/importerbase.js | source/import/importerbase.js | OV.ImporterBase = class
{
constructor ()
{
this.extension = null;
this.callbacks = null;
this.model = null;
this.error = null;
this.message = null;
}
Import (content, extension, callbacks)
{
this.extension = extension;
this.callbacks = callbacks;
... | OV.ImporterBase = class
{
constructor ()
{
this.extension = null;
this.callbacks = null;
this.model = null;
this.error = null;
this.message = null;
}
Import (content, extension, callbacks)
{
this.extension = extension;
this.callbacks = callbacks;
... | Reorder function in importer base class. | Reorder function in importer base class.
| JavaScript | mit | kovacsv/Online3DViewer,kovacsv/Online3DViewer,kovacsv/Online3DViewer,kovacsv/Online3DViewer |
b0b85699f9ed1365cd2dcea2069661b581cdfd72 | tests/scripts/config/karma.browserstack.conf.js | tests/scripts/config/karma.browserstack.conf.js | const base = require('./karma.base.conf');
module.exports = function(config) {
config.set(Object.assign(base, {
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESS_KEY
},
customLaunchers: {
bs_safari_mac: {
base: 'BrowserStack',
browser: 'saf... | const base = require('./karma.base.conf');
module.exports = function(config) {
config.set(Object.assign(base, {
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESS_KEY
},
customLaunchers: {
bs_safari_mac: {
base: 'BrowserStack',
browser: 'saf... | Add windows 10 to browserstack tests | Add windows 10 to browserstack tests
| JavaScript | apache-2.0 | weepower/wee-core |
c41398df848788f4d1c7f4c1307c85a55759f88c | src/Drivers/Cache/Redis/index.js | src/Drivers/Cache/Redis/index.js | 'use strict'
const { ioc } = require('@adonisjs/fold')
const Cache = require('..')
class Redis extends Cache {
constructor() {
super()
this.Redis = ioc.use('Redis')
}
/**
* Generate cache.
* @param {String} key
* @param {Mixed} value
* @param {Integer} milliseconds
*
* @return {Timeou... | 'use strict'
const Cache = require('..')
class Redis extends Cache {
/**
* Namespaces to inject by IoC container.
*
* @attribute inject
* @return {Array}
*/
static get inject() {
return ['Adonis/Src/Config', 'Adonis/Addons/Redis'];
}
constructor(Config, Redis) {
super()
const conf... | Refactor to use dependency injection | Refactor to use dependency injection
| JavaScript | mit | masasron/adonis-throttle,masasron/adonis-throttle |
837db5afc43088e7392fe1fac40a2d86af4c3402 | app/services/unauthenticated_github_api.js | app/services/unauthenticated_github_api.js | import Conductor from 'conductor';
import ajax from 'glazier/utils/ajax';
/*
Provides unauthenticated github api access
@class UnauthenticatedGithubApiConsumer
*/
var UnauthenticatedGithubApiService = Conductor.Oasis.Service.extend({
/*
@public
@property requests
@type Object
*/
requests: {
... | import Conductor from 'conductor';
import ajax from 'glazier/utils/ajax';
/*
Provides unauthenticated github api access
@class UnauthenticatedGithubApiConsumer
*/
var UnauthenticatedGithubApiService = Conductor.Oasis.Service.extend({
/*
@public
@property requests
@type Object
*/
requests: {
... | Apply new ajax adjustment to unauthenticatedGithubApiService too. | Apply new ajax adjustment to unauthenticatedGithubApiService too. | JavaScript | mit | yapplabs/glazier,yapplabs/glazier |
6d3d99c637ed068ec310bc555ebb00ddcc84efe6 | src/account-info/LogoutButton.js | src/account-info/LogoutButton.js | /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet } from 'react-native';
import type { Actions, Auth } from '../types';
import connectWithActions from '../connectWithActions';
import { ZulipButton } from '../common';
import { unregisterPush } from '../api';
import { getAuth, getAccounts, ge... | /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet } from 'react-native';
import type { Actions, Auth } from '../types';
import connectWithActions from '../connectWithActions';
import { ZulipButton } from '../common';
import { unregisterPush } from '../api';
import { getAuth, getPushToken } ... | Clean up logout method call. | logout: Clean up logout method call.
This was a silent type error -- we were passing an argument to a
function that doesn't expect any. Make the code less confused.
[greg: revised commit message]
| JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile |
4d5e1837616915f3f9ceed02ad6586588d6b05d6 | app/scripts/services/banner_service.js | app/scripts/services/banner_service.js | /* global Firebase */
'use strict';
/**
* @ngdoc service
* @name bannerPreviewApp.BannerService
* @description
* # BannerService
* Service in the bannerPreviewApp.
*/
angular.module('bannerPreviewApp')
.service('BannerService', function BannerService($firebase, configuration) {
this.getBanners = function()... | /* global Firebase */
'use strict';
/**
* @ngdoc service
* @name bannerPreviewApp.BannerService
* @description
* # BannerService
* Service in the bannerPreviewApp.
*/
angular.module('bannerPreviewApp')
.service('BannerService', function BannerService($firebase, configuration) {
this.getBanners = function()... | Add getBanner method to BannerService | Add getBanner method to BannerService
| JavaScript | mit | rudylee/banner-preview |
e270384f75fbb6b59dfb2a4361b24603d0383fac | src/app/initializers/store.js | src/app/initializers/store.js | define( [ "Ember", "EmberData", "EmberDataLS" ], function( Ember, DS ) {
// no initializer here: just upgrade the application store
var merge = Ember.merge;
DS.Store.reopen({
/**
* Find a record and unload the generated record
* @param {string} modelName
* @param {string|number} id
* @param {Object?... | define( [ "Ember", "EmberData", "EmberDataLS" ], function( Ember, DS ) {
// no initializer here: just upgrade the application store
var merge = Ember.merge;
DS.Store.reopen({
/**
* Find a record and unload the generated record
* @param {string} modelName
* @param {string|number} id
* @param {Object?... | Fix memory leak in EmberData's RecordArrayManager | Fix memory leak in EmberData's RecordArrayManager
Immediately unregister record arrays from the manager.
| JavaScript | mit | streamlink/streamlink-twitch-gui,streamlink/streamlink-twitch-gui,chhe/livestreamer-twitch-gui,bastimeyer/livestreamer-twitch-gui,bastimeyer/livestreamer-twitch-gui,chhe/livestreamer-twitch-gui,chhe/livestreamer-twitch-gui,streamlink/streamlink-twitch-gui,bastimeyer/livestreamer-twitch-gui |
7d440d4a155971dad3fd42cb67f7ab61f951ed2a | src/controllers/v2/capsules.js | src/controllers/v2/capsules.js |
const limit = require('../../lib/query-builder/v2/limit');
const project = require('../../lib/query-builder/v2/project');
module.exports = {
/**
* Returns all Dragon data
*/
all: async (ctx) => {
const data = await global.db
.collection('dragon')
.find({})
.project(project(ctx.request... |
const limit = require('../../lib/query-builder/v2/limit');
const project = require('../../lib/query-builder/v2/project');
module.exports = {
/**
* Returns all Dragon data
*/
all: async (ctx) => {
const data = await global.db
.collection('dragon')
.find({})
.project(project(ctx.request... | Fix order in v2 dragon endpoint | Fix order in v2 dragon endpoint
| JavaScript | apache-2.0 | r-spacex/SpaceX-API,r-spacex/SpaceX-API |
1e8d5ff7175f2e5804f2ace70468d749da051ffe | public/scripts/main.js | public/scripts/main.js | import addFavicon from './helpers';
import LazyLoad from 'vanilla-lazyload';
const bowser = require('bowser');
if (bowser.msie && bowser.version < 11) {
$('.browser').removeClass('hide');
} else if (bowser.chrome && bowser.version < 64) {
$('.browser').removeClass('hide');
} else if (bowser.firefox && bowser.vers... | import addFavicon from './helpers';
import LazyLoad from 'vanilla-lazyload';
const bowser = require('bowser');
if (bowser.msie) {
$('.browser').removeClass('hide');
} else if (bowser.msedge && bowser.version < 12) {
$('.browser').removeClass('hide');
} else if (bowser.chrome && bowser.version < 64) {
$('.browser... | Add message browser out of date for all msie | Add message browser out of date for all msie
| JavaScript | mit | itarverne/generator-itarverne-landing-page,itarverne/generator-itarverne-landing-page |
13d383be967855ce50638b082503d5360eccc870 | portal/apps/org.wso2.carbon.iam.user-portal.app/src/main/public/js/account-setting.js | portal/apps/org.wso2.carbon.iam.user-portal.app/src/main/public/js/account-setting.js | $(window).load(function(){
var selector = '.settings-nav li';
$(selector).not(".collapse-li").click(function () {
$(selector).not(".collapse-li").removeClass('active');
});
// Show the relevant tab from url
var url = document.location.toString();
if (url.match('#')) {
$('.setti... | $(window).load(function(){
var selector = '.settings-nav li';
$(selector).not(".collapse-li").click(function () {
$(selector).not(".collapse-li").removeClass('active');
});
// Show the relevant tab from url
var url = document.location.toString();
if (url.match('#')) {
$('.setti... | Remove focus effect on readonly fields | Remove focus effect on readonly fields
| JavaScript | apache-2.0 | harsha1979/product-is,harsha1979/product-is,harsha1979/product-is,harsha1979/product-is |
62ff842047ee82e17ca30576d3e77323d078c1f0 | src/Plugins/Torrents/Hadouken.Plugins.Torrents/UI/js/app/dialogs/addTorrentsDialog.js | src/Plugins/Torrents/Hadouken.Plugins.Torrents/UI/js/app/dialogs/addTorrentsDialog.js | define(['jquery', 'dialog', 'rpcClient'], function($, Dialog, RpcClient) {
function AddTorrentsDialog() {
Dialog.call(this, '/plugins/core.torrents/dialogs/add-torrents.html');
this.rpc = new RpcClient();
}
AddTorrentsDialog.prototype = new Dialog();
AddTorrentsDialog.prototype.... | define(['jquery', 'dialog', 'rpcClient'], function($, Dialog, RpcClient) {
function AddTorrentsDialog() {
Dialog.call(this, '/plugins/core.torrents/dialogs/add-torrents.html');
this.rpc = new RpcClient();
}
AddTorrentsDialog.prototype = new Dialog();
AddTorrentsDialog.prototype.... | Add torrent dialog now adds torrents. | Add torrent dialog now adds torrents.
| JavaScript | mit | Robo210/hadouken,Robo210/hadouken,Robo210/hadouken,yonglehou/hadouken,yonglehou/hadouken,vktr/hadouken,Robo210/hadouken,vktr/hadouken,vktr/hadouken,vktr/hadouken,yonglehou/hadouken |
a991d2de576e1fa9de4cbbb0163c6c77b83149ea | src/sap.m/test/sap/m/demokit/tutorial/walkthrough/37/webapp/controller/HelloDialog.js | src/sap.m/test/sap/m/demokit/tutorial/walkthrough/37/webapp/controller/HelloDialog.js | sap.ui.define([
"sap/ui/base/Object"
], function (UI5Object) {
"use strict";
return UI5Object.extend("sap.ui.demo.wt.controller.HelloDialog", {
constructor : function (oView) {
this._oView = oView;
},
open : function () {
var oView = this._oView;
var oDialog = oView.byId("helloDialog");
// crea... | sap.ui.define([
"sap/ui/base/Object"
], function (UI5Object) {
"use strict";
return UI5Object.extend("sap.ui.demo.wt.controller.HelloDialog", {
constructor : function (oView) {
this._oView = oView;
},
open : function () {
var oView = this._oView;
var oDialog = oView.byId("helloDialog");
// crea... | Fix walkthrough step 37 after simplification | [INTERNAL][FIX] Fix walkthrough step 37 after simplification
Change-Id: Id93e8d246a989e2116b442bcb644e09c8a52041a
| JavaScript | apache-2.0 | nzamani/openui5,SQCLabs/openui5,nzamani/openui5,olirogers/openui5,SAP/openui5,cschuff/openui5,SQCLabs/openui5,SAP/openui5,SAP/openui5,olirogers/openui5,nzamani/openui5,SAP/openui5,cschuff/openui5,olirogers/openui5,SQCLabs/openui5,cschuff/openui5 |
26e9505fc08ebbbdf6eab8b53c461be436dee021 | client/packages/settings-dashboard-extension-worona/src/dashboard/selectorCreators/index.js | client/packages/settings-dashboard-extension-worona/src/dashboard/selectorCreators/index.js | import { createSelector } from 'reselect';
import * as deps from '../deps';
import * as selectors from '../selectors';
export const getSettings = packageNamespace =>
createSelector(
selectors.getSettingsLiveCollection,
deps.selectors.getSelectedSiteId,
(settings, siteId) =>
settings.find(
i... | import { createSelector } from 'reselect';
import * as deps from '../deps';
import * as selectors from '../selectors';
export const getSettings = packageNamespace =>
createSelector(
selectors.getSettingsLiveCollection,
deps.selectors.getActivatedPackages,
deps.selectors.getSelectedSiteId,
(settings, ... | Remove the need of namespaces in settings. | Remove the need of namespaces in settings.
| JavaScript | mit | worona/worona-dashboard,worona/worona-core,worona/worona-core,worona/worona,worona/worona,worona/worona,worona/worona-dashboard |
e9a88d0549d13a57f973836600e74dde86940aba | core/app/assets/javascripts/application.js | core/app/assets/javascripts/application.js | // Factlink configuration
//= require_tree ./globals
// All the default libraries/files needed for all pages on Factlink
//= require local_storage_polyfill
//= require underscore
//= require console_polyfill
//= require function_bind_polyfill
//= require jquery_ujs
//= require jquery.scrollTo
//= require jquery_ujs_ov... | // Factlink configuration
//= require_tree ./globals
// All the default libraries/files needed for all pages on Factlink
//= require console_polyfill
//= require function_bind_polyfill
//= require local_storage_polyfill
//= require jquery_ujs
//= require jquery.scrollTo
//= require jquery_ujs_override
//= require jqu... | Move polyfills into their own seperate section | Move polyfills into their own seperate section
| JavaScript | mit | Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core |
21aa3901b13d4882c6f7f0b672749bdefc713bb4 | .storybook/styles.js | .storybook/styles.js | export const baseStyles = {
height: '100vh',
};
export const centerStyles = {
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
};
| export const baseStyles = {};
export const centerStyles = {
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
};
| Remove the height: 100vh from baseStyles which breaks the viewport scrolling | Remove the height: 100vh from baseStyles which breaks the viewport scrolling
| JavaScript | mit | teamleadercrm/teamleader-ui |
3b5edcb5a08233d37a98cb6e069a4bd701e31760 | database.js | database.js | var monk = require('monk');
module.exports = monk('localhost:27017/frozen-forest'); | var monk = require('monk');
module.exports = monk(process.env.MONGOHQ_URL || 'localhost:27017/frozen-forest'); | Use MongoHQ URI if available. | Use MongoHQ URI if available.
"if available" means if running on heroku. If not, it will automatically fallback to localhost.
| JavaScript | bsd-3-clause | Staytment/Server |
0a39048ed5b9fe93d42addf380e7e2072ae7179f | client/components/timed.js | client/components/timed.js | angular.module('sparrow')
.controller('TimedCtrl', function() {
})
.component('timed', {
controller: 'TimedCtrl',
templateUrl: 'templates/timed.html'
}); | angular.module('sparrow')
.controller('TimedCtrl', function() {
this.workout = [];
//workout contain template created by user.
this.addWorkout = function() {
var obj = {};
obj.activity = this.activity;
obj.duration = Number(this.minutes || 0) * 60 + Number(this.seconds);
this.workout.push(obj);
... | Add addWorkout() which help create a template of workout | Add addWorkout() which help create a template of workout
| JavaScript | mit | Ankit09osr/sparrow,Ankit09osr/sparrow,TeamSparrows/sparrow,TeamSparrows/sparrow |
2aa5b9cb9a76bfa26fd75ea65a77890ade90540e | app/assets/javascripts/angular/app.js | app/assets/javascripts/angular/app.js | (function(){
'use strict';
angular
.module('secondLead',
['ngDragDrop',
'ui.bootstrap',
'ui.router',
'gridster',
'restangular',
'angularUtils.directives.dirPagination',
'secondLead.common',
'templates'])
.config(function(paginationTemplateProvider) {
paginationTemplateProvider.set... | (function(){
'use strict';
angular
.module('secondLead',
['ngDragDrop',
'ui.bootstrap',
'ui.router',
'gridster',
'restangular',
'angularUtils.directives.dirPagination',
'secondLead.common',
'templates'])
.config(function(paginationTemplateProvider) {
paginationTemplateProvider.set... | Add stateProvider state for user | Add stateProvider state for user
| JavaScript | mit | ac-adekunle/secondlead,ac-adekunle/secondlead,ac-adekunle/secondlead |
45d54c47cc94ae938ceb7cd4a54cb343b0f110cd | app/models/formats/kml.js | app/models/formats/kml.js | var ogr = require('./ogr');
function kml() {}
kml.prototype = new ogr('kml');
var p = kml.prototype;
p._contentType = "application/kml; charset=utf-8";
p._fileExtension = "kml";
// As of GDAL 1.10 SRID detection is bogus, so we use
// our own method. See:
// http://trac.osgeo.org/gdal/ticket/5131
// http:... | var ogr = require('./ogr');
function kml() {}
kml.prototype = new ogr('kml');
var p = kml.prototype;
p._contentType = "application/kml; charset=utf-8";
p._fileExtension = "kml";
// As of GDAL 1.10.1 SRID detection is bogus, so we use
// our own method. See:
// http://trac.osgeo.org/gdal/ticket/5131
// htt... | Add note about which GDAL version fixes the SRID detection bug | Add note about which GDAL version fixes the SRID detection bug
| JavaScript | bsd-3-clause | calvinmetcalf/CartoDB-SQL-API,CartoDB/CartoDB-SQL-API,dbirchak/CartoDB-SQL-API,calvinmetcalf/CartoDB-SQL-API,dbirchak/CartoDB-SQL-API,dbirchak/CartoDB-SQL-API,CartoDB/CartoDB-SQL-API,calvinmetcalf/CartoDB-SQL-API,calvinmetcalf/CartoDB-SQL-API,dbirchak/CartoDB-SQL-API |
d90de80b66cc36f366410efd1d1e4122a36de77d | app/assets/javascripts/filter_form.js | app/assets/javascripts/filter_form.js | $(document).ready(function() {
$(window).listHistory();
$("select, input[type='radio']", ".filter-form").loader({
trigger_on_event: "change"
});
$("button[type='submit']", ".filter-form").loader();
$("button.refresh-btn", ".filter-form").cleaner();
$('div.content')
.per_page_paginat... | $(document).ready(function() {
$(window).listHistory();
$(".link-export").click(function() {
$(this).attr("href", $.clear_query_params($(this).attr("href")) + window.location.search);
});
$("select, input[type='radio']", ".filter-form").loader({
trigger_on_event: "change"
});
$("... | Add form params to PDF 'link-export' link | Add form params to PDF 'link-export' link
Change-Id: I4088f40903b42b7bd0639d75e38889bfa99645cb
| JavaScript | agpl-3.0 | Opensoftware/USI-Core,Opensoftware/USI-Core,Opensoftware/USI-Core |
75a0ad0a95ecbdb6cde8424edcbb72400c3de463 | app/reducers/frontpage.js | app/reducers/frontpage.js | import { createSelector } from 'reselect';
import { selectArticles } from './articles';
import { selectEvents } from './events';
export const selectFrontpage = createSelector(
selectArticles,
selectEvents,
(articles, events) => {
return articles.concat(events);
}
);
| import moment from 'moment';
import { sortBy } from 'lodash';
import { createSelector } from 'reselect';
import { selectArticles } from './articles';
import { selectEvents } from './events';
export const selectFrontpage = createSelector(
selectArticles,
selectEvents,
(articles, events) =>
sortBy(articles.con... | Sort events and articles by dates from now | Sort events and articles by dates from now
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp |
c7d02f9c8deaf1b3de8817a6c994c2fa426abe55 | blueprints/app/files/config/targets.js | blueprints/app/files/config/targets.js | const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
];
const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === 'production';
if (isCI || isProduction) {
browsers.push('ie 11');
}
module.exports = {
browsers
};
| 'use strict';
const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
];
const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === 'production';
if (isCI || isProduction) {
browsers.push('ie 11');
}
module.exports = {
browsers
};
| Fix 'const' declarations in non-strict mode are not supported | Fix 'const' declarations in non-strict mode are not supported
Without `'use strict';` I get lint errors of `'const' declarations in non-strict mode are not supported yet on Node 4.5.0` due to the new node linting rules. Adding this fixes the issue. Alternatively, we could disable that rule for this file or altogether. | JavaScript | mit | twokul/ember-cli,HeroicEric/ember-cli,Turbo87/ember-cli,gfvcastro/ember-cli,ember-cli/ember-cli,ef4/ember-cli,jrjohnson/ember-cli,fpauser/ember-cli,twokul/ember-cli,cibernox/ember-cli,gfvcastro/ember-cli,fpauser/ember-cli,thoov/ember-cli,balinterdi/ember-cli,HeroicEric/ember-cli,buschtoens/ember-cli,elwayman02/ember-cl... |
e314e82adbcc3b627244723733f9068bac5130a3 | app/modules/mobilizations/pages/mobilization-page.spec.js | app/modules/mobilizations/pages/mobilization-page.spec.js | import React from 'react'
import { shallow } from 'enzyme'
import { MobilizationPage } from '../../pages/mobilization-page'
describe('app/modules/mobilizations/__tests__/pages/mobilization-page', () => {
const defaultProps = { mobilization: {} }
const context = { router: {} }
it('should render without crashed'... | import React from 'react'
import { shallow } from 'enzyme'
import { MobilizationPage } from './mobilization-page'
describe('app/modules/mobilizations/pages/mobilization-page', () => {
const defaultProps = { mobilization: {} }
const context = { router: {} }
it('should render without crashed', () => {
shallo... | Fix mobilization page test file import | Fix mobilization page test file import
| JavaScript | agpl-3.0 | nossas/bonde-client,nossas/bonde-client,nossas/bonde-client |
c9bd277f1496b9bf219f82e8b421b4cc5c57ab98 | source/assets/javascripts/analytics.js | source/assets/javascripts/analytics.js | <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analy... |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js'... | Resolve a bug due to GA tracker code | Resolve a bug due to GA tracker code | JavaScript | mit | gregoiredierendonck/Labo3G,gregoiredierendonck/Labo3G,gregoiredierendonck/Labo3G |
2a4ac7722d6da1a2a564dad1ea04bc447b98270b | js/examples.js | js/examples.js | (function() {
reactDemo();
boringDemo();
function reactDemo() {
document.getElementById('react-touch-demo').addEventListener('loadedmetadata', function() {
this.currentTime = 43;
}, false);
}
function boringDemo() {
var menuButton = document.getElementsByCla... | (function() {
fullScreen();
reactDemo();
boringDemo();
function toggleFullScreen() {
if (!document.fullscreenElement && // alternative standard method
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working met... | Add full screen link via title click | Add full screen link via title click
| JavaScript | mit | poshaughnessy/edtechdevs-awesome-mobile-animations |
5e9ce48bed8126f4c77b074dfd95fbf8d2acb20e | client/src/js/index.js | client/src/js/index.js | import 'core-js/es5';
import 'core-js/fn/promise';
import 'core-js/fn/symbol';
import 'core-js/fn/array/from';
import 'core-js/fn/array/iterator';
import 'core-js/fn/array/find';
import 'core-js/fn/string/ends-with';
import 'core-js/fn/string/starts-with';
import 'whatwg-fetch';
import 'moment-timezone/moment-timezone... | import 'core-js/es5';
import 'core-js/fn/promise';
import 'core-js/fn/symbol';
import 'core-js/fn/array';
import 'core-js/fn/string/ends-with';
import 'core-js/fn/string/starts-with';
import 'whatwg-fetch';
import 'moment-timezone/moment-timezone';
import 'moment/locale/ru';
import moment from 'moment';
import timez... | Bring back the full Array polyfill for now | Bring back the full Array polyfill for now
This may or may not fix older devices. Gotta investigate.
| JavaScript | mit | despawnerer/theatrics,despawnerer/theatrics,despawnerer/theatrics |
90824d64d6bb8b2a7aa20ab4ee86be16e16c16ca | kaba/kaba/js/lint.js | kaba/kaba/js/lint.js | "use strict";
const CLIEngine = require("eslint").CLIEngine;
const Promise = require("bluebird");
const fs = require("fs");
const path = require("path");
const filePathMatcher = require("../../lib/file-path-matcher");
/**
*
* @param {string} file
* @param {string} srcDir
* @param {JsTaskConfig} config
*/
module... | "use strict";
const CLIEngine = require("eslint").CLIEngine;
const Promise = require("bluebird");
const fs = require("fs");
const path = require("path");
const filePathMatcher = require("../../lib/file-path-matcher");
/**
*
* @param {string} file
* @param {string} srcDir
* @param {JsTaskConfig} config
*/
module... | Fix empty lines in JS output | Fix empty lines in JS output
| JavaScript | bsd-3-clause | Becklyn/kaba,Becklyn/kaba |
c3aeb8490653e959c9996c2e4e7769f07029a46d | models/Shoes.js | models/Shoes.js | const mongoose = require('mongoose');
const shoesSchema = new mongoose.Schema({
name: String
});
const Shoes = mongoose.model('Shoes', shoesSchema);
module.exports = Shoes; | const mongoose = require('mongoose');
const shoesSchema = new mongoose.Schema({
name: String
});
const Shoes = mongoose.model('Shoes', shoesSchema);
module.exports = Shoes;
/*function listshoes() {
return a list of all the shoes to be treated
}
*/
/*function getSize(shoe) {
return the size of a shoe
}
*/ | Add comments for desired methods in shoe model | Add comments for desired methods in shoe model
| JavaScript | mit | chaBiselx/BigBeardShoes,chaBiselx/BigBeardShoes |
81fed40ede2057456da41988415485d54240fbed | ocw-ui/frontend-new/test/spec/controllers/resultdetail.js | ocw-ui/frontend-new/test/spec/controllers/resultdetail.js | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | Remove temporary test for ResultDetailCtrl | Remove temporary test for ResultDetailCtrl
| JavaScript | apache-2.0 | huikyole/climate,apache/climate,apache/climate,lewismc/climate,jarifibrahim/climate,Omkar20895/climate,pwcberry/climate,agoodm/climate,jarifibrahim/climate,kwhitehall/climate,agoodm/climate,agoodm/climate,huikyole/climate,kwhitehall/climate,apache/climate,riverma/climate,Omkar20895/climate,Omkar20895/climate,pwcberry/c... |
14ad78fddec0072ed1b05334cf335f8233548f76 | app/controllers.js | app/controllers.js | /* eslint babel/semi: "error" */
export AttachmentsController from './controllers/api/v1/AttachmentsController';
export FeedFactoriesController from './controllers/api/v1/FeedFactoriesController';
export GroupsController from './controllers/api/v1/GroupsController';
export PasswordsController from './controllers/api/v1... | export { default as AttachmentsController } from './controllers/api/v1/AttachmentsController';
export { default as FeedFactoriesController } from './controllers/api/v1/FeedFactoriesController';
export { default as GroupsController } from './controllers/api/v1/GroupsController';
export { default as PasswordsController }... | Change export syntax for Typescript & eslint | Change export syntax for Typescript & eslint
| JavaScript | mit | FreeFeed/freefeed-server,FreeFeed/freefeed-server |
f6b5fe7f411346bddbb1177a9b6f76907cd6b5bf | server/index.js | server/index.js | require('babel-register'); // transpile code on the fly
module.exports = require('./server.js');
| // Use babel-register to transpile server code on the fly
require('babel-register');
module.exports = require('./server.js');
| Use babel-register to transpile server code on the fly | Use babel-register to transpile server code on the fly
| JavaScript | mit | leifoolsen/webpack2-boilerplate,leifoolsen/webpack2-boilerplate |
1ffe788a55cee5cadf030663a37c56bc89f37b09 | lib/scripts/slack.js | lib/scripts/slack.js | const IDoneThis = require('../apis/i-done-this');
const Slack = require('../apis/slack');
module.exports = commander => {
commander
.command('slack')
.description('Posts your list of IDoneThis goals for today in Slack.')
.action(() => {
const idt = new IDoneThis({
token: process.env.IDT_TOK... | const IDoneThis = require('../apis/i-done-this');
const Slack = require('../apis/slack');
module.exports = commander => {
commander
.command('slack')
.description('Posts your list of IDoneThis goals for today in Slack.')
.arguments('[type]')
.action(type => {
type = type ? type.trim().toLowerCa... | Add ability to post goals of a specific type to Slack | Add ability to post goals of a specific type to Slack
| JavaScript | mit | mmiller42/idt-slack-goals |
6562c90fbb8859189de3dd8c97e010dcb57cbbc3 | Gruntfile.js | Gruntfile.js | var config = require('./Build/Config');
module.exports = function(grunt) {
'use strict';
// Display the execution time of grunt tasks
require('time-grunt')(grunt);
/**
* Load all grunt-tasks in 'Build/Grunt-Options'.
*/
var gruntOptionsObj = require('load-grunt-configs')(grunt, {
config : {
src: "Build... | var config = require('./Build/Config');
module.exports = function(grunt) {
'use strict';
// Display the execution time of grunt tasks
require('time-grunt')(grunt);
// Load all grunt-tasks in 'Build/Grunt-Options'.
var gruntOptionsObj = require('load-grunt-configs')(grunt, {
config : {
src: "Build/Grunt-Opt... | Change the comment style for single line comments | [MISC] Change the comment style for single line comments
| JavaScript | mit | t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template |
0cfcf910e21664ce058ac6de99aad1ab75e84ad1 | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: {
node: true,
globals: {},
white: true,
indent: 2,
camelcase: true,
... | module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: {
node: true,
globals: {},
white: true,
indent: 2,
camelcase: true,
... | Set Mocha timout to 5 seconds | Set Mocha timout to 5 seconds
| JavaScript | mit | imrosner/imgurwrap,msrxthr/imgurwrap |
dc7d52f72fb5c3883ee42c4b4ff85d80b64027ba | Gruntfile.js | Gruntfile.js | module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
build: {
src: "build"
}
},
copy: {
build: {
files: [
{
expand: true,
cwd: 'source/',
src: ['clever-style-switcher.js'],
dest: 'build/'
}
]
}
... | module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
build: {
src: "build"
}
},
copy: {
build: {
files: [
{
expand: true,
cwd: 'source/',
src: ['clever-style-switcher.js'],
dest: 'build/'
}
]
}
... | Add a build task for Grunt and make it the default. | Add a build task for Grunt and make it the default.
| JavaScript | mit | carroket/clever-style-switcher |
d16f90edd13e9e36833cecf24b0164b413763bfc | js/polyfills.js | js/polyfills.js | /*
Copyright 2018 Alfredo Mungo <alfredo.mungo@protonmail.ch>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to u... | /*
Copyright 2018 Alfredo Mungo <alfredo.mungo@protonmail.ch>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to u... | Fix Object.fromEntries polyfill (for Safari 11) | Fix Object.fromEntries polyfill (for Safari 11)
| JavaScript | mit | jimwins/scat,jimwins/scat,jimwins/scat,jimwins/scat |
1823ca6fbc8bf38c09bfe8ef1250640d915a5530 | src/Frontend/Themes/Bootstrap4/src/Js/Theme/Pagination.js | src/Frontend/Themes/Bootstrap4/src/Js/Theme/Pagination.js | export class Pagination {
events () {
$('[data-role="mobile-pagination"]').on('change', $.proxy(this.goToPage, this))
}
goToPage (event) {
let $current = $(event.currentTarget)
let nextPageId = $current.val()
let url = window.location.href.split('?')[0]
let parameters = this.getParameters()... | export class Pagination {
events () {
$('[data-role="mobile-pagination"]').on('change', $.proxy(this.goToPage, this))
}
goToPage (event) {
let $current = $(event.currentTarget)
let nextPageId = $current.val()
this.changePageInUrlAndReload(nextPageId)
}
changePageInUrlAndReload (value) {
... | Upgrade get params of mobile pagination | Upgrade get params of mobile pagination
| JavaScript | mit | carakas/forkcms,jonasdekeukelaere/forkcms,sumocoders/forkcms,jonasdekeukelaere/forkcms,carakas/forkcms,carakas/forkcms,sumocoders/forkcms,jonasdekeukelaere/forkcms,carakas/forkcms,sumocoders/forkcms,sumocoders/forkcms,carakas/forkcms,jonasdekeukelaere/forkcms,jonasdekeukelaere/forkcms,sumocoders/forkcms |
ce489cb26125b16c52176b457dd9607f43c24a46 | app/utilities/Simulator.js | app/utilities/Simulator.js | 'use strict';
const fs = require('fs');
const path = require('path');
const { spawn } = require('child_process');
const { BrowserWindow } = require('electron');
const simulator = root => {
const WIDTH = 800;
const HEIGHT = 600;
//Deserialize project info from projInfo file, contains path to index.html and prese... | 'use strict';
const fs = require('fs');
const path = require('path');
const { spawn } = require('child_process');
const { BrowserWindow } = require('electron');
const EXPORT_FILES = 'export_files';
const exportedDir = path.join(__dirname, '../', EXPORT_FILES);
const simulator = root => {
const WIDTH = 800;
const ... | Change directory call for simulator | Change directory call for simulator
| JavaScript | mit | FermORG/FermionJS,FermORG/FermionJS |
2e9174115bd1be939c85baeb7f21b6071f2a1ded | lib/libra2/app/assets/javascripts/file_upload_options.js | lib/libra2/app/assets/javascripts/file_upload_options.js | (function() {
"use strict";
function initPage() {
var fileTypes = [
"csv",
"gif",
"htm",
"html",
"jpeg",
"jpg",
"mp3",
"mp4",
"pdf",
"png",
"tif",
"tiff",
"txt",
"xml"
];
var list = fileTypes.join(", ").toUpperCase();
var filter = fileTypes.join("|");
// Match an... | (function() {
"use strict";
function initPage() {
var fileTypes = [
"csv",
"gif",
"htm",
"html",
"jpeg",
"jpg",
"mp3",
"pdf",
"png",
"tif",
"tiff",
"txt",
"xml"
];
var list = fileTypes.join(", ").toUpperCase();
var filter = fileTypes.join("|");
// Match any file tha... | Remove MP4 from the list of supported filetypes | Remove MP4 from the list of supported filetypes
| JavaScript | apache-2.0 | uvalib/Libra2,uvalib/Libra2,uvalib/Libra2,uvalib/Libra2,uvalib/Libra2 |
4e97adcc9483d9b4682726e8530ef799d16ff821 | client/SearchBoxT.js | client/SearchBoxT.js | Template.SearchBoxT.events( {
'submit form' : function( evt, template ) {
evt.preventDefault();
var wordList = Session.get( "WordList" );
var newWords = template.find(".search-query").value.split(/\s+/);
_.each( newWords, function( newWord ) {
var word = newWord.replace(",", "").t... | Template.SearchBoxT.events( {
'submit form' : function( evt, template ) {
evt.preventDefault();
var wordList = Session.get( "WordList" );
var newWords = template.find(".search-query")
.value
.replace(/,/g, " ")
... | Replace "," with " " before splitting the input. | Replace "," with " " before splitting the input.
| JavaScript | mit | tiagoetiene/ifeel,tiagoetiene/ifeel |
d33cb6ecf918fdba60396c74d1c49993ca9cc656 | bin/build-sprite-string.js | bin/build-sprite-string.js | import defaultAttrs from '../src/default-attrs.json';
/**
* Build an SVG sprite string containing SVG symbols.
* @param {Object} icons
* @returns {string}
*/
function buildSpriteString(icons) {
const symbols = Object.keys(icons)
.map(icon => toSvgSymbol(icon, icons[icon]))
.join('');
return `<svg xmln... | import DEFAULT_ATTRS from '../src/default-attrs.json';
/**
* Build an SVG sprite string containing SVG symbols.
* @param {Object} icons
* @returns {string}
*/
function buildSpriteString(icons) {
const symbols = Object.keys(icons)
.map(icon => toSvgSymbol(icon, icons[icon]))
.join('');
return `<svg xml... | Use uppercase for default attrs import | refactor: Use uppercase for default attrs import | JavaScript | mit | colebemis/feather,colebemis/feather |
b6bd71d96f1f1ae897446385861a82a67a5009ba | web/src/containers/Editable/interactive-editable/index.js | web/src/containers/Editable/interactive-editable/index.js | import { List as list } from 'immutable';
import React from 'react';
import ImmutableComponent from '../../../ImmutableComponent';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import SuggestionsList from '../suggestions-list';
import { getEditValue, getDefaultValue } from '../format';
expor... | import React from 'react';
import ImmutableComponent from '../../../ImmutableComponent';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import SuggestionsList from '../suggestions-list';
import { getEditValue, getDefaultValue } from '../format';
export default class InteractiveEditable extend... | Select all on input elements when navigating to them | Select all on input elements when navigating to them
| JavaScript | mit | felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget |
76f1ec746b3f5f40ebf06ea2ac0482986d5d16b6 | src/api/http.js | src/api/http.js | const mediaType = 'application/vnd.cignium.resource+json'
export async function request(method, href, data, config) {
const request = {
body: data && JSON.stringify(data),
credentials: 'include',
headers: new Headers({ Accept: 'application/json' }),
method,
}
const response = await fetch(href, r... | const mediaType = 'application/vnd.cignium.resource+json'
export async function request(method, href, data, config) {
const request = {
body: data && JSON.stringify(data),
credentials: 'include',
headers: new Headers({ Accept: 'application/json' }),
method,
}
const response = await fetch(href, r... | Refresh on all 401 responses | fix: Refresh on all 401 responses
| JavaScript | mit | cignium/hypermedia-client,cignium/hypermedia-client |
845b716811fad0786c0db0e226974b280c5e4654 | src/api/node.js | src/api/node.js | import fs from "fs";
import {parse} from "babylon";
import CodeGenerator from "../CodeGenerator";
import processTokens from "../process-tokens";
function parseText(text) {
let ast = parse(text, {
preserveParens: true,
plugins: ["*"]
});
let tokens = ast.tokens;
let semicolons = ast.to... | import fs from "fs";
import {parse} from "babylon";
import CodeGenerator from "../CodeGenerator";
import processTokens from "../process-tokens";
function parseText(text) {
let ast = parse(text, {
preserveParens: true,
sourceType: "module",
plugins: ["*"]
});
let tokens = ast.token... | Add module sourceType in options to babylon. | Add module sourceType in options to babylon.
| JavaScript | mit | Mark-Simulacrum/attractifier,Mark-Simulacrum/pretty-generator |
ee9f7055ce9a370e4361d26d2d6542f97053d94b | tests/scripts/config/karma.dev.conf.js | tests/scripts/config/karma.dev.conf.js | const base = require('./karma.base.conf');
module.exports = function(config) {
config.set(Object.assign(base, {
browsers: ['Chrome'],
autoWatch: true,
singleRun: false,
// console.error to print to terminal
logLevel: config.LOG_ERROR,
}));
};
| const base = require('./karma.base.conf');
module.exports = function(config) {
config.set(Object.assign(base, {
browsers: ['Chrome-1024x768'],
autoWatch: true,
singleRun: false,
customLaunchers: {
'Chrome-1024x768': {
base: 'Chrome',
flags: [
'--window-size=1024,768'
]
}
},
// conso... | Add custom launcher for parity with browserstack | Add custom launcher for parity with browserstack
| JavaScript | apache-2.0 | weepower/wee-core |
47c71249689adf536546899cf51492fc7874f784 | src/validators/required-if.js | src/validators/required-if.js | import required from './required';
const validate = (val, ruleObj, propertyName, inputObj) => {
const targetProperty = ruleObj.params[0];
if (inputObj[targetProperty] === ruleObj.params[1]) {
return required.validate(val);
}
return true;
};
const message = required.message;
export default {validate, me... | import _ from 'lodahs/fp';
import required from './required';
class And {
constructor(mappings) {
this.mappings = mappings;
}
satisfied(inputObj) {
const equalInput = function (mapping) {
return _.get(mapping.key, inputObj) === mapping.value;
};
return _.every(equalInput, this.mappings);
... | Add data structure for `And` and `Or` required if | Add data structure for `And` and `Or` required if
| JavaScript | mit | cermati/satpam,sendyhalim/satpam |
1f5696a27be83d5b3e66e5f583f53a61d4404905 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var mocha = require('gulp-mocha');
gulp.task('default', function() {
gulp.watch(['lib/**', 'test/**'], ['test']);
});
gulp.task('test', function() {
return gulp.src(['test/test-*.js'], { read: false })
.pipe(mocha({
reporter: 'dot'
}));
}); | var gulp = require('gulp');
var mocha = require('gulp-mocha');
gulp.task('default', function() {
gulp.watch(['honeycomb.js', 'lib/**', 'test/**'], ['test']);
});
gulp.task('test', function() {
return gulp.src(['test/test-*.js'], { read: false })
.pipe(mocha({
reporter: 'dot'
}));
}); | Watch the main file too | Watch the main file too
| JavaScript | isc | BrandExtract/Honeycomb |
ed9954c98ac50c4d6cb92eab80fb02e6731ff733 | src/js/BrowserUtils.js | src/js/BrowserUtils.js | // Copyright 2013 Google 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/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | // Copyright 2013 Google 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/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | Add .matches() as default choice for browserUtils.matchSelector | Add .matches() as default choice for browserUtils.matchSelector
Formerly known as matchesSelector(), with many vendor prefixes as seen in this function.
I'm using ADT in a jsdom environment, which doesn't support any vendor-prefixed variations
of this function.
http://caniuse.com/#feat=matchesselector
| JavaScript | apache-2.0 | t9nf/accessibility-developer-tools,GoogleChrome/accessibility-developer-tools,ricksbrown/accessibility-developer-tools,kublaj/accessibility-developer-tools,t9nf/accessibility-developer-tools,garcialo/accessibility-developer-tools,alice/accessibility-developer-tools,ckundo/accessibility-developer-tools,seksanman/accessi... |
87f4e4d1db64ecf7394d72797d98b7606293456e | Node/PushNotifier.js | Node/PushNotifier.js | var apn = require('apn');
function PushNotifier() {
var options = {
cert: '/home/pi/node/HomeSensor/Node/cert.pem',
key: '/home/pi/node/HomeSensor/Node/key.pem',
errorCallback: function(err, notif) {
console.log('ERROR : ' + err + '\nNOTIFICATION : ' + notif);
}
};
var apnConnection = new apn.Connect... | var apn = require('apn');
function PushNotifier() {
var options = {
cert: '/home/pi/node/HomeSensor/Node/cert.pem',
key: '/home/pi/node/HomeSensor/Node/key.pem',
errorCallback: function(err, notif) {
console.log('ERROR : ' + err + '\nNOTIFICATION : ' + notif);
}
};
var apnConnection = new apn.Connect... | Expire messages in 1 hour. | Expire messages in 1 hour.
| JavaScript | apache-2.0 | MichMich/HomeSensor |
0bec410028155023c632c8b4743c5dfbc71909c8 | tests/dummy/config/targets.js | tests/dummy/config/targets.js | const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
];
const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === 'production';
if (isCI || isProduction) {
browsers.push('ie 11');
}
module.exports = {
browsers
};
| 'use strict';
const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
];
const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === 'production';
if (isCI || isProduction) {
browsers.push('ie 11');
}
module.exports = {
browsers
};
| Add 'use strict' for node 4.x compat | Add 'use strict' for node 4.x compat
| JavaScript | mit | isleofcode/ember-cli-testdouble,isleofcode/ember-cli-testdouble |
834e4ab1effde2c3ca02ac1da31789874e3ca086 | src/__test__/flattenDeep.test.js | src/__test__/flattenDeep.test.js | import flattenDeep from "../flattenDeep"
describe("flattenDeep", () => {
it("returns a non nested array as is", () => {
expect(flattenDeep([5, "a"])).toEqual([5, "a"]);
})
});
| import flattenDeep from "../flattenDeep"
describe("flattenDeep", () => {
it("returns a non nested array as is", () => {
expect(flattenDeep([5, "a"])).toEqual([5, "a"]);
});
it("flattens a one level nested array", () => {
expect(flattenDeep([5, "a", [3, 2]])).toEqual([5, "a", 3, 2]);
})... | Test one and two level flatten | Test one and two level flatten
| JavaScript | mit | mormahr/flatten-deep |
e55b3d19943e8f84b7df55b2d33188bc6e6b639b | node-mongo-script.js | node-mongo-script.js | GNU nano 2.2.6 File: test.js Modified
var MongoClient = require('mongodb').MongoClient;
var assert = require('assert');... | var MongoClient = require('mongodb').MongoClient;
var assert = require('assert');
var ObjectId = require('mongodb').ObjectID;
var url = 'mongodb://localhost:27017/test';
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
db.collection('videos', function(err, coll) {
coll.count(function(err... | Change random range to size of collection | Change random range to size of collection | JavaScript | mit | mmetro/WeirdSideofYouTube,ametrocavich/WeirdSideofYouTube,mmetro/WeirdSideofYouTube |
b0124867e2a30795a51c6fc186ff18aa4b60555e | test/server/testServerMain.js | test/server/testServerMain.js | import {PROTOCOL, LOCATION, PORT} from '../../shared/constants'
import http from 'http'
const options = {
host: '',
path: '/data',
port: `${PORT}`,
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
};
const callback = function(response) {
let str = ''
response.on('data', function (chunk) {
... | import {PROTOCOL, LOCATION, PORT} from '../../shared/constants'
import http from 'http'
import tcpPortUsed from 'tcp-port-used'
const options = {
host: '',
path: '/data',
port: `${PORT}`,
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}
const callback = function(response) {
let str = ''
r... | Add dev server status checking for testing safety | Add dev server status checking for testing safety
| JavaScript | mit | UVicFH/Telemetry-v2,UVicFH/Telemetry-v2 |
767986bdd707a3af5670512660f387a5f6c514e8 | src/components/Posts/posts.js | src/components/Posts/posts.js | import Vue from 'vue';
import { postsResource } from 'src/util/resources';
import template from './posts.html';
export default Vue.extend({
template,
data() {
return {
posts: []
};
},
created(){
this.fetchPosts();
},
methods: {
fetchPosts(){
return postsResource.get('/')
... | import Vue from 'vue';
import { postsResource } from 'src/util/resources';
import template from './posts.html';
const animation = 'flipInX';
const animationDelay = 25; // in ms
export default Vue.extend({
template,
data() {
return {
postsFilter: '',
posts: []
};
},
computed: {
filte... | Add filteredPosts as computed, add animations to list | Add filteredPosts as computed, add animations to list
| JavaScript | mit | villeristi/vue.js-starter-template,villeristi/vue.js-starter-template |
d36808a253d41f34addd24fb9ad9fe49759f0cdd | src/components/videos/VideoView.js | src/components/videos/VideoView.js | import * as _ from 'lodash'
import React from 'react'
import {connect} from 'react-redux'
import {compose, withProps} from 'recompose'
import {updateVideo} from '../../actions/videos'
import CommentList from '../CommentList'
import {withDatabaseSubscribe} from '../hocs'
const mapStateToProps = ({videos}) => ({
vi... | import * as _ from 'lodash'
import React from 'react'
import {connect} from 'react-redux'
import {compose, withProps} from 'recompose'
import {updateVideo} from '../../actions/videos'
import {withDatabaseSubscribe} from '../hocs'
const mapStateToProps = ({videos}) => ({
videos
})
const enhance = compose(
conne... | Remove comment list from video view | Remove comment list from video view
- It doesn't work anymore and will belong on performances instead
| JavaScript | mit | mg4tv/mg4tv-web,mg4tv/mg4tv-web |
a46ef64f0b9a0944b2acc5b7127721d9adaaaa92 | tasks/styles.js | tasks/styles.js | var gulp = require('gulp');
var plumber = require('gulp-plumber');
var postcss = require('gulp-postcss');
var cssnext = require('cssnext');
module.exports = function() {
var processors = [
cssnext({
url: false
})
];
return gulp.src('assets/css/*.css')
.pipe(plumber())
... | var gulp = require('gulp');
var plumber = require('gulp-plumber');
var postcss = require('gulp-postcss');
var cssnext = require('cssnext');
module.exports = function() {
var processors = [
cssnext({
url: false,
compress: true
})
];
return gulp.src('assets/css/*.css'... | Compress true dans les options de cssnext | Compress true dans les options de cssnext
| JavaScript | mit | drazik/babdelaura,drazik/babdelaura,drazik/babdelaura |
176be425b787483db12e6dac59a6e291ceaee968 | livedoc-ui-webjar/src/sagas/watchFetchDoc.js | livedoc-ui-webjar/src/sagas/watchFetchDoc.js | // @flow
import { push } from 'react-router-redux';
import { apply, call, put, takeLatest } from 'redux-saga/effects';
import type { FetchDocAction } from '../redux/actions/loader';
import { actions, FETCH_DOC } from '../redux/actions/loader';
function* fetchDoc(action: FetchDocAction): * {
try {
console.log('Fe... | // @flow
import { push } from 'react-router-redux';
import { apply, call, put, takeLatest } from 'redux-saga/effects';
import type { FetchDocAction } from '../redux/actions/loader';
import { actions, FETCH_DOC } from '../redux/actions/loader';
function* fetchDoc(action: FetchDocAction): * {
try {
console.log('Fe... | Add simple authentication support for doc fetch | Add simple authentication support for doc fetch
Resolves:
https://github.com/joffrey-bion/livedoc/issues/82
| JavaScript | mit | joffrey-bion/livedoc,joffrey-bion/livedoc,joffrey-bion/livedoc,joffrey-bion/livedoc,joffrey-bion/livedoc |
d3bfeb9d2e344c939ab097d91236645f3a6044f1 | src/magic_search_bootstrap.js | src/magic_search_bootstrap.js | angular.module('MagicSearch', ['ui.bootstrap'])
.directive('magicOverrides', function() {
return {
restrict: 'A',
controller: function($scope) {
// showMenu and hideMenu depend on foundation's dropdown. They need
// to be modified to work with another ... | angular.module('MagicSearch', ['ui.bootstrap'])
.directive('magicOverrides', function() {
return {
restrict: 'A',
controller: function($scope) {
// showMenu and hideMenu depend on foundation's dropdown. They need
// to be modified to work with another ... | Support facets in the url that don't exist yet | Support facets in the url that don't exist yet
For example, the page first loads with a domain=Vivaldi facet
in the URL. But there is no such domain, because domains are
not loaded for another .1 second. So the facet is in the URL
but not the search bar. With this fix, when domains are
loaded and the facet JSON is upd... | JavaScript | apache-2.0 | fantapop/magic-search,nagyistoce/magic-search,eucalyptus/magic-search,nagyistoce/magic-search,fantapop/magic-search,eucalyptus/magic-search |
8c2aeb9b2143c30b4ad066dd3558161815c37312 | core/js/oc-requesttoken.js | core/js/oc-requesttoken.js | $(document).on('ajaxSend',function(elm, xhr) {
xhr.setRequestHeader('requesttoken', oc_requesttoken);
}); | $(document).on('ajaxSend',function(elm, xhr) {
xhr.setRequestHeader('requesttoken', oc_requesttoken);
xhr.setRequestHeader('OCS-APIREQUEST', 'true');
});
| Add OCS API header per default | Add OCS API header per default
Relieve @PVince from having to write it all the time ;-)
| JavaScript | agpl-3.0 | cernbox/core,pollopolea/core,sharidas/core,nextcloud/server,pmattern/server,Ardinis/server,pixelipo/server,pixelipo/server,pmattern/server,xx621998xx/server,andreas-p/nextcloud-server,owncloud/core,pmattern/server,nextcloud/server,bluelml/core,sharidas/core,sharidas/core,pixelipo/server,whitekiba/server,xx621998xx/serv... |
ca0bd590276676051f563280b89aed0a825a1e52 | components/PersonListView.js | components/PersonListView.js | import React from 'react'
import { ScrollView, View } from 'react-native'
import { List, ListItem, SearchBar } from 'react-native-elements'
import PropTypes from 'prop-types'
function PersonListView({colors, styles, list, handlePress}) {
return (
<View style={styles.container}>
<SearchBar
lightThem... | import React from 'react'
import { ScrollView, View } from 'react-native'
import { List, ListItem, SearchBar } from 'react-native-elements'
import PropTypes from 'prop-types'
function PersonListView({colors, styles, list, handlePress}) {
return (
<View style={styles.container}>
<SearchBar
lightThem... | Add photo to avatar if possible | Add photo to avatar if possible
| JavaScript | mit | FindEarth/app |
cba4d446a7c40ba7d2d4e14d0ca94d6af8a33061 | tests/loader.js | tests/loader.js |
Tinytest.add(
'Loader - Load all critical files first',
function (test) {
var scripts = document.getElementsByTagName('script');
scripts = Array.prototype.slice.call(scripts);
scripts = scripts.slice(0, 6).map(getSrc);
var expected = [
'/packages/zones/assets/utils.js',
'/packages/zones... |
Tinytest.add(
'Loader - Load all critical files first',
function (test) {
var scripts = document.getElementsByTagName('script');
scripts = Array.prototype.slice.call(scripts);
scripts = scripts.slice(0, 6).map(getSrc);
var expected = [
'/packages/zones/assets/utils.js',
'/packages/zones... | Check if requestAnimationFrame exists (for travis) | Check if requestAnimationFrame exists (for travis)
| JavaScript | mit | meteorhacks/zones |
a715d94a919bf1fd491e9aa175f62606c397f9fb | tests/models.js | tests/models.js | var mongoose = require('mongoose');
var sugar = require('../lib/mongoose-sugar');
var schema = sugar.schema(mongoose);
var ref = sugar.ref;
var refs = sugar.refs;
var unique = sugar.unique;
exports.Author = schema('Author', {
name: {type: String, required: true},
nick: String,
extra: mongoose.Schema.Types... | var mongoose = require('mongoose');
var sugar = require('../lib/mongoose-sugar');
var schema = sugar.schema(mongoose);
var ref = sugar.ref;
var refs = sugar.refs;
var unique = sugar.unique;
exports.Author = schema('Author', {
name: {type: String, required: true},
nick: String,
extra: mongoose.Schema.Types... | Define LibraryAuthor schema for testing | Define LibraryAuthor schema for testing
| JavaScript | mit | sugarjs/mongoose-sugar |
7478a67aeb62b665fe832f8dcac72fb19fc2e065 | app/components/shared/Emojify.js | app/components/shared/Emojify.js | import React from 'react';
import Emoji from '../../lib/Emoji';
class Emojify extends React.Component {
static propTypes = {
text: React.PropTypes.string,
className: React.PropTypes.string
};
render() {
return (
<span className={this.props.className} dangerouslySetInnerHTML={{ __html: Emoji.pa... | import React from 'react';
import shallowCompare from 'react-addons-shallow-compare';
import Emoji from '../../lib/Emoji';
class Emojify extends React.Component {
static propTypes = {
text: React.PropTypes.string,
className: React.PropTypes.string
};
shouldComponentUpdate(nextProps, nextState) {
re... | Add title to emojify component | Add title to emojify component
Also throw shallowCompare into shouldComponentUpdate
| JavaScript | mit | fotinakis/buildkite-frontend,fotinakis/buildkite-frontend,buildkite/frontend,buildkite/frontend |
23816db36c7506a36836fdc288552bdda7908cef | src/shared/reducers/errors.js | src/shared/reducers/errors.js | import { ERROR_OCCURED, RESET_ERRORS } from '../actions/errors'
const initialState = {
error: null,
assistiveAccessDisabled: false
}
export default function errors(state = initialState, action) {
switch (action.type) {
case ERROR_OCCURED: {
return {
...state,
error: action.payload,
... | import { ERROR_OCCURED, RESET_ERRORS } from '../actions/errors'
const initialState = {
error: null,
assistiveAccessDisabled: false
}
export default function errors(state = initialState, action) {
switch (action.type) {
case ERROR_OCCURED: {
const error = action.payload
return {
...state,... | Fix assistive access error detection | fix: Fix assistive access error detection
| JavaScript | mpl-2.0 | okonet/codestage,okonet/codestage |
0afe0df108ee75a086e3bb7f324f87829395e5ff | examples/node/parse.js | examples/node/parse.js | /*jshint node:true */
"use strict";
var fs = require("fs"),
util = require("util"),
mp3Parser = require(__dirname + "/../../main"),
pathToMp3 = process.argv[2],
toArrayBuffer = function (buffer) {
var bufferLength = buffer.length, i = 0,
uint8Array = new Uint8Array(new ArrayBuffer(b... | /*jshint node:true, esversion:6 */
"use strict";
const fs = require("fs");
const util = require("util");
const mp3Parser = require(__dirname + "/../../main");
const pathToMp3 = process.argv[2];
const toArrayBuffer = buffer => {
const bufferLength = buffer.length;
const uint8Array = new Uint8Array(new ArrayBuff... | Switch node example to es6 | Switch node example to es6
| JavaScript | mit | acastSthlm/mp3-parser,biril/mp3-parser,biril/mp3-parser |
8626e88208cf5c126dc81eff651baa22e47b11d3 | script.js | script.js | window.onload = function(){
if(document.getElementsByTagName('tspan').length > 0){
run();
}
function run(){
var elements = document.getElementsByTagName('tspan');
var tags = getTags();
var username = getUsername();
// Add event to each tag strings.
for(var x = 0; x < elements.length; x++)... | window.onload = function(){
if(document.getElementsByTagName('tspan').length > 0){
run();
}
function run(){
var elements = document.getElementsByTagName('tspan');
var tags = getTags();
var username = getUsername();
// Add event to each tag strings.
for(var x = 0; x < elements.length; x++)... | Fix class name in order to get correct user name | Fix class name in order to get correct user name
| JavaScript | mit | suzuki86/ImproveTagListForQiita |
b73910d525f6a366b890291ad6e8b9c9f4a1ba8d | modules/annotator/components/tick-bar.js | modules/annotator/components/tick-bar.js |
class TickBar {
constructor(annotator){
this.annotator = annotator;
// Create the element
this.$tickBar = $("<div class='annotator-tickbar'></div>");
this.annotator.player.controlBar.$container.append(this.$tickBar);
}
LoadAnnotations(annotationManager){
let annota... |
class TickBar {
constructor(annotator){
this.annotator = annotator;
// Create the element
this.$tickBar = $("<div class='annotator-tickbar'></div>");
this.annotator.player.controlBar.$container.append(this.$tickBar);
this.annotator.$container.on("OnAnnotationsLoaded", (eve... | Use event for loading annotations | Use event for loading annotations
| JavaScript | mit | seieibob/Waldorf,seieibob/Waldorf |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.