commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 624 | message stringlengths 15 4.7k | lang stringclasses 3
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
3a0a5f2f9e2b2ba62da6013ba238c3783039c71c | src/client/actions/StatusActions.js | src/client/actions/StatusActions.js | import Axios from 'axios';
import {
PROVIDER_CHANGE,
FILTER_BOARD, FILTER_THREAD,
SERACH_BOARD, SEARCH_THREAD,
STATUS_UPDATE
} from '../constants';
// TODO: Filter + Search actions
export function changeProvider( provider ) {
return (dispatch, getState) => {
if (shouldChangeProvider(getStat... | import Axios from 'axios';
import {
PROVIDER_CHANGE,
FILTER_BOARD, FILTER_THREAD,
SERACH_BOARD, SEARCH_THREAD,
ALERT_MESSAGE
} from '../constants';
// TODO: Filter + Search actions
export function changeProvider( provider ) {
return (dispatch, getState) => {
if (shouldChangeProvider(getStat... | Remove clearStatus action; not in use | Remove clearStatus action; not in use
| JavaScript | mit | AdamSalma/Lurka,AdamSalma/Lurka |
5b6f3ac716e37b9d03bff3da826dca24826b24eb | jasmine/spec/inverted-index-test.js | jasmine/spec/inverted-index-test.js | describe ("Read book data",function(){
it("assert JSON file is not empty",function(){
var isNotEmpty = function IsJsonString(filePath) {
try {
JSON.parse(filePath);
} catch (e) {
return false;
}
return true;
};
expect(isNotEmpty).toBe(true).because('The JSON file sh... | describe("Read book data", function() {
beforeEach(function(){
var file = filePath.files[0];
var reader = new FileReader();
});
it("assert JSON file is not empty",function(){
var fileNotEmpty = JSON.parse(reader.result);
var fileNotEmptyResult = function(fileNotEmpty){
if (fileNotEmpty = null){
r... | Change the read book test and populate index test | Change the read book test and populate index test
| JavaScript | mit | andela-pbirir/inverted-index,andela-pbirir/inverted-index |
221f6da58e1190b97ab3c6310d3e9b699e512ea0 | ProgressBar.js | ProgressBar.js | var React = require('react-native');
var {
Animated,
Easing,
StyleSheet,
View
} = React;
var styles = StyleSheet.create({
background: {
backgroundColor: '#bbbbbb',
height: 5,
overflow: 'hidden'
},
fill: {
backgroundColor: '#3b5998',
height: 5
}
});
var ProgressBar = React.createCl... | var React = require('react-native');
var {
Animated,
Easing,
StyleSheet,
View
} = React;
var styles = StyleSheet.create({
background: {
backgroundColor: '#bbbbbb',
height: 5,
overflow: 'hidden'
},
fill: {
backgroundColor: '#3b5998',
height: 5
}
});
var ProgressBar = React.createCl... | Add initialProgress property to make start from the given value | Add initialProgress property to make start from the given value
| JavaScript | mit | lwansbrough/react-native-progress-bar |
fab2943412258c0a55c7d127cc67798f30587551 | test/bootstrap.js | test/bootstrap.js | /**
* require dependencies
*/
WebdriverIO = require('webdriverio');
WebdriverCSS = require('../index.js');
fs = require('fs-extra');
gm = require('gm');
glob = require('glob');
async = require('async');
should = require('chai').should();
expect = require('chai').expect;
capabilities = {logLevel: 'silent',desiredCap... | /**
* require dependencies
*/
WebdriverIO = require('webdriverio');
WebdriverCSS = require('../index.js');
fs = require('fs-extra');
gm = require('gm');
glob = require('glob');
async = require('async');
should = require('chai').should();
expect = require('chai').expect;
capabilities = {logLevel: 'silent',desiredCap... | Disable test cleanup for debugging | Disable test cleanup for debugging
| JavaScript | mit | JustinTulloss/webdrivercss,JustinTulloss/webdrivercss |
86d8c0168182a23b75bdd62135231b9292b881af | test/plugin.spec.js | test/plugin.spec.js | import BabelRootImportPlugin from '../plugin';
import * as babel from 'babel-core';
describe('Babel Root Import - Plugin', () => {
describe('Babel Plugin', () => {
it('transforms the relative path into an absolute path', () => {
const targetRequire = `${process.cwd()}/some/example.js`;
const transfor... | import BabelRootImportPlugin from '../plugin';
import * as babel from 'babel-core';
describe('Babel Root Import - Plugin', () => {
describe('Babel Plugin', () => {
it('transforms the relative path into an absolute path', () => {
const targetRequire = `${process.cwd()}/some/example.js`;
const transfor... | Add test for custom root (setted by babelrc) | Add test for custom root (setted by babelrc)
| JavaScript | mit | michaelzoidl/babel-root-import,Quadric/babel-plugin-inline-import |
fdd9ce07ece40caee51c093254ec232348ef2908 | api/models/User.js | api/models/User.js | /**
* User
*
* @module :: Model
* @description :: A short summary of how this model works and what it represents.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
email: 'STRING',
name: 'STRING'
/* e.g.
nickname: 'string'
*/
}
};
| /**
* User
*
* @module :: Model
* @description :: A short summary of how this model works and what it represents.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
email: {
type: 'email',
required: true
}
name: 'STRING'
/* e.g.
... | Add some validation to my model | Add some validation to my model
| JavaScript | mit | thomaslangston/sailsnode |
1a4c8c303dcfa0e9a49ff554ba540da638a8a6ab | app/controllers/index.js | app/controllers/index.js | /**
* Global Navigation Handler
*/
Alloy.Globals.Navigator = {
/**
* Handle to the Navigation Controller
*/
navGroup: $.nav,
open: function(controller, payload){
var win = Alloy.createController(controller, payload || {}).getView();
if(OS_IOS){
$.nav.openWindow(win);
}
else if(OS_MOBILEWEB){
... | /**
* Global Navigation Handler
*/
Alloy.Globals.Navigator = {
/**
* Handle to the Navigation Controller
*/
navGroup: $.nav,
open: function(controller, payload){
var win = Alloy.createController(controller, payload || {}).getView();
if(OS_IOS){
$.nav.openWindow(win);
}
else if(OS_MOBILEWEB){
... | Fix para iphone al abrir controlador | Fix para iphone al abrir controlador
Al abrir el controlador de forms no se veia el window title
| JavaScript | apache-2.0 | egregori/HADA,egregori/HADA |
2861764dfaff112ccea7a574ccf75710528b1b9f | lib/transitions/parseTransitions.js | lib/transitions/parseTransitions.js | var getInterpolation = require('interpolation-builder');
var createTransitions = require('./createTransitions');
module.exports = function(driver, states, transitions) {
// go through each transition and setup kimi with a function that works
// with values between 0 and 1
transitions.forEach( function(transitio... | var getInterpolation = require('interpolation-builder');
var createTransitions = require('./createTransitions');
module.exports = function(driver, states, transitions) {
// go through each transition and setup kimi with a function that works
// with values between 0 and 1
transitions.forEach( function(transitio... | Put back in handling for animation being a function for transition definitions | Put back in handling for animation being a function for transition definitions
| JavaScript | mit | Jam3/f1 |
9a5cdc88c83364d9ca91be189b9b36828b35ede2 | steam_user_review_filter.user.js | steam_user_review_filter.user.js | // ==UserScript==
// @name Steam Review filter
// @namespace https://github.com/somoso/steam_user_review_filter/raw/master/steam_user_review_filter.user.js
// @version 0.31
// @description try to filter out the crap on steam
// @author You
// @match http://store.steampowered.com/app/*
// @... | // ==UserScript==
// @name Steam Review filter
// @namespace https://github.com/somoso/steam_user_review_filter/raw/master/steam_user_review_filter.user.js
// @version 0.31
// @description try to filter out the crap on steam
// @author You
// @match http://store.steampowered.com/app/*
// @... | Add filtering for "Best BLAHBLAHBLAH ever made" | Add filtering for "Best BLAHBLAHBLAH ever made" | JavaScript | unlicense | somoso/steam_user_review_filter,somoso/steam_user_review_filter |
94701f09422ed9536463afc7dc2e48463af2301e | app/config/config.js | app/config/config.js | const dotenv = require('dotenv');
dotenv.config({silent: true});
const config = {
"development": {
"username": process.env.DB_DEV_USER,
"password": process.env.DB_DEV_PASS,
"database": process.env.DB_DEV_NAME,
"host": process.env.DB_DEV_HOST,
"secrete": process.env.AUTH_SECRETE,
"dialect": "po... | const dotenv = require('dotenv');
dotenv.config({silent: true});
const config = {
"development": {
"username": process.env.DB_DEV_USER,
"password": process.env.DB_DEV_PASS,
"database": process.env.DB_DEV_NAME,
"host": process.env.DB_DEV_HOST,
"secrete": process.env.AUTH_SECRETE,
"dialect": "po... | Enable logging for test environment | Enable logging for test environment
| JavaScript | mit | cyrielo/document-manager |
7f45b377171d4cffb3f83602b4a6f4025a58ac11 | app/settings/settings.js | app/settings/settings.js | const mapbox_token = 'pk.eyJ1IjoiaG90IiwiYSI6ImNpbmx4bWN6ajAwYTd3OW0ycjh3bTZvc3QifQ.KtikS4sFO95Jm8nyiOR4gQ'
export default {
'vt-source': 'http://osm-analytics.vizzuality.com', // source of current vector tiles
'vt-hist-source': 'http://osm-analytics.vizzuality.com', // source of historic vector tiles for compare ... | const mapbox_token = 'pk.eyJ1IjoiaG90IiwiYSI6ImNpbmx4bWN6ajAwYTd3OW0ycjh3bTZvc3QifQ.KtikS4sFO95Jm8nyiOR4gQ'
export default {
'vt-source': 'https://osm-analytics.vizzuality.com', // source of current vector tiles
'vt-hist-source': 'https://osm-analytics.vizzuality.com', // source of historic vector tiles for compar... | Revert "https doesn't work at the moment for osma tiles served from vizzuality" | Revert "https doesn't work at the moment for osma tiles served from vizzuality"
This reverts commit 96c3024ca822cbe801a6c2af43eae5b12c3fa9a4.
| JavaScript | bsd-3-clause | hotosm/osm-analytics,hotosm/osm-analytics,hotosm/osm-analytics |
591b86fc35858a16337b6fcd75c9575770eaa68a | static/js/front.js | static/js/front.js | var getThat = {};
getThat.controller = function() {
};
getThat.header = function() {
return m('.row', [
m('.col-md-10', [
m('.jumbotron', [
m('h1', [
m('a[href="//getthat.email"]', 'Get That Email')
])
])
])
]);
};
g... | var getThat = {};
getThat.controller = function() {
};
getThat.header = function() {
return m('.row', [
m('.col-md-10', [
m('.jumbotron', [
m('h1', [
m('a[href="//getthat.email"]', 'Get That Email')
])
])
])
]);
};
g... | Update the email selection UI | Update the email selection UI
| JavaScript | mit | chrisseto/dinosaurs.sexy,chrisseto/dinosaurs.sexy |
8ac385bc002cf517f0542d71ffdbc5c73bc6a9c5 | app/test/client.js | app/test/client.js | window.requirejs = window.yaajs;
window.history.replaceState(null, document.title = 'Piki Test Mode', '/');
define(function(require, exports, module) {
var koru = require('koru/main-client');
require('koru/session/main-client');
require('koru/test/client');
koru.onunload(module, 'reload');
require(['koru/... | window.requirejs = window.yaajs;
window.history.replaceState(null, document.title = 'Piki Test Mode', '/');
define(function(require, exports, module) {
var koru = require('koru/main-client');
require('koru/test/client');
koru.onunload(module, 'reload');
});
| Fix test starting two connections to server | Fix test starting two connections to server
| JavaScript | agpl-3.0 | jacott/piki-scoreboard,jacott/piki-scoreboard,jacott/piki-scoreboard |
dc3c20f6dbfddb315932a49d6f7a54e5d8b1043d | app/assets/javascripts/accordion.js | app/assets/javascripts/accordion.js | $(function() {
$('.accordion_head').each( function() {
$(this).after('<ul style="display: none;"></ul>');
});
$(document).on("click", '.accordion_head', function() {
var ul = $(this).next();
if (ul.text() == '') {
term = $(this).data('term');
$.getJSON("/children_graph?term=" + term, func... | $(function() {
$('.accordion_head').each( function() {
$(this).after('<ul style="display: none;"></ul>');
});
$(document).on("click", '.accordion_head', function() {
var ul = $(this).next();
if (ul.text() == '') {
term = $(this).data('term');
$.getJSON("/children_graph?term=" + term)
... | Use `done` callback for smooth animation | Use `done` callback for smooth animation
| JavaScript | mit | yohoushi/yohoushi,yohoushi/yohoushi,yohoushi/yohoushi |
7421477c92380fa88a3910e4707046ce9daf5a71 | tests/acceptance/sidebar_test.js | tests/acceptance/sidebar_test.js | var App;
module("Acceptances - Index", {
setup: function(){
var sampleDataUrl = '';
if (typeof __karma__ !== 'undefined')
sampleDataUrl = '/base';
sampleDataUrl = sampleDataUrl + '/tests/support/api.json';
App = startApp({apiDataUrl: sampleDataUrl});
},
teardown: function() {
Ember.r... | var App;
module("Acceptances - Sidebar", {
setup: function(){
var sampleDataUrl = '';
if (typeof __karma__ !== 'undefined')
sampleDataUrl = '/base';
sampleDataUrl = sampleDataUrl + '/tests/support/api.json';
App = startApp({apiDataUrl: sampleDataUrl});
},
teardown: function() {
Ember... | Fix name of sidebar acceptance test. | Fix name of sidebar acceptance test.
[ci skip]
| JavaScript | mit | rwjblue/ember-live-api |
fb9d61439a75481c1f1d9349f6f0cda2eaf02d6c | collections/server/collections.js | collections/server/collections.js | Letterpress.Collections.Pages = new Mongo.Collection('pages');
Letterpress.Collections.Pages.before.insert(function (userId, doc) {
doc.path = doc.path || doc.title.replace(/ /g, '-').toLowerCase();
if (doc.path[0] !== '/') {
doc.path = '/' + doc.path;
}
});
Meteor.publish("pages", function () {
return Let... | Letterpress.Collections.Pages = new Mongo.Collection('pages');
Letterpress.Collections.Pages.before.insert(function (userId, doc) {
doc.path = doc.path || doc.title.replace(/ /g, '-').toLowerCase();
if (doc.path[0] !== '/') {
doc.path = '/' + doc.path;
}
});
Meteor.publish("pages", function () {
var fields... | Add a publication restriction to not share premium content unless the user is signed in. | Add a publication restriction to not share premium content unless the user is signed in.
| JavaScript | mit | liangsun/Letterpress,dandv/Letterpress,shrop/Letterpress,FleetingClouds/Letterpress,chrisdamba/Letterpress,chrisdamba/Letterpress,cp612sh/Letterpress,nhantamdo/Letterpress,nhantamdo/Letterpress,shrop/Letterpress,xolvio/Letterpress,chrisdamba/Letterpress,cp612sh/Letterpress,dandv/Letterpress,dandv/Letterpress,FleetingCl... |
89dd2ec4add8840e5e8cda0e37a0162d66ec560b | src/loadNode.js | src/loadNode.js | var context = require('vm').createContext({
options: {
server: true,
version: 'dev'
},
Canvas: require('canvas'),
console: console,
require: require,
include: function(uri) {
var source = require('fs').readFileSync(__dirname + '/' + uri);
// For relative includes, we save the current directory and then... | var fs = require('fs'),
vm = require('vm'),
path = require('path');
// Create the context within which we will run the source files:
var context = vm.createContext({
options: {
server: true,
version: 'dev'
},
// Node Canvas library: https://github.com/learnboost/node-canvas
Canvas: require('canvas'),
// Cop... | Support running of PaperScript .pjs files. | Support running of PaperScript .pjs files.
| JavaScript | mit | NHQ/paper,NHQ/paper |
7a5dffb138349c3e6b2a1503fc6a6c82877c0bdc | lib/tab-stop-list.js | lib/tab-stop-list.js | /** @babel */
import TabStop from './tab-stop';
class TabStopList {
constructor (snippet) {
this.snippet = snippet;
this.list = {};
}
get length () {
return Object.keys(this.list).length;
}
findOrCreate({ index, snippet }) {
if (!this.list[index]) {
this.list[index] = new TabStop({ ... | const TabStop = require('./tab-stop')
class TabStopList {
constructor (snippet) {
this.snippet = snippet
this.list = {}
}
get length () {
return Object.keys(this.list).length
}
findOrCreate ({ index, snippet }) {
if (!this.list[index]) {
this.list[index] = new TabStop({ index, snippet... | Remove Babel dependency and convert to standard code style | Remove Babel dependency and convert to standard code style
| JavaScript | mit | atom/snippets |
08f1f9d972bdd71891e7e24a529c44fae1bfa687 | lib/util/getRoles.js | lib/util/getRoles.js | // Dependencies
var request = require('request');
//Define
module.exports = function(group, rank, callbacks) {
request.get('http://www.roblox.com/api/groups/' + group + '/RoleSets/', function(err, res, body) {
if (callbacks.always)
callbacks.always();
if (err) {
if (callbacks.failure)
cal... | // Dependencies
var request = require('request');
// Define
module.exports = function(group, callbacks) {
request.get('http://www.roblox.com/api/groups/' + group + '/RoleSets/', function(err, res, body) {
if (callbacks.always)
callbacks.always();
if (err) {
if (callbacks.failure)
callback... | Move getRole to separate file | Move getRole to separate file
Work better with cache
| JavaScript | mit | FroastJ/roblox-js,OnlyTwentyCharacters/roblox-js,sentanos/roblox-js |
cf765d21e235c686ef2546cf24e5399ea6e348c2 | lib/reddit/base.js | lib/reddit/base.js | var Snoocore = require('snoocore');
var pkg = require('../../package.json');
var uaString = "QIKlaxonBot/" + pkg.version + ' (by /u/StuartPBentley)';
module.exports = function(cfg, duration, scopes){
return new Snoocore({
userAgent: uaString,
decodeHtmlEntities: true,
oauth: {
type: 'explicit',
... | var Snoocore = require('snoocore');
var pkg = require('../../package.json');
var uaString = "QIKlaxonBot/" + pkg.version + ' (by /u/StuartPBentley)';
module.exports = function(cfg, duration, scopes){
return new Snoocore({
userAgent: uaString,
decodeHtmlEntities: true,
oauth: {
type: 'explicit',
... | Add support for non-default domains | Add support for non-default domains
| JavaScript | mit | stuartpb/QIKlaxonBot,stuartpb/QIKlaxonBot |
97fdbebde2c762d0f3ce1ab0a8529000a71dd92f | template.js | template.js | (function (<bridge>) {
// unsafeWindow
with ({ unsafeWindow: window, document: window.document, location: window.location, window: undefined }) {
// define GM functions
var GM_log = function (s) {
unsafeWindow.console.log('GM_log: ' + s);
return <bridge>.gmLog_(s);
... | (function (<bridge>) {
with ({ document: window.document, location: window.location, }) {
// define GM functions
var GM_log = function (s) {
window.console.log('GM_log: ' + s);
return <bridge>.gmLog_(s);
};
var GM_getValue = function (k, d) {
retur... | Remove fake-unsafeWindow because it's too buggy. | Remove fake-unsafeWindow because it's too buggy.
| JavaScript | mit | sohocoke/greasekit,tbodt/greasekit,kzys/greasekit,chrismessina/greasekit |
b57115294999bc2292ccee19c948bbf555fd6077 | tests/helpers/start-app.js | tests/helpers/start-app.js | import { merge } from '@ember/polyfills';
import { run } from '@ember/runloop'
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let attributes = merge({}, config.APP);
attributes = merge(attributes, attrs); // use defa... | import { assign } from '@ember/polyfills';
import { run } from '@ember/runloop'
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let attributes = assign({}, config.APP);
attributes = assign(attributes, attrs); // use d... | Update test helper due to deprecated function | Update test helper due to deprecated function
| JavaScript | apache-2.0 | ExplorViz/explorviz-ui-frontend,ExplorViz/explorviz-ui-frontend,ExplorViz/explorviz-ui-frontend |
61a0a3c5b600bc3b52d006aba46a4d144d4ab0dd | collections/List.js | collections/List.js | List = new Meteor.Collection( 'List' );
List.allow({
insert: (userId, document) => true,
update: (userId, document) => document.owner_id === Meteor.userId(),
remove: (userId, document) => false
});
List.deny({
insert: (userId, document) => false,
update: (userId, document) => false,
remove: (u... | List = new Meteor.Collection( 'List' );
List.allow({
insert: (userId, document) => true,
update: (userId, document) => document.owner_id === Meteor.userId(),
remove: (userId, document) => false
});
List.deny({
insert: (userId, document) => false,
update: (userId, document) => false,
remove: (u... | Set owner_id on new post. | Set owner_id on new post.
| JavaScript | mit | lnwKodeDotCom/WeCode,lnwKodeDotCom/WeCode |
f9221c7e28915de2fd3f253c78c1f7f24e960937 | shared/common-adapters/avatar.desktop.js | shared/common-adapters/avatar.desktop.js | // @flow
import React, {Component} from 'react'
import resolveRoot from '../../desktop/resolve-root'
import type {Props} from './avatar'
const noAvatar = `file:///${resolveRoot('shared/images/no-avatar@2x.png')}`
export default class Avatar extends Component {
props: Props;
render () {
return (
<img
... | // @flow
import React, {Component} from 'react'
import resolveRoot from '../../desktop/resolve-root'
import type {Props} from './avatar'
const noAvatar = `file:///${resolveRoot('shared/images/icons/placeholder-avatar@2x.png')}`
export default class Avatar extends Component {
props: Props;
render () {
return... | Add grey no avatar image | Add grey no avatar image
| JavaScript | bsd-3-clause | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client |
42d206a5364616aa6b32f4cc217fcc57fa223d2a | src/components/markdown-render/inlineCode.js | src/components/markdown-render/inlineCode.js | import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
className = className ? '' : className;
const language = className.replace(/lang... | import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
className = className ? className : '';
const language = className.replace(/lang... | Fix code snippet codetype so it passes in correctly | Fix code snippet codetype so it passes in correctly
| JavaScript | mit | sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system |
4f09ecf3fc15a2ca29ac3b9605046c5a84012664 | mods/gen3/scripts.js | mods/gen3/scripts.js | exports.BattleScripts = {
inherit: 'gen5',
gen: 3,
init: function () {
for (var i in this.data.Pokedex) {
delete this.data.Pokedex[i].abilities['H'];
}
var specialTypes = {Fire:1, Water:1, Grass:1, Ice:1, Electric:1, Dark:1, Psychic:1, Dragon:1};
var newCategory = '';
for (var i in this.data.Movedex) {
... | exports.BattleScripts = {
inherit: 'gen5',
gen: 3,
init: function () {
for (var i in this.data.Pokedex) {
delete this.data.Pokedex[i].abilities['H'];
}
var specialTypes = {Fire:1, Water:1, Grass:1, Ice:1, Electric:1, Dark:1, Psychic:1, Dragon:1};
var newCategory = '';
for (var i in this.data.Movedex) {
... | Revert "Gen 3: A faint ends the turn just like in gens 1 and 2" | Revert "Gen 3: A faint ends the turn just like in gens 1 and 2"
This reverts commit ebfaf1e8340db1187b9daabcb6414ee3329d882b.
| JavaScript | mit | kubetz/Pokemon-Showdown,SerperiorBae/Pokemon-Showdown,yashagl/pokemon,Nineage/Origin,Irraquated/EOS-Master,ehk12/bigbangtempclone,danpantry/Pokemon-Showdown,AWailOfATail/Pokemon-Showdown,Atwar/server-epilogueleague.rhcloud.com,DesoGit/TsunamiPS,PrimalGallade45/Lumen-Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,lFernanl... |
a3d8e35c1b438bfe7671375aca48863ca91acc90 | src/scripts/browser/utils/logger.js | src/scripts/browser/utils/logger.js | import colors from 'colors/safe';
export function printDebug() {
console.log(...arguments);
const fileLogger = require('browser/utils/file-logger');
fileLogger.writeLog(...arguments);
}
export function printError(namespace, isFatal, err) {
const errorPrefix = `[${new Date().toUTCString()}] ${namespace}:`;
i... | import colors from 'colors/safe';
function getCleanISODate() {
return new Date().toISOString().replace(/[TZ]/g, ' ').trim();
}
export function printDebug() {
console.log(...arguments);
const fileLogger = require('browser/utils/file-logger');
fileLogger.writeLog(`DEBUG [${getCleanISODate()}]`, ...arguments);
}... | Improve logging (timestamp and level) | Improve logging (timestamp and level)
| JavaScript | mit | Aluxian/Facebook-Messenger-Desktop,rafael-neri/whatsapp-webapp,rafael-neri/whatsapp-webapp,Aluxian/Facebook-Messenger-Desktop,rafael-neri/whatsapp-webapp,Aluxian/Facebook-Messenger-Desktop,Aluxian/Messenger-for-Desktop,Aluxian/Messenger-for-Desktop,Aluxian/Messenger-for-Desktop |
09f1a06bb726af840ced3c4e3d0e1cd3e2794025 | modules/youtube.js | modules/youtube.js | /**
* To use this module, add youtube.key to your config.json
* You need the key for the Youtube Data API:
* https://console.developers.google.com/apis/credentials
*/
var yt = require( 'youtube-search' );
module.exports = {
commands: {
yt: {
help: 'Searches YouTube for a query string',
aliases: [ 'youtube'... | /**
* To use this module, add youtube.key to your config.json
* You need the key for the Youtube Data API:
* https://console.developers.google.com/apis/credentials
*/
var yt = require( 'youtube-search' );
module.exports = {
commands: {
yt: {
help: 'Searches YouTube for a query string',
aliases: [ 'youtube'... | Add workaround for bad YouTube results | Add workaround for bad YouTube results
The upstream module used for YouTube search breaks when results are
neither videos nor channels. This commit forces YouTube to return only
videos and channels, in order to work around the bug.
Bug: MaxGfeller/youtube-search#15
| JavaScript | isc | zuzakistan/civilservant,zuzakistan/civilservant |
4a51369bf5b24c263ceac5199643ace5597611d3 | lib/assure-seamless-styles.js | lib/assure-seamless-styles.js | 'use strict';
var isParentNode = require('dom-ext/parent-node/is')
, isStyleSheet = require('html-dom-ext/link/is-style-sheet')
, forEach = Array.prototype.forEach;
module.exports = function (nodes) {
var styleSheets = [], container, document;
forEach.call(nodes, function self(node) {
if (isStyleSheet(node))... | 'use strict';
var isParentNode = require('dom-ext/parent-node/is')
, isStyleSheet = require('html-dom-ext/link/is-style-sheet')
, forEach = Array.prototype.forEach;
module.exports = exports = function (nodes) {
var styleSheets = [], container, document;
if (!exports.enabled) return;
forEach.call(nodes, functi... | Allow external disable of stylesheets hack | Allow external disable of stylesheets hack
| JavaScript | mit | medikoo/site-tree |
efe31ffd074aa24cb6d92fdb265fdcb7bbccbc30 | src/core/keyboard/compare.js | src/core/keyboard/compare.js | import dEqual from 'fast-deep-equal';
// Compares two possible objects
export function compareKbdCommand(c1, c2) {
return dEqual(c1, c2);
}
| import dEqual from 'fast-deep-equal';
// Compares two possible objects
export function compareKbdCommand(c1, c2) {
if (Array.isArray(c1)) {
return dEqual(c1[0], c1[1]);
}
return dEqual(c1, c2);
}
| Handle array case in keyboard command comparison | Handle array case in keyboard command comparison
| JavaScript | mit | reblws/tab-search,reblws/tab-search |
5b867ada55e138a1a73da610dc2dec4c98c8b442 | app/scripts/models/player.js | app/scripts/models/player.js | // An abstract base model representing a player in a game
function Player(args) {
// The name of the player (e.g. 'Human 1')
this.name = args.name;
// The player's chip color (supported colors are black, blue, and red)
this.color = args.color;
// The player's total number of wins across all games
this.score... | // An abstract base model representing a player in a game
class Player {
constructor(args) {
// The name of the player (e.g. 'Human 1')
this.name = args.name;
// The player's chip color (supported colors are black, blue, and red)
this.color = args.color;
// The player's total number of wins acros... | Convert Player base model to ES6 class | Convert Player base model to ES6 class
| JavaScript | mit | caleb531/connect-four |
3d9fc84c280ed14cfd980ca443c30a4a30ecffd5 | lib/assets/javascripts/cartodb/models/tile_json_model.js | lib/assets/javascripts/cartodb/models/tile_json_model.js | /**
* Model to representing a TileJSON endpoint
* See https://github.com/mapbox/tilejson-spec/tree/master/2.1.0 for details
*/
cdb.admin.TileJSON = cdb.core.Model.extend({
idAttribute: 'url',
url: function() {
return this.get('url');
},
save: function() {
// no-op, obviously no write privileges ;)... | /**
* Model to representing a TileJSON endpoint
* See https://github.com/mapbox/tilejson-spec/tree/master/2.1.0 for details
*/
cdb.admin.TileJSON = cdb.core.Model.extend({
idAttribute: 'url',
url: function() {
return this.get('url');
},
save: function() {
// no-op, obviously no write privileges ;)... | Set description as fallback for name | Set description as fallback for name
Both are optional, so might be empty or undefined, for which depending
on use-case might need to handle (for basemap will get a custom name)
| JavaScript | bsd-3-clause | future-analytics/cartodb,splashblot/dronedb,dbirchak/cartodb,DigitalCoder/cartodb,dbirchak/cartodb,thorncp/cartodb,raquel-ucl/cartodb,DigitalCoder/cartodb,DigitalCoder/cartodb,raquel-ucl/cartodb,thorncp/cartodb,splashblot/dronedb,future-analytics/cartodb,DigitalCoder/cartodb,nyimbi/cartodb,CartoDB/cartodb,nuxcode/carto... |
145b8c979cb7800cf3eb6ff2ad30037e4b19c51d | applications/firefox/user.js | applications/firefox/user.js | user_pref("accessibility.typeaheadfind", 1);
user_pref("browser.fixup.alternate.enabled", false);
user_pref("browser.newtab.url", "https://www.google.co.nz");
user_pref("browser.pocket.enabled", false);
user_pref("browser.tabs.tabClipWidth", 1);
user_pref("datareporting.healthreport.service.enabled", false);
user_pref(... | user_pref("browser.ctrlTab.previews", true);
user_pref("browser.fixup.alternate.enabled", false);
user_pref("browser.newtab.url", "https://www.google.co.nz");
user_pref("browser.pocket.enabled", false);
user_pref("browser.tabs.tabClipWidth", 1);
user_pref("datareporting.healthreport.service.enabled", false);
user_pref(... | Tidy up firefox prefs, and added CTRL+TAB through tabs :) | Tidy up firefox prefs, and added CTRL+TAB through tabs :)
| JavaScript | mit | craighurley/dotfiles,craighurley/dotfiles,craighurley/dotfiles |
af6314d64914d4450ceabb197b2c451e97ac2a62 | server/websocket.js | server/websocket.js |
var ds = require('./discovery')
var rb = require('./rubygems')
var sc = require('./scrape')
var WebSocketServer = require('ws').Server
var wss = new WebSocketServer({host: 'localhost', port: 3001})
var clients = {}
wss.on('connection', (ws) => {
ws.on('message', (data) => {
var req = JSON.parse(data)
if... |
var ds = require('./discovery')
var rb = require('./rubygems')
var sc = require('./scrape')
var WebSocketServer = require('ws').Server
var wss = new WebSocketServer({host: 'localhost', port: 3001})
var clients = {}
wss.on('connection', (ws) => {
ws.on('message', (data) => {
var req = JSON.parse(data)
if... | Send back the socket id with the pong message | Send back the socket id with the pong message
| JavaScript | mit | simov/rubinho,simov/rubinho |
976aed3d7a14c176e369ceb600baf61260daeed2 | packages/shared/lib/api/logs.js | packages/shared/lib/api/logs.js | export const queryLogs = ({ Page, PageSize } = {}) => ({
method: 'get',
url: 'logs/auth',
params: { Page, PageSize }
});
export const clearLogs = () => ({
method: 'delete',
url: 'logs/auth'
});
| export const queryLogs = (params) => ({
method: 'get',
url: 'logs/auth',
params
});
export const clearLogs = () => ({
method: 'delete',
url: 'logs/auth'
});
| Allow queryLogs to be without params | Allow queryLogs to be without params
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
50ebf1fdca04c6472f9c1d1eef0b6c2341ecaafa | packages/jest-fela-bindings/src/createSnapshotFactory.js | packages/jest-fela-bindings/src/createSnapshotFactory.js | import { format } from 'prettier'
import HTMLtoJSX from 'htmltojsx'
import { renderToString } from 'fela-tools'
import type { DOMRenderer } from '../../../flowtypes/DOMRenderer'
function formatCSS(css) {
return format(css, { parser: 'css', useTabs: false, tabWidth: 2 })
}
function formatHTML(html) {
const conve... | import { format } from 'prettier'
import HTMLtoJSX from 'htmltojsx'
import { renderToString } from 'fela-tools'
import type { DOMRenderer } from '../../../flowtypes/DOMRenderer'
function formatCSS(css) {
return format(css, { parser: 'css', useTabs: false, tabWidth: 2 })
}
function formatHTML(html) {
const conve... | Use 'babel' Prettier parser instead of deprecated 'bablyon'. | Use 'babel' Prettier parser instead of deprecated 'bablyon'.
As per warning when using jest-react-fela.
console.warn node_modules/prettier/index.js:7939
{ parser: "babylon" } is deprecated; we now treat it as { parser:
"babel" }.
| JavaScript | mit | rofrischmann/fela,risetechnologies/fela,risetechnologies/fela,rofrischmann/fela,risetechnologies/fela,rofrischmann/fela |
0f875085def889ae65b834c15f56109fc2363e7a | packages/bpk-docs/src/pages/ShadowsPage/ShadowsPage.js | packages/bpk-docs/src/pages/ShadowsPage/ShadowsPage.js | /*
* Backpack - Skyscanner's Design System
*
* Copyright 2017 Skyscanner Ltd
*
* 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
*
* Un... | /*
* Backpack - Skyscanner's Design System
*
* Copyright 2017 Skyscanner Ltd
*
* 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
*
* Un... | Add elevation tokens under shadows | [BPK-1053] Add elevation tokens under shadows
| JavaScript | apache-2.0 | Skyscanner/backpack,Skyscanner/backpack,Skyscanner/backpack |
577b1add3cd2804dbf4555b0cbadd45f8f3be761 | .github/actions/change-release-intent/main.js | .github/actions/change-release-intent/main.js | const { exec } = require('@actions/exec');
const getWorkspaces = require('get-workspaces').default;
async function execWithOutput(command, args, options) {
let myOutput = '';
let myError = '';
return {
code: await exec(command, args, {
listeners: {
stdout: data => {
myOutput += data.... | const { exec } = require('@actions/exec');
const getWorkspaces = require('get-workspaces').default;
async function execWithOutput(command, args, options) {
let myOutput = '';
let myError = '';
return {
code: await exec(command, args, {
listeners: {
stdout: data => {
myOutput += data.... | Add @xstate/vue to publishable packages | Add @xstate/vue to publishable packages
| JavaScript | mit | davidkpiano/xstate,davidkpiano/xstate,davidkpiano/xstate |
2a9b5a4077ea3d965b6994c9d432c3d98dc839ca | app/components/Settings/EncryptQR/index.js | app/components/Settings/EncryptQR/index.js | // @flow
import { connect } from 'react-redux'
import { compose } from 'recompose'
import { getEncryptedWIF } from '../../../modules/generateEncryptedWIF'
import EncryptQR from './EncryptQR'
const mapStateToProps = (state: Object) => ({
encryptedWIF: getEncryptedWIF(state),
})
export default compose(connect(mapSt... | // @flow
import { connect } from 'react-redux'
import { getEncryptedWIF } from '../../../modules/generateEncryptedWIF'
import EncryptQR from './EncryptQR'
const mapStateToProps = (state: Object) => ({
encryptedWIF: getEncryptedWIF(state),
})
export default connect(
mapStateToProps,
(dispatch: Dispatch) => ({ d... | Fix yarn type annotation error | Fix yarn type annotation error
| JavaScript | mit | hbibkrim/neon-wallet,CityOfZion/neon-wallet,CityOfZion/neon-wallet,hbibkrim/neon-wallet,CityOfZion/neon-wallet |
775ac532cd1fab831b679955226e205c97dceaf0 | novaform/lib/resources/iam.js | novaform/lib/resources/iam.js | var AWSResource = require('../awsresource')
, types = require('../types');
var Role = AWSResource.define('AWS::IAM::Role', {
AssumeRolePolicyDocument : { type: types.object('iam-assume-role-policy-document'), required: true },
Path : { type: types.string, required: true },
Policies : { type: types.arra... | var AWSResource = require('../awsresource')
, types = require('../types');
var Role = AWSResource.define('AWS::IAM::Role', {
AssumeRolePolicyDocument : { type: types.object('iam-assume-role-policy-document'), required: true },
ManagedPolicyArns: { type: types.array },
Path : { type: types.string },
... | Update IAM Role cfn resource | Update IAM Role cfn resource
| JavaScript | apache-2.0 | aliak00/kosmo,comoyo/nova,comoyo/nova,aliak00/kosmo |
d1909fc22d1c94772b51c9fb1841c4c5c10808a1 | src/device-types/device-type.js | src/device-types/device-type.js | /**
* Copyright 2019, 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 writi... | /**
* Copyright 2019, 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 writi... | Move DeviceType valuesArray to constructor | Move DeviceType valuesArray to constructor
classProperties is not enabled for Polymer compiler
See: https://github.com/Polymer/tools/issues/3360
Bug: 137847631
Change-Id: Iae68919462765e9672539fbc68c14fa9818ea163
| JavaScript | apache-2.0 | actions-on-google/smart-home-frontend,actions-on-google/smart-home-frontend |
f86c39497502954b6973702cf090e76fa3ddf463 | lib/behavior/events.js | lib/behavior/events.js | events = {};
events.beforeInsert = function() {
// Find a class on which the behavior had been set.
var behaviorData = Astro.utils.behaviors.findBehavior(this.constructor, 'timestamp');
// If the "hasCreatedField" option is set.
if (behaviorData.hasCreatedField) {
// Set value for created field.
this.... | events = {};
events.beforeInsert = function() {
var doc = this;
var Class = doc.constructor;
// Find a class on which the behavior had been set.
var behaviorData = Astro.utils.behaviors.findBehavior(
Class,
'timestamp'
);
// Get current date.
var date = new Date();
// If the "hasCreatedField... | Set updatedAt field on insertion | Set updatedAt field on insertion
| JavaScript | mit | jagi/meteor-astronomy-timestamp-behavior |
17096bf54d0692abf2fc22b497b7ebc2cbb217a2 | packages/extract-css/index.js | packages/extract-css/index.js | 'use strict';
var assert = require('assert'),
Batch = require('batch'),
getStylesData = require('style-data'),
getStylesheetList = require('list-stylesheets'),
getHrefContent = require('href-content');
module.exports = function (html, options, callback) {
var batch = new Batch(),
data = ge... | 'use strict';
var assert = require('assert'),
Batch = require('batch'),
getStylesData = require('style-data'),
getStylesheetList = require('list-stylesheets'),
getHrefContent = require('href-content');
module.exports = function (html, options, callback) {
var batch = new Batch(),
data = ge... | Move var declarations to the top. | Move var declarations to the top.
| JavaScript | mit | jonkemp/inline-css,jonkemp/inline-css |
3d28029aaed853c2a20e289548fea4a325e8d867 | src/modules/api/models/Media.js | src/modules/api/models/Media.js | /* global require, module, process, console, __dirname */
/* jshint -W097 */
var
mongoose = require('mongoose'),
Schema = mongoose.Schema;
var MediaSchema = new Schema({
name: String,
description: String,
url: String,
active: Boolean
});
module.exports = mongoose.model('Media', Media... | /* global require, module, process, console, __dirname */
/* jshint -W097 */
'use strict';
var
mongoose = require('mongoose'),
Schema = mongoose.Schema;
var MediaSchema = new Schema({
name: String,
description: String,
url: String,
active: Boolean
});
module.exports = mongoose.model... | Add missing 'use strict' declaration | style: Add missing 'use strict' declaration
| JavaScript | mit | mosaiqo/frontend-devServer |
c28b11a967befef52d4378f4ee2c74e805ce8774 | waveform.js | waveform.js | var rows = 0;
var cols = 10;
var table;
var edit_border = "thin dotted grey";
function text(str)
{
return document.createTextNode(str);
}
function cellContents(rowindex, colindex)
{
return " ";
}
function init()
{
table = document.getElementById("wftable");
addRows(4);
}
function addRows(numrow... | var rows = 0;
var cols = 10;
var table;
var edit_border = "thin dotted lightgrey";
function text(str)
{
return document.createTextNode(str);
}
function cellContents(rowindex, colindex)
{
return " ";
}
function init()
{
table = document.getElementById("wftable");
addRows(4);
}
function addRows(n... | Set editing border color to lightgrey | Set editing border color to lightgrey
| JavaScript | mit | seemuth/waveforms |
88f9da77f9865f1f093792bf4dace8ea5ab59d8b | frontend/frontend.js | frontend/frontend.js | $(document).ready(function(){
$("#related").click(function(){
$.post("http://localhost:8080/dummy_backend.php",
{
related: "true"
},
function(){
});
//alert("post sent");
});
$("#unrelated").click(function(){
$.post("http://localhost:8080/dum... | $(document).ready(function(){
$("#related").click(function(){
$.post("http://localhost:8080/",
{
'action': 'my_action',
'related': "true"
'individual': 0,//update code for Id
},
function(){
});
//alert("post sent");
});
$("#unrela... | Add wordpress and GA capabilities to JS | Add wordpress and GA capabilities to JS
| JavaScript | mit | BrandonBaucher/website-optimization,BrandonBaucher/website-optimization,BrandonBaucher/website-optimization,BrandonBaucher/website-optimization,BrandonBaucher/website-optimization |
a2c7b0b92c4d12e0a74397a8099c36bdde95a8ff | packages/shared/lib/helpers/string.js | packages/shared/lib/helpers/string.js | import getRandomValues from 'get-random-values';
export const getRandomString = (length) => {
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let i;
let result = '';
const values = getRandomValues(new Uint32Array(length));
for (i = 0; i < length; i++) {
r... | import getRandomValues from 'get-random-values';
const CURRENCIES = {
USD: '$',
EUR: '€',
CHF: 'CHF'
};
export const getRandomString = (length) => {
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let i;
let result = '';
const values = getRandomValues(new... | Add helper to format price value | Add helper to format price value
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
2669a19d55bcc27ca8b9a47667e2664f24a8aadf | mix-write/index.js | mix-write/index.js | var File = require('vinyl');
var mix = require('mix');
var path = require('path');
var rimraf = require('rimraf');
var vfs = require('vinyl-fs');
module.exports = function (dir) {
var pending = [];
function schedule(work) {
pending.push(work);
if (pending.length === 1) {
performNex... | var File = require('vinyl');
var mix = require('mix');
var path = require('path');
var rimraf = require('rimraf');
var vfs = require('vinyl-fs');
module.exports = function (dir) {
var pending = [];
function schedule(work) {
pending.push(work);
if (pending.length === 1) {
performNex... | Implement remainder of the write plugin | Implement remainder of the write plugin
| JavaScript | mit | byggjs/bygg,byggjs/bygg-plugins |
2a75bf909aadb7cb754e40ff56da1ac19fbc6533 | src/rules/order-alphabetical.js | src/rules/order-alphabetical.js | /*
* Rule: All properties should be in alphabetical order..
*/
/*global CSSLint*/
CSSLint.addRule({
//rule information
id: "order-alphabetical",
name: "Alphabetical order",
desc: "Assure properties are in alphabetical order",
browsers: "All",
//initialization
init: function(parser, repor... | /*
* Rule: All properties should be in alphabetical order..
*/
/*global CSSLint*/
CSSLint.addRule({
//rule information
id: "order-alphabetical",
name: "Alphabetical order",
desc: "Assure properties are in alphabetical order",
browsers: "All",
//initialization
init: function(parser, repor... | Order Aphabetical: Add listeners for at-rules | Order Aphabetical: Add listeners for at-rules
Viewport was completely missing, but the others were also not reporting
at the end of the rule scope
| JavaScript | mit | YanickNorman/csslint,SimenB/csslint,lovemeblender/csslint,malept/csslint,codeclimate/csslint,dashk/csslint,SimenB/csslint,scott1028/csslint,Arcanemagus/csslint,sergeychernyshev/csslint,scott1028/csslint,malept/csslint,codeclimate/csslint,lovemeblender/csslint,dashk/csslint,sergeychernyshev/csslint,YanickNorman/csslint,... |
ff95ba59917460a3858883141c9f4dd3da8c8d40 | src/jobs/items/itemPrices.js | src/jobs/items/itemPrices.js | const mongo = require('../../helpers/mongo.js')
const api = require('../../helpers/api.js')
const async = require('gw2e-async-promises')
const transformPrices = require('./_transformPrices.js')
async function itemPrices (job, done) {
job.log(`Starting job`)
let prices = await api().commerce().prices().all()
let... | const mongo = require('../../helpers/mongo.js')
const api = require('../../helpers/api.js')
const async = require('gw2e-async-promises')
const transformPrices = require('./_transformPrices.js')
const config = require('../../config/application.js')
async function itemPrices (job, done) {
job.log(`Starting job`)
le... | Clean up item price updating (1/2 runtime!) | Clean up item price updating (1/2 runtime!)
| JavaScript | agpl-3.0 | gw2efficiency/gw2-api.com |
7188b06d2a1168ce8950be9eff17253a0b10e09c | .eslintrc.js | .eslintrc.js | module.exports = {
root: true,
env: {
node: true,
"jest/globals": true
},
plugins: ["jest"],
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ... | module.exports = {
root: true,
env: {
node: true,
"jest/globals": true
},
plugins: ["jest"],
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/no-use-v-if-with-v-for... | Remove no-console rule from estlint configuration | Remove no-console rule from estlint configuration
| JavaScript | agpl-3.0 | cgwire/kitsu,cgwire/kitsu |
cd27c9c88623f0659fb0a58b59add58e26461fb0 | src/store/modules/users.spec.js | src/store/modules/users.spec.js | const mockCreate = jest.fn()
jest.mock('@/services/api/users', () => ({ create: mockCreate }))
import { createStore } from '>/helpers'
describe('users', () => {
beforeEach(() => jest.resetModules())
let storeMocks
let store
beforeEach(() => {
storeMocks = {
auth: {
actions: {
logi... | const mockCreate = jest.fn()
jest.mock('@/services/api/users', () => ({ create: mockCreate }))
import { createStore } from '>/helpers'
describe('users', () => {
beforeEach(() => jest.resetModules())
let storeMocks
let store
beforeEach(() => {
storeMocks = {
auth: {
actions: {
logi... | Add basic users module test | Add basic users module test
| JavaScript | mit | yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend |
090b36392e1549c44108b300f3bb86bf72f79164 | .eslintrc.js | .eslintrc.js | module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
... | module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
... | Modify eslint rules; change indent spaces from 4 to 2 | Modify eslint rules; change indent spaces from 4 to 2
| JavaScript | apache-2.0 | ailijic/era-floor-time,ailijic/era-floor-time |
5ae40aeffa9358825ce6043d4458130b45a090a7 | src/localization/currency.js | src/localization/currency.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2020
*/
import currency from 'currency.js';
import { LANGUAGE_CODES } from '.';
const CURRENCY_CONFIGS = {
DEFAULT: {
decimal: '.',
separator: ',',
pattern: '!#',
symbol: '$',
formatWithSymbol: true,
},
[LANGUAGE_CODES.FRENCH]: {
... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2020
*/
import currency from 'currency.js';
import { LANGUAGE_CODES } from '.';
const CURRENCY_CONFIGS = {
DEFAULT: {
decimal: '.',
separator: ',',
},
[LANGUAGE_CODES.FRENCH]: {
decimal: ',',
separator: '.',
},
};
let currentLanguageCo... | Add remove formatting with symbol from Currency object | Add remove formatting with symbol from Currency object
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
0da9f19684e830eb0a704e973dfb8ec1358d6eaf | pixi/main.js | pixi/main.js | (function (PIXI) {
'use strict';
var stage = new PIXI.Stage(0x66FF99);
var renderer = PIXI.autoDetectRenderer(400, 300);
document.body.appendChild(renderer.view);
window.requestAnimationFrame(animate);
var texture = PIXI.Texture.fromImage('bunny.png');
var bunny = new PIXI.Sprite(texture);
bunny.anc... | (function (PIXI) {
'use strict';
var stage = new PIXI.Stage(0x66FF99);
var renderer = PIXI.autoDetectRenderer(400, 300);
document.body.appendChild(renderer.view);
window.requestAnimationFrame(animate);
var texture = PIXI.Texture.fromImage('bunny.png');
var bunny = new PIXI.Sprite(texture);
var direc... | Make the rotating direction go back and forth | Make the rotating direction go back and forth
| JavaScript | isc | ThibWeb/browser-games,ThibWeb/browser-games |
8b4c1dac9a1611142f108839e48b59f2880cb9ba | public/democrats/signup/main.js | public/democrats/signup/main.js | requirejs.config({
shim: {
'call': {
deps: ['form', 'jquery', 'campaign'],
exports: 'call'
},
'campaign': {
deps: ['form', 'jquery'],
exports: 'campaign'
},
'form_mods': {
deps: ['jquery', 'form'],
export... | requirejs.config({
shim: {
'call': {
deps: ['form', 'jquery', 'campaign'],
exports: 'call'
},
'campaign': {
deps: ['form', 'jquery'],
exports: 'campaign'
},
'form_mods': {
deps: ['jquery', 'form'],
export... | Remove clear_id for signup page | Remove clear_id for signup page
Still need it for /act so we get zip codes.
| JavaScript | agpl-3.0 | advocacycommons/advocacycommons,matinieves/advocacycommons,agustinrhcp/advocacycommons,agustinrhcp/advocacycommons,matinieves/advocacycommons,advocacycommons/advocacycommons,agustinrhcp/advocacycommons,advocacycommons/advocacycommons,matinieves/advocacycommons |
29f1e731c1e7f153284f637c005e12b0aeb9a2f5 | web.js | web.js | var coffee = require('coffee-script/register'),
express = require('express'),
assets = require('connect-assets'),
logfmt = require('logfmt'),
app = express();
var port = Number(process.env.PORT || 1337);
app.set('views', 'src/views');
app.set('view engine', 'jade');
require('./routes'... | var coffee = require('coffee-script/register'),
express = require('express'),
assets = require('connect-assets'),
logfmt = require('logfmt'),
app = express();
var port = Number(process.env.PORT || 1337);
app.use(logfmt.requestLogger());
app.set('views', 'src/views');
app.set('view engi... | Move logging above asset serving | Move logging above asset serving
| JavaScript | mit | GeoSensorWebLab/asw-workbench,GeoSensorWebLab/Arctic-Scholar-Portal,GeoSensorWebLab/Arctic-Scholar-Portal,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/asw-workbench |
fc81b4a53a88ff0f04f62afb5e919098e86f20a9 | ui/src/kapacitor/constants/index.js | ui/src/kapacitor/constants/index.js | export const defaultRuleConfigs = {
deadman: {
period: '10m',
},
relative: {
change: 'change',
period: '1m',
shift: '1m',
operator: 'greater than',
value: '90',
},
threshold: {
operator: 'greater than',
value: '90',
relation: 'once',
percentile: '90',
period: '1m',
... | export const defaultRuleConfigs = {
deadman: {
period: '10m',
},
relative: {
change: 'change',
period: '1m',
shift: '1m',
operator: 'greater than',
value: '90',
},
threshold: {
operator: 'greater than',
value: '90',
relation: 'once',
percentile: '90',
period: '1m',
... | Change all 1d to 24h | Change all 1d to 24h
| JavaScript | agpl-3.0 | brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf |
c2936f41aa6ae9dbd5b34106e8eff8f2bbe4b292 | gulp/tasks/lint.js | gulp/tasks/lint.js | module.exports = function(gulp, config) {
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var jscs = require('gulp-jscs');
var logger = require('../utils/logger');
gulp.task('av:lint', function() {
if (config && config.js && config.js.jshintrc) {
var src = [];
if... | module.exports = function(gulp, config) {
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var jscs = require('gulp-jscs');
var logger = require('../utils/logger');
gulp.task('av:lint', ['av:lint:js', 'av:lint:lib']);
gulp.task('av:lint:js', function() {
if (config && conf... | Support separate jshintrc for lib | Support separate jshintrc for lib
| JavaScript | mit | Availity/availity-limo |
36378676c7b5fc35fb84def2ddee584e376b2bb9 | main.js | main.js | /*global require: false, console: false */
(function () {
"use strict";
var proxy = require("./proxy/proxy"),
server = require("./server/server"),
cprocess = require('child_process');
var port = -1;
console.log("Staring proxy.");
proxy.start().then(function () {
server.star... | /*global require: false, console: false */
(function () {
"use strict";
var proxy = require("./proxy/proxy"),
server = require("./server/server"),
cprocess = require('child_process'),
open = require("open");
var port = -1;
console.log("Staring proxy.");
proxy.start().then(f... | Use open to launch the browser. | Use open to launch the browser.
| JavaScript | mit | busykai/ws-rpc,busykai/ws-rpc |
5106b793f76f2ba226420e5e5078d35796487d39 | main.js | main.js | 'use strict';
var visitors = require('./vendor/fbtransform/visitors').transformVisitors;
var transform = require('jstransform').transform;
module.exports = {
transform: function(code) {
return transform(visitors.react, code).code;
}
};
| 'use strict';
var visitors = require('./vendor/fbtransform/visitors');
var transform = require('jstransform').transform;
module.exports = {
transform: function(code, options) {
var visitorList;
if (options && options.harmony) {
visitorList = visitors.getAllVisitors();
} else {
visitorList = ... | Add support for {harmony: true} to react-tools | Add support for {harmony: true} to react-tools
```
require('react-tools').transform(code, {harmony: true});
```
now enables all the harmony es6 transforms that are supported.
This is modeled after https://github.com/facebook/react/blob/master/bin/jsx#L17-L23 | JavaScript | bsd-3-clause | bspaulding/react,JasonZook/react,jkcaptain/react,jlongster/react,rickbeerendonk/react,edmellum/react,kakadiya91/react,edvinerikson/react,joaomilho/react,jordanpapaleo/react,zyt01/react,gj262/react,blue68/react,jquense/react,rricard/react,ashwin01/react,trueadm/react,usgoodus/react,DJCordhose/react,andrescarceller/react... |
d126cd694e312aa862a2d0d0260e6974ea7cd6f6 | src/containers/NewsFeedContainer.js | src/containers/NewsFeedContainer.js | /* NewsFeedContainer.js
* Container for our NewsFeed as a view
* Dependencies: ActionTypes
* Modules: NewsActions, and NewsFeed
* Author: Tiffany Tse
* Created: July 29, 2017
*/
//import dependencie
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
//import modules
import { loadN... | /* NewsFeedContainer.js
* Container for our NewsFeed as a view
* Dependencies: ActionTypes
* Modules: NewsActions, and NewsFeed
* Author: Tiffany Tse
* Created: July 29, 2017
*/
//import dependencie
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
//import modules
import { loadN... | Refactor mapStateToProps to use reshapeNewsData | Refactor mapStateToProps to use reshapeNewsData
| JavaScript | mit | titse/NYTimes-Clone,titse/NYTimes-Clone,titse/NYTimes-Clone |
943cbe5cb8e1ca0d2fc10dd04d6c300d60e34da3 | seasoned_api/src/cache/redis.js | seasoned_api/src/cache/redis.js | const redis = require("redis")
const client = redis.createClient()
class Cache {
/**
* Retrieve an unexpired cache entry by key.
* @param {String} key of the cache entry
* @returns {Promise}
*/
get(key) {
return new Promise((resolve, reject) => {
client.get(key, (error, reply) => {
if... | const redis = require("redis")
const client = redis.createClient()
class Cache {
/**
* Retrieve an unexpired cache entry by key.
* @param {String} key of the cache entry
* @returns {Promise}
*/
get(key) {
return new Promise((resolve, reject) => {
client.get(key, (error, reply) => {
if... | Return rejected promise and don't set cache if key or value is null. | Return rejected promise and don't set cache if key or value is null.
| JavaScript | mit | KevinMidboe/seasonedShows,KevinMidboe/seasonedShows,KevinMidboe/seasonedShows,KevinMidboe/seasonedShows |
891bccd617b93507a9d9d554b253730e1b4d92e8 | test/can_test.js | test/can_test.js | steal('can/util/mvc.js')
.then('funcunit/qunit',
'can/test/fixture.js')
.then(function() {
// Set the test timeout to five minutes
QUnit.config.testTimeout = 300000;
})
.then('./mvc_test.js',
'can/construct/construct_test.js',
'can/observe/observe_test.js',
'can/view/view_test.js',
'can/control/contro... | steal('can/util/mvc.js')
.then('funcunit/qunit',
'can/test/fixture.js')
.then(function() {
// Set the test timeout to five minutes
QUnit.config.testTimeout = 300000;
var oldmodule = module,
library = 'jQuery';
if (window.STEALDOJO){
library = 'Dojo';
} else if( window.STEALMOO) {
library = 'Mootools';
}... | Make QUnit module declarations append the name of the library being used | Make QUnit module declarations append the name of the library being used
| JavaScript | mit | beno/canjs,asavoy/canjs,UXsree/canjs,airhadoken/canjs,Psykoral/canjs,ackl/canjs,bitovi/canjs,rjgotten/canjs,thomblake/canjs,patrick-steele-idem/canjs,juristr/canjs,dimaf/canjs,cohuman/canjs,rjgotten/canjs,mindscratch/canjs,shiftplanning/canjs,schmod/canjs,sporto/canjs,yusufsafak/canjs,gsmeets/canjs,sporto/canjs,Psykora... |
c766b6c025278b79a6e9daaaeb7728bb59ede9c9 | template/browser-sync.config.js | template/browser-sync.config.js | module.exports = {
port: 3001,
{{#notServer}}server: true,
startPath: {{#lib}}"demo.html"{{/lib}}{{#client}}"index.html"{{/client}},
{{/notServer}}files: [ 'build/*'{{#lib}}, 'demo.html'{{/lib}}{{#server}}, "src/views/index.html"{{/server}}{{#clientOnly}}, "index.html"{{/clientOnly}} ]
};
| module.exports = {
port: 3001,
ghostMode: false,
notify: false,
{{#notServer}}server: true,
startPath: {{#lib}}"demo.html"{{/lib}}{{#client}}"index.html"{{/client}},
{{/notServer}}files: [ 'build/*'{{#lib}}, 'demo.html'{{/lib}}{{#server}}, "src/views/index.html"{{/server}}{{#clientOnly}}, "index.html"{{/cli... | Disable browsersync ghostMode (user actions mirroring) and notify (corner notifications) | Disable browsersync ghostMode (user actions mirroring) and notify
(corner notifications)
| JavaScript | mit | maxkfranz/slush-js,maxkfranz/slush-js |
d70463cd29560573006a61b9b558de2db84bbce4 | javascript/router.js | javascript/router.js | angular.module('Gistter')
.config([$routeProvider, function($routeProvider) {
$routeProvider
.when('/', {
controller: 'TwitterController',
templateUrl: 'templates/index/index.html'
});
}]);
| angular.module('Gistter')
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
controller: 'TwitterController',
templateUrl: 'templates/index/index.html'
});
}]);
| Fix route provider to be string for minification | Fix route provider to be string for minification
| JavaScript | mit | Thrashmandicoot/Gistter,Thrashmandicoot/Gistter |
7c422706dc38f151a0cf2c1172c1371f4ccbcf9f | app/app.js | app/app.js | 'use strict';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
// Top-level React (pure functional) component:
const App = () => (
<div>
Hello, World!
</div>
);
// Inject into #app HTML element:
ReactDOM.render(<App />, document.getElementById('app'));
| Introduce main React component DOM injector | feat: Introduce main React component DOM injector
| JavaScript | mit | IsenrichO/DaviePoplarCapital,IsenrichO/DaviePoplarCapital | |
a2779a379a4df0237e515c4b77845a672b47e9de | protractor-conf.js | protractor-conf.js | var url = 'http://127.0.0.1:8000/'; // This should be local webserver
var capabilities = {
'browserName': 'firefox'
},
if (process.env.TRAVIS) {
url = 'https://b3ncr.github.io/angular-xeditable/' // Change to your dev server
capabilities["tunnel-identifier"] = process.env.TRAVIS_JOB_NUMBER; // this is requi... | var url = 'http://127.0.0.1:8000/'; // This should be local webserver
var capabilities = {
'browserName': 'firefox'
};
if (process.env.TRAVIS) {
url = 'https://b3ncr.github.io/angular-xeditable/'; // Change to your dev server
capabilities["tunnel-identifier"] = process.env.TRAVIS_JOB_NUMBER; // this is requ... | Fix syntax errors in protractor.conf.js | Fix syntax errors in protractor.conf.js
| JavaScript | mit | B3nCr/angular-xeditable,B3nCr/angular-xeditable |
0332a515299bb4325e8ba97640b25ec5d5b9e35c | controllers/movies.js | controllers/movies.js | import models from '../models';
import express from 'express';
import _ from 'lodash';
let router = express.Router();
const defaults = {
limit: 10,
page: 1,
category: null
};
router.get('/', (req, res) => {
let params = _.defaults(req.query, defaults);
let category = params.category ? {'name': params.categ... | import models from '../models';
import express from 'express';
import _ from 'lodash';
let router = express.Router();
const defaults = {
limit: 10,
page: 1,
category: null
};
router.get('/', (req, res) => {
let params = _.defaults(req.query, defaults);
let category = params.category ? {'name': params.categ... | Add get movie details endpoint | Add get movie details endpoint
| JavaScript | mit | sabarasaba/moviez.city-server,sabarasaba/moviezio-server,sabarasaba/moviez.city-server,sabarasaba/moviezio-server |
75baec7f3797772247970f7e3842764880ae5d93 | site/src/components/introduction/decorate-bars.js | site/src/components/introduction/decorate-bars.js | var width = 500, height = 250;
var container = d3.select('#decorate-bars')
.append('svg')
.attr({'width': width, 'height': height});
var dataGenerator = fc.data.random.financial()
.startDate(new Date(2014, 1, 1));
var data = dataGenerator(20);
var xScale = fc.scale.dateTime()
.domain(fc.util.extent().... | var width = 500, height = 250;
var container = d3.select('#decorate-bars')
.append('svg')
.attr({'width': width, 'height': height});
var dataGenerator = fc.data.random.financial()
.startDate(new Date(2014, 1, 1));
var data = dataGenerator(20);
var xScale = fc.scale.dateTime()
.domain(fc.util.extent().... | Fix site bar decorate example - specify correct accessors and pad x-domain | Fix site bar decorate example - specify correct accessors and pad x-domain
| JavaScript | mit | alisd23/d3fc-d3v4,djmiley/d3fc,alisd23/d3fc-d3v4,alisd23/d3fc-d3v4,djmiley/d3fc,djmiley/d3fc |
2ee0d06764f0033c767d2a143dd8b6e59e58006c | bin/cli.js | bin/cli.js | #!/usr/bin/env node
var minimist = require('minimist');
if (process.argv.length < 3) {
printUsage();
process.exit(1);
}
var command = process.argv[2];
var args = minimist(process.argv.slice(3));
var pwd = process.cwd();
switch (command) {
case 'help':
printUsage();
break;
case 'new':
if (args._.length !=... | #!/usr/bin/env node
var path = require('path')
var minimist = require('minimist');
var pkg = require(path.resolve(__dirname, '../package.json'));
if (process.argv.length < 3) {
printUsage();
process.exit(1);
}
var command = process.argv[2];
var args = minimist(process.argv.slice(3));
var pwd = process.cwd();
sw... | Add neon version and print the package version in the usage info | Add neon version and print the package version in the usage info
| JavaScript | apache-2.0 | rustbridge/neon-cli,dherman/rust-bindings,dherman/neon-cli,neon-bindings/neon-cli,dherman/rust-bindings,rustbridge/neon,rustbridge/neon,neon-bindings/neon,neon-bindings/neon,neon-bindings/neon,rustbridge/neon,rustbridge/neon,dherman/neon-cli,neon-bindings/neon-cli,dherman/nanny,rustbridge/neon,neon-bindings/neon,neon-b... |
5d47571ac1c7e72b2772af48b3a260fb5e08b441 | components/ionLoading/ionLoading.js | components/ionLoading/ionLoading.js | IonLoading = {
show: function (userOptions) {
var userOptions = userOptions || {};
var options = _.extend({
delay: 0,
duration: null,
customTemplate: null,
backdrop: false
}, userOptions);
if (options.backdrop) {
IonBackdrop.retain();
$('.backdrop').addClass('b... | IonLoading = {
show: function (userOptions) {
var userOptions = userOptions || {};
var options = _.extend({
delay: 0,
duration: null,
customTemplate: null,
backdrop: false
}, userOptions);
if (options.backdrop) {
IonBackdrop.retain();
$('.backdrop').addClass('b... | Fix for ion-modal spurious blaze errors | Fix for ion-modal spurious blaze errors
| JavaScript | mit | gnmfcastro/meteor-ionic,ludiculous/meteor-ionic,kalyneramon/meteor-ionic,JoeyAndres/meteor-ionic,kabaros/meteor-ionic,txs/meteor-wecare-ionic-flow,Tarang/meteor-ionic,kalyneramon/meteor-ionic,zhonglijunyi/meteor-ionic,vieko/meteor-ionic,kabaros/meteor-ionic,txs/meteor-wecare-ionic-flow,zhonglijunyi/meteor-ionic,kevohag... |
a1129daa792c56b88db0ae2248e522b458aec0d8 | tools/middleware/liveReloadMiddleware.js | tools/middleware/liveReloadMiddleware.js | /**
* Copyright 2017-present, Callstack.
* All rights reserved.
*
* MIT License
*
* Copyright (c) 2017 Mike Grabowski
*
* 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 restr... | function liveReloadMiddleware(compiler) {
let watchers = [];
compiler.plugin('done', () => {
const headers = {
'Content-Type': 'application/json; charset=UTF-8',
};
watchers.forEach(watcher => {
watcher.writeHead(205, headers);
watcher.end(JSON.stringify({ changed: true }));
});
... | Use own implementation of live reload RN middleware | Use own implementation of live reload RN middleware
| JavaScript | mit | sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit,sysgears/apollo-universal-starter-kit |
cfa4fec100e8597c20ce17f7cce349d065f899ca | src/main/web/florence/js/functions/_checkPathParsed.js | src/main/web/florence/js/functions/_checkPathParsed.js | function checkPathParsed (uri) {
if (uri.charAt(uri.length-1) === '/') {
uri = uri.slice(0, -1);
}
if (path.charAt(0) !== '/') {
path = '/' + path;
}
var myUrl = parseURL(uri);
return myUrl.pathname;
}
| function checkPathParsed (uri) {
if (uri.charAt(uri.length-1) === '/') {
uri = uri.slice(0, -1);
}
if (uri.charAt(0) !== '/') {
uri = '/' + uri;
}
var myUrl = parseURL(uri);
return myUrl.pathname;
}
| Refactor to ensure pathnames are all the same | Refactor to ensure pathnames are all the same
| JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence |
6e34d25b98fda1cd249817bfe829583848e732dc | lib/border-radius.js | lib/border-radius.js | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-border-radius/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-border-radius/tachyons-border-radius.min.css', 'utf8'... | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-border-radius/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-border-radius/tachyons-border-radius.min.css', 'utf8'... | Add site footer to each documentation generator | Add site footer to each documentation generator
| JavaScript | mit | tachyons-css/tachyons,cwonrails/tachyons,fenderdigital/css-utilities,getfrank/tachyons,topherauyeung/portfolio,topherauyeung/portfolio,topherauyeung/portfolio,matyikriszta/moonlit-landing-page,fenderdigital/css-utilities,pietgeursen/pietgeursen.github.io |
c37ff6db05d2e428e6ec55100321b134e7e15a65 | src/backend/routes/api/files.js | src/backend/routes/api/files.js | var express = require('express');
var router = module.exports = express.Router();
router.post('/url', function(req, res, next) {
var data = req.body,
model;
if (data.type === 'expense_attachment') {
model = req.app.get('bookshelf').models.ExpenseAttachment;
}
if (!model) return res.status(400).send(... | 'use strict';
var express = require('express');
var router = module.exports = express.Router();
router.post('/url', function(req, res, next) {
var data = req.body,
model;
if (data.type === 'expense_attachment') {
model = req.app.get('bookshelf').models.ExpenseAttachment;
} else if (data.type === 'inbo... | Support fetching urls for inbox attachments | Support fetching urls for inbox attachments
| JavaScript | agpl-3.0 | nnarhinen/nerve,nnarhinen/nerve |
094204663537a8f9f631de79c0f98dc447029448 | Gruntfile.js | Gruntfile.js | /*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homep... | /*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homep... | Add banner to CSS files | Add banner to CSS files
| JavaScript | mit | ShoppinPal/ng-mobile-menu,Malkiat-Singh/ng-mobile-menu,ShoppinPal/ng-mobile-menu,Malkiat-Singh/ng-mobile-menu |
2055de5634fb1daa265ca5c1845ea0b247330ea7 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Configure tasks
grunt.initConfig({
// Project settings
project: {
app: 'app'
},
// Watch files and execute tasks when they change
watch: {
livereload: {... | 'use strict';
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Configure tasks
grunt.initConfig({
// Project settings
project: {
app: 'app'
},
// Watch files and execute tasks when they change
watch: {
bower: {
... | Watch bower.json and run wiredep | Watch bower.json and run wiredep
| JavaScript | mit | thewildandy/life-graph |
82964068366aa00f4ffc768058eed8b423450aca | src/resolvers/ParameterResolver.js | src/resolvers/ParameterResolver.js | import BaseResolver from './BaseResolver';
import { STRING } from '../parsers/Types';
/**
* @classdesc Options resolver for command parameter definitions.
* @extends BaseResolver
*/
export default class ParameterResolver extends BaseResolver {
/**
* Constructor.
*/
constructor() {
super();
this.r... | import BaseResolver from './BaseResolver';
import { STRING } from '../parsers/Types';
/**
* @classdesc Options resolver for command parameter definitions.
* @extends BaseResolver
*/
export default class ParameterResolver extends BaseResolver {
/**
* Constructor.
*/
constructor() {
super();
this.r... | Fix resolver failing for default param descriptions. | Fix resolver failing for default param descriptions.
| JavaScript | mit | hkwu/ghastly |
fc2a0b966a8c7796ff06653f4f9bc4a70101e43e | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n',
concat: {
options: {
... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n',
concat: {
options: {
stripBanners: {
... | Apply consistent tabbing to gruntfile | Apply consistent tabbing to gruntfile
2 space tabs
| JavaScript | mit | aduth/correctingInterval |
a98a9b7401212661ca170551cb3cede388fa0623 | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default', ['browserify']);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
main: {
src: 'lib/... | module.exports = function(grunt) {
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['browserify']);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
main: {
src: 'lib/vjs-hls.js',
... | Load grunt-* dependencies with matchdep | Load grunt-* dependencies with matchdep
| JavaScript | mit | catenoid-company/videojs5-hlsjs-source-handler,streamroot/videojs5-hlsjs-source-handler,catenoid-company/videojs5-hlsjs-source-handler,streamroot/videojs5-hlsjs-source-handler |
801f4d56a217cee39eb08249a20c8dbd577dc030 | src/modules/filters/ThreadFilter.js | src/modules/filters/ThreadFilter.js | import FilterModule from "../FilterModule";
import { dependencies as Inject, singleton as Singleton } from "needlepoint";
import Promise from "bluebird";
import Threads from "../../util/Threads";
@Singleton
@Inject(Threads)
export default class ThreadFilter extends FilterModule {
/**
* @param {Threads} thread... | import FilterModule from "../FilterModule";
import { dependencies as Inject, singleton as Singleton } from "needlepoint";
import Promise from "bluebird";
import Threads from "../../util/Threads";
@Singleton
@Inject(Threads)
export default class ThreadFilter extends FilterModule {
/**
* @param {Threads} thread... | Fix use of Array.includes not supported in current node version | Fix use of Array.includes not supported in current node version
| JavaScript | apache-2.0 | ivkos/botyo |
152821d211418870dc90f98077a43e8c51e3f426 | lib/remove.js | lib/remove.js | "use strict";
const fs = require("./utils/fs");
const validate = require("./utils/validate");
const validateInput = (methodName, path) => {
const methodSignature = `${methodName}([path])`;
validate.argument(methodSignature, "path", path, ["string", "undefined"]);
};
// -------------------------------------------... | "use strict";
const fs = require("./utils/fs");
const validate = require("./utils/validate");
const validateInput = (methodName, path) => {
const methodSignature = `${methodName}([path])`;
validate.argument(methodSignature, "path", path, ["string", "undefined"]);
};
// -------------------------------------------... | Use same maxRetries as rimraf did | Use same maxRetries as rimraf did
| JavaScript | mit | szwacz/fs-jetpack,szwacz/fs-jetpack |
ba08a8b9d3cadd484a0d3fee6a7bfc15b70f36fd | src/scripts/services/auth/config.js | src/scripts/services/auth/config.js | 'use strict';
module.exports =
/*@ngInject*/
function ($httpProvider, $stateProvider) {
$httpProvider.interceptors.push(require('./oauth_interceptor.js'));
$stateProvider.state('access_token', {
url: '/access_token={accessToken}&token_type={tokenType}&expires_in={expiresIn}',
template: '',
controller... | 'use strict';
module.exports =
/*@ngInject*/
function ($httpProvider, $stateProvider) {
$httpProvider.interceptors.push(require('./oauth_interceptor.js'));
$stateProvider.state('access_token', {
url: '/access_token={accessToken}&token_type={tokenType}&expires_in={expiresIn}',
template: '',
controller... | Throw error is there are now state params to redirect to upon authentication | Throw error is there are now state params to redirect to upon authentication | JavaScript | agpl-3.0 | empirical-org/Quill-Grammar,ddmck/Quill-Grammar,ddmck/Quill-Grammar,ddmck/Quill-Grammar,empirical-org/Quill-Grammar,empirical-org/Quill-Grammar |
78e76784231ee7f9fdc9e0926bc985617b012f7e | test.js | test.js | var log = require('./log');
var TunerTwitter = require('./tuner_twitter');
var tt = TunerTwitter.create({twitterName: 'L2G', keywords: 'test'});
//var tt = TunerTwitter.create({twitterID: 14641869});
log.debug('created new TunerTwitter');
tt.on('ready', function () {
log.debug('TwitterTuner is ready');
tt.tune... | var log = require('./log');
var TunerTwitter = require('./tuner_twitter');
var tt = TunerTwitter.create({twitterName: 'L2G', keywords: 'test'});
//var tt = TunerTwitter.create({twitterID: 14641869});
log.debug('created new TunerTwitter');
tt.on('ready', function () {
log.debug('TwitterTuner is ready');
tt.tune... | Change some "debug" level log messages to "info" | Change some "debug" level log messages to "info"
| JavaScript | mit | L2G/batsig |
b2ef3f8fd40be85ea931a03f81dfcb2b502cbec5 | client/routes/controllers/admin_logon.js | client/routes/controllers/admin_logon.js | /**
* AdminLogonController: Creates a endpoint where a user can log
* into the system. It renders the login template only if user is
* not already logged in.
*/
AdminLogonController = RouteController.extend({
waitOn: function () {
return Meteor.user();
},
onBeforeAction: function(pause) {
// Redirects use... | /**
* AdminLogonController: Creates a endpoint where a user can log
* into the system. It renders the login template only if user is
* not already logged in.
*/
AdminLogonController = RouteController.extend({
onBeforeAction: function(pause) {
// Redirects user if allready logged in
if (Meteor.user()) {
if... | Fix a bug where the user was not redirected because of wrong use of waitOn | Fix a bug where the user was not redirected because of wrong use of waitOn
| JavaScript | apache-2.0 | bompi88/concept,bompi88/concept,bompi88/concept |
b529cb8fe16a6f899c92d0153b13c6d471733f5e | run-benchmarks.js | run-benchmarks.js | #!/usr/bin/env node
/*
Copyright (C) 2010, Oleg Efimov <efimovov@gmail.com>
See license text in LICENSE file
*/
var
bindings_list = ['Sannis-node-mysql-libmysqlclient', 'felixge-node-mysql', /*'stevebest-node-mysql',*/ 'PHP-MySQL'],
sys = require('sys'),
default_factor = 1,
factor = default_factor,
cfg;
if... | #!/usr/bin/env node
/*
Copyright (C) 2010, Oleg Efimov <efimovov@gmail.com>
See license text in LICENSE file
*/
var
bindings_list = ['Sannis-node-mysql-libmysqlclient', 'felixge-node-mysql', /*'stevebest-node-mysql',*/ 'PHP-MySQL'],
//bindings_list = ['sidorares-nodejs-mysql-native'],
sys = require('sys'),
de... | Add //bindings_list = ['sidorares-nodejs-mysql-native'] for tests | Add //bindings_list = ['sidorares-nodejs-mysql-native'] for tests
| JavaScript | mit | Sannis/node-mysql-benchmarks,Sannis/node-mysql-benchmarks,Sannis/node-mysql-benchmarks,Sannis/node-mysql-benchmarks |
67f6b0dd9cae88debab6a350f84f4dff0d13eefc | Engine/engine.js | Engine/engine.js | var Game = (function () {
var Game = function (canvasRenderer,svgRenderer ) {
};
return Game;
}());
| var canvasDrawer = new CanvasDrawer();
var player = new Player('Pesho', 20, 180, 15);
var disc = new Disc(canvasDrawer.canvasWidth / 2, canvasDrawer.canvasHeight / 2, 12);
function startGame() {
canvasDrawer.clear();
canvasDrawer.drawPlayer(player);
canvasDrawer.drawDisc(disc);
player.move();
disc.... | Implement logic for player and disc movements and collision between them | Implement logic for player and disc movements and collision between them
| JavaScript | mit | TeamBarracuda-Telerik/JustDiscBattle,TeamBarracuda-Telerik/JustDiscBattle |
b379a4293d67349cecf026221938c4ca65efc453 | reporters/index.js | reporters/index.js | var gutil = require('gulp-util'),
fs = require('fs');
/**
* Loads reporter by its name.
*
* The function works only with reporters that shipped with the plugin.
*
* @param {String} name Name of a reporter to load.
* @param {Object} options Custom options object that will be passed to
* a reporter.
* @ret... | var gutil = require('gulp-util'),
fs = require('fs');
/**
* Loads reporter by its name.
*
* The function works only with reporters that shipped with the plugin.
*
* @param {String} name Name of a reporter to load.
* @param {Object} options Custom options object that will be passed to
* a reporter.
* @ret... | Make reporters' loader work on windows | Make reporters' loader work on windows
| JavaScript | mit | JustBlackBird/gulp-phpcs,JustBlackBird/gulp-phpcs |
5f8c42f6c0360547ece990855256d3480ba3546c | website/static/js/tests/tests.webpack.js | website/static/js/tests/tests.webpack.js | // Generate a single webpack bundle for all tests for faster testing
// See https://github.com/webpack/karma-webpack#alternative-usage
// Configure raven with a fake DSN to avoid errors in test output
var Raven = require('raven-js');
Raven.config('http://abc@example.com:80/2');
// Include all files that end with .tes... | // Generate a single webpack bundle for all tests for faster testing
// See https://github.com/webpack/karma-webpack#alternative-usage
// Configure raven with a fake DSN to avoid errors in test output
var Raven = require('raven-js');
Raven.config('http://abc@example.com:80/2');
// Include all files that end with .tes... | Update line that was pointing to the erstwhile ./website/addons now ./addons | Update line that was pointing to the erstwhile ./website/addons now ./addons
| JavaScript | apache-2.0 | CenterForOpenScience/osf.io,aaxelb/osf.io,Johnetordoff/osf.io,erinspace/osf.io,mfraezz/osf.io,mattclark/osf.io,crcresearch/osf.io,laurenrevere/osf.io,adlius/osf.io,aaxelb/osf.io,laurenrevere/osf.io,CenterForOpenScience/osf.io,CenterForOpenScience/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,chennan47/osf.io,pattisdr/o... |
128a3d691d9be875ca5a53fbbc7237d3ba4f234a | main.js | main.js | var Bind = require("github/jillix/bind");
var Events = require("github/jillix/events");
module.exports = function(config) {
var self = this;
Events.call(self, config);
for (var i in config.roles) {
$("." + config.roles[i]).hide();
}
var cache;
self.updateLinks = function (data) {
... | var Bind = require("github/jillix/bind");
var Events = require("github/jillix/events");
module.exports = function(config) {
var self = this;
Events.call(self, config);
for (var i in config.roles) {
$("." + config.roles[i]).hide();
}
var cache;
self.updateLinks = function (data) {
... | Remove only links that have not the data.role class. | Remove only links that have not the data.role class.
| JavaScript | mit | jxmono/links |
2d99515fd22cf92c7d47a15434eb89d6d26ce525 | src/shared/urls.js | src/shared/urls.js | const trimStart = (str) => {
// NOTE String.trimStart is available on Firefox 61
return str.replace(/^\s+/, '');
};
const SUPPORTED_PROTOCOLS = ['http:', 'https:', 'ftp:', 'mailto:'];
const searchUrl = (keywords, searchSettings) => {
try {
let u = new URL(keywords);
if (SUPPORTED_PROTOCOLS.includes(u.pr... | const trimStart = (str) => {
// NOTE String.trimStart is available on Firefox 61
return str.replace(/^\s+/, '');
};
const SUPPORTED_PROTOCOLS = ['http:', 'https:', 'ftp:', 'mailto:', 'about:'];
const searchUrl = (keywords, searchSettings) => {
try {
let u = new URL(keywords);
if (SUPPORTED_PROTOCOLS.inc... | Add about: pages to open home page | Add about: pages to open home page
| JavaScript | mit | ueokande/vim-vixen,ueokande/vim-vixen,ueokande/vim-vixen |
d69b7e3eaecb1a38cce45e12abdb64ecd36ce13c | static/js/contest-details.js | static/js/contest-details.js | $(document).ready(function(){
$('.entries').slick({
slidesToShow: 3,
variableWidth: true,
autoplay: true,
lazyLoad: 'ondemand'
});
Dropzone.options.dropzoneSubmitPhoto = {
paramName: "image",
maxFilesize: 2 // MB
};
});
| $(document).ready(function(){
$('.entries').slick({
slidesToShow: 3,
variableWidth: true,
autoplay: true,
lazyLoad: 'ondemand'
});
Dropzone.options.dropzoneSubmitPhoto = {
paramName: "image",
maxFilesize: 2, // MB
init: function() {
this.on... | Refresh the page when successfully uploading a photo | Refresh the page when successfully uploading a photo
| JavaScript | isc | RevolutionTech/flamingo,RevolutionTech/flamingo,RevolutionTech/flamingo,RevolutionTech/flamingo |
b451fd49780ad69869b4cc4087bdd4a95a066b0f | src/components/NewMealForm.js | src/components/NewMealForm.js | import React, { Component } from 'react'
import { reduxForm, Field } from 'redux-form'
class NewMealForm extends Component {
render() {
return (
<form onSubmit={this.props.handleSubmit}>
<label htmlFor="name">Meal Name</label>
<Field name="name" component="input" type="text" />
<bu... | import React, { Component } from 'react'
import { reduxForm, Field } from 'redux-form'
import { css } from 'glamor'
class NewMealForm extends Component {
render() {
return (
<form onSubmit={this.props.handleSubmit}>
<ul {...ul}>
<li {...styles}>
<label {...styles2} htmlFor="n... | Add styling for new meal form | Add styling for new meal form
| JavaScript | mit | cernanb/personal-chef-react-app,cernanb/personal-chef-react-app |
6e53504d4fa4c5add94f4df61b2c96d96db3906d | site/code.js | site/code.js | $(window).scroll
( function ()
{
$( "header" ).css
( "top"
, Math.max(-280, Math.min(0, -$("body").scrollTop()))
);
}
);
$("nav a").click
( function (ev)
{
var target = $("*[name=" + $(ev.target).attr("href").substr(1) + "]");
$("html, body").animate({ scrol... | $(window).scroll
( function ()
{
$( "header" ).css
( "top"
, Math.max(-280, Math.min(0, -$("body").scrollTop()))
);
}
);
$("nav a").click
( function (ev)
{
var target = $("*[name=" + $(ev.target).attr("href").substr(1) + "]");
$("html, body").animate
... | Allow slow scrolling with shift. | Allow slow scrolling with shift.
Because we can. | JavaScript | bsd-3-clause | bergmark/clay,rbros/clay,rbros/clay |
1946b1e6190e9b374f323f6b99bfe8790f879ef0 | tasks/html-hint.js | tasks/html-hint.js | /**
* Hint HTML
*/
'use strict';
const gulp = require('gulp'),
htmlhint = require('gulp-htmlhint'),
notify = require('gulp-notify');
module.exports = function(options) {
return cb => {
gulp.src('./*.html')
.pipe(htmlhint())
.pipe(htmlhint.reporter('htmlhint-stylish'))
.pip... | /**
* Hint HTML
*/
'use strict';
const gulp = require('gulp'),
htmlhint = require('gulp-htmlhint'),
notify = require('gulp-notify');
module.exports = function(options) {
return cb => {
gulp.src('./*.html')
.pipe(htmlhint({
'attr-lowercase': ['viewBox']
}))
.pipe(ht... | Add the 'viewBox' attribute to htmlhint ignore list | Add the 'viewBox' attribute to htmlhint ignore list
| JavaScript | mit | justcoded/web-starter-kit,vodnycheck/justcoded,KirillPd/web-starter-kit,justcoded/web-starter-kit,vodnycheck/justcoded,KirillPd/web-starter-kit |
35c2111792ca6f6a0cd0ef0468c43afd13e54693 | test/repl-tests.js | test/repl-tests.js | const assert = require("assert");
// Masquerade as the REPL module.
module.filename = null;
module.id = "<repl>";
module.loaded = false;
module.parent = void 0;
delete require.cache[require.resolve("../node/repl-hook.js")];
describe("Node REPL", () => {
import "../node/repl-hook.js";
import { createContext } fro... | const assert = require("assert");
// Masquerade as the REPL module.
module.filename = null;
module.id = "<repl>";
module.loaded = false;
module.parent = void 0;
delete require.cache[require.resolve("../node/repl-hook.js")];
describe("Node REPL", () => {
import "../node/repl-hook.js";
import { createContext } fro... | Make sure to close REPLs started by tests. | Make sure to close REPLs started by tests.
| JavaScript | mit | benjamn/reify,benjamn/reify |
102b53a7b6390f7854556fc529615a1c4a86057b | src/services/config/config.service.js | src/services/config/config.service.js | 'use strict';
// Service for the spec config.
// We keep this separate so that changes are kept even if the spec changes.
angular.module('vlui')
.factory('Config', function() {
var Config = {};
Config.data = {};
Config.config = {};
Config.getConfig = function() {
return {};
};
Config... | 'use strict';
// Service for the spec config.
// We keep this separate so that changes are kept even if the spec changes.
angular.module('vlui')
.factory('Config', function() {
var Config = {};
Config.data = {};
Config.config = {};
Config.getConfig = function() {
return {};
};
Config... | Make polestar's config useRawDomain = false | Make polestar's config useRawDomain = false
Fix https://github.com/uwdata/voyager2/issues/202
| JavaScript | bsd-3-clause | vega/vega-lite-ui,vega/vega-lite-ui,uwdata/vega-lite-ui,vega/vega-lite-ui,uwdata/vega-lite-ui,uwdata/vega-lite-ui |
59148c34d125d0eafb45e0b2516e3cd08bb37735 | src/systems/tracked-controls-webxr.js | src/systems/tracked-controls-webxr.js | var registerSystem = require('../core/system').registerSystem;
/**
* Tracked controls system.
* Maintain list with available tracked controllers.
*/
module.exports.System = registerSystem('tracked-controls-webxr', {
init: function () {
this.addSessionEventListeners = this.addSessionEventListeners.bind(this);
... | var registerSystem = require('../core/system').registerSystem;
/**
* Tracked controls system.
* Maintain list with available tracked controllers.
*/
module.exports.System = registerSystem('tracked-controls-webxr', {
init: function () {
this.controllers = [];
this.addSessionEventListeners = this.addSession... | Initialize controllers to empty array | Initialize controllers to empty array
| JavaScript | mit | chenzlabs/aframe,ngokevin/aframe,chenzlabs/aframe,ngokevin/aframe,aframevr/aframe,aframevr/aframe |
11c7e21ad172de2e3197ef871191731602f33269 | src/index.js | src/index.js | import React from 'react';
function allMustExist(props) {
Object.keys(props).every(propName => props[propName] != null);
}
export default function pending(NotReadyComponent) {
return (hasLoaded = allMustExist) => (ReadyComponent, ErrorComponent) => ({ error, ...props }) => {
if (error) {
return <ErrorCo... | import React from 'react';
function allMustExist(props) {
Object.keys(props).every(propName => props[propName] != null);
}
function propTypesMustExist(props, { propTypes, displayName }) {
Object.keys(propTypes).every(propName => propTypes[propName](props, propName, displayName) == null);
}
export default functio... | Add required prop types checker, and make it default loaded tester | Add required prop types checker, and make it default loaded tester
| JavaScript | mit | BurntCaramel/react-pending |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.