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 |
|---|---|---|---|---|---|---|---|---|---|
f45deeef6b6162a086dc40269dfca3e1e8157e50 | server/APIv1/likes/likesController.js | server/APIv1/likes/likesController.js | import { postgresConnection as cn } from '../../config/helpers.js';
const pgp = require('pg-promise')();
const db = pgp(cn);
| import { postgresConnection as cn } from '../../config/helpers.js';
const pgp = require('pg-promise')();
const db = pgp(cn);
module.exports = {
getAllLikedRecipes: (request, response, next) => {
const newQueryObj = {
name: 'get-my-favorite-recipes',
text: `SELECT
*
FROM
... | Add getAllLikedRecipes method, to get all liked recipes for a single user | Add getAllLikedRecipes method, to get all liked recipes for a single user
| JavaScript | mit | rompingstalactite/rompingstalactite,rompingstalactite/rompingstalactite,forkful/forkful,forkful/forkful,forkful/forkful,rompingstalactite/rompingstalactite |
c40a768c17d54f4ebb71d6e9aafb0bff086bffde | C-FAR/db.js | C-FAR/db.js | var Sequelize = require('sequelize');
var sequelize = new Sequelize('c-far', 'root', '123456@', {
host: '192.168.99.100',
dialect: 'mysql',
pool: {
max: 5,
min: 0,
idle: 10000
},
});
module.exports = sequelize; | var Sequelize = require('sequelize');
var sequelize = new Sequelize('c-far', 'root', '123456@', {
host: '192.168.99.100',
dialect: 'mysql',
port: 3306,
pool: {
max: 5,
min: 0,
idle: 10000
},
});
module.exports = sequelize; | Add database port in the config file. | Add database port in the config file.
| JavaScript | mit | tom19960222/C-FAR-Website,tom19960222/C-FAR-Website,tom19960222/C-FAR-Website,tom19960222/C-FAR-Website |
d8ec3bb5d5863f2b8b37223f39af42355135fedf | config.test.js | config.test.js | 'use strict';
var fs = require('fs');
var crypto = require('crypto');
module.exports = {
root: '',
db: {
host: 'localhost',
db: 'gandhi'
},
pool: {
max: 1,
min: 1,
timeout: 30000
},
redis: {
host: process.env.REDIS_PORT_6379_TCP_ADDR || '127.0.0.1',
port: process.env.REDIS_PORT_6379_TCP_PORT || 63... | 'use strict';
var fs = require('fs');
var crypto = require('crypto');
module.exports = {
root: '',
db: {
host: process.env.RETHINKDB_PORT_29015_TCP_ADDR,
port: process.env.RETHINKDB_PORT_28015_TCP_PORT,
db: 'gandhi'
},
pool: {
max: 1,
min: 1,
timeout: 30000
},
redis: {
host: process.env.REDIS_PORT... | Use docker connect env vars | Use docker connect env vars
| JavaScript | agpl-3.0 | mike-marcacci/gandhi,mike-marcacci/gandhi,mike-marcacci/gandhi |
c42aaec157d14e9f0173575d4fbac272c0917b5f | Brocfile.js | Brocfile.js | /* jshint node: true */
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
var app = new EmberAddon();
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object ... | /* jshint node: true */
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
var app = new EmberAddon();
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object ... | Use `app.bowerDirectory` instead of hardcoded `bower_components` | Use `app.bowerDirectory` instead of hardcoded `bower_components`
| JavaScript | mit | aravindranath/ember-cli-datepicker,topaxi/ember-bootstrap-datepicker,maladon/ember-cli-bootstrap-datepicker,Hanastaroth/ember-cli-bootstrap-datepicker,jesenko/ember-cli-bootstrap-datepicker,aravindranath/ember-cli-datepicker,lazybensch/ember-cli-bootstrap-datepicker,lazybensch/ember-cli-bootstrap-datepicker,jelhan/embe... |
003becf56e1cfc3b9737ee5c43824ebd12ffc252 | sampleConfig.js | sampleConfig.js | var global = {
domain: 'http://subdomain.yourdomain.com/',
secretUrlSuffix: 'putSomeAlphanumericSecretCharsHere'
};
var projects = [
{
repo: {
owner: 'yourbitbucketusername',
slug: 'your-bitbucket-repo-name',
sshPrivKeyPath: '/home/youruser/.ssh/id_rsa'
},
dest: {
host: 'yours... | var global = {
domain: 'http://subdomain.yourdomain.com/',
secretUrlSuffix: 'putSomeAlphanumericSecretCharsHere'
};
var projects = [
{
repo: {
owner: 'yourbitbucketusername',
slug: 'your-bitbucket-repo-name',
sshPrivKeyPath: '/home/youruser/.ssh/id_rsa'
},
dest: {
host: 'yours... | Add global to export config | Add global to export config
| JavaScript | mit | mplewis/statichook |
f7df94c004677304e33e3deae35f1478b004292b | public/js/login.js | public/js/login.js | /* eslint-env jquery */
start();
function start () {
'use strict';
$(document).ready(() => {
$('form').submit(event => {
event.preventDefault();
const username = $('#username').val();
const password = $('#password').val();
const loginObj = {
username,
password
};
... | /* eslint-env jquery */
start();
function start () {
'use strict';
$(document).ready(() => {
$('form').submit(event => {
event.preventDefault();
const username = $('#username').val();
const password = $('#password').val();
const loginObj = {
username,
password
};
... | Remove console.log that we use for debugging | Remove console.log that we use for debugging
| JavaScript | apache-2.0 | ailijic/era-floor-time,ailijic/era-floor-time |
f7adbbb625830a472f278d696123981b1d96317d | source/background/library/browserEvents.js | source/background/library/browserEvents.js | import log from "../../shared/library/log.js";
import { dispatch } from "../redux/index.js";
import { setAuthToken } from "../../shared/actions/dropbox.js";
const BUTTERCUP_DOMAIN_REXP = /^https:\/\/buttercup.pw\//;
const DROPBOX_ACCESS_TOKEN_REXP = /access_token=([^&]+)/;
export function attachBrowserStateListeners(... | import log from "../../shared/library/log.js";
import { dispatch } from "../redux/index.js";
import { setAuthToken } from "../../shared/actions/dropbox.js";
import { setUserActivity } from "../../shared/actions/app.js";
const BUTTERCUP_DOMAIN_REXP = /^https:\/\/buttercup.pw\//;
const DROPBOX_ACCESS_TOKEN_REXP = /acces... | Set user's activity tracking on tab events | Set user's activity tracking on tab events
Update user's activity tracking on any tab opening or closing.
| JavaScript | mit | buttercup-pw/buttercup-browser-extension,buttercup-pw/buttercup-browser-extension,perry-mitchell/buttercup-chrome,perry-mitchell/buttercup-chrome |
a4a733f8d852eb9928686e933895a46696d567c0 | server/index.js | server/index.js | // Importing Node modules and initializing Express
const express = require('express'),
app = express(),
bodyParser = require('body-parser'),
logger = require('morgan'),
mongoose = require('mongoose'),
router = require('./router');
config = require('./config/main');
// Database connection
mongoo... | // Importing Node modules and initializing Express
const express = require('express'),
app = express(),
bodyParser = require('body-parser'),
logger = require('morgan'),
mongoose = require('mongoose'),
router = require('./router');
config = require('./config/main');
// Database connection
mongoo... | Fix CORS behavior to not freeze | Fix CORS behavior to not freeze
| JavaScript | mit | davdkm/battlerite-base |
b61ada99d9031e418a57b1676605f7ea0818735f | lib/server/appTokenUtil.js | lib/server/appTokenUtil.js | const AppTokenUtil = {
getAppTokensBasedOnQuery: getAppTokensBasedOnQuery
};
function getAppTokensBasedOnQuery(query, desktopAppId) {
let userDisabledMap = new Map();
let userIdsSet = new Set();
let appTokens = Push.appTokens.find(query).fetch();
if (!appTokens.length) {
return [];
}
appTokens.for... | const AppTokenUtil = {
getAppTokensBasedOnQuery: getAppTokensBasedOnQuery
};
function getAppTokensBasedOnQuery(query, desktopAppId) {
let userDisabledMap = new Map();
let userIdsSet = new Set();
let appTokens = Push.appTokens.find(query).fetch();
if (!appTokens.length) {
return [];
}
if (desktopAp... | Remove vet check for desktop notifications in AppTokenUtil. | Remove vet check for desktop notifications in AppTokenUtil.
| JavaScript | mit | okgrow/push,staceesanti/push |
05fdcac6fa83207956f67bc3fa7b0ad8270543d0 | routes/domain-lookup.js | routes/domain-lookup.js | const router = require('express').Router();
router.get('/*', (req, res, next) => {
const seFree = require('se-free'),
domainName = parseDomainFromUrlPath(req.originalUrl),
domainLookup = seFree(domainName);
domainLookup.then(
(domainLookupResult) => {
res.render('domain-lookup', {
... | const router = require('express').Router();
router.get('/*', (req, res, next) => {
const seFree = require('se-free'),
domainName = parseDomainFromUrlPath(req.originalUrl);
if(!endsWithSe(domainName)) {
res.redirect(301, '/' + domainName + '.se');
};
seFree(domainName)
.then((domainLookupResul... | Add .se using redirect if neccessary | Add .se using redirect if neccessary
| JavaScript | mit | kpalmvik/isfree.se,kpalmvik/isfree.se |
558bb084d6d09f4a212f022640142ee812e61352 | app/utils/setPrompts.js | app/utils/setPrompts.js | 'use strict';
var _ = require('lodash');
module.exports = function (answers) {
this.prompts = {};
this.prompts.projectName = answers.projectName;
this.prompts.authorName = answers.useBranding ? 'XHTMLized' : answers.authorName;
this.prompts.useBranding = answers.useBranding;
... | 'use strict';
var _ = require('lodash');
module.exports = function (answers) {
this.prompts = {};
this.prompts.projectName = answers.projectName;
this.prompts.authorName = answers.useBranding ? 'XHTMLized' : answers.authorName;
this.prompts.useBranding = answers.useBranding;
... | Fix issue with wrong features format in .yo-rc file | Fix issue with wrong features format in .yo-rc file
| JavaScript | mit | xfiveco/generator-xh,xhtmlized/generator-xh,xfiveco/generator-xh,xhtmlized/generator-xh |
d1aae6ce7c12dda1fc2189411403e7a409aa81c1 | lib/controllers/acceptanceTestExecutions.js | lib/controllers/acceptanceTestExecutions.js | var mongoose = require('mongoose');
var _ = require('lodash');
var AcceptanceTestExecution = mongoose.model('AcceptanceTestExecution');
exports.list = function(req, res, next) {
AcceptanceTestExecution
.find()
.where('acceptanceTest').equals(req.acceptanceTest._id)
.select('-acceptanceTest... | var mongoose = require('mongoose');
var _ = require('lodash');
var AcceptanceTestExecution = mongoose.model('AcceptanceTestExecution');
exports.list = function(req, res, next) {
AcceptanceTestExecution
.find()
.where('acceptanceTest').equals(req.acceptanceTest._id)
.select('-acceptanceTest... | Fix ancien appel de fonction | Fix ancien appel de fonction
| JavaScript | agpl-3.0 | sgmap/mes-aides-api |
ba78bb8f7a90558a2fe67f91e3305d63dbfdc70f | config/globals.js | config/globals.js | module.exports.globals = {
proxy: process.env.PROXY_URL || 'http://localhost:4200',
proxyEnabled: process.env.PROXY_ENABLED === undefined ? false : process.env.PROXY_ENABLED === 'true',
redisHost: process.env.REDIS_HOST || 'localhost',
awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID,
awsSecretAccessKey: proce... | module.exports.globals = {
version: process.env.npm_package_version,
proxy: process.env.PROXY_URL || 'http://localhost:4200',
proxyEnabled: process.env.PROXY_ENABLED === undefined ? false : process.env.PROXY_ENABLED === 'true',
redisHost: process.env.REDIS_HOST || 'localhost',
awsAccessKeyId: process.env.AW... | Add NPM version as a global variable | Add NPM version as a global variable
| JavaScript | mit | TheConnMan/missd,TheConnMan/missd,TheConnMan/missd |
9afe827941349417a8ef416ca2e0255020d28706 | src/DEFAULTS.js | src/DEFAULTS.js | import reactDOMRunner from './reactDOMRunner';
export const endpoint = 'https://happo.now.sh';
export const include = '**/@(*-snaps|snaps).@(js|jsx)';
export const stylesheets = [];
export const targets = {};
export const configFile = './.happo.js';
export const hooks = {
run: reactDOMRunner,
finish: (result) => {... | import reactDOMRunner from './reactDOMRunner';
export const endpoint = 'https://happo.io';
export const include = '**/@(*-happo|happo).@(js|jsx)';
export const stylesheets = [];
export const targets = {};
export const configFile = './.happo.js';
export const hooks = {
run: reactDOMRunner,
finish: (result) => {
... | Change endpoint + include pattern | Change endpoint + include pattern
happo.io is now working.
I've decided to use `-happo.js*` as the file naming format instead of
-snaps.
| JavaScript | mit | enduire/happo.io,enduire/happo.io |
45399b5b85d25675430462aa4239d0bd4d1e6009 | atmo/static/js/forms.js | atmo/static/js/forms.js | $(function() {
// apply datetimepicker initialization
$('.datetimepicker').datetimepicker({
sideBySide: true, // show the time picker and date picker at the same time
useCurrent: false, // don't automatically set the date when opening the dialog
widgetPositioning: {vertical: 'bottom'}, // make sure the ... | $(function() {
// apply datetimepicker initialization
$('.datetimepicker').datetimepicker({
sideBySide: true, // show the time picker and date picker at the same time
useCurrent: false, // don't automatically set the date when opening the dialog
format: 'YYYY-MM-DD HH:mm',
stepping: 5,
minDate: ... | Use 24h based datepicket and prevent dates in the past | Use 24h based datepicket and prevent dates in the past
| JavaScript | mpl-2.0 | mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service,mozilla/telemetry-analysis-service |
0b76375e1ebc40067e9fe1afacf5cf499d903c8a | extensions/roc-plugin-dredd/src/actions/dredd.js | extensions/roc-plugin-dredd/src/actions/dredd.js | import { initLog } from 'roc';
import Dredd from 'dredd';
const log = initLog();
export default ({ context: { config: { settings } } }) => () => {
const port = process.env.PORT || settings.runtime.port;
const dredd = new Dredd({
server: `http://localhost:${port}`,
options: settings.test.dredd... | import { initLog } from 'roc';
import Dredd from 'dredd';
const { name, version } = require('../../package.json');
const log = initLog(name, version);
export default ({ context: { config: { settings } } }) => () => {
const port = process.env.PORT || settings.runtime.port;
const dredd = new Dredd({
s... | Initialize log using `name` and `version` | Initialize log using `name` and `version`
| JavaScript | mit | voldern/roc-plugin-dredd |
e5dae645d220a22a70babc7ac2216b79ebb2a136 | components/stateless/screens/Home.js | components/stateless/screens/Home.js | import React from 'react';
import { StyleSheet, Text, View, TextInput, Button } from 'react-native';
import { SearchBar } from 'react-native-elements'
export let SEARCH_QUERY = ''
const Home = ({ navigation: { navigate }}) => {
console.log('Home rendered!!')
return (
<View style={{flex: 1}}>
<View styl... | import React from 'react';
import { StyleSheet, Text, View, TextInput, Button, StatusBar } from 'react-native';
import { SearchBar } from 'react-native-elements'
export let SEARCH_QUERY = ''
const Home = ({ navigation: { navigate }}) => {
console.log('Home rendered!!')
return (
<View style={{flex: 1}}>
<St... | Hide the flippin' status bar on android | Hide the flippin' status bar on android
| JavaScript | mit | bnovf/react-native-github-graphql-app |
afa164de11eec71948252f1eb469a7ed9c981dac | bin/projects-resolve.js | bin/projects-resolve.js | #!/usr/bin/env node
exports.command = {
description: 'resolve a path to a project',
arguments: '<path>'
};
if (require.main !== module) {
return;
}
var path = require('path');
var storage = require('../lib/storage.js');
var utilities = require('../lib/utilities.js');
var program = utilities.programDefaults('r... | #!/usr/bin/env node
exports.command = {
description: 'resolve a path to a project',
arguments: '<path>'
};
if (require.main !== module) {
return;
}
var path = require('path');
var storage = require('../lib/storage.js');
var utilities = require('../lib/utilities.js');
var program = utilities.programDefaults('r... | Return a proper relative path | Return a proper relative path
| JavaScript | mit | beaugunderson/projects,beaugunderson/projects |
20ba9b777292c4f74c28e942801ea928af6b7a9b | test/src/board/movable_point/lance_test.js | test/src/board/movable_point/lance_test.js | import Board from '../../../../frontend/src/shogi/board';
import Piece from '../../../../frontend/src/shogi/piece';
import memo from 'memo-is';
import _ from 'lodash';
describe('black', () => {
context('match the piece of coordinate', () => {
context('exists movable coordinates', () => {
});
context('do... | import Board from '../../../../frontend/src/shogi/board';
import Piece from '../../../../frontend/src/shogi/piece';
import memo from 'memo-is';
import _ from 'lodash';
describe('black', () => {
context('match the piece of coordinate', () => {
context('exists movable coordinates', () => {
var board = memo()... | Add example but this is failed. | Add example but this is failed.
| JavaScript | mit | mgi166/usi-front,mgi166/usi-front |
4dd28119cb553ffa71cc2ab8a67e37295f6732b8 | src/index.js | src/index.js | module.exports = ({types: t}) => {
return {
pre(file) {
const opts = this.opts;
if (
!(
opts &&
typeof opts === 'object' &&
Object.keys(opts).every(key => (
opts[key] &&
(
typeof opts[key] === 'string' ||
(
... | module.exports = ({types: t}) => {
return {
pre(file) {
const opts = this.opts;
if (
!(
opts &&
typeof opts === 'object' &&
Object.keys(opts).every(key => (
opts[key] &&
(
typeof opts[key] === 'string' ||
(
... | Check type of options more carefully | Check type of options more carefully
| JavaScript | mit | mopedjs/babel-plugin-import-globals |
4b479f671156db716f986144b9950865792ac0f4 | src/index.js | src/index.js | const express = require('express');
const bodyParser = require('body-parser');
const morgan = require('morgan');
const logger = require('./logger');
const streamClient = require('./streamClient');
const sendEmail = require('./sendEmail');
const app = express();
if (process.env.NODE_ENV !== 'test') {
app.use(morgan(... | const express = require('express');
const bodyParser = require('body-parser');
const morgan = require('morgan');
const logger = require('./logger');
const streamClient = require('./streamClient');
const sendEmail = require('./sendEmail');
const app = express();
if (process.env.NODE_ENV !== 'test') {
app.use(morgan(... | Make the port overridable from the environment | Make the port overridable from the environment
| JavaScript | agpl-3.0 | rabblerouser/mailer,rabblerouser/mailer |
509b334c79b75adb2cd2d7bfa193b89e14a7dfd6 | src/index.js | src/index.js | import { Game } from 'cervus/modules/core';
import { Plane, Box } from 'cervus/modules/shapes';
import { basic } from 'cervus/modules/materials';
const game = new Game({
width: window.innerWidth,
height: window.innerHeight,
clear_color: "#eeeeee",
far: 1000
});
document.querySelector("#ui").addEventListener(... | import { Game } from 'cervus/core';
import { Plane, Box } from 'cervus/shapes';
import { basic } from 'cervus/materials';
const game = new Game({
width: window.innerWidth,
height: window.innerHeight,
clear_color: "#eeeeee",
far: 1000
});
document.querySelector("#ui").addEventListener(
'click', () => game.ca... | Update to new Cervus API | Update to new Cervus API
| JavaScript | isc | piesku/moment-lost,piesku/moment-lost |
4b81900bbe4bbf113fbfb967ff37938ac96f071f | src/index.js | src/index.js |
import {Video} from 'kaleidoscopejs';
import {ContainerPlugin} from 'clappr';
export default class Video360 extends ContainerPlugin {
constructor(container) {
super(container);
this.listenTo(this.container, 'container:fullscreen', this.updateSize);
let {height, width, autoplay} = container.options;
... |
import {Video} from 'kaleidoscopejs';
import {ContainerPlugin, Mediator, Events} from 'clappr';
export default class Video360 extends ContainerPlugin {
constructor(container) {
super(container);
Mediator.on(`${this.options.playerId}:${Events.PLAYER_RESIZE}`, this.updateSize, this);
let {height, width, a... | Fix plugin scaling when player size is set in percents or player is resized at runtime | Fix plugin scaling when player size is set in percents or player is resized at runtime
| JavaScript | mit | thiagopnts/video-360,thiagopnts/video-360 |
cd1b69dfb75def40203f6783dbae7e4ebbe6f36a | src/index.js | src/index.js | // @flow
import 'source-map-support/register';
import 'babel-polyfill';
import 'colors';
// import async from 'async';
// import _ from 'lodash';
import console from 'better-console';
import './fib-gen';
import './table';
import './random-throw';
| // @flow
import 'source-map-support/register';
import 'babel-polyfill';
import 'colors';
// import async from 'async';
// import _ from 'lodash';
// import console from 'better-console';
| Comment unwanted but relevant modules | Comment unwanted but relevant modules
| JavaScript | mit | abhisekp/Practice-Modern-JavaScript |
c026131558cdfd02d62d6d60bf494e93fd2d5285 | test/fixtures/with-config/nuxt.config.js | test/fixtures/with-config/nuxt.config.js | module.exports = {
router: {
base: '/test/'
},
cache: true,
plugins: ['~plugins/test.js'],
loading: '~components/loading',
env: {
bool: true,
num: 23,
string: 'Nuxt.js'
}
}
| module.exports = {
router: {
base: '/test/'
},
cache: true,
plugins: ['~plugins/test.js'],
loading: '~components/loading',
env: {
bool: true,
num: 23,
string: 'Nuxt.js'
},
extend (config, options) {
config.devtool = 'eval-source-map'
}
}
| Add test for extend option | Add test for extend option
| JavaScript | mit | jfroffice/nuxt.js,cj/nuxt.js,jfroffice/nuxt.js,cj/nuxt.js,mgesmundo/nuxt.js,mgesmundo/nuxt.js |
4895034d5368d6ec65d02c00ef3a0b7fe46c25e6 | src/index.js | src/index.js | import React from 'react';
import ReactDOM from 'react-dom';
import SearchBar from './components/search_bar'
const API_KEY = 'AIzaSyBKBu77HCUT6I3oZiFXlaIdou8S_3voo5E';
const App = () => {
return (
<div>
<SearchBar />
</div>
);
}
ReactDOM.render(<App />, document.querySelector('.container'));
| import React from 'react';
import ReactDOM from 'react-dom';
import YTSearch from 'youtube-api-search'
import SearchBar from './components/search_bar'
const API_KEY = 'AIzaSyBKBu77HCUT6I3oZiFXlaIdou8S_3voo5E';
YTSearch({key: API_KEY, term: 'surfboards'}, function(data) {
console.log(data);
});
const App = () => {... | Add simple youtube api call | Add simple youtube api call
| JavaScript | mit | izabelka/redux-simple-starter,izabelka/redux-simple-starter |
d72ad53ce31a49754fd62978741c1fe7ac819751 | src/index.js | src/index.js | import React from 'react'
import ReactDOM from 'react-dom'
import { createGlobalStyle } from 'styled-components'
import { App } from './App'
import woff2 from './fonts/source-sans-pro-v11-latin-regular.woff2'
import woff from './fonts/source-sans-pro-v11-latin-regular.woff'
import registerServiceWorker from './registe... | import React from 'react'
import ReactDOM from 'react-dom'
import { createGlobalStyle } from 'styled-components'
import { App } from './App'
import woff2 from './fonts/source-sans-pro-v11-latin-regular.woff2'
import woff from './fonts/source-sans-pro-v11-latin-regular.woff'
import registerServiceWorker from './registe... | Disable pull-to-refresh and overscroll glow | Disable pull-to-refresh and overscroll glow
| JavaScript | mit | joelgeorgev/react-checkbox-tree,joelgeorgev/react-checkbox-tree |
465fe8a992b6a277f0371fe175309b68688c77fe | creep.Harvester.behaviour.Harvest.js | creep.Harvester.behaviour.Harvest.js | module.exports = function (creep) {
// Aquire target
if(creep.memory.currentTarget.ticksToRegeneration === undefined || !creep.memory.currentTarget.energy || !creep.memory.movement.path.length) {
creep.memory.currentTarget = creep.pos.findClosest(FIND_SOURCES_ACTIVE, {
algorithm: "astar"
});
}
// E... | module.exports = function (creep) {
// Aquire target
if(!creep.memory.currentTarget || creep.memory.currentTarget.ticksToRegeneration === undefined || !creep.memory.currentTarget.energy || !creep.memory.movement.path.length) {
creep.memory.currentTarget = creep.pos.findClosest(FIND_SOURCES_ACTIVE, {
algori... | Add checks for currentTarget defined | Add checks for currentTarget defined
| JavaScript | mit | pmaidens/screeps,pmaidens/screeps |
1861155258d041d1c4b0c00dfb5b5e7407a37f0c | src/peeracle.js | src/peeracle.js | 'use strict';
(function () {
var Peeracle = {};
Peeracle.Media = require('./media');
Peeracle.Peer = require('./peer');
Peeracle.Tracker = require('./tracker');
module.exports = Peeracle;
})();
| 'use strict';
(function () {
var Peeracle = {};
Peeracle.Media = require('./media');
Peeracle.Metadata = require('./metadata');
Peeracle.Peer = require('./peer');
Peeracle.Tracker = require('./tracker');
Peeracle.Utils = require('./utils');
module.exports = Peeracle;
})();
| Load Metadata and Utils in node | Load Metadata and Utils in node
| JavaScript | mit | peeracle/legacy |
037af037f4b392ebc51da482ff654b8915f8f448 | reducers/es5/reviews.js | reducers/es5/reviews.js | const reviews = (state=[], action) => {
switch (action.type) {
case 'ADD_REVIEW':
return [
...state, {
id: action.id,
reviewer: action.reviewer,
text: action.text,
rating: action.rating,
flag: false
}
]
case 'DELETE_REVIEW':
return state.filter(... | const reviews = (state=[], action) => {
switch (action.type) {
case 'ADD_REVIEW':
return [
...state, {
id: action.id,
reviewer: action.reviewer,
text: action.text,
rating: action.rating,
flag: false
}
]
case 'DELETE_REVIEW':
return state.filter(r... | Remove unneccessary paren in flag review statement | [Chore] Remove unneccessary paren in flag review statement
| JavaScript | mit | andela-emabishi/immutable-redux |
909be0fe839a61616bc62e93176a7ceb7f8fdd55 | example/redux/client/routes.js | example/redux/client/routes.js | /* @flow */
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import { App, NotFound } from './components/App.js';
import Home, { Who, How } from './components/Pages.js';
import { LogIn, SignUp } from './components/SignUp.js';
/**
* The route configuration for the whole app.
*/
export co... | /* @flow */
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import { App, NotFound } from './components/App.js';
import Home, { Who, How } from './components/Pages.js';
import { LogIn, SignUp } from './components/SignUp.js';
/**
* The route configuration for the whole app.
*/
export co... | Fix title rendering in redux example | Fix title rendering in redux example
| JavaScript | mit | iansinnott/react-static-webpack-plugin,iansinnott/react-static-webpack-plugin |
29071eee23739d47dd9957b7fbdfacd5dd2918d7 | app.js | app.js | //var http = require('http');
var express = require('express');
var app = module.exports = express();
/*http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'});
res.end('Can i haz app.js host another one or probably?');
}).listen(4080);*/
app.get('/', functio... | //var http = require('http');
var express = require('express');
var app = module.exports = express();
/*http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'});
res.end('Can i haz app.js host another one or probably?');
}).listen(4080);*/
app.get('/', functio... | Fix issue with old express usage | Fix issue with old express usage
| JavaScript | mit | pieszynski/test |
1c372f7892199b84f128662fd71dc5795ec64348 | test/tests/itemTest.js | test/tests/itemTest.js | describe("Zotero.Item", function() {
describe("#getField()", function () {
it("should return false for valid unset fields on unsaved items", function* () {
var item = new Zotero.Item('book');
assert.equal(item.getField('rights'), false);
});
it("should return false for valid unset fields on unsaved item... | describe("Zotero.Item", function() {
describe("#getField()", function () {
it("should return false for valid unset fields on unsaved items", function* () {
var item = new Zotero.Item('book');
assert.equal(item.getField('rights'), false);
});
it("should return false for valid unset fields on unsaved item... | Remove extra debug lines in item test | Remove extra debug lines in item test
| JavaScript | agpl-3.0 | hoehnp/zotero,hoehnp/zotero,retorquere/zotero,rmzelle/zotero,hoehnp/zotero,gracile-fr/zotero,rmzelle/zotero,gracile-fr/zotero,gracile-fr/zotero,retorquere/zotero,retorquere/zotero,rmzelle/zotero |
17f04695e0548e093533d8b498d2b741bdc9daeb | test/twitterService.js | test/twitterService.js | 'use strict';
class TwitterService {
// House Keeping of our connection/server
constructor() {
this.server = undefined;
}
start(done) {
require('../server').then((server) => {
this.server = server;
done();
}).catch(done);
}
clearDB() {
this.server.db.dropDatabase();
}
sto... | 'use strict';
const User = require('../app/models/user');
class TwitterService {
// House Keeping of our connection/server
constructor() {
this.server = undefined;
}
start(done) {
require('../server').then((server) => {
this.server = server;
done();
}).catch(done);
}
clearDB() {
... | Add user helpers to test service | Add user helpers to test service
| JavaScript | mit | FritzFlorian/true-parrot,FritzFlorian/true-parrot |
2a780f2132c867a996e78c1c0f1e9ef92d4a86fa | bot.js | bot.js | /* Require modules */
var nodeTelegramBot = require('node-telegram-bot')
, config = require('./config.json')
, request = require("request")
, cheerio = require("cheerio");
/* Functions */
/**
* Uses the request module to return the body of a web page
* @param {string} url
* @param {callback} callb... | /* Require modules */
var nodeTelegramBot = require('node-telegram-bot')
, config = require('./config.json')
, request = require("request")
, cheerio = require("cheerio");
/* Functions */
/**
* Uses the request module to return the body of a web page
* @param {string} url
* @param {callback} callb... | Add support for new @mention command syntax | Add support for new @mention command syntax
| JavaScript | mit | frdmn/telegram-WhatToEatBot |
092931766b842f4be71c27ab467f3549e1acf901 | Gulpfile.js | Gulpfile.js | var gulp = require('gulp');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var mocha = require('gulp-mocha');
gulp.task('lint', function() {
gulp.src(['src/**/*.js', 'test/**/*.js'])
.pipe(jshint({
esnext: true
}))
.pipe(jshint.reporter(stylish))
... | var gulp = require('gulp');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var mocha = require('gulp-mocha');
var sixToFive = require('gulp-6to5');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var del = require('del');
gulp.task('lint', function() {
gulp.... | Add UMD dist file building | Add UMD dist file building
| JavaScript | mit | MadaraUchiha/chusha |
4c0dfb36c9814228c633a430041f516018114a9c | routes/recipes/index.js | routes/recipes/index.js | var express = require('express');
var router = express.Router();
var JsonDB = require('node-json-db');
var _ = require('lodash');
// Escape a string for regexp use
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
// Recipes listing
router.get('/', function (req, res, next) {
... | var express = require('express');
var router = express.Router();
var JsonDB = require('node-json-db');
var _ = require('lodash');
// Recipes listing
router.get('/', function (req, res, next) {
var db = new JsonDB('db', false, false);
var recipes = db.getData('/recipes');
// Expand requested resources if they ex... | Revert "Prepare branch for section 2.4 tutorial" | Revert "Prepare branch for section 2.4 tutorial"
This reverts commit 169e11232511209548673dd769a9c6f71d9b8498.
| JavaScript | mit | adamsea/recipes-api |
5d329062de1f903a05bb83101d81e4543cf993f6 | cu-build.config.js | cu-build.config.js | /**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
var name = 'cu-patcher-ui';
var config = {
type: 'module',
path: __dirname,
name: name,
bundle: {
... | /**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
var name = 'cu-patcher-ui';
var config = {
type: 'module',
path: __dirname,
name: name,
bundle: {
... | Fix gulp server root (for some reason started defaulting to dist) | Fix gulp server root (for some reason started defaulting to dist)
| JavaScript | mpl-2.0 | jamkoo/cu-patcher-ui,saddieeiddas/cu-patcher-ui,stanley85/cu-patcher-ui,stanley85/cu-patcher-ui,saddieeiddas/cu-patcher-ui,jamkoo/cu-patcher-ui,saddieeiddas/cu-patcher-ui |
c77cf00a60d489aaf3ceb45eb9f08ba7a85d2097 | figlet-node.js | figlet-node.js | /**
* Figlet JS node.js module
*
* Copyright (c) 2010 Scott González
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://github.com/scottgonzalez/figlet-js
*/
var Figlet = require("./figlet").Figlet;
Figlet.loadFont = function(name, fn) {
require("fs").readFile(... | /**
* Figlet JS node.js module
*
* Copyright (c) 2010 Scott González
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://github.com/scottgonzalez/figlet-js
*/
var fs = require("fs");
var path = require('path');
var Figlet = require("./figlet").Figlet;
Figlet.load... | Clean up figlet font loading for node | Clean up figlet font loading for node
| JavaScript | mit | olizilla/figlet-js |
eabfa3b3ed987746d335d4e0eb04688a6033b100 | ui/app/controllers/csi/volumes/volume.js | ui/app/controllers/csi/volumes/volume.js | import Controller from '@ember/controller';
export default Controller.extend({
actions: {
gotoAllocation(allocation) {
this.transitionToRoute('allocations.allocation', allocation);
},
},
});
| import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
export default Controller.extend({
system: service(),
sortedReadAllocations: computed('model.readAllocations.@each.modifyIndex', function() {
return this.model.readAllocati... | Sort allocation tables by modify index | Sort allocation tables by modify index
| JavaScript | mpl-2.0 | dvusboy/nomad,burdandrei/nomad,dvusboy/nomad,dvusboy/nomad,burdandrei/nomad,dvusboy/nomad,burdandrei/nomad,hashicorp/nomad,hashicorp/nomad,burdandrei/nomad,burdandrei/nomad,hashicorp/nomad,dvusboy/nomad,burdandrei/nomad,hashicorp/nomad,burdandrei/nomad,dvusboy/nomad,hashicorp/nomad,dvusboy/nomad,hashicorp/nomad |
91e3c6bddf1345970b7e2f8a34a487ccf9dc5224 | sashimi-webapp/test/database/sqlCommands_test.js | sashimi-webapp/test/database/sqlCommands_test.js | /*
* Test-unit framework for sqlCommands.js
*/
const assert = require('assert');
const vows = require('vows');
const Sql = require('../../src/database/sql-related/sqlCommands');
const sqlCommands = new Sql();
const isNotEmptyTable = function isNotEmptyTable(stringResult) {
return stringResult !== undefined;
};... | /*
* Test-unit framework for sqlCommands.js
*/
const assert = require('assert');
const vows = require('vows');
const Sql = require('../../src/database/sql-related/sqlCommands');
const sqlCommands = new Sql();
const isNotEmptyTable = function isNotEmptyTable(stringResult) {
return stringResult !== undefined;
};... | Add code framework to return data from test | Add code framework to return data from test
| JavaScript | mit | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note |
a2981360a9531458ce590eb8c6144fbd64848d90 | configs/typescript.js | configs/typescript.js | module.exports = {
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
// typescript will handle this so no need for it
'no-undef': 'off',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-unus... | module.exports = {
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
rules: {
// typescript will handle this so no need for it
'no-undef': 'off',
'no-unused-vars': 'off',
'no-use-before-define': ... | Add parser to ts overrides | fix: Add parser to ts overrides
| JavaScript | mit | relekang/eslint-config-relekang |
f1da9f35647cd44ee8bd898593da8f35b7e7cb02 | routes/media.js | routes/media.js | const db = require('../lib/db')
const mongoose = db.goose
const conn = db.rope
const fs = require('fs')
const router = require('koa-router')()
const File = require('../lib/models/file')
const grid = require('gridfs-stream')
const gfs = grid(conn.db, mongoose.mongo)
router.get('/', function *() {
try {
var resu... | const db = require('../lib/db')
const mongoose = db.goose
const conn = db.rope
const fs = require('fs')
const router = require('koa-router')()
const File = require('../lib/models/file')
const grid = require('gridfs-stream')
const gfs = grid(conn.db, mongoose.mongo)
router.get('/', function *() {
try {
var resu... | Remove temporary file after upload | Remove temporary file after upload
| JavaScript | mit | kunni80/server,muffin/server |
28df4f7258df6930b0fa5892becde4c8962c6017 | packages/geolocation/geolocation.js | packages/geolocation/geolocation.js | var locationDep = new Deps.Dependency();
var location = null;
var locationRefresh = false;
var options = {
enableHighAccuracy: true,
maximumAge: 0
};
var errCallback = function () {
// do nothing
};
var callback = function (newLocation) {
location = newLocation;
locationDep.changed();
};
var enableLocatio... | var locationDep = new Deps.Dependency();
var location = null;
var locationRefresh = false;
var options = {
enableHighAccuracy: true,
maximumAge: 0
};
var errCallback = function () {
// do nothing
};
var callback = function (newLocation) {
location = newLocation;
locationDep.changed();
};
var enableLocatio... | Add simple location to Geolocation package | Add simple location to Geolocation package
| JavaScript | mit | steedos/meteor,yalexx/meteor,justintung/meteor,Profab/meteor,mubassirhayat/meteor,aramk/meteor,ashwathgovind/meteor,lpinto93/meteor,jagi/meteor,skarekrow/meteor,papimomi/meteor,SeanOceanHu/meteor,emmerge/meteor,lawrenceAIO/meteor,dfischer/meteor,Theviajerock/meteor,rabbyalone/meteor,mubassirhayat/meteor,stevenliuit/met... |
af56a39be34c4c42ffffbcf9f5dff5bba268bb8a | src/components/Modal.js | src/components/Modal.js | import React from 'react'
import styled from 'styled-components'
const Modal = props =>
props.isOpen ? (
<ModalContainer>
<ModalContent>{props.children}</ModalContent>
</ModalContainer>
) : (
<div />
)
const ModalContainer = styled.div`
display: flex;
justify-content: center;
align-items... | import React from 'react'
import styled from 'styled-components'
import Close from 'react-icons/lib/md/close'
const Modal = props =>
props.isOpen ? (
<ModalContainer>
<ModalContent>
<CloseIcon onClick={() => props.handleClose()} />
{props.children}
</ModalContent>
</ModalContainer... | Add close icon to modal window | Add close icon to modal window
| JavaScript | mit | h-simpson/hughsimpson.me,h-simpson/hughsimpson.me |
254a3a85d6ca2e769949c7062bb6035dcfd9cd11 | addon/components/ilios-calendar-event.js | addon/components/ilios-calendar-event.js | import Ember from 'ember';
import { default as CalendarEvent } from 'el-calendar/components/calendar-event';
import layout from '../templates/components/ilios-calendar-event';
import moment from 'moment';
const {computed, Handlebars} = Ember;
const {SafeString} = Handlebars;
export default CalendarEvent.extend({
la... | import Ember from 'ember';
import { default as CalendarEvent } from 'el-calendar/components/calendar-event';
import layout from '../templates/components/ilios-calendar-event';
import moment from 'moment';
const {computed, Handlebars} = Ember;
const {SafeString} = Handlebars;
export default CalendarEvent.extend({
la... | Fix single event class bindings | Fix single event class bindings
| JavaScript | mit | ilios/calendar,jrjohnson/calendar,stopfstedt/calendar,stopfstedt/calendar,ilios/calendar,jrjohnson/calendar |
4875769e5f7b38642e76ef8996058b644b45aae2 | src/defaultContainer.js | src/defaultContainer.js | import {formatString} from './utils';
import HostStorage from './Storage/HostStorage';
import ContextualIdentities from './ContextualIdentity';
import ExtendedURL from './ExtendedURL';
export async function buildDefaultContainer(preferences, url) {
url = new ExtendedURL(url);
let name = preferences['defaultContain... | import {formatString} from './utils';
import HostStorage from './Storage/HostStorage';
import ContextualIdentities from './ContextualIdentity';
import ExtendedURL from './ExtendedURL';
import PreferenceStorage from './Storage/PreferenceStorage';
export async function buildDefaultContainer(preferences, url) {
url = n... | Save 'lifetime' preference for created default containers | Save 'lifetime' preference for created default containers
| JavaScript | mit | kintesh/containerise,kintesh/containerise |
0cacc1182e66fe3cc8ac68639309b1bc5c8714b2 | src/models/variables.js | src/models/variables.js | 'use strict';
const readline = require('readline');
const _ = require('lodash');
const Bacon = require('baconjs');
function parseLine (line) {
const p = line.split('=');
const key = p[0];
p.shift();
const value = p.join('=');
if (line.trim()[0] !== '#' && p.length > 0) {
return [key.trim(), value.trim(... | 'use strict';
const readline = require('readline');
const _ = require('lodash');
const Bacon = require('baconjs');
function parseLine (line) {
const p = line.split('=');
const key = p[0];
p.shift();
const value = p.join('=');
if (line.trim()[0] !== '#' && p.length > 0) {
return [key.trim(), value.trim(... | Remove leftover `console.log` in `clever env import` | Remove leftover `console.log` in `clever env import` | JavaScript | apache-2.0 | CleverCloud/clever-tools,CleverCloud/clever-tools,CleverCloud/clever-tools |
63cd19e26f0cd5629372fb50c0244986c3ef1bbd | app/client/templates/posts/post_submit.js | app/client/templates/posts/post_submit.js | Template.postSubmit.events({
'submit form': function(e) {
e.preventDefault();
var post = {
url: $(e.target).find('[name=url]').val(),
title: $(e.target).find('[name=title]').val()
};
post.slug = slugify(post.title);
post._id = Posts.insert(post);
Router.go('postPage', post);
}... | Template.postSubmit.events({
'submit form': function(e) {
e.preventDefault();
var post = {
url: $(e.target).find('[name=url]').val(),
title: $(e.target).find('[name=title]').val()
};
post.slug = slugify(post.title);
Meteor.call('postInsert', post, function(error, result) {
// ... | Stop if there's an error | Stop if there's an error
| JavaScript | mit | drainpip/music-management-system,drainpip/music-management-system |
e3c9a348450c91830d5e36a792563fffcbe7d992 | app/extensions/safe/server-routes/safe.js | app/extensions/safe/server-routes/safe.js | import logger from 'logger';
import { getAppObj } from '../network';
const safeRoute = {
method : 'GET',
path : '/safe/{link*}',
handler : async ( request, reply ) =>
{
try
{
const link = `safe://${request.params.link}`;
const app = getAppObj();
... | import logger from 'logger';
import { getAppObj } from '../network';
const safeRoute = {
method : 'GET',
path : '/safe/{link*}',
handler : async ( request, reply ) =>
{
try
{
const link = `safe://${request.params.link}`;
const app = getAppObj();
... | Add content-encoding headers for webfetch response. Set 'chunked' | fix/webFetch-encoding: Add content-encoding headers for webfetch response. Set 'chunked'
| JavaScript | mit | joshuef/peruse,joshuef/peruse |
561d5e010f91fef43bda94e7e51af6ed5cbd9792 | app/assets/javascripts/custom.js | app/assets/javascripts/custom.js | $(document).on('turbolinks:load', function () {
$("#selectImage").imagepicker({
hide_select: true,
show_label : true
});
var $container = $('.image_picker_selector');
// initialize
$container.imagesLoaded(function () {
$container.masonry({
columnWidth: 30,
... | $(document).on('turbolinks:load', function () {
$("#selectImage").imagepicker({
hide_select: true,
show_label : true
});
$("#pendingImage").imagepicker({
hide_select: true,
show_label : true
});
$("#moochedImage").imagepicker({
hide_select: true,
s... | Use imagepicker for all forms | Use imagepicker for all forms
| JavaScript | mit | ppanagiotis/gamemooch,ppanagiotis/gamemooch,ppanagiotis/gamemooch,ppanagiotis/gamemooch |
84bc2383b6c99b0e4696f758b5cb5fa9749fcb14 | app/assets/javascripts/editor.js | app/assets/javascripts/editor.js | /**
* Wysiwyg related javascript
*/
// =require ./lib/redactor.js
(function($){
$(document).ready( function() {
/**
* Minimal wysiwyg support
*/
$('.wysiwyg-minimal').redactor({
airButtons: ['bold', 'italic', 'deleted', '|', 'link'],
air: true
});
/**
* Basic wysiwyg su... | /**
* Wysiwyg related javascript
*/
// =require ./lib/redactor.js
(function($){
$(document).ready( function() {
/**
* Minimal wysiwyg support
*/
$('.wysiwyg-minimal').redactor({
airButtons: ['bold', 'italic', 'deleted', '|', 'link'],
air: true
});
/**
* Basic wysiwyg su... | Disable convertion to divs, preserve paragraphs. | Disable convertion to divs, preserve paragraphs. | JavaScript | mit | Courseware/coursewa.re,Courseware/coursewa.re |
b49b4c23636c8264794085b33ffcc702a3d46620 | bids-validator/tests/env/load-examples.js | bids-validator/tests/env/load-examples.js | const fs = require('fs')
const { promisify } = require('util')
const request = require('sync-request')
const AdmZip = require('adm-zip')
const lockfile = require('lockfile')
const lockPromise = promisify(lockfile.lock)
const test_version = '1.2.0'
const examples_lock = 'bids-validator/tests/data/examples.lockfile'
//... | const fs = require('fs')
const { promisify } = require('util')
const request = require('sync-request')
const AdmZip = require('adm-zip')
const lockfile = require('lockfile')
const lockPromise = promisify(lockfile.lock)
const test_version = '1.2.0'
const examples_lock = 'bids-validator/tests/data/examples.lockfile'
//... | Remove extraneous directory creation in examples environment. | Remove extraneous directory creation in examples environment.
| JavaScript | mit | nellh/bids-validator,nellh/bids-validator,Squishymedia/bids-validator,Squishymedia/BIDS-Validator,nellh/bids-validator |
4b707d9da54fb68888a5494fcd9d6d64036446c1 | scripts/time.js | scripts/time.js | /*
* Clock plugin using Moment.js (http://momentjs.com/) to
* format the time and date.
*
* The only exposed property, 'format', determines the
* format (see Moment.js documentation) to display time and date.
*
* Requires 'jquery' and 'moment' to be available through RequireJS.
*/
define(['jquery', 'moment'], f... | /*
* Clock plugin using Moment.js (http://momentjs.com/) to
* format the time and date.
*
* The only exposed property, 'format', determines the
* format (see Moment.js documentation) to display time and date.
*
* Requires 'jquery' and 'moment' to be available through RequireJS.
*/
define(['jquery', 'moment'], f... | Update for new Moment.js API | Update for new Moment.js API
| JavaScript | mit | koterpillar/tianbar,koterpillar/tianbar,koterpillar/tianbar |
7a49bcacbb557caca510ea8a044e4a57a62a8733 | lib/components/App.js | lib/components/App.js | import React, {Component} from 'react';
import $ from 'jquery';
import CurrentWeatherCard from './CurrentWeatherCard';
export default class App extends Component {
constructor(){
super()
this.state = {
location:'',
responseData: null,
currentData: null,
forecastData: null,
hourl... | import React, {Component} from 'react';
import $ from 'jquery';
import CurrentWeatherCard from './CurrentWeatherCard';
export default class App extends Component {
constructor(){
super()
this.state = {
location:'',
responseData: null,
currentData: null,
forecastData: null,
hourl... | Add additional property to pass to weatherCard. | Add additional property to pass to weatherCard.
| JavaScript | mit | thatPamIAm/weathrly,thatPamIAm/weathrly |
40b9521f4e05eed0bf03accf868f5a4e844e3b9f | app/routes/owner/repositories.js | app/routes/owner/repositories.js | import Ember from 'ember';
import TravisRoute from 'travis/routes/basic';
import config from 'travis/config/environment';
export default TravisRoute.extend({
needsAuth: false,
titleToken(model) {
var name = model.name || model.login;
return name;
},
model(params, transition) {
var options;
op... | import Ember from 'ember';
import TravisRoute from 'travis/routes/basic';
import config from 'travis/config/environment';
export default TravisRoute.extend({
needsAuth: false,
titleToken(model) {
var name = model.name || model.login;
return name;
},
model(params, transition) {
var options;
op... | Remove line break in includes params | Remove line break in includes params
This was causing a 400 Invalid Request on the organizations page.
| JavaScript | mit | fotinakis/travis-web,travis-ci/travis-web,travis-ci/travis-web,fotinakis/travis-web,fotinakis/travis-web,fotinakis/travis-web,travis-ci/travis-web,travis-ci/travis-web |
796174d58262bafa0157684ae6e28e455dec82b3 | app.js | app.js | import {Component, View, bootstrap} from 'angular2/angular2';
// Annotation section
@Component({
selector: 'my-app'
})
@View({
inline: '<h1>Hello {{ name }}</h1>'
})
// Component controller
class MyAppComponent {
constructor() {
this.name = 'Alice'
}
}
bootstrap(MyAppComponent); | import {Component, Template, bootstrap} from 'angular2/angular2';
// Annotation section
@Component({
selector: 'my-app'
})
@Template({
inline: '<h1>Hello {{ name }}</h1>'
})
// Component controller
class MyAppComponent {
constructor() {
this.name = 'Alice'
}
}
bootstrap(MyAppComponent); | Fix 'template' error replacing View with Template (suggested in blog comments) | Fix 'template' error replacing View with Template
(suggested in blog comments)
| JavaScript | mit | training-blogs/20150514-ionic-angular-2-series-introduction,training-blogs/20150514-ionic-angular-2-series-introduction,training-blogs/20150514-ionic-angular-2-series-introduction |
533833d77577306c8250410dba1ef3332cc4c1e6 | handlers/middlewares/addedToGroup.js | handlers/middlewares/addedToGroup.js | 'use strict';
// Bot
const bot = require('../../bot');
const { replyOptions } = require('../../bot/options');
const { addGroup, managesGroup } = require('../../stores/group');
const { masterID } = require('../../config.json');
const addedToGroupHandler = async (ctx, next) => {
const msg = ctx.message;
const wasAd... | 'use strict';
// Bot
const bot = require('../../bot');
const { replyOptions } = require('../../bot/options');
const { admin } = require('../../stores/user');
const { addGroup, managesGroup } = require('../../stores/group');
const { masterID } = require('../../config.json');
const addedToGroupHandler = async (ctx, ne... | Add master to admins when added to group | Add master to admins when added to group
| JavaScript | agpl-3.0 | TheDevs-Network/the-guard-bot |
72bcff83f71a0fd9cb04a05386e43898c6fbf75b | hooks/lib/android-helper.js | hooks/lib/android-helper.js |
var fs = require("fs");
var path = require("path");
var utilities = require("./utilities");
module.exports = {
addFabricBuildToolsGradle: function() {
var buildGradle = utilities.readBuildGradle();
buildGradle += [
"// Fabric Cordova Plugin - Start Fabric Build Tools ",
... |
var fs = require("fs");
var path = require("path");
var utilities = require("./utilities");
module.exports = {
addFabricBuildToolsGradle: function() {
var buildGradle = utilities.readBuildGradle();
buildGradle += [
"",
"// Fabric Cordova Plugin - Start Fabric Build Tool... | Fix hook to remove build.gradle config on uninstall. | Fix hook to remove build.gradle config on uninstall.
| JavaScript | mit | andrestraumann/FabricPlugin,sarriaroman/FabricPlugin,andrestraumann/FabricPlugin,sarriaroman/FabricPlugin,sarriaroman/FabricPlugin,andrestraumann/FabricPlugin,sarriaroman/FabricPlugin |
c9b1e95d27e9e5bc150576cd02a2e4769a073f8f | public/js/register.js | public/js/register.js | $(function() {
$("#register").submit(function() {
var password = $("#password").val();
if (password !== $("#confirm").val()) {
return false;
}
var hashedPassword = CryptoJS.SHA256(password).toString();
$("#hashedPassword").val(hashedPassword);
return true;
})
}); | $(function() {
$("#register").submit(function() {
var password = $("#password").val();
var confirmation = $("#confirm").val();
clearErrors();
if (!passwordValid(password)) {
addValidationError("Password must be at least 6 characters long");
return false;
}
if (!passwordConfirmed(password, confir... | Add password validation to client side | Add password validation to client side
Since the password is getting hashed before it's sent to the server I
couldn't do any validations on the presence or length of the password on
the server side.
| JavaScript | mit | jimguys/poemlab,jimguys/poemlab |
c2c711f7896ad4cf405e239a4d37dd8112fd288a | chrome-extension/app/scripts/bitbucket.js | chrome-extension/app/scripts/bitbucket.js | var BitBucket = {
hasLogin: function () {
return !!localStorage['bitbucketLogin'] && !!localStorage['bitbucketRepo'];
},
getLastChangeset: function (user, repo, callback, fail) {
var url = "https://bitbucket.org/api/1.0/repositories/" + user + "/" + repo + "/changesets/";
$.ajax({
dataType: "j... | var BitBucket = {
hasLogin: function () {
return !!localStorage['bitbucketLogin'] && !!localStorage['bitbucketRepo'];
},
getLastChangeset: function (user, repo, callback, fail) {
var url = "https://bitbucket.org/api/1.0/repositories/" + user + "/" + repo + "/changesets/";
$.ajax({
dataType: "j... | Handle 404 from BitBucket API | Handle 404 from BitBucket API
| JavaScript | mit | asivokon/mooch-sentinel,asivokon/mooch-sentinel,asivokon/mooch-sentinel,asivokon/mooch-sentinel |
3f6b6b1db300809bef2540df1c6f05d53e2482af | seeds/cities.js | seeds/cities.js | var util = require('../src/util/seeds');
exports.seed = function(knex, Promise) {
return util.insertOrUpdate(knex, 'cities', {
id: 1,
name: 'Otaniemi',
})
.then(() => util.insertOrUpdate(knex, 'cities', {
id: 2,
name: 'Tampere',
}));
}
| var util = require('../src/util/seeds');
exports.seed = function(knex, Promise) {
return util.removeIfExists(knex, 'cities', {
id: 1,
name: 'Other',
})
.then(() => util.insertOrUpdate(knex, 'cities', {
id: 2,
name: 'Otaniemi',
}))
.then(() => util.insertOrUpdate(knex, 'cities', {
id: 3,
... | Remove city 'Other' using removeIfExists | Remove city 'Other' using removeIfExists
| JavaScript | mit | futurice/wappuapp-backend,futurice/wappuapp-backend,kaupunki-apina/prahapp-backend,kaupunki-apina/prahapp-backend |
24d0c3e7822165e860132d5bcdc1e9c2ed9d9a2e | initializers/trailing-history.js | initializers/trailing-history.js | /*global Ember */
var trailingHistory = Ember.HistoryLocation.extend({
setURL: function (path) {
var state = this.getState();
path = this.formatURL(path);
path = path.replace(/\/?$/, '/');
if (state && state.path !== path) {
this.pushState(path);
}
}
});
va... | /*global Ember */
var trailingHistory = Ember.HistoryLocation.extend({
formatURL: function () {
return this._super.apply(this, arguments).replace(/\/?$/, '/');
}
});
var registerTrailingLocationHistory = {
name: 'registerTrailingLocationHistory',
initialize: function (container, application) ... | Fix trailing slashes output app-wide | Fix trailing slashes output app-wide
closes #2963, closes #2964
- override Ember's `HistoryLocation.formatURL`
- remove overridden `HistoryLocation.setURL`
| JavaScript | mit | dbalders/Ghost-Admin,kevinansfield/Ghost-Admin,acburdine/Ghost-Admin,acburdine/Ghost-Admin,JohnONolan/Ghost-Admin,airycanon/Ghost-Admin,JohnONolan/Ghost-Admin,dbalders/Ghost-Admin,TryGhost/Ghost-Admin,kevinansfield/Ghost-Admin,TryGhost/Ghost-Admin,airycanon/Ghost-Admin |
e9de3d6da5e3cfc03b6d5e39fe92ede9c110d712 | webpack_config/server/webpack.prod.babel.js | webpack_config/server/webpack.prod.babel.js | import webpack from 'webpack'
import baseWebpackConfig from './webpack.base'
import UglifyJSPlugin from 'uglifyjs-webpack-plugin'
import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer'
import {Plugin as ShakePlugin} from 'webpack-common-shake'
import OptimizeJsPlugin from 'optimize-js-plugin'
const analyzePlugin... | import webpack from 'webpack'
import baseWebpackConfig from './webpack.base'
import UglifyJSPlugin from 'uglifyjs-webpack-plugin'
import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer'
import {Plugin as ShakePlugin} from 'webpack-common-shake'
import OptimizeJsPlugin from 'optimize-js-plugin'
const plugins = [
... | Revert "style(webpack_config/server): rewrite prod conf in functional style" | Revert "style(webpack_config/server): rewrite prod conf in functional style"
This reverts commit bc707a71f85e918a2d95acd7ce1f15beb191525b.
| JavaScript | apache-2.0 | Metnew/react-semantic.ui-starter |
6bf45d425a47caa83eae07113249c414df6c32c4 | jest.config.js | jest.config.js | var semver = require('semver');
function getSupportedTypescriptTarget() {
var nodeVersion = process.versions.node;
if (semver.gt(nodeVersion, '7.6.0')) {
return 'es2017'
} else if (semver.gt(nodeVersion, '7.0.0')) {
return 'es2016';
} else if (semver.gt(nodeVersion, '6.0.0')) {
return 'es2015';
... | var semver = require('semver');
function getSupportedTypescriptTarget() {
var nodeVersion = process.versions.node;
if (semver.gt(nodeVersion, '7.6.0')) {
return 'es2017'
} else if (semver.gt(nodeVersion, '7.0.0')) {
return 'es2016';
} else if (semver.gt(nodeVersion, '6.0.0')) {
return 'es2015';
... | Fix deprecated warning for ts-jest | Fix deprecated warning for ts-jest
| JavaScript | mit | maxdavidson/structly,maxdavidson/structly |
03ed1776047ebe316fef8e077a0d62d6b5587da6 | client/views/home/edit/edit.js | client/views/home/edit/edit.js | Template.editHome.helpers({
'home': function () {
// Get Home ID from template data context
// convert the 'String' object to a string for the DB query
var homeId = this._id;
// Get home document
var home = Homes.findOne(homeId);
return home;
}
});
Template.editHome.created = function () ... | Template.editHome.created = function () {
// Get reference to template instance
var instance = this;
// Get reference to router
var router = Router.current();
// Get Home ID from router parameter
var homeId = router.params.homeId;
// Subscribe to single home, based on Home ID
instance.subscribe('sing... | Remove unused template helper; add comments | Remove unused template helper; add comments
| JavaScript | agpl-3.0 | GeriLife/wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing |
a205caefe68d4c9279aaa86470c30974da226874 | Miscellaneous/ebay.highlight-bids.user.js | Miscellaneous/ebay.highlight-bids.user.js | // ==UserScript==
// @name eBay - Hilight Items With Bids
// @namespace http://mathemaniac.org
// @include http://*.ebay.*/*
// @grant none
// @version 2.3.1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @description Hilights items that have bids ... | // ==UserScript==
// @name eBay - Hilight Items With Bids
// @namespace http://mathemaniac.org
// @include http://*.ebay.*/*
// @grant none
// @version 2.3.2
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @description Hilights items that have bids ... | Update eBay highlight script to work with new classes | Update eBay highlight script to work with new classes
| JavaScript | mit | Eckankar/userscripts,Eckankar/userscripts |
2f2a17f599a3d3de05b61664c6d321494c01e552 | server/production.js | server/production.js | /* eslint strict: 0 */
'use strict';
// Load environment variables
require('dotenv-safe').load();
// Load assets
const assets = require('./assets');
const express = require('express');
const compression = require('compression');
const cookieParser = require('cookie-parser');
const server = express();
// Set up the r... | /* eslint strict: 0 */
'use strict';
// Load environment variables
require('dotenv-safe').load();
// Load assets
const assets = require('./assets');
const express = require('express');
const compression = require('compression');
const cookieParser = require('cookie-parser');
const server = express();
// Set up the r... | Set long time caching for js/css builds. | Set long time caching for js/css builds.
| JavaScript | mit | reauv/persgroep-app,reauv/persgroep-app |
f4d79cf2e7924ef1dd294e8c37ce54bfc2a73d02 | js/controllers/catalog-ctrl.js | js/controllers/catalog-ctrl.js | catalogApp.controller('CatalogCtrl', ['$scope', 'assetService', function($scope, assetService) {
$scope.assets = [];
$scope.totalHits = 0;
$scope.getAssets = function(data) {
var promise = assetService.getAssets({
data: data
});
promise.then(function(response) {
var originalAssets = resp... | catalogApp.controller('CatalogCtrl', ['$scope', 'assetService', function($scope, assetService) {
$scope.assets = [];
$scope.currentPage = 0;
$scope.totalPages = 1;
$scope.pageNumbers = [];
$scope.pageSize = 20;
$scope.totalHits = 0;
$scope.pageOffset = 0;
var initPagination = function(totalPages) {
... | Add pagination logic, cleanup re-org code | Add pagination logic, cleanup re-org code
| JavaScript | mit | satbirjhuti/catalogFeed,satbirjhuti/catalogFeed |
1a067a9635585cbb96c80040b2941e92868b07df | browscap.js | browscap.js | "use strict";
module.exports = function Browscap (cacheDir) {
if (typeof cacheDir === 'undefined') {
cacheDir = './sources/';
}
this.cacheDir = cacheDir;
/**
* parses the given user agent to get the information about the browser
*
* if no user agent is given, it uses {@see \BrowscapPHP\Helper\Su... | "use strict";
module.exports = function Browscap (cacheDir) {
if (typeof cacheDir === 'undefined') {
cacheDir = __dirname + '/sources/';
}
this.cacheDir = cacheDir;
/**
* parses the given user agent to get the information about the browser
*
* if no user agent is given, it uses {@see \BrowscapPH... | Use cache dir based on file location | Use cache dir based on file location | JavaScript | mit | mimmi20/browscap-js |
a7da36d8376de9f2eccac11f9e3db35618ecf44a | source/index.js | source/index.js | import normalizeEvents from './tools/normalizeEvents';
import normalizeListener from './tools/normalizeListener';
export default function stereo () {
let listeners = {};
let emitter = {
on(events, listener) {
// Normalize arguments.
events = normalizeEvents(events);
listener = normalizeListe... | import normalizeEvents from './tools/normalizeEvents';
import normalizeListener from './tools/normalizeListener';
export default function stereo () {
let listeners = {};
let emitter = {
on(events, listener) {
// Normalize arguments.
events = normalizeEvents(events);
listener = normalizeListe... | Switch from arrays to Sets | Switch from arrays to Sets
| JavaScript | mit | stoeffel/stereo,tomekwi/stereo |
a0b049a5f396eb9498bd1a8ea8bdb79f64321b97 | server/repositories/gameRepository.js | server/repositories/gameRepository.js | const mongoskin = require('mongoskin');
const logger = require('../log.js');
class GameRepository {
save(game, callback) {
var db = mongoskin.db('mongodb://127.0.0.1:27017/throneteki');
if(!game.id) {
db.collection('games').insert(game, function(err, result) {
if(err) {... | const mongoskin = require('mongoskin');
const logger = require('../log.js');
class GameRepository {
save(game, callback) {
var db = mongoskin.db('mongodb://127.0.0.1:27017/throneteki');
if(!game.id) {
db.collection('games').insert(game, function(err, result) {
if(err) {... | Save the players array correctly when saving game stats | Save the players array correctly when saving game stats
| JavaScript | mit | ystros/throneteki,jeremylarner/ringteki,cryogen/gameteki,DukeTax/throneteki,cryogen/throneteki,jbrz/throneteki,gryffon/ringteki,jeremylarner/ringteki,jbrz/throneteki,gryffon/ringteki,Antaiseito/throneteki_for_doomtown,cryogen/throneteki,Antaiseito/throneteki_for_doomtown,cryogen/gameteki,gryffon/ringteki,DukeTax/throne... |
40743d988e0ab90d9e54f304a65a5f436db13dbd | server/test/unit/logger/loggerSpec.js | server/test/unit/logger/loggerSpec.js | 'use strict';
var chai = require('chai'),
expect = chai.expect,
sinon = require('sinon'),
sinonChai = require('sinon-chai'),
logger = require('../../../logger');
chai.use(sinonChai);
describe('logger', function () {
describe('infoStream', function () {
var infoStream = logger.infoStream... | 'use strict';
var chai = require('chai'),
expect = chai.expect,
sinon = require('sinon'),
sinonChai = require('sinon-chai'),
logger = require('../../../logger');
chai.use(sinonChai);
describe('logger', function () {
describe('infoStream', function () {
var infoStream = logger.infoStream... | Add test for untested empty string branch. | Add test for untested empty string branch.
| JavaScript | mit | lxanders/community |
2d78ed41e309568eb0307769c58a3bbdad5d75f9 | app/assets/javascripts/assessment_form.js | app/assets/javascripts/assessment_form.js | $(document).ready(function() {
function updateAssessmentFormState() {
var numberOfQuestions = $('#assessment .legend').length;
var numberOfCheckedAnswers = $('#assessment input:checked').length;
var numberOfUnansweredQuestions = numberOfQuestions - numberOfCheckedAnswers;
var unansweredQuestionsBadge... | $(document).ready(function() {
function updateAssessmentFormState() {
var numberOfQuestions = $('#assessment .legend').length;
var numberOfCheckedAnswers = $('#assessment input:checked').length;
var numberOfUnansweredQuestions = numberOfQuestions - numberOfCheckedAnswers;
var unansweredQuestionsBadge... | Hide (instead of fade out) badge on iPhone | Hide (instead of fade out) badge on iPhone
| JavaScript | mit | woople/woople-theme,woople/woople-theme |
627ea6e7175d3ec1fb89e0c896e123ed8bd3ee2b | bookWorm.js | bookWorm.js | $(document).ready(function() {
onCreatedChrome()
});
function onCreatedChrome() {
chrome.tabs.onCreated.addListener(function(tab) {
alert("hello");
});
}
| $(document).ready(function() {
onCreatedChrome();
});
function onCreatedChrome() {
chrome.tabs.onCreated.addListener(function(tab) {
chrome.bookmarks.getChildren("1", (bar) => {
chrome.bookmarks.remove(bar[bar.length - 1].id);
});
});
}
| Make function to eat bookmarks | Make function to eat bookmarks
| JavaScript | mit | tmashuang/BookWorm,tmashuang/BookWorm |
f98e9ddd8fa02c5d16f7d94c8b811b21e2c39b8f | src/main/resources/web/js/tool-editor/constants.js | src/main/resources/web/js/tool-editor/constants.js | /**
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.o... | /**
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.o... | Update Siddhi quick start guide link | Update Siddhi quick start guide link
| JavaScript | apache-2.0 | wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics |
d602a2a4c9b2aca9ca330768025fd594ad2f0037 | lib/helpers.js | lib/helpers.js | var exec = require('child_process').exec,
_ = require('lodash')
module.exports.asyncIterate = function(array, callback, done) {
function iterate(idx) {
var current = array[idx]
if (current) {
callback(current, function() { iterate(idx+1) }, function(err) { done(err) })
... | var exec = require('child_process').exec,
_ = require('lodash')
module.exports.asyncIterate = function(array, callback, done) {
function iterate(idx) {
var current = array[idx]
if (current) {
callback(current, function() { iterate(idx+1) }, function(err) { done(err) })
... | Add helper for container “created”-status checking | Add helper for container “created”-status checking | JavaScript | mit | mnylen/pig,mnylen/pig |
cb92521b4c237e8a6d7b26f0fe02c26b10187c3a | modifyurl@2ch.user.js | modifyurl@2ch.user.js | // ==UserScript==
// @id Modify URL @2ch
// @name Modify URL @2ch
// @version 0.0.5
// @namespace curipha
// @author curipha
// @description Modify "ttp://" text to anchor and redirect URIs to direct link.
// @include http://*.2ch.net/*
// @include http://*.bbs... | // ==UserScript==
// @id Modify URL @2ch
// @name Modify URL @2ch
// @version 0.0.6
// @namespace curipha
// @author curipha
// @description Modify "ttp://" text to anchor and redirect URIs to direct link.
// @include http://*.2ch.net/*
// @include http://*.bbs... | Fix the potential XSS in URI-like strings with <, > and " | Fix the potential XSS in URI-like strings with <, > and "
| JavaScript | unlicense | curipha/userscripts,curipha/userscripts |
c515c365778b609c1e54a24bc670f23d3ef2fac4 | lib/message.js | lib/message.js | /**
* Creates an instance of `Message`.
*
* This class is used as a mock when testing Crane handlers, substituted in
* place of a `Message` from the underlying message queue adapter.
*
* @constructor
* @api protected
*/
function Message(cb) {
this.queue = '/';
this.headers = {};
this.__cb = cb;
}
Message... | /**
* Creates an instance of `Message`.
*
* This class is used as a mock when testing Crane handlers, substituted in
* place of a `Message` from the underlying message queue adapter.
*
* @constructor
* @api protected
*/
function Message(cb) {
this.topic = '/';
this.headers = {};
this.__cb = cb;
}
Message... | Set topic rather than queue. | Set topic rather than queue.
| JavaScript | mit | jaredhanson/chai-crane-handler |
1dabed199a7087054b64896d523983f1539802af | prepublish.js | prepublish.js | 'use strict';
var fs = require('fs');
var visitors = require('react-tools/vendor/fbtransform/visitors');
var jstransform = require('jstransform');
var visitorList = visitors.getAllVisitors();
var getJsName = function(filename) {
var dot = filename.lastIndexOf(".");
var baseName = filename.substring(0, dot);
... | 'use strict';
var fs = require('fs');
var visitors = require('react-tools/vendor/fbtransform/visitors');
var jstransform = require('jstransform');
var visitorList = visitors.getAllVisitors();
var getJsName = function(filename) {
var dot = filename.lastIndexOf(".");
var baseName = filename.substring(0, dot);
... | Replace .jsx requires in .js to be able to require e.g. timeago | Replace .jsx requires in .js to be able to require e.g. timeago
| JavaScript | mit | sloria/react-components,quicktoolbox/react-components,sloria/react-components,redsunsoft/react-components,jepezi/react-components,jepezi/react-components,Khan/react-components,redsunsoft/react-components,jepezi/react-components,vasanthk/react-components,sloria/react-components,vasanthk/react-components,quicktoolbox/rea... |
5d03539ad1fb34c246b3d7f729256c4370f1ad6d | javascript/mailblock.js | javascript/mailblock.js | (function($) {
$(document).ready(function(){
showHideButton();
$('.cms-tabset-nav-primary li').on('click', showHideButton);
function showHideButton() {
if ($('#Root_Mailblock_set').is(':visible')) {
$('#Form_EditForm_action_mailblockTestEmail').show();
}
else {
$('#Form_EditForm_action_mailb... | (function($) {
$(document).ready(function(){
showHideButton();
$('.cms-tabset-nav-primary li').on('click', showHideButton);
function showHideButton() {
if ($('#Root_Mailblock_set').is(':visible')) {
$('#Form_EditForm_action_mailblockTestEmail').show();
... | Replace all tabs with spaces. | Replace all tabs with spaces.
| JavaScript | bsd-3-clause | signify-nz/silverstripe-mailblock,signify-nz/silverstripe-mailblock |
fed9ff29a9a2390146666ec19119836fa91cd96a | examples/starters/list/js/controllers.js | examples/starters/list/js/controllers.js | angular.module('listExample.controllers', [])
// Controller that fetches a list of data
.controller('MovieIndexCtrl', function($scope, MovieService) {
// "MovieService" is a service returning mock data (services.js)
// the returned data from the service is placed into this
// controller's scope so the templ... | angular.module('listExample.controllers', [])
// Controller that fetches a list of data
.controller('MovieIndexCtrl', function($scope, MovieService,$timeout) {
// "MovieService" is a service returning mock data (services.js)
// the returned data from the service is placed into this
// controller's scope so ... | Add 3 movies in example, looks better | Add 3 movies in example, looks better
| JavaScript | mit | Jeremy017/ionic,Jeremy017/ionic,lutrosis81/manup-app,gyx8899/ionic,Gregcop1/ionic,blueElix/ionic,Kryz/ionic,ddddm/ionic,yalishizhude/ionic,nelsonsozinho/ionic,cnbin/ionic,chrisbautista/ionic,thebigbrain/ionic,Jandersolutions/ionic,chinakids/ionic,abcd-ca/ionic,brant-hwang/ionic,Urigo/meteor-ionic,Xeeshan94/ionic,janij/... |
d7991bc3af6d3bce7ae1fec107e8497c4b1e25f1 | js/components/player.js | js/components/player.js | import React from 'react';
module.exports = React.createClass({
getInitialState: function getInitialState() {
return {
isPlayingStream: typeof window.orientation === 'undefined', // Should return true if not mobile
nowPlayingLabel: 'Offline',
};
},
setPlayerState: function setPlayerState() {... | import React from 'react';
module.exports = React.createClass({
getInitialState: function getInitialState() {
return {
isPlayingStream: typeof window.orientation === 'undefined', // Should return true if not mobile
nowPlayingLabel: 'Offline',
};
},
onPlayClicked: function onPlayClicked() {
... | Add click listener to play buttotn. | Add click listener to play buttotn.
| JavaScript | mit | frequencyasia/website,frequencyasia/website |
768f4bf499d00c6a801b018b6a1c656c5800076c | nodejs/lib/hoptoad.js | nodejs/lib/hoptoad.js | var Hoptoad = require('hoptoad-notifier').Hoptoad
, env = require('../environment')
, shouldReport = env.hoptoad && env.hoptoad.reportErrors;
if(shouldReport)
Hoptoad.key = env.hoptoad.apiKey;
process.addListener('uncaughtException', function(err) {
if(shouldReport)
Hoptoad.notify(err, function(){});
});
... | var Hoptoad = require('hoptoad-notifier').Hoptoad
, env = require('../environment')
, shouldReport = env.hoptoad && env.hoptoad.reportErrors;
if(shouldReport)
Hoptoad.key = env.hoptoad.apiKey;
process.addListener('uncaughtException', function(err) {
if(shouldReport)
Hoptoad.notify(err, function(){});
con... | Print out uncaught exceptions. Node stops doing this when you add an uncaught exception handler. | Print out uncaught exceptions. Node stops doing this when you add an uncaught exception handler.
| JavaScript | mit | iFixit/wompt.com,iFixit/wompt.com,Wompt/wompt.com,iFixit/wompt.com,Wompt/wompt.com,Wompt/wompt.com,iFixit/wompt.com |
e0860e4491a2519493426cb1cfdbcca8071467e9 | validators/json/load.js | validators/json/load.js | const utils = require('../../utils')
const load = (files, jsonFiles, jsonContentsDict, annexed, dir) => {
let issues = []
// Read JSON file contents and parse for issues
const readJsonFile = (file, annexed, dir) =>
utils.files
.readFile(file, annexed, dir)
.then(contents => utils.json.parse(file... | const utils = require('../../utils')
class JSONParseError extends Error {
constructor(message) {
super(message)
this.name = 'JSONParseError'
}
}
const load = (files, jsonFiles, jsonContentsDict, annexed, dir) => {
let issues = []
// Read JSON file contents and parse for issues
const readJsonFile = ... | Reimplement early exit for JSON parse errors. | Reimplement early exit for JSON parse errors.
| JavaScript | mit | nellh/bids-validator,Squishymedia/bids-validator,Squishymedia/BIDS-Validator,nellh/bids-validator,nellh/bids-validator |
fea368f1da1c6c3a58ad7bbcf6193d56c5592e68 | app/Resources/appify.js | app/Resources/appify.js | /*
* This is a template used when TiShadow "appifying" a titanium project.
* See the README.
*/
var TiShadow = require("/api/TiShadow");
var Compression = require('ti.compression');
// Need to unpack the bundle on a first load;
var path_name = "{{app_name}}".replace(/ /g,"_");
var target = Ti.Filesystem.getFile(T... | /*
* This is a template used when TiShadow "appifying" a titanium project.
* See the README.
*/
Titanium.App.idleTimerDisabled = true;
var TiShadow = require("/api/TiShadow");
var Compression = require('ti.compression');
// Need to unpack the bundle on a first load;
var path_name = "{{app_name}}".replace(/ /g,"_... | Disable idleTimer on iOS for appified apps | Disable idleTimer on iOS for appified apps | JavaScript | apache-2.0 | titanium-forks/dbankier.TiShadow,r8o8s1e0/TiShadow,HazemKhaled/TiShadow,FokkeZB/TiShadow,emilyvon/TiShadow,HazemKhaled/TiShadow,r8o8s1e0/TiShadow,Biotelligent/TiShadow,r8o8s1e0/TiShadow,Biotelligent/TiShadow,HazemKhaled/TiShadow,FokkeZB/TiShadow,emilyvon/TiShadow,emilyvon/TiShadow,titanium-forks/dbankier.TiShadow,titan... |
c140b8c985cfc05ce8ae1326e470d9f4e1231a54 | lib/metalsmith-metafiles.js | lib/metalsmith-metafiles.js | "use strict";
var MetafileMatcher = require('./metafile-matcher');
// Not needed in Node 4.0+
if (!Object.assign) Object.assign = require('object-assign');
class MetalsmithMetafiles {
constructor(options) {
options = options || {};
this._initMatcherOptions(options);
this._initMatchers();
}
_initM... | "use strict";
var MetafileMatcher = require('./metafile-matcher');
// Not needed in Node 4.0+
if (!Object.assign) Object.assign = require('object-assign');
class MetalsmithMetafiles {
constructor(options) {
options = options || {};
this._initMatcherOptions(options);
this._initMatchers();
}
_initM... | Remove arrow function to remain compatible with older Node versions | Remove arrow function to remain compatible with older Node versions
| JavaScript | mit | Ajedi32/metalsmith-metafiles |
14b04b085f0688c37580b7622ef36b062e4d0bcf | app/routes/ember-cli.js | app/routes/ember-cli.js | import Route from '@ember/routing/route';
export default Route.extend({
titleToken() {
return 'Ember CLI';
}
});
| import Route from '@ember/routing/route';
export default Route.extend({
title() {
return 'Ember CLI - Ember API Documentation';
}
});
| Update to return the title Function | Update to return the title Function | JavaScript | mit | ember-learn/ember-api-docs,ember-learn/ember-api-docs |
1623ae966b9823088e65870104d9e37d714b23c0 | src/reactize.js | src/reactize.js | var Turbolinks = require("exports?this.Turbolinks!turbolinks");
/* Disable the Turbolinks page cache to prevent Tlinks from storing versions of
* pages with `react-id` attributes in them. When popping off the history, the
* `react-id` attributes cause React to treat the old page like a pre-rendered
* page and break... | var Turbolinks = require("exports?this.Turbolinks!turbolinks");
// Disable the Turbolinks page cache to prevent Tlinks from storing versions of
// pages with `react-id` attributes in them. When popping off the history, the
// `react-id` attributes cause React to treat the old page like a pre-rendered
// page and break... | Standardize on “//“ for all JS comments | Standardize on “//“ for all JS comments | JavaScript | apache-2.0 | ssorallen/turbo-react,ssorallen/turbo-react,ssorallen/turbo-react |
fd20009fcf17de391b398cbb7ce746144fc610c6 | js/Search.spec.js | js/Search.spec.js | import React from 'react'
import { shallow } from 'enzyme'
import { shallowToJson } from 'enzyme-to-json'
import Search from './Search'
import ShowCard from './ShowCard'
import preload from '../public/data.json'
test('Search snapshot test', () => {
const component = shallow(<Search />)
const tree = shallowToJson(c... | import React from 'react'
import { shallow } from 'enzyme'
import { shallowToJson } from 'enzyme-to-json'
import Search from './Search'
import ShowCard from './ShowCard'
import preload from '../public/data.json'
test('Search snapshot test', () => {
const component = shallow(<Search />)
const tree = shallowToJson(c... | Add test for the search field. | Add test for the search field.
| JavaScript | mit | dianafisher/FEM-complete-intro-to-react,dianafisher/FEM-complete-intro-to-react |
fdcfa64c627f9522db5f176cc103171df839cad1 | ember-cli-build.js | ember-cli-build.js | /* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
// Add options here
});
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This... | /* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function (defaults) {
var app = new EmberAddon(defaults, {
'ember-cli-babel': {
includePolyfill: true
}
});
/*
This build file specifies the options for the dummy test app of this
addon, ... | Fix broken test by including babel polyfill on dummy app | Fix broken test by including babel polyfill on dummy app
| JavaScript | mit | scottwernervt/ember-cli-group-by,scottwernervt/ember-cli-group-by |
6ce99ce4acbed8c57b672706c4b26dfc063bb04b | extensionloader.js | extensionloader.js | /*
Load a block from github.io.
Accepts a url as a parameter which can include url parameters e.g. https://megjlow.github.io/extension2.js?name=SUN&ip=10.0.0.1
*/
new (function() {
var ext = this;
var descriptor = {
blocks: [
[' ', 'Load extension block %s', 'loadBlock', 'url', 'url'],
],
ur... | /*
Load a block from github.io.
Accepts a url as a parameter which can include url parameters e.g. https://megjlow.github.io/extension2.js?name=SUN&ip=10.0.0.1
*/
new (function() {
var ext = this;
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(document.currentScript... | Allow a block to be specified for loading | Allow a block to be specified for loading | JavaScript | mit | megjlow/megjlow.github.io |
275dc5b09b27d5441814aa423cddaa7472344dbf | src/hooks/usePopover.js | src/hooks/usePopover.js | import React, { useState, useCallback, useRef } from 'react';
/**
* Hook which manages popover position over a DOM element.
* Pass a ref created by React.createRef. Receive callbacks,
*/
export const usePopover = () => {
const [visibilityState, setVisibilityState] = useState(false);
const ref = useRef(React.cre... | import React, { useState, useCallback, useRef } from 'react';
import { useNavigationFocus } from './useNavigationFocus';
/**
* Hook which manages popover position over a DOM element.
* Pass a ref created by React.createRef. Receive callbacks,
*/
export const usePopover = navigation => {
const [visibilityState, se... | Add use of navigation focus custom hook in usePopOver hook | Add use of navigation focus custom hook in usePopOver hook
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
0087fa9db21bf615d3c57480c89a706c8d8e75bf | lib/jsdom/level2/languages/javascript.js | lib/jsdom/level2/languages/javascript.js | var Context = process.binding('evals').Context,
// TODO: Remove .Script when bumping req'd node version to >= 5.0
Script = process.binding('evals').NodeScript || process.binding('evals').Script;
exports.javascript = function(element, code, filename) {
var document = element.ownerDocument,
window = docu... | var vm = require('vm');
exports.javascript = function(element, code, filename) {
var document = element.ownerDocument,
window = document.parentWindow;
if (window) {
var ctx = window.__scriptContext;
if (!ctx) {
window.__scriptContext = ctx = vm.createContext({});
ctx.__proto__ = window;
... | Use vm instead of evals binding | Use vm instead of evals binding
| JavaScript | mit | iizukanao/jsdom,aduyng/jsdom,jeffcarp/jsdom,jeffcarp/jsdom,tmpvar/jsdom,Zirro/jsdom,evdevgit/jsdom,susaing/jsdom,sebmck/jsdom,Zirro/jsdom,Ye-Yong-Chi/jsdom,mbostock/jsdom,zaucy/jsdom,beni55/jsdom,kesla/jsdom,darobin/jsdom,cpojer/jsdom,mbostock/jsdom,Sebmaster/jsdom,snuggs/jsdom,AshCoolman/jsdom,szarouski/jsdom,janusnic... |
dcbba806e6d933f714fec77c1b37c485a43a9e00 | tests/unit/controllers/submit-test.js | tests/unit/controllers/submit-test.js | import { moduleFor, test } from 'ember-qunit';
moduleFor('controller:submit', 'Unit | Controller | submit', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
needs: [
'validator:presence',
'validator:length',
'validator:format',
'service:... | import { moduleFor, test } from 'ember-qunit';
moduleFor('controller:submit', 'Unit | Controller | submit', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
needs: [
'validator:presence',
'validator:length',
'validator:format',
'service:... | Add tests for some submit controller actions. | Add tests for some submit controller actions.
| JavaScript | apache-2.0 | baylee-d/ember-preprints,caneruguz/ember-preprints,baylee-d/ember-preprints,CenterForOpenScience/ember-preprints,CenterForOpenScience/ember-preprints,laurenrevere/ember-preprints,laurenrevere/ember-preprints,caneruguz/ember-preprints |
c8e2d1ac9ed72967aa8f8210f8c05f2af8044cab | tests/dummy/app/components/froala-editor.js | tests/dummy/app/components/froala-editor.js | import FroalaEditorComponent from 'ember-froala-editor/components/froala-editor';
export default FroalaEditorComponent.extend({
// eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects
options: {
key: 'Tvywseoh1irkdyzdhvlvC8ehe=='
}
});
| import FroalaEditorComponent from 'ember-froala-editor/components/froala-editor';
export default FroalaEditorComponent.extend({
// eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects
options: {
key: '3C3B6eF5B4A3E3E2C2C6D6A3D3xg1kemB-22B-16rF-11dyvwtvze1zdA1H-8vw=='
}
});
| Update editor key for docs site | Update editor key for docs site
| JavaScript | mit | froala/ember-froala-editor,froala/ember-froala-editor,Panman8201/ember-froala-editor,Panman8201/ember-froala-editor |
5b0082d9aaa6ae25e2ed7a0049b1829b3a9aa242 | src/patch_dns_lookup.js | src/patch_dns_lookup.js | // Patch DNS.lookup to resolve all hosts added via Replay.localhost as 127.0.0.1
const DNS = require('dns');
const Replay = require('./');
const originalLookup = DNS.lookup;
DNS.lookup = function(domain, options, callback) {
if (typeof domain === 'string' && typeof options === 'object' &&
typeof callback ... | // Patch DNS.lookup to resolve all hosts added via Replay.localhost as 127.0.0.1
const DNS = require('dns');
const Replay = require('./');
const originalLookup = DNS.lookup;
DNS.lookup = function(domain, options, callback) {
if (typeof domain === 'string' && typeof options === 'object' &&
typeof callback ... | Support |all| option when shimming DNS.lookup | Support |all| option when shimming DNS.lookup
Before, clients attempting an "all" style address lookup,
such as the SQL Server database module tedious does in its connector.js
when provided a hostname,
were liable to error out due to treating the argument as an array
when Replay was supplying a string. This might have... | JavaScript | mit | assaf/node-replay |
6e853e6d2eba890ddff29b71a21130e145c747fb | html/directives/validateBitcoinAddress.js | html/directives/validateBitcoinAddress.js | angular.module('app').directive("validateBitcoinAddress", function() {
return {
require: 'ngModel',
link: function(scope, ele, attrs, ctrl) {
ctrl.$parsers.unshift(function(value) {
// test and set the validity after update.
var valid = window.bitcoinAdd... | angular.module('app').directive("validateBitcoinAddress", function() {
return {
require: 'ngModel',
link: function(scope, ele, attrs, ctrl) {
ctrl.$parsers.unshift(function(value) {
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('val... | Clean up comments and validity check | Clean up comments and validity check
| JavaScript | mit | atsuyim/OpenBazaar,must-/OpenBazaar,must-/OpenBazaar,saltduck/OpenBazaar,NolanZhao/OpenBazaar,NolanZhao/OpenBazaar,tortxof/OpenBazaar,tortxof/OpenBazaar,must-/OpenBazaar,blakejakopovic/OpenBazaar,habibmasuro/OpenBazaar,bankonme/OpenBazaar,blakejakopovic/OpenBazaar,rllola/OpenBazaar,rllola/OpenBazaar,mirrax/OpenBazaar,b... |
246825583b1c778e56bad458f3e4283c9b1c5df6 | es2015/total-replies.js | es2015/total-replies.js | "use strict";
let replyCount = 21;
let message = `This topic has a total of replies`; | "use strict";
let replyCount = 21;
let message = `This topic has a total of ${replyCount} replies`; | Complete the code to use the variable replyCount from inside the template string | Complete the code to use the variable replyCount from inside the template string
| JavaScript | mit | var-bin/reactjs-training,var-bin/reactjs-training,var-bin/reactjs-training |
5a14bf458e67d893cefe99e7515fdb3b904ab556 | src/interfaces/i-tracker-manager.js | src/interfaces/i-tracker-manager.js | 'use strict';
const EventEmitter = require('events');
/**
* Tracker Manager
* @interface
*/
class ITrackerManager extends EventEmitter {
constructor() {
super();
if (this.constructor === ITrackerManager) {
throw new TypeError('Can not create new instance of interface');
}
}
/**
* Include tracker in... | 'use strict';
const EventEmitter = require('events');
/**
* Tracker Manager
* @interface
*/
class ITrackerManager extends EventEmitter {
constructor() {
super();
if (this.constructor === ITrackerManager) {
throw new TypeError('Can not create new instance of interface');
}
}
/**
* Include tracker in... | Change interface for make change in implementation | Change interface for make change in implementation
| JavaScript | mit | reeFridge/tracker-proxy |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.