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 |
|---|---|---|---|---|---|---|---|---|---|
0b1eecf180c79d6196d796ba786a46b1158abbbc | scripts/objects/2-cleaver.js | scripts/objects/2-cleaver.js | exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
});
}
},
remove: function (l10n) {
re... | exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
});
player.combat.addToDodgeMod({
na... | Add balancing for cleaver scripts. | Add balancing for cleaver scripts.
| JavaScript | mit | seanohue/ranviermud,seanohue/ranviermud,shawncplus/ranviermud |
e15b144af678fbbfabe6fac280d869d02bcfb2ce | app/reducers/studentProfile.js | app/reducers/studentProfile.js | const initialState = {
profile: { data: null },
name: { data: null },
image: { data: null },
barcode: { data: null }
}
function studentProfileReducer(state = initialState, action) {
const newState = { ...state }
switch (action.type) {
case 'SET_STUDENT_PROFILE':
newState.profile.data = action.profile
ret... | const initialState = {
profile: { data: null },
name: { data: null },
image: { data: null },
barcode: { data: null }
}
function studentProfileReducer(state = initialState, action) {
const newState = { ...state }
switch (action.type) {
case 'SET_STUDENT_PROFILE':
newState.profile.data = action.profile
ret... | Fix issue where data was not being cleared upon logout | Fix issue where data was not being cleared upon logout
| JavaScript | mit | UCSD/campus-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/campus-mobile |
4109657238be43d0c2e8bc9615d5429e6b69a1b7 | test/tweet-card-content.js | test/tweet-card-content.js | import test from 'ava';
import TweetCardContent from '../lib/tweet-card-content';
const META_SECTION = "Tweet should be about";
test("Test static exports", (t) => {
t.true("TWEET_CONTENT" in TweetCardContent);
t.true("RETWEET" in TweetCardContent);
t.true("SCHEDULED" in TweetCardContent);
});
test("Creat... | import test from 'ava';
import TweetCardContent from '../lib/tweet-card-content';
const META_SECTION = "Tweet should be about";
test("Test static exports", (t) => {
t.true("TWEET_CONTENT" in TweetCardContent);
t.true("RETWEET" in TweetCardContent);
t.true("SCHEDULED" in TweetCardContent);
});
test("Creat... | Add closing ) that got removed by acident2 | Add closing ) that got removed by acident2
| JavaScript | mpl-2.0 | mozillach/gh-projects-content-queue |
f672c1cc4b3648303f6a770ccbc9f24be423d8bd | app/src/containers/timeline.js | app/src/containers/timeline.js | import { connect } from 'react-redux';
import Timeline from '../components/map/timeline';
import { updateFilters } from '../actions/filters';
const mapStateToProps = state => {
return {
filters: state.filters
};
};
const mapDispatchToProps = dispatch => {
return {
updateFilters: filters => {
// co... | import { connect } from 'react-redux';
import Timeline from '../components/map/Timeline';
import { updateFilters } from '../actions/filters';
const mapStateToProps = state => {
return {
filters: state.filters
};
};
const mapDispatchToProps = dispatch => {
return {
updateFilters: filters => {
// co... | Fix casing in file import | Fix casing in file import
| JavaScript | mit | Vizzuality/GlobalFishingWatch,Vizzuality/GlobalFishingWatch,Vizzuality/GlobalFishingWatch |
0200a9c8123896848792b7f3150fa7a56aa07470 | app/support/DbAdapter/utils.js | app/support/DbAdapter/utils.js | import _ from 'lodash';
export const unexistedUID = '00000000-0000-0000-C000-000000000046';
export function initObject(classDef, attrs, id, params) {
return new classDef({ ...attrs, id, ...params });
}
export function prepareModelPayload(payload, namesMapping, valuesMapping) {
const result = {};
const keys = ... | import _ from 'lodash';
import pgFormat from 'pg-format';
import { List } from '../open-lists';
export const unexistedUID = '00000000-0000-0000-C000-000000000046';
export function initObject(classDef, attrs, id, params) {
return new classDef({ ...attrs, id, ...params });
}
export function prepareModelPayload(pay... | Add helpers functions to generate SQL for 'field [NOT] IN somelist' | Add helpers functions to generate SQL for 'field [NOT] IN somelist'
| JavaScript | mit | FreeFeed/freefeed-server,FreeFeed/freefeed-server |
e44c9d381503575c441d0de476690e9ba94a6cca | src/api/lib/adminRequired.js | src/api/lib/adminRequired.js | export default function authRequired(req, res, next) {
if (req.user.isAdmin) {
next();
} else {
res.status(403);
res.json({
id: 'AUTH_FORBIDDEN',
message: 'You need admin privilege to run this command.'
});
}
}
| export default function adminRequired(req, res, next) {
if (req.user && req.user.isAdmin) {
next();
} else {
res.status(403);
res.json({
id: 'AUTH_FORBIDDEN',
message: 'You need admin privilege to run this command.'
});
}
}
| Fix admin checking throwing error if not logged in | Fix admin checking throwing error if not logged in
| JavaScript | mit | yoo2001818/shellscripts |
e762c50fba4e25c6cff3152ab499c6ff310c95ee | src/components/UserVideos.js | src/components/UserVideos.js | import React from 'react'
import {connect} from 'react-redux'
import {Link} from 'react-router-dom'
import {compose} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './VideoPreviewsList'
const mapStateToProps = ({userVi... | import React from 'react'
import {connect} from 'react-redux'
import {compose, withHandlers, withProps} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
import {createVideo, VideoOwnerTypes} from '../actions/videos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './Vi... | Make a user create video button | Make a user create video button
| JavaScript | mit | mg4tv/mg4tv-web,mg4tv/mg4tv-web |
9af9fd4200ffe08681d42bb131b9559b52073f1b | src/components/katagroups.js | src/components/katagroups.js | import React from 'react';
import {default as KataGroupsData} from '../katagroups.js';
export default class KataGroupsComponent extends React.Component {
static propTypes = {
kataGroups: React.PropTypes.instanceOf(KataGroupsData).isRequired
};
render() {
const {kataGroups} = this.props;
return (
... | import React from 'react';
import {default as KataGroupsData} from '../katagroups.js';
export default class KataGroupsComponent extends React.Component {
static propTypes = {
kataGroups: React.PropTypes.instanceOf(KataGroupsData).isRequired
};
render() {
const {kataGroups} = this.props;
return (
... | Use the new `url` property. | Use the new `url` property. | JavaScript | mit | wolframkriesing/es6-react-workshop,wolframkriesing/es6-react-workshop |
d2dcc04cbcc2b6a19762c4f95e98476b935a29e4 | src/components/style-root.js | src/components/style-root.js | /* @flow */
import React, {Component, PropTypes} from 'react';
import Enhancer from '../enhancer';
import StyleKeeper from '../style-keeper';
import StyleSheet from './style-sheet';
function _getStyleKeeper(instance): StyleKeeper {
if (!instance._radiumStyleKeeper) {
const userAgent = (
instance.props.ra... | /* @flow */
import React, {Component, PropTypes} from 'react';
import Enhancer from '../enhancer';
import StyleKeeper from '../style-keeper';
import StyleSheet from './style-sheet';
function _getStyleKeeper(instance): StyleKeeper {
if (!instance._radiumStyleKeeper) {
const userAgent = (
instance.props.ra... | Stop passing radiumConfig prop to div | Stop passing radiumConfig prop to div
| JavaScript | mit | FormidableLabs/radium |
c257e7fd2162131559b0db4c2eb2b1e8d8a1edbc | src/render.js | src/render.js | import Instance from './instance';
import instances from './instances';
export default (node, options = {}) => {
// Stream was passed instead of `options` object
if (typeof options.write === 'function') {
options = {
stdout: options,
stdin: process.stdin
};
}
options = {
stdout: process.stdout,
stdi... | import Instance from './instance';
import instances from './instances';
export default (node, options = {}) => {
// Stream was passed instead of `options` object
if (typeof options.write === 'function') {
options = {
stdout: options,
stdin: process.stdin
};
}
options = {
stdout: process.stdout,
stdi... | Add default value for `experimental` option | Add default value for `experimental` option
| JavaScript | mit | vadimdemedes/ink,vadimdemedes/ink |
84a5ea535a61cd8d608694406c1bdf05a0adf599 | src/router.js | src/router.js | (function(win){
'use strict';
var paramRe = /:([^\/.\\]+)/g;
function Router(){
if(!(this instanceof Router)){
return new Router();
}
this.routes = [];
}
Router.prototype.route = function(path, fn){
paramRe.lastIndex = 0;
var regexp = path + '',... | (function(win){
'use strict';
var paramRe = /:([^\/.\\]+)/g;
function Router(){
if(!(this instanceof Router)){
return new Router();
}
this.routes = [];
}
Router.prototype.route = function(path, fn){
paramRe.lastIndex = 0;
var regexp = path + '',... | Fix params with period not being passed to callback | Fix params with period not being passed to callback
| JavaScript | unlicense | ryanmorr/router |
b77f1e3bca3e2858ca0c0b85cc3d2d8083cdb199 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | Fix js manifest for older jquery ui | Fix js manifest for older jquery ui
| JavaScript | mit | dfurber/historyforge,timwaters/mapwarper,kartta-labs/mapwarper,dfurber/historyforge,kartta-labs/mapwarper,kartta-labs/mapwarper,dfurber/mapwarper,timwaters/mapwarper,dfurber/historyforge,timwaters/mapwarper,dfurber/mapwarper,dfurber/historyforge,dfurber/mapwarper,dfurber/mapwarper,timwaters/mapwarper,kartta-labs/mapwar... |
68ad2fe3afc0f674a8424ada83a397d699559bd8 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... | Remove last of the gem | Remove last of the gem
| JavaScript | mit | tonyedwardspz/westcornwallevents,tonyedwardspz/westcornwallevents,tonyedwardspz/westcornwallevents |
84a21f18b364bed6249002ff311900f240059b16 | app/assets/javascripts/inspections.js | app/assets/javascripts/inspections.js | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
$(function() {
return console.log($("span").length);
});
$(".status").hover((function() ... | $(function() {
console.log($("span").length);
});
$(".status").hover((function() {
console.log(this);
$(this).children(".details").show();
}), function() {
console.log("bob");
$(this).children(".details").hide();
});
| Fix for conversion from coffee->js | Fix for conversion from coffee->js
| JavaScript | mit | nomatteus/dinesafe,jbinto/dinesafe,jbinto/dinesafe-chrome-backend,nomatteus/dinesafe,nomatteus/dinesafe,jbinto/dinesafe-chrome-backend,nomatteus/dinesafe,jbinto/dinesafe,jbinto/dinesafe-chrome-backend,jbinto/dinesafe-chrome-backend,jbinto/dinesafe,jbinto/dinesafe |
e7933b56614eda1941811bb95e533fceb1eaf907 | app/components/chess-board-square.js | app/components/chess-board-square.js | import React from "react";
import classNames from "classnames";
import { selectPiece } from "store/actions";
class ChessBoardSquare extends React.Component {
constructor(props) {
super(props);
this.selectSquare = this.selectSquare.bind(this);
}
squareCoords() {
return { rank: this.props.rank, file... | import React from "react";
import classNames from "classnames";
import { selectPiece } from "store/actions";
class ChessBoardSquare extends React.Component {
constructor(props) {
super(props);
this.selectSquare = this.selectSquare.bind(this);
}
squareCoords() {
return { rank: this.props.rank, file... | Fix problem with null selectedSquare | Fix problem with null selectedSquare
| JavaScript | mit | danbee/chess,danbee/chess,danbee/chess |
cc38cd161bf98799a87039cfedea311e76b7ca3f | web/templates/javascript/Entry.js | web/templates/javascript/Entry.js | import Session from "./Session.js";
let session = new Session();
loadPlugins()
.then(() => session.connect());
async function loadPlugins()
{
let pluginEntryScripts = <%- JSON.stringify(entryScripts) %>;
let importPromises = [];
for(let entryScript of pluginEntryScripts) {
let importPromise = import(ent... | import Session from "./Session.js";
<% for(let i = 0; i < entryScripts.length; i++) { -%>
import { default as plugin<%- i %> } from "<%- entryScripts[i] %>";
<% } -%>
let session = new Session();
loadPlugins()
.then(() => session.connect());
async function loadPlugins()
{
<% for(let i = 0; i < entryScripts.length;... | Remove dynamic import in client source | Remove dynamic import in client source
| JavaScript | mit | ArthurCose/JoshDevelop,ArthurCose/JoshDevelop |
7499a6bfd2b91b04724f5c7bd0ad903de5a226ab | sashimi-webapp/test/e2e/specs/fileManager/create-file-folder.spec.js | sashimi-webapp/test/e2e/specs/fileManager/create-file-folder.spec.js | function createDoc(browser, docType) {
const devServer = browser.globals.devServerURL;
browser.url(`${devServer}/`);
browser.expect.element('#app').to.be.visible.before(5000);
browser.execute(() => {
const className = `.${docType}`;
const numDocs = document.querySelectorAll(className).length;
ret... | function createDoc(browser, docType) {
const devServer = browser.globals.devServerURL;
browser.url(`${devServer}/`);
browser.expect.element('#app').to.be.visible.before(5000);
browser.execute(() => {
const className = `.${docType}`;
const numDocs = document.querySelectorAll(className).length;
ret... | Add pause after button click to handle delays | Add pause after button click to handle delays
| JavaScript | mit | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note |
e32bf7f935f9677847639ce10267830b63b3c2ec | tasks/scss-lint.js | tasks/scss-lint.js | module.exports = function (grunt) {
var _ = require('lodash'),
scsslint = require('./lib/scss-lint').init(grunt);
grunt.registerMultiTask('scsslint', 'Validate `.scss` files with `scss-lint`.', function() {
var done = this.async(),
files = this.filesSrc,
fileCount = this.filesSrc.length,
... | module.exports = function (grunt) {
var _ = require('lodash'),
scsslint = require('./lib/scss-lint').init(grunt);
grunt.registerMultiTask('scsslint', 'Validate `.scss` files with `scss-lint`.', function() {
var done = this.async(),
files = this.filesSrc,
fileCount = this.filesSrc.length,
... | Fix typo in logging results on error. | Fix typo in logging results on error.
| JavaScript | mit | nick11703/grunt-scss-lint,nick11703/grunt-scss-lint,chrisnicotera/grunt-scss-lint,asev/grunt-scss-lint,DBaker85/grunt-scss-lint-json,meinaart/grunt-scss-lint,asev/grunt-scss-lint,ahmednuaman/grunt-scss-lint,barzik/grunt-scss-lint,ahmednuaman/grunt-scss-lint,DBaker85/grunt-scss-lint-json,cornedor/grunt-scss-lint,cornedo... |
ac86b98535232756835e0e2b1df0a1c87dfc3529 | webmaker-download-locales.js | webmaker-download-locales.js | var async = require("async");
var path = require("path");
var url = require("url");
var utils = require("./lib/utils");
module.exports = function(options, callback) {
utils.list_files(options, function(err, objects) {
if (err) {
callback(err);
return;
}
var q = async.queue(function(translat... | var async = require("async");
var path = require("path");
var url = require("url");
var utils = require("./lib/utils");
module.exports = function(options, callback) {
utils.list_files(options, function(err, objects) {
if (err) {
callback(err);
return;
}
var q = async.queue(function(translat... | Use / as a separator for urls | Use / as a separator for urls
| JavaScript | mit | mozilla/webmaker-download-locales |
edda84fefd17426fcdf822fc3fb746f30047085c | lib/template/blocks.js | lib/template/blocks.js | var _ = require('lodash');
module.exports = {
// Return non-parsed html
// since blocks are by default non-parsable, a simple identity method works fine
html: _.identity,
// Highlight a code block
// This block can be replaced by plugins
code: function(blk) {
return {
html:... | var _ = require('lodash');
module.exports = {
// Return non-parsed html
// since blocks are by default non-parsable, a simple identity method works fine
html: _.identity,
// Highlight a code block
// This block can be replaced by plugins
code: function(blk) {
return {
html:... | Add block "markdown", "asciidoc" and "markup" | Add block "markdown", "asciidoc" and "markup"
| JavaScript | apache-2.0 | ryanswanson/gitbook,gencer/gitbook,tshoper/gitbook,gencer/gitbook,GitbookIO/gitbook,strawluffy/gitbook,tshoper/gitbook |
dec054ca7face3467e6beeafdac8772346e8f38c | api/routes/users.js | api/routes/users.js | import {Router} from 'express'
import models from '../models';
import tasks from './tasks'
export default () => {
let app = Router({mergeParams: true})
app.use('/:userId/tasks', tasks())
app.get('/', (req, res) => {
models.User.findAll({
attributes: ['id', 'email']
}).then((users) => {
res.send(users)
... | import {Router} from 'express'
import models from '../models';
import tasks from './tasks'
export default () => {
let app = Router({mergeParams: true})
app.use('/:userId/tasks', tasks())
app.get('/:id', (req, res) => {
models.User.find(req.params.id).then((users) => {
res.send(users)
})
})
app.get('/new... | Update user POST and GET routes | Update user POST and GET routes
| JavaScript | mit | taodav/MicroSerfs,taodav/MicroSerfs |
7e5bc4044748de2130564ded69d3bc3618274b8a | test/test-purge.js | test/test-purge.js | require('./harness').run();
var recvCount = 0;
var body = "hello world";
connection.addListener('ready', function () {
puts("connected to " + connection.serverProperties.product);
var e = connection.exchange('node-purge-fanout', {type: 'fanout'});
var q = connection.queue('node-purge-queue', function() {
q... | require('./harness').run();
var recvCount = 0;
var body = "hello world";
connection.addListener('ready', function () {
puts("connected to " + connection.serverProperties.product);
var e = connection.exchange('node-purge-fanout', {type: 'fanout', confirm: true});
var q = connection.queue('node-purge-queue', fun... | Fix race condition in purge test. | Fix race condition in purge test.
| JavaScript | mit | xebitstudios/node-amqp,albert-lacki/node-amqp,zkochan/node-amqp,postwait/node-amqp,zinic/node-amqp,postwait/node-amqp,xebitstudios/node-amqp,albert-lacki/node-amqp,zinic/node-amqp,zkochan/node-amqp,postwait/node-amqp,remind101/node-amqp,remind101/node-amqp,hinson0/node-amqp,seanahn/node-amqp,seanahn/node-amqp,segmentio... |
6831e4787d7fd5a19aef1733e3bb158cb82538dd | resources/framework/dropdown-nav.js | resources/framework/dropdown-nav.js | /* From w3schools */
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
$(function () {
$('.c-dropdown__btn').click(function (event) {
event.preventDefault();
$(this).nextAll(".c-dropdown__cont").toggleClass('c-dropdown__cont--hide');
});
});
// Cl... | /* From w3schools */
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
$(function () {
$('.c-site-nav').on('click', '.c-dropdown__btn', function (event) {
event.preventDefault();
$(this).nextAll(".c-dropdown__cont").toggleClass('c-dropdown__cont--hide'... | Fix nav issue when using mean menu | Fix nav issue when using mean menu
When the link only had a dropdown and didnt have a link itself, it wouldnt trigger the dropdown on mobile
| JavaScript | mit | solleer/framework,solleer/framework,solleer/framework |
0ad0b316bb699abb9fd554e9bfce32135ca9f421 | webpack.config.babel.js | webpack.config.babel.js | import path from 'path';
import webpack from 'webpack';
import CommonsChunkPlugin from 'webpack/lib/optimize/CommonsChunkPlugin';
const PROD = process.env.NODE_ENV || 0;
module.exports = {
devtool: PROD ? false : 'eval',
entry: {
app: './app/assets/scripts/App.js',
vendor: [
'picturefill',
'.... | import path from 'path';
import webpack from 'webpack';
import CommonsChunkPlugin from 'webpack/lib/optimize/CommonsChunkPlugin';
const PROD = process.env.NODE_ENV || 0;
module.exports = {
devtool: PROD ? false : 'eval-cheap-module-source-map',
entry: {
app: './app/assets/scripts/App.js',
vendor: [
... | Improve source maps for JS | Improve source maps for JS
| JavaScript | mit | trendyminds/pura,trendyminds/pura |
824bd9786602e1af2414438f01dfea9e26842001 | js/src/forum/addTagLabels.js | js/src/forum/addTagLabels.js | import { extend } from 'flarum/extend';
import DiscussionListItem from 'flarum/components/DiscussionListItem';
import DiscussionPage from 'flarum/components/DiscussionPage';
import DiscussionHero from 'flarum/components/DiscussionHero';
import tagsLabel from '../common/helpers/tagsLabel';
import sortTags from '../comm... | import { extend } from 'flarum/extend';
import DiscussionListItem from 'flarum/components/DiscussionListItem';
import DiscussionHero from 'flarum/components/DiscussionHero';
import tagsLabel from '../common/helpers/tagsLabel';
import sortTags from '../common/utils/sortTags';
export default function() {
// Add tag l... | Remove an obsolete method extension | Remove an obsolete method extension
This method hasn't existed in a while, and its purpose (including
the related tags when loading a discussion via API) has already
been achieved by extending the backend.
| JavaScript | mit | Luceos/flarum-tags,flarum/flarum-ext-tags,flarum/flarum-ext-tags,Luceos/flarum-tags |
0c727e568bf61fa89c43f13ed0f413062442297f | js/src/util/load-resource.js | js/src/util/load-resource.js | import req from 'superagent';
import {dispatch} from '../dispatcher';
import {Action} from '../actions';
import meta from '../meta';
const DIR_CONFIG='/resource/config/app/moe/somesim',
DIR_DOC='/resource/markdown/app/moe/somesim';
export default ()=>{
req
.get(DIR_CONFIG+'/somesim.json?='+meta.version)
.e... | import req from 'superagent';
import {dispatch} from '../dispatcher';
import {Action} from '../actions';
import meta from '../meta';
const DIR_CONFIG='/resource/config/app/moe/somesim',
DIR_DOC='/resource/markdown/app/moe/somesim';
export default ()=>{
req
.get(DIR_CONFIG+'/somesim.json?='+meta.version)
.e... | Change property to be access | Change property to be access
| JavaScript | mit | pocka/moe-somesim,pocka/moe-somesim,pocka/moe-somesim |
6b7d6db52e3aca121e8ae0d12bc752c290bbad5f | updater/entries.js | updater/entries.js | 'use strict';
const format = require('util').format;
const log = require('util').log;
const Promise = require('bluebird');
const db = require('../shared/db');
module.exports = {
insert: insertEntries,
delete: deleteEntries
};
function deleteEntries(distribution) {
return Promise.using(db(), function(cli... | 'use strict';
const format = require('util').format;
const log = require('util').log;
const Promise = require('bluebird');
const db = require('../shared/db');
module.exports = {
insert: insertEntries,
delete: deleteEntries
};
function deleteEntries(distribution) {
return Promise.using(db(), function(cli... | Use one query per source instead of a single query | Use one query per source instead of a single query
This makes the code much much simpler.
| JavaScript | mit | ralt/dpsv,ralt/dpsv |
cedfb682fbcb4badfd314710c07ad423feac417e | app/routes/media.js | app/routes/media.js | import Ember from 'ember'
import Authenticated from 'ember-simple-auth/mixins/authenticated-route-mixin'
const { get, set } = Ember
export default Ember.Route.extend(Authenticated, {
pageTitle: 'Media',
toggleDropzone () {
$('body').toggleClass('dz-open')
},
actions: {
uploadImage (file) {
const... | import Ember from 'ember'
import Authenticated from 'ember-simple-auth/mixins/authenticated-route-mixin'
const { get, set } = Ember
export default Ember.Route.extend(Authenticated, {
pageTitle: 'Media',
toggleDropzone () {
$('body').toggleClass('dz-open')
},
actions: {
uploadImage (file) {
const... | Add record details after upload | Add record details after upload
| JavaScript | mit | small-cake/client,small-cake/client |
b74b69dc57fdf71e742b19ea22f6311199fe2752 | src/ui/constants/licenses.js | src/ui/constants/licenses.js | export const CC_LICENSES = [
{
value: 'Creative Commons Attribution 4.0 International',
url: 'https://creativecommons.org/licenses/by/4.0/legalcode',
},
{
value: 'Creative Commons Attribution-ShareAlike 4.0 International',
url: 'https://creativecommons.org/licenses/by-sa/4.0/legalcode',
},
{
... | export const CC_LICENSES = [
{
value: 'Creative Commons Attribution 3.0',
url: 'https://creativecommons.org/licenses/by/3.0/legalcode',
},
{
value: 'Creative Commons Attribution 4.0 International',
url: 'https://creativecommons.org/licenses/by/4.0/legalcode',
},
{
value: 'Creative Commons ... | Add Creative Commons Attribution 3.0 license | Add Creative Commons Attribution 3.0 license
This license is used for many presentation recordings. It would be great
to have the license supported by the application directly and avoid
constantly looking for the license link.
| JavaScript | mit | lbryio/lbry-app,lbryio/lbry-electron,lbryio/lbry-electron,lbryio/lbry-electron,lbryio/lbry-app |
56f1fce919464363aaf2beff7564de5552d3cf26 | src/configs/extra_colors.js | src/configs/extra_colors.js | export default {
black_pink: ['#36516e', '#f93b58', 0],
pink_black: ['#f93b58', '#36516e', 1],
white_blue: ['#45c0e9', '#efefef', 0],
blue_white: ['#45c0e9', '#efefef', 1],
beige_black: ['#eadaca', '#433947', 1],
black_white: ['#433947', '#efefef', 0]
}; | export default {
black_pink: ['#36516e', '#f93b58', 0],
pink_black: ['#f93b58', '#36516e', 1],
white_blue: ['#45c0e9', '#efefef', 0],
blue_white: ['#efefef', '#45c0e9', 1],
beige_black: ['#eadaca', '#433947', 1],
black_white: ['#433947', '#efefef', 0]
}; | Fix white blue colors for color picker | Fix white blue colors for color picker
| JavaScript | mit | g8extended/Character-Generator,g8extended/Character-Generator |
c27a38c04828f3ad670b195982583d6f2f3efdec | static/getMusic.js | static/getMusic.js | function getMusic(element) {
element = $(element);
var info_send = {
//method: 'info', // TODO possible method to get the song data: song 'info' or song 'id'
artist: element.data('artist'),
album: element.data('album'),
title: element.data('title')
};
console.log(info_... | function getMusic(element) {
element = $(element);
var info_send = {
//method: 'info', // TODO possible method to get the song data: song 'info' or song 'id'
artist: element.data('artist'),
album: element.data('album'),
title: element.data('title')
};
console.log(info_... | Add reset rating stars color when reload video. | Add reset rating stars color when reload video.
| JavaScript | apache-2.0 | edmundo096/MoodMusic,edmundo096/MoodMusic,edmundo096/MoodMusic |
b7a3179b2d56e320a922401ecd66f6fcc87296ec | src/client/editor.js | src/client/editor.js | import { component } from "d3-component";
import { select, local } from "d3-selection";
const codeMirrorLocal = local();
// User interface component for the code editor.
export default component("div", "shadow")
.create(function ({ onChange }){
const codeMirror = codeMirrorLocal
.set(this, CodeMirror(this... | import { component } from "d3-component";
import { select, local } from "d3-selection";
const codeMirrorLocal = local();
// User interface component for the code editor.
export default component("div", "shadow")
.create(function (){
const my = codeMirrorLocal.set(this, {
codeMirror: CodeMirror(this, {
... | Use correct listener in CodeMirror callbacks | Use correct listener in CodeMirror callbacks
| JavaScript | mit | curran/example-viewer,curran/example-viewer |
a0168c294d72f11e28287434653adbd2970fdf7a | util/debug.js | util/debug.js | "use strict";
const hasDebug = process.argv.indexOf("--debug") > -1;
const debug = (!hasDebug) ?
function() {} :
(message) => console.log(message);
debug.on = function() { return hasDebug; }
module.exports = debug; | "use strict";
const hasDebug = process.argv.indexOf("--debug") > -1;
const debug = (!hasDebug) ?
function() {} :
() => console.log.apply(console, arguments);
debug.on = function() { return hasDebug; };
module.exports = debug; | Debug should output everything pls | Debug should output everything pls
| JavaScript | mit | TeaSeaLancs/train-timeline,TeaSeaLancs/train-timeline |
fb7e4bc04e0a54e5a08f51e3f12c5982a6a1ca86 | string/compress.js | string/compress.js | // Method that performs basic string compression using the counts of repeated characters
function compressStr(str) {
var output = "", // will return this variable as final compressed string
currChar = "", // represents character we are searching for in string
currCount = "", // counts number of times character is... | // Method that performs basic string compression using the counts of repeated characters
function compressStr(str) {
var output = "", // will return this variable as final compressed string
currChar = "", // represents character we are searching for in string
currCount = ""; // counts number of times character is... | Debug and add test cases | Debug and add test cases
| JavaScript | mit | derekmpham/interview-prep,derekmpham/interview-prep |
d4e5de834aeaee536df0ffd998be1f1660eee2d1 | lib/node_modules/@stdlib/math/base/dist/normal/pdf/examples/index.js | lib/node_modules/@stdlib/math/base/dist/normal/pdf/examples/index.js | 'use strict';
var pdf = require( './../lib' );
var x;
var mu;
var sigma;
var v;
var i;
for ( i = 0; i < 10; i++ ) {
x = Math.random() * 10;
mu = Math.random() * 10 - 5;
sigma = Math.random() * 20;
v = pdf( x, mu, sigma );
console.log( 'x: %d, mu: %d, sigma: %d, f(x;mu,sigma): %d', x, mu, sigma, v );
}
| 'use strict';
var pdf = require( './../lib' );
var sigma;
var mu;
var x;
var v;
var i;
for ( i = 0; i < 10; i++ ) {
x = Math.random() * 10;
mu = Math.random() * 10 - 5;
sigma = Math.random() * 20;
v = pdf( x, mu, sigma );
console.log( 'x: %d, mu: %d, sigma: %d, f(x;mu,sigma): %d', x, mu, sigma, v );
}
| Reorder vars according to length | Reorder vars according to length
| JavaScript | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib |
7f292e1e1c3a7147331a462e2ded5e3a01cdfe7f | server/public/scripts/controllers/home.controller.js | server/public/scripts/controllers/home.controller.js | app.controller('HomeController', ['$http', 'AuthFactory', function($http, AuthFactory) {
console.log('HomeController running');
var self = this;
self.userStatus = AuthFactory.userStatus;
self.dataArray = [{
src: '../assets/images/carousel/genome-sm.jpg'
},
{
src: '../assets/images/carousel/... | app.controller('HomeController', ['$http', 'AuthFactory', function($http, AuthFactory) {
console.log('HomeController running');
var self = this;
self.userStatus = AuthFactory.userStatus;
self.dataArray = [
{ src: '../assets/images/carousel/genome-sm.jpg' },
{ src: '../assets/images/carousel/falkirk-whe... | Refactor carousel image references for better readability | Refactor carousel image references for better readability
| JavaScript | mit | STEMentor/STEMentor,STEMentor/STEMentor |
f3c4fc88e6e2bb7cb28bd491812226805f321994 | lib/helpers.js | lib/helpers.js | 'use babel'
import minimatch from 'minimatch'
export function showError(e) {
atom.notifications.addError(`[Linter] ${e.message}`, {
detail: e.stack,
dismissable: true
})
}
export function shouldTriggerLinter(linter, wasTriggeredOnChange, scopes) {
if (wasTriggeredOnChange && !linter.lintOnFly) {
re... | 'use babel'
import minimatch from 'minimatch'
export function showError(e) {
atom.notifications.addError(`[Linter] ${e.message}`, {
detail: e.stack,
dismissable: true
})
}
export function shouldTriggerLinter(linter, wasTriggeredOnChange, scopes) {
if (wasTriggeredOnChange && !linter.lintOnFly) {
re... | Add a message key helper; also cleanup unused | :new: Add a message key helper; also cleanup unused
| JavaScript | mit | AtomLinter/Linter,atom-community/linter,steelbrain/linter |
1b37e313bc95d878a2774590bdad9e7682d4b829 | lib/html2js.js | lib/html2js.js | 'use babel'
import Html2JsView from './html2js-view'
import html2js from './html-2-js'
import { CompositeDisposable } from 'atom'
export default {
html2JsView: null,
modalPanel: null,
subscriptions: null,
activate (state) {
this.subscriptions = new CompositeDisposable()
this.html2JsView = new Html2... | 'use babel'
import Html2JsView from './html2js-view'
import html2js from './html-2-js'
import { CompositeDisposable } from 'atom'
export default {
html2JsView: null,
modalPanel: null,
subscriptions: null,
activate (state) {
this.subscriptions = new CompositeDisposable()
this.html2JsView = new Html2... | Set JS grammar to newly created pane texteditor | Set JS grammar to newly created pane texteditor
| JavaScript | mit | jerone/atom-html2js,jerone/atom-html2js |
bac10e88a8732cf5d4914635bb93ff91c8c68e81 | .grunt-tasks/postcss.js | .grunt-tasks/postcss.js | module.exports = {
options: {
map: true,
processors: [
require("pixrem")(), // add fallbacks for rem units for IE8+
require("autoprefixer")({ browsers: "> 1%, last 2 versions, ie >= 8" }), // add vendor prefixes
]
},
default: {
src: "dist/stylesheets/*.css"
}
};
| module.exports = {
options: {
map: true,
processors: [
require("pixrem")({ html: false, atrules: true }), // add fallbacks for rem units for IE8+
require("autoprefixer")({ browsers: "> 1%, last 2 versions, ie >= 8" }), // add vendor prefixes
]
},
default: {
src: "dist/stylesheets/*.css"
}
};
| Update post css task to add rem fallbacks properly for IE8 | Update post css task to add rem fallbacks properly for IE8
| JavaScript | mit | nhsevidence/NICE-Experience,nhsevidence/NICE-Experience |
a8cddb0a5b2e026ce0733a66aa4aaa77de1ec506 | bin/cli.js | bin/cli.js | #!/usr/bin/env node
'use strict';
const dependencyTree = require('../');
const program = require('commander');
program
.version(require('../package.json').version)
.usage('[options] <filename>')
.option('-d, --directory <path>', 'location of files of supported filetypes')
.option('-c, --require-config <path>... | #!/usr/bin/env node
'use strict';
const dependencyTree = require('../');
const program = require('commander');
program
.version(require('../package.json').version)
.usage('[options] <filename>')
.option('-d, --directory <path>', 'location of files of supported filetypes')
.option('-c, --require-config <path>... | Add --tsconfig CLI option to specify a TypeScript config file | Add --tsconfig CLI option to specify a TypeScript config file
| JavaScript | mit | dependents/node-dependency-tree,dependents/node-dependency-tree |
408567081d82c28b1ff0041c10c57f879acf1187 | dawn/js/components/peripherals/NameEdit.js | dawn/js/components/peripherals/NameEdit.js | import React from 'react';
import InlineEdit from 'react-edit-inline';
import Ansible from '../../utils/Ansible';
var NameEdit = React.createClass({
propTypes: {
name: React.PropTypes.string,
id: React.PropTypes.string
},
dataChange(data) {
Ansible.sendMessage('custom_names', {
id: this.props.i... | import React from 'react';
import InlineEdit from 'react-edit-inline';
import Ansible from '../../utils/Ansible';
var NameEdit = React.createClass({
propTypes: {
name: React.PropTypes.string,
id: React.PropTypes.string
},
dataChange(data) {
var x = new RegExp("^[A-Za-z][A-Za-z0-9]+$");
if (x.test... | Check new peripheral names against regex | Check new peripheral names against regex
| JavaScript | apache-2.0 | pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral |
ee678fe9f72422507e138ffa9fb45485c7fb0449 | src/views/Main/Container.js | src/views/Main/Container.js | import React from 'react';
import Map, {GoogleApiWrapper} from 'google-maps-react';
import { searchNearby } from 'utils/googleApiHelpers';
export class Container extends React.Component {
onReady(mapProps, map) {
// when map is ready and
const { google } = this.props;
const opts = {
location: map.center,
... | import React from 'react';
import Map, {GoogleApiWrapper} from 'google-maps-react';
import { searchNearby } from 'utils/googleApiHelpers';
export class Container extends React.Component {
constructor(props) {
// super initializes this
super(props);
this.state = {
places: [],
pagination: null
}
}
onR... | Set Main container to be stateful | Set Main container to be stateful
| JavaScript | mit | Kgiberson/welp |
7da241808bb335551bd4a822c6970561b859ab76 | src/models/apikey.js | src/models/apikey.js | import stampit from 'stampit';
import {Meta, Model} from './base';
const ApiKeyMeta = Meta({
name: 'apiKey',
pluralName: 'apiKeys',
endpoints: {
'detail': {
'methods': ['delete', 'get'],
'path': '/v1/instances/{instanceName}/api_keys/{id}/'
},
'list': {
'methods': ['post', 'get'],
... | import stampit from 'stampit';
import {Meta, Model} from './base';
const ApiKeyMeta = Meta({
name: 'apiKey',
pluralName: 'apiKeys',
endpoints: {
'detail': {
'methods': ['delete', 'patch', 'put', 'get'],
'path': '/v1/instances/{instanceName}/api_keys/{id}/'
},
'list': {
'methods': ['... | Add methods to api key's detail endpoint | [LIB-386] Add methods to api key's detail endpoint
| JavaScript | mit | Syncano/syncano-server-js |
35cbf16ff15966ecddc02abd040f8c46fe824a0d | src/components/posts/PostsAsGrid.js | src/components/posts/PostsAsGrid.js | import React from 'react'
import { parsePost } from '../parsers/PostParser'
class PostsAsGrid extends React.Component {
static propTypes = {
posts: React.PropTypes.object,
json: React.PropTypes.object,
currentUser: React.PropTypes.object,
gridColumnCount: React.PropTypes.number,
}
renderColumn(p... | import React from 'react'
import { parsePost } from '../parsers/PostParser'
class PostsAsGrid extends React.Component {
static propTypes = {
posts: React.PropTypes.object,
json: React.PropTypes.object,
currentUser: React.PropTypes.object,
gridColumnCount: React.PropTypes.number,
}
renderColumn(p... | Fix an issue with grid post rendering. | Fix an issue with grid post rendering. | JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
74b87cbca5fc7bd065ecd129463856dffc8b4b7e | app/routes/fellows.server.routes.js | app/routes/fellows.server.routes.js | 'use strict';
var users = require('../../app/controllers/users');
var fellows = require('../../app/controllers/fellows');
module.exports = function(app) {
// Setting up the bootcamp api
app.route('/camps')
<<<<<<< HEAD
.get(fellows.list_camp) // login and authorization required
=======
.get(fellows.list_camp);... | 'use strict';
var users = require('../../app/controllers/users');
var fellows = require('../../app/controllers/fellows');
module.exports = function(app) {
// Setting up the bootcamp api
app.route('/camps')
.get(fellows.list_camp); // login and authorization required
// .post(fellows.create_camp); //by admin
... | Reset fellow server js file | Reset fellow server js file
| JavaScript | mit | andela-ogaruba/AndelaAPI |
36ffbef010db6d60a4dbc9b6c4eab9ad4ebbcf7b | src/components/views/elements/Field.js | src/components/views/elements/Field.js | /*
Copyright 2019 New Vector 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
Unless required by applicable law or agreed to in writing, software
... | /*
Copyright 2019 New Vector 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
Unless required by applicable law or agreed to in writing, software
... | Tweak comment about field ID | Tweak comment about field ID
Co-Authored-By: jryans <91e4c98f79b38ce04c052c188926e2d9ae2a3b28@gmail.com> | JavaScript | apache-2.0 | matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk |
49cb1ee49686ea320689ae97ce94c5d593cccdbb | ws-connect.js | ws-connect.js | var WebSocket = require('ws');
var reHttpSignalhost = /^http(.*)$/;
var reTrailingSlash = /\/$/;
function connect(signalhost) {
// if we have a http/https signalhost then do some replacement magic to push across
// to ws implementation (also add the /primus endpoint)
if (reHttpSignalhost.test(signalhost)) {
... | var WebSocket = require('ws');
var reHttpSignalhost = /^http(.*)$/;
var reTrailingSlash = /\/$/;
var pingers = [];
var PINGHEADER = 'primus::ping::';
var PONGHEADER = 'primus::pong::';
function connect(signalhost) {
var socket;
// if we have a http/https signalhost then do some replacement magic to push across
... | Improve node socket connection to ping as per what a primus server expects | Improve node socket connection to ping as per what a primus server expects
| JavaScript | apache-2.0 | eightyeight/rtc-signaller,rtc-io/rtc-signaller |
a6972191cf167266225ddcedc1c12ce94297ef1c | lib/reporters/lcov-reporter.js | lib/reporters/lcov-reporter.js | var Reporter = require('../reporter');
var lcovRecord = function(data) {
var str = "",
lineHandled = 0,
lineFound = 0,
fileName = data.fileName;
if(this.options.lcovOptions && this.options.lcovOptions.renamer){
fileName = this.options.lcovOptions.renamer(fileName);
}
str += 'SF:' + file... | var Reporter = require('../reporter');
var lcovRecord = function(data) {
var str = '',
lineHandled = 0,
lineFound = 0,
fileName = data.fileName;
if (this.options.cliOptions && this.options.cliOptions.lcovOptions && this.options.cliOptions.lcovOptions.renamer){
fileName = this.options.cliOpti... | Fix renamer, lcov check was not accessing the proper object | Fix renamer, lcov check was not accessing the proper object
| JavaScript | mit | yagni/ember-cli-blanket,elwayman02/ember-cli-blanket,jschilli/ember-cli-blanket,calderas/ember-cli-blanket,dwickern/ember-cli-blanket,yagni/ember-cli-blanket,calderas/ember-cli-blanket,notmessenger/ember-cli-blanket,jschilli/ember-cli-blanket,elwayman02/ember-cli-blanket,mike-north/ember-cli-blanket,sglanzer/ember-cli-... |
24e687564a18b651d57f7f49ae5c79ff935fb95a | lib/ui/widgets/basewidget.js | lib/ui/widgets/basewidget.js | var schema = require('signalk-schema');
function BaseWidget(id, options, streamBundle, instrumentPanel) {
this.instrumentPanel = instrumentPanel;
}
BaseWidget.prototype.setActive = function(value) {
this.options.active = value;
this.instrumentPanel.onWidgetChange(this);
}
BaseWidget.prototype.getLabelForPath =... | var schema = require('signalk-schema');
function BaseWidget(id, options, streamBundle, instrumentPanel) {
this.instrumentPanel = instrumentPanel;
}
BaseWidget.prototype.setActive = function(value) {
this.options.active = value;
this.instrumentPanel.onWidgetChange(this);
}
BaseWidget.prototype.getLabelForPath =... | Add shared function for range sensitive rounding | Add shared function for range sensitive rounding
| JavaScript | apache-2.0 | SignalK/instrumentpanel,SignalK/instrumentpanel |
e17572851a8351fdf7210db5aed7c6c9784c2497 | test/stack-test.js | test/stack-test.js | /*global describe, it*/
/*
* mochify.js
*
* Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>
*
* @license MIT
*/
'use strict';
var assert = require('assert');
var run = require('./fixture/run');
describe('stack', function () {
this.timeout(3000);
it('does not screw up xunit', function (done) {
... | /*global describe, it*/
/*
* mochify.js
*
* Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>
*
* @license MIT
*/
'use strict';
var assert = require('assert');
var run = require('./fixture/run');
describe('stack', function () {
this.timeout(3000);
it('does not screw up xunit', function (done) {
... | Fix test case to not fail due to varying timing (again) | Fix test case to not fail due to varying timing (again)
| JavaScript | mit | mantoni/mochify.js,jhytonen/mochify.js,mantoni/mochify.js,mantoni/mochify.js,jhytonen/mochify.js,Heng-xiu/mochify.js,Swaagie/mochify.js,Swaagie/mochify.js,boneskull/mochify.js,boneskull/mochify.js,Heng-xiu/mochify.js |
e178e5a5213b07650fa4c9ce1fc32c25c3d7af12 | main/plugins/settings/index.js | main/plugins/settings/index.js | import React from 'react';
import Settings from './Settings';
/**
* Plugin to show app settings in results list
* @param {String} term
*/
const settingsPlugin = (term, callback) => {
if (!term.match(/^(show\s+)?(settings|preferences)\s*/i)) return;
callback([{
icon: '/Applications/Cerebro.app',
title: ... | import React from 'react';
import search from 'lib/search';
import Settings from './Settings';
// Settings plugin name
const NAME = 'Cerebro Settings';
// Phrases that used to find settings plugins
const KEYWORDS = [
NAME,
'Cerebro Preferences'
];
/**
* Plugin to show app settings in results list
* @param {St... | Improve search if settings plugin Now available by settings and preferences words | Improve search if settings plugin
Now available by settings and preferences words
| JavaScript | mit | KELiON/cerebro,KELiON/cerebro |
3af7d2e005748a871efe4d2dd278d11dfc82950f | next.config.js | next.config.js | const withOffline = require("next-offline");
const nextConfig = {
target: "serverless",
future: {
webpack5: true,
},
workboxOpts: {
swDest: "static/service-worker.js",
runtimeCaching: [
{
urlPattern: /^https?.*/,
handler: "NetworkFirst",
options: {
cacheName:... | const withOffline = require("next-offline");
const nextConfig = {
target: "serverless",
workboxOpts: {
runtimeCaching: [
{
urlPattern: /^https?.*/,
handler: "NetworkFirst",
options: {
cacheName: "offlineCache",
expiration: {
maxEntries: 200
... | Swap back to webpack 4, adjust next-offline | Swap back to webpack 4, adjust next-offline
| JavaScript | bsd-2-clause | overshard/isaacbythewood.com,overshard/isaacbythewood.com |
06cac5f7a677bf7d9bc4f92811203d52dc3c6313 | cookie-bg-picker/background_scripts/background.js | cookie-bg-picker/background_scripts/background.js | /* Retrieve any previously set cookie and send to content script */
browser.tabs.onUpdated.addListener(cookieUpdate);
function getActiveTab() {
return browser.tabs.query({active: true, currentWindow: true});
}
function cookieUpdate(tabId, changeInfo, tab) {
getActiveTab().then((tabs) => {
// get any previous... | /* Retrieve any previously set cookie and send to content script */
function getActiveTab() {
return browser.tabs.query({active: true, currentWindow: true});
}
function cookieUpdate() {
getActiveTab().then((tabs) => {
// get any previously set cookie for the current tab
var gettingCookies = browser.cooki... | Update on tab activate as well as update | Update on tab activate as well as update
| JavaScript | mpl-2.0 | mdn/webextensions-examples,mdn/webextensions-examples,mdn/webextensions-examples |
5b20639101d8da9031641fa9565970bcdc67b441 | app/assets/javascripts/books.js | app/assets/javascripts/books.js | var ready = function() {
$('#FontSize a').click(function() {
$('.content').css("font-size", this.dataset.size);
});
$('#FontFamily a').click(function(){
$('.content').css("font-family", this.innerHTML);
});
$('#Leading a').click(function(){
$('.content').css("line-height", this.dataset.spacing);
});
$('... | // http://www.quirksmode.org/js/cookies.html
function createCookie(name, value, days) {
var expires;
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
} else {
expires = "";
}
document.cookie = encodeURIComponent(na... | Use cookies to persist formatting options | Use cookies to persist formatting options
| JavaScript | mit | mk12/great-reads,mk12/great-reads,mk12/great-reads |
39b78875d513f19cd5ba3b6eeeafe244d6980953 | app/assets/javascripts/forms.js | app/assets/javascripts/forms.js | $(function() {
if ($('small.error').length > 0) {
$('html, body').animate({
scrollTop: ($('small.error').first().offset().top)
},500);
}
}); | $(function() {
if ($('small.error').length > 0) {
$('html, body').animate({
scrollTop: ($('small.error').first().offset().top-100)
},500);
}
}); | Improve scrolling to error feature | Improve scrolling to error feature
| JavaScript | mit | airslie/renalware-core,airslie/renalware-core,airslie/renalware-core,airslie/renalware-core |
add6c9550f0968e0efe196747997887ed8921c33 | app/controllers/observations.js | app/controllers/observations.js | var config = require('../../config/config.js');
var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var Observation = mongoose.model('Observation');
var realtime = require('../realtime/realtime.js');
module.exports = function (app) {
app.use('/observations', router)... | var config = require('../../config/config.js');
var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var Observation = mongoose.model('Observation');
var realtime = require('../realtime/realtime.js');
module.exports = function (app) {
app.use('/observations', router)... | Fix bug by restoring calls to socket.io service | Fix bug by restoring calls to socket.io service
| JavaScript | mit | MichaelRohrer/OpenAudit,IoBirds/iob-server,MichaelRohrer/OpenAudit,IoBirds/iob-server |
a5b130aaeb84c5dc2b26fddba87805c4d9a8915d | xmlToJson/index.js | xmlToJson/index.js | var fs = require('fs');
module.exports = function (context, xmlZipBlob) {
context.log('Node.js blob trigger function processed blob:', xmlZipBlob);
context.log(`typeof xmlZipBlob:`, typeof xmlZipBlob);
fs.writeFile('xmlZip.txt', "Hello World", 'utf8', (err) => {
if (err) {
throw err;
... | var fs = require('fs');
var path = rqeuire('path');
module.exports = function (context, xmlZipBlob) {
context.log('Node.js blob trigger function processed blob:', xmlZipBlob);
context.log(`typeof xmlZipBlob:`, typeof xmlZipBlob);
var tempDirectory = process.env["TMP"];
var tempFileName = "xmlZip.zip";... | Update xmlBlob function to write to temp directory | Update xmlBlob function to write to temp directory
| JavaScript | mit | mattmazzola/sc2iq-azure-functions |
6916f08a1d587d64db47aa9068c0389d08aa5e1c | app/scripts/filters/timecode.js | app/scripts/filters/timecode.js | (function() {
function timecode() {
return function(seconds) {
var seconds = Number.parseFloat(seconds);
if (Number.isNaN(seconds)) {
return '-:--';
}
var wholeSeconds = Math.floor(seconds);
var minutes = Ma... | (function() {
function timecode() {
return function(seconds) {
/**
var seconds = Number.parseFloat(seconds);
if (Number.isNaN(seconds)) {
return '-:--';
}
var wholeSeconds = Math.floor(seconds);
... | Use buzz.toTimer() method for time filter | Use buzz.toTimer() method for time filter
| JavaScript | apache-2.0 | orlando21/ng-bloc-jams,orlando21/ng-bloc-jams |
f6c1c6a4bf04d64c97c06fd57cc14f584fc530f5 | static/js/components/callcount_test.js | static/js/components/callcount_test.js | const html = require('choo/html');
const callcount = require('./callcount.js');
const chai = require('chai');
const expect = chai.expect;
// Skip a test if the browser does not support locale-based number formatting
function ifLocaleSupportedIt (test) {
if (window.Intl && window.Intl.NumberFormat) {
it(test);
... | const html = require('choo/html');
const callcount = require('./callcount.js');
const chai = require('chai');
const expect = chai.expect;
// Skip a test if the browser does not support locale-based number formatting
function ifLocaleSupportedIt (name, test) {
if (window.Intl && window.Intl.NumberFormat) {
it(nam... | Fix support check that skips tests on ALL browsers | Fix support check that skips tests on ALL browsers
Mistake and poor checking on my part.
| JavaScript | mit | 5calls/5calls,5calls/5calls,5calls/5calls,5calls/5calls |
d08cf84a589a20686ed431e8c8134697ee3c004c | js/home.js | js/home.js | function startTime() {
var today=new Date();
var h=checkTime(today.getHours());
var m=checkTime(today.getMinutes());
var s=checkTime(today.getSeconds());
var timeString = s%2===0 ? h + ":" + m + ":" + s : h + ":" + m + " " + s;
document.getElementById("time").innerHTML = timeString;
var twen... | function startTime() {
var today=new Date();
var h=checkTime(today.getHours());
var m=checkTime(today.getMinutes());
var s=checkTime(today.getSeconds());
var timeString = s%2===0 ? h + ":" + m + ":" + s : h + ":" + m + " " + s;
document.getElementById("time").innerHTML = timeString;
var twen... | Fix bug in background color | Fix bug in background color
| JavaScript | mit | SalomonSmeke/old-site,SalomonSmeke/old-site,SalomonSmeke/old-site |
11bab5733e1f0292ff06b0accc1fc6cc25cd29b6 | share/spice/maps/maps/maps_maps.js | share/spice/maps/maps/maps_maps.js | DDG.require('maps',function(){
ddg_spice_maps_maps = function(response) {
if (!response || !response.length) { return Spice.failed('maps'); }
// OSM sends back a bunch of places, just want the first one for now
response = [response[0]];
if ... | DDG.require('maps',function(){
ddg_spice_maps_maps = function(response) {
if (!response) { return Spice.failed('maps'); }
// OSM sends back a bunch of places, just want the first one for now
response = response.features[0];
Spice.add({
data: response,
... | Handle mapbox geocoder response data | Handle mapbox geocoder response data
| JavaScript | apache-2.0 | whalenrp/zeroclickinfo-spice,MoriTanosuke/zeroclickinfo-spice,MoriTanosuke/zeroclickinfo-spice,sagarhani/zeroclickinfo-spice,lernae/zeroclickinfo-spice,Retrobottega/zeroclickinfo-spice,xaviervalarino/zeroclickinfo-spice,GrandpaCardigan/zeroclickinfo-spice,MoriTanosuke/zeroclickinfo-spice,shyamalschandra/zeroclickinfo-s... |
d1b9a635f976403db95e86b7cbbdbd03daadc44a | addon/components/bs4/bs-navbar.js | addon/components/bs4/bs-navbar.js | import { computed } from '@ember/object';
import Navbar from 'ember-bootstrap/components/base/bs-navbar';
export default Navbar.extend({
classNameBindings: ['breakpointClass', 'backgroundClass'],
type: 'light',
/**
* Defines the responsive toggle breakpoint size. Options are the standard
* two character ... | import { computed } from '@ember/object';
import Navbar from 'ember-bootstrap/components/base/bs-navbar';
export default Navbar.extend({
classNameBindings: ['breakpointClass', 'backgroundClass'],
type: computed('appliedType', {
get() {
return this.get('appliedType');
},
set(key, value) { // esl... | Enforce compatibility of the `undefined` and `default` setting for navbar color scheme. This makes the demo work for the default, but the inverse still doesn't work because of different scheme names. | Enforce compatibility of the `undefined` and `default` setting for navbar color scheme. This makes the demo work for the default, but the inverse still doesn't work because of different scheme names.
| JavaScript | mit | jelhan/ember-bootstrap,jelhan/ember-bootstrap,kaliber5/ember-bootstrap,kaliber5/ember-bootstrap |
d0d1e2f8beee81818d0905c9e86c1d0f59ee2e31 | html/introduction-to-html/the-html-head/script.js | html/introduction-to-html/the-html-head/script.js | var list = document.createElement('ul');
var info = document.createElement('p');
var html = document.querySelector('html');
info.textContent = 'Below is a dynamic list. Click anywhere outside the list to add a new list item. Click an existing list item to change its text to something else.';
document.body.appendChild... | const list = document.createElement('ul');
const info = document.createElement('p');
const html = document.querySelector('html');
info.textContent = 'Below is a dynamic list. Click anywhere outside the list to add a new list item. Click an existing list item to change its text to something else.';
document.body.appen... | Use const instead of var as according to best practices | Use const instead of var as according to best practices
| JavaScript | cc0-1.0 | mdn/learning-area,mdn/learning-area,mdn/learning-area,mdn/learning-area |
78204ce46e10970b9911f956615709d4e68dcd6f | config/supportedLanguages.js | config/supportedLanguages.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/. */
// The list below should be kept in sync with:
// https://raw.githubusercontent.com/mozilla/fxa-content-server/mas... | /* 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/. */
// The list below should be kept in sync with:
// https://raw.githubusercontent.com/mozilla/fxa-content-server/mas... | Revert "feat(locale): add Arabic locale support" | Revert "feat(locale): add Arabic locale support"
This reverts commit a13e32a8f0426a0890c813cefbe3987750b12802.
| JavaScript | mpl-2.0 | mozilla/fxa-auth-server,mozilla/fxa-auth-server,mozilla/fxa-auth-server,mozilla/fxa-auth-server |
e2276933cf61b229ed63e6fe69010586468af649 | src/graphql/dataLoaders/articleCategoriesByCategoryIdLoaderFactory.js | src/graphql/dataLoaders/articleCategoriesByCategoryIdLoaderFactory.js | import DataLoader from 'dataloader';
import client from 'util/client';
export default () =>
new DataLoader(async categoryQueries => {
const body = [];
categoryQueries.forEach(({ id, first, before, after }) => {
// TODO error independently?
if (before && after) {
throw new Error('Use of b... | import DataLoader from 'dataloader';
import client from 'util/client';
export default () =>
new DataLoader(
async categoryQueries => {
const body = [];
categoryQueries.forEach(({ id, first, before, after }) => {
// TODO error independently?
if (before && after) {
throw new ... | Implement cacheKeyFn and fix lint | Implement cacheKeyFn and fix lint
| JavaScript | mit | MrOrz/rumors-api,MrOrz/rumors-api,cofacts/rumors-api |
62af16add5c5e9456b543787a136226c892ea229 | app/mixins/inventory-selection.js | app/mixins/inventory-selection.js | import Ember from "ember";
export default Ember.Mixin.create({
/**
* For use with the inventory-type ahead. When an inventory item is selected, resolve the selected
* inventory item into an actual model object and set is as inventoryItem.
*/
inventoryItemChanged: function() {
var select... | import Ember from "ember";
export default Ember.Mixin.create({
/**
* For use with the inventory-type ahead. When an inventory item is selected, resolve the selected
* inventory item into an actual model object and set is as inventoryItem.
*/
inventoryItemChanged: function() {
var select... | Make sure inventory item is completely loaded | Make sure inventory item is completely loaded
| JavaScript | mit | HospitalRun/hospitalrun-frontend,HospitalRun/hospitalrun-frontend,HospitalRun/hospitalrun-frontend,HospitalRun/hospitalrun-frontend |
584bdf23880938277f952bb8e59b33c697bd5974 | Resources/lib/events.js | Resources/lib/events.js | var listeners = {};
exports.addEventListener = function(name, func) {
if (!listeners[name]) {
listeners[name] = [];
}
listeners[name].push(func);
return exports;
};
exports.hasEventListeners = function(name) {
return !!listeners[name];
};
exports.clearEventListeners = function() {
listeners = {};
return exp... | var listeners = {};
exports.addEventListener = function(name, func) {
if (!listeners[name]) {
listeners[name] = [];
}
listeners[name].push(func);
return exports;
};
exports.hasEventListeners = function(name) {
return !!listeners[name];
};
exports.clearEventListeners = function() {
listeners = {};
return exp... | Allow Multiple Arguments to Events | Allow Multiple Arguments to Events
| JavaScript | apache-2.0 | appcelerator-titans/abcsWriter |
ee492f36b4d945945bb88a6dcbc64c5b6ef602d1 | .prettierrc.js | .prettierrc.js | module.exports = {
semi: false,
tabWidth: 2,
singleQuote: true,
proseWrap: 'always',
}
| module.exports = {
semi: false,
tabWidth: 2,
singleQuote: true,
proseWrap: 'always',
overrides: [
{
files: 'src/**/*.mdx',
options: {
parser: 'mdx',
},
},
],
}
| Configure prettier to format mdx | Configure prettier to format mdx
| JavaScript | mit | dtjv/dtjv.github.io |
c5ad27b894412c2cf32a723b1bfad1cce62360bf | app/scripts/reducers/userStatus.js | app/scripts/reducers/userStatus.js | import update from 'immutability-helper'
import ActionTypes from '../actionTypes'
const initialState = {
isLoading: false,
lastRequestAt: undefined,
latestActivities: [],
unreadMessagesCount: 0,
}
export default (state = initialState, action) => {
switch (action.type) {
case ActionTypes.AUTH_TOKEN_EXPIRE... | import update from 'immutability-helper'
import ActionTypes from '../actionTypes'
const initialState = {
isLoading: false,
lastRequestAt: undefined,
latestActivities: [],
unreadMessagesCount: 0,
}
export default (state = initialState, action) => {
switch (action.type) {
case ActionTypes.AUTH_TOKEN_EXPIRE... | Fix wrong usage of update | Fix wrong usage of update
| JavaScript | agpl-3.0 | adzialocha/hoffnung3000,adzialocha/hoffnung3000 |
15cdaec26ef23fac04c6055dc93398dd55cb65d4 | app/scripts/directives/sidebar.js | app/scripts/directives/sidebar.js | 'use strict';
(function() {
angular.module('ncsaas')
.directive('sidebar', ['$state', sidebar]);
function sidebar($state, $uibModal) {
return {
restrict: 'E',
scope: {
items: '=',
context: '='
},
templateUrl: 'views/directives/sidebar.html',
link: function(sc... | 'use strict';
(function() {
angular.module('ncsaas')
.directive('sidebar', ['$state', sidebar]);
function sidebar($state, $uibModal) {
return {
restrict: 'E',
scope: {
items: '=',
context: '='
},
templateUrl: 'views/directives/sidebar.html',
link: function(sc... | Use normal button for select workspace button (SAAS-1389) | Use normal button for select workspace button (SAAS-1389)
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport |
243f8dc177fbcf33c2fa67c0df2f177e3d53e6ad | app/scripts/modules/auth/index.js | app/scripts/modules/auth/index.js | import { connect } from 'react-redux';
import { Component } from 'react';
import PropTypes from 'prop-types';
import { setConfig } from 'widget-editor';
import { browserHistory } from 'react-router';
import actions from './auth-actions';
import initialState from './auth-reducer-initial-state';
import * as reducers fro... | import { connect } from 'react-redux';
import { Component } from 'react';
import PropTypes from 'prop-types';
import { setConfig } from 'widget-editor';
import { browserHistory } from 'react-router';
import actions from './auth-actions';
import initialState from './auth-reducer-initial-state';
import * as reducers fro... | Fix a bug where the user wouldn't be able to log in | Fix a bug where the user wouldn't be able to log in
| JavaScript | mit | resource-watch/prep-app,resource-watch/prep-app |
ed9b3e12309fa37080541f96f11e4c1ab2fb8cf1 | lib/cartodb/models/mapconfig_overviews_adapter.js | lib/cartodb/models/mapconfig_overviews_adapter.js | var queue = require('queue-async');
var _ = require('underscore');
function MapConfigNamedLayersAdapter(overviewsApi) {
this.overviewsApi = overviewsApi;
}
module.exports = MapConfigNamedLayersAdapter;
MapConfigNamedLayersAdapter.prototype.getLayers = function(username, layers, callback) {
var self = this;
... | var queue = require('queue-async');
var _ = require('underscore');
function MapConfigNamedLayersAdapter(overviewsApi) {
this.overviewsApi = overviewsApi;
}
module.exports = MapConfigNamedLayersAdapter;
MapConfigNamedLayersAdapter.prototype.getLayers = function(username, layers, callback) {
var self = this;
... | Bring in code commented out for tests | Bring in code commented out for tests
| JavaScript | bsd-3-clause | CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb |
2ae9e370b6b3c4ef87275471f50f1db007dbfb23 | test/channel-mapping.test.js | test/channel-mapping.test.js | import chai from 'chai';
import irc from 'irc';
import discord from 'discord.js';
import Bot from '../lib/bot';
import config from './fixtures/single-test-config.json';
import caseConfig from './fixtures/case-sensitivity-config.json';
import DiscordStub from './stubs/discord-stub';
import ClientStub from './stubs/irc-c... | import chai from 'chai';
import irc from 'irc';
import discord from 'discord.js';
import Bot from '../lib/bot';
import config from './fixtures/single-test-config.json';
import caseConfig from './fixtures/case-sensitivity-config.json';
import DiscordStub from './stubs/discord-stub';
import ClientStub from './stubs/irc-c... | Update check to look for presence, not equality (order unnecessary) | Update check to look for presence, not equality (order unnecessary)
| JavaScript | mit | reactiflux/discord-irc |
23ff386f7989dd6a1aaf63d6c1108c5b0b5d2583 | blueprints/ember-table/index.js | blueprints/ember-table/index.js | module.exports = {
normalizeEntityName: function() {},
afterInstall: function(options) {
// We assume that handlebars, ember, and jquery already exist
return this.addBowerPackagesToProject([
{
// Antiscroll seems to be abandoned by its original authors. We need
// two things: (1) a ve... | module.exports = {
normalizeEntityName: function() {},
afterInstall: function(options) {
// We assume that handlebars, ember, and jquery already exist
return this.addBowerPackagesToProject([
{
// Antiscroll seems to be abandoned by its original authors. We need
// two things: (1) a ve... | Use correct version of antiscroll in blueprint | Use correct version of antiscroll in blueprint
| JavaScript | bsd-3-clause | hedgeserv/ember-table,Gaurav0/ember-table,phoebusliang/ember-table,phoebusliang/ember-table,Gaurav0/ember-table,hedgeserv/ember-table |
d2b7ee755b6d51c93d5f6f1d24a65b34f2d1f90d | app/soc/content/js/tips-081027.js | app/soc/content/js/tips-081027.js | $(function() {
$('tr[title]').bt();
}); | $(function() {
// Change 'title' to something else first
$('tr[title]').each(function() {
$(this).attr('xtitle', $(this).attr('title')).removeAttr('title');
})
.children().children(':input')
// Set up event handlers
.bt({trigger: ['helperon', 'helperoff'],
titleSelector: "parent()... | Make tooltips work when tabbing | Make tooltips work when tabbing
Fixed the tooltips on IE, and changed the background colour to be
nicer on Firefox.
Patch by: Haoyu Bai <baihaoyu@gmail.com>
--HG--
extra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%401624
| JavaScript | apache-2.0 | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son |
0202747e5620276e90c907bfbd14905891f744a5 | public/javascripts/youtube-test.js | public/javascripts/youtube-test.js | var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '39... | var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '39... | Change video ID (see extended log) | Change video ID (see extended log)
- Demonstrate that HTTP referrer overriding is not necessary. This is
mostly for my own research and for eventual changes I will make to Toby
my YouTube player so that I no longer require a patch to
libchromiumcontent allowing the overriding of the HTTP referrer.
| JavaScript | mit | frankhale/electron-with-express |
5c0ff1bf885ac5a40dddd67b9e9733ee120e4361 | project/src/js/main.js | project/src/js/main.js | /* application entry point */
// require mithril globally for convenience
window.m = require('mithril');
// cordova plugins polyfills for browser
if (!window.cordova) require('./cordovaPolyfills.js');
var utils = require('./utils');
var session = require('./session');
var i18n = require('./i18n');
var home = requir... | /* application entry point */
// require mithril globally for convenience
window.m = require('mithril');
// cordova plugins polyfills for browser
if (!window.cordova) require('./cordovaPolyfills.js');
var utils = require('./utils');
var session = require('./session');
var i18n = require('./i18n');
var home = requir... | Refresh data on app going foreground | Refresh data on app going foreground
| JavaScript | mit | btrent/lichobile,btrent/lichobile,garawaa/lichobile,garawaa/lichobile,btrent/lichobile,garawaa/lichobile,btrent/lichobile |
96f88d87967b29d338f5baf984691ba7f7e9110d | Web/api/models/Questions.js | Web/api/models/Questions.js | /**
* Questions.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
text: 'string',
type: {
type: 'string',
enum: ['e... | /**
* Questions.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
text: 'string',
type: {
type: 'string',
enum: ['s... | Modify question type to allow the following type: string, text or range | Modify question type to allow the following type: string, text or range
| JavaScript | mit | Xignal/Backend |
5bd0512b74cb30edd82b8aa4d2c8ea55f8944a56 | viewsource/js/static/ast.js | viewsource/js/static/ast.js | // This just dumps out an ast for your viewing pleasure.
include("dumpast.js");
function process_js(ast) {
dump_ast(ast);
}
| include("beautify.js");
function process_js(ast) {
_print('// process_js');
_print(js_beautify(uneval(ast))
.replace(/op: (\d+),/g,
function (hit, group1) {
return 'op: ' + decode_op(group1) + '(' + group1 + '),'
})
.replace(/type: (\d+),/g,
function (hit, group1) {
... | Make jshydra output match dehydra's. | [ViewSource] Make jshydra output match dehydra's.
| JavaScript | mit | srenatus/dxr,jonasfj/dxr,pelmers/dxr,jay-z007/dxr,jay-z007/dxr,jbradberry/dxr,jbradberry/dxr,pelmers/dxr,kleintom/dxr,jonasfj/dxr,erikrose/dxr,pombredanne/dxr,nrc/dxr,gartung/dxr,pombredanne/dxr,pelmers/dxr,nrc/dxr,jay-z007/dxr,KiemVM/Mozilla--dxr,gartung/dxr,erikrose/dxr,jay-z007/dxr,KiemVM/Mozilla--dxr,jbradberry/dxr... |
67f62b161eb997b77e21a2c1bedd6748baa97908 | app/components/quotes.js | app/components/quotes.js | import React, { PropTypes } from 'react';
const Quote = ({quote}) => (
<div>
<p>{quote.value}</p>
<p>{quote.author}</p>
</div>
)
Quote.propTypes = {
quote: PropTypes.object.isRequired
}
export default Quote; | import React, { PropTypes } from 'react';
const Quote = ({quote}) => (
<div className='quote_comp'>
<p className='quote_comp__text'>{quote.value}</p>
<p className='quote_comp__author'>- {quote.author}</p>
</div>
)
Quote.propTypes = {
quote: PropTypes.object.isRequired
}
export default Quote; | Add classes to quote component | Add classes to quote component
| JavaScript | mit | subramaniashiva/quotes-pwa,subramaniashiva/quotes-pwa |
c82e4c18c64c3f86e3865484b4b1a01de6f026a5 | lib/app.js | lib/app.js | #!/usr/bin/env node
/*eslint-disable no-var */
var path = require('path');
var spawner = require('child_process');
exports.getFullPath = function(script){
return path.join(__dirname, script);
};
// Respawn ensuring proper command switches
exports.respawn = function respawn(script, requiredArgs, hostProcess) {
... | #!/usr/bin/env node
/*eslint-disable no-var */
var path = require('path');
var spawner = require('child_process');
exports.getFullPath = function(script){
return path.join(__dirname, script);
};
// Respawn ensuring proper command switches
exports.respawn = function respawn(script, requiredArgs, hostProcess) {
... | Fix ordering on command line | Fix ordering on command line
| JavaScript | mit | SockDrawer/SockBot |
f9ea5ab178f8326b79c177889a5266a2bd4af91b | client/app/scripts/services/api.js | client/app/scripts/services/api.js | angular
.module('app')
.factory('apiService', [
'$http',
function($http) {
return {
client: $http.get('/api/bower'),
server: $http.get('/api/package')
};
}
])
;
| angular
.module('app')
.factory('apiService', [
'$http',
function($http) {
return {
client: $http.get('../bower.json'),
server: $http.get('../package.json')
};
}
])
;
| Use relative paths for bower/package.json | Use relative paths for bower/package.json
| JavaScript | mit | ericclemmons/ericclemmons.github.io,ericclemmons/ericclemmons.github.io |
92b0f90d0962114f54ec58babcc6017018a1263b | client/helpers/validations/book.js | client/helpers/validations/book.js | const validate = (values) => {
const errors = {};
if (!values.title || values.title.trim() === '') {
errors.title = 'Book title is required';
}
if (!values.author || values.author.trim() === '') {
errors.author = 'Book author is required';
}
if (!values.description || values.description.trim() === '... | const validate = (values) => {
const errors = {};
if (!values.title || values.title.trim() === '') {
errors.title = 'Book title is required';
}
if (!values.author || values.author.trim() === '') {
errors.author = 'Book author is required';
}
if (!values.description || values.description.trim() === '... | Fix bug in validation method | Fix bug in validation method
| JavaScript | mit | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books |
8070c9f13209b80b1881fc83de027b3895656046 | test/unescape-css.js | test/unescape-css.js | var test = require('ava');
var unescapeCss = require('../lib/unescape-css');
test('should unescape plain chars', function (t) {
t.is(unescapeCss('Romeo \\+ Juliette'), 'Romeo + Juliette');
});
test('should unescape ASCII chars', function (t) {
t.is(unescapeCss('\\34\\32'), '42');
});
test('should unescape Unicod... | var test = require('ava');
var unescapeCss = require('../lib/unescape-css');
test('unescapes plain chars', function (t) {
t.is(unescapeCss('Romeo \\+ Juliette'), 'Romeo + Juliette');
});
test('unescapes ASCII chars', function (t) {
t.is(unescapeCss('\\34\\32'), '42');
});
test('unescapes Unicode chars', function... | Remove word "should" from test descriptions | Remove word "should" from test descriptions
| JavaScript | mit | assetsjs/postcss-assets,borodean/postcss-assets |
7c8a1b33bad96e772921a24ced0343d756dcae34 | jquery.dragster.js | jquery.dragster.js | (function ($) {
$.fn.dragster = function (options) {
var settings = $.extend({
enter: $.noop,
leave: $.noop
}, options);
return this.each(function () {
var first = false,
second = false,
$this = $(this);
$this... | (function ($) {
$.fn.dragster = function (options) {
var settings = $.extend({
enter: $.noop,
leave: $.noop,
over: $.noop
}, options);
return this.each(function () {
var first = false,
second = false,
$this = $... | Fix drop event with preventDefault | Fix drop event with preventDefault
If preventDefault is not triggered, we can't use drop event. I fix it
and added an over function to disable it by default.
| JavaScript | mit | catmanjan/jquery-dragster |
439cfd0b85a8a2416aeac40607bfddad86ef9773 | app/controllers/form.js | app/controllers/form.js | var args = arguments[0] || {};
if (args.hasOwnProperty('itemIndex')) {
// Edit mode
var myModel = Alloy.Collections.tasks.at(args.itemIndex);
$.text.value = myModel.get('text');
} else {
// Add mode
var myModel = Alloy.createModel('tasks');
myModel.set("status", "pending");
}
// Focus on 1st input
functio... | var args = arguments[0] || {};
if (args.hasOwnProperty('itemIndex')) {
// Edit mode
var myModel = Alloy.Collections.tasks.at(args.itemIndex);
$.text.value = myModel.get('text');
} else {
// Add mode
var myModel = Alloy.createModel('tasks');
myModel.set("status", "pending");
}
// Focus on 1st input
functio... | Validate the only 1 field we have right now | Validate the only 1 field we have right now
| JavaScript | mit | HazemKhaled/TiTODOs,HazemKhaled/TiTODOs |
350209bd9bebca2d9365e531d87ecdf53758026d | assets/javascripts/js.js | assets/javascripts/js.js | $(document).ready(function() {
$('.side-nav-container').hover(function() {
$(this).addClass('is-showed');
$('.kudo').addClass('hide');
}, function() {
$(this).removeClass('is-showed');
$('.kudo').removeClass('hide');
});
$(window).scroll(function () {
var logotype = $('.logotype');
v... | $(document).ready(function () {
$('.side-nav-container').hover(function () {
$(this).addClass('is-showed');
$('.kudo').addClass('hide');
}, function() {
$(this).removeClass('is-showed');
$('.kudo').removeClass('hide');
});
$(window).scroll(function () {
var logo... | Add animation for kudo-side when kudo-bottom is showed | Add animation for kudo-side when kudo-bottom is showed
| JavaScript | cc0-1.0 | cybertk/cybertk.github.io,margaritis/svbtle-jekyll,orlando/svbtle-jekyll,margaritis/margaritis.github.io,orlando/svbtle-jekyll,margaritis/margaritis.github.io,margaritis/margaritis.github.io,cybertk/cybertk.github.io,margaritis/svbtle-jekyll |
67efb8bde264e3ea0823e40558d29dd89120c0c9 | src/components/views/messages/MessageTimestamp.js | src/components/views/messages/MessageTimestamp.js | /*
Copyright 2015, 2016 OpenMarket 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
Unless required by applicable law or agreed to in writing, sof... | /*
Copyright 2015, 2016 OpenMarket 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
Unless required by applicable law or agreed to in writing, sof... | Add date tooltip to timestamps | Add date tooltip to timestamps
| JavaScript | apache-2.0 | vector-im/riot-web,vector-im/riot-web,vector-im/vector-web,vector-im/vector-web,vector-im/vector-web,martindale/vector,vector-im/vector-web,vector-im/riot-web,vector-im/riot-web,vector-im/vector-web,vector-im/riot-web,vector-im/riot-web,martindale/vector |
50a084e7894ae1b3586709cf488bd2260cbeb615 | packages/eslint-config-eventbrite/rules/style.js | packages/eslint-config-eventbrite/rules/style.js | // The rules ultimately override any rules defined in legacy/rules/style.js
module.exports = {
rules: {
// Enforce function expressions
// http://eslint.org/docs/rules/func-style
'func-style': ['error', 'expression'],
// enforce that `let` & `const` declarations are declared togethe... | // The rules ultimately override any rules defined in legacy/rules/style.js
module.exports = {
rules: {
// Enforce function expressions
// http://eslint.org/docs/rules/func-style
'func-style': ['error', 'expression'],
// enforce that `let` & `const` declarations are declared togethe... | Add new rule for spacing around infix operators | Add new rule for spacing around infix operators
| JavaScript | mit | eventbrite/javascript |
f683c19b98c6f2a87ea4c97e55854f871fae5763 | app/reducers/network.js | app/reducers/network.js | import { ActionConstants as actions } from '../actions'
import { NETWORK_MAIN, NETWORK_TEST } from '../actions/network'
export default function network(state = {}, action) {
switch (action.type) {
case actions.network.SWITCH: {
return {
...state,
net: action.netw... | import { ActionConstants as actions } from '../actions'
import { NETWORK_MAIN, NETWORK_TEST } from '../actions/network'
export default function network(state = {}, action) {
switch (action.type) {
case actions.network.SWITCH: {
return {
...state,
net: action.netw... | Fix updating of balance after a logout followed by a quick login | Fix updating of balance after a logout followed by a quick login
| JavaScript | mit | ixje/neon-wallet-react-native,ixje/neon-wallet-react-native,ixje/neon-wallet-react-native |
0c009ce0f6c647b3e514f1e4efeefb30c929120e | client/angular/src/app/controllers/movies.controller.spec.js | client/angular/src/app/controllers/movies.controller.spec.js | 'use strict';
describe('controllers', function() {
var httpBackend, scope, createController;
beforeEach(module('polyflix'));
beforeEach(inject(function($rootScope, $httpBackend, $controller) {
httpBackend = $httpBackend;
scope = $rootScope.$new();
httpBackend.whenGET(mocks.configUrl).respond(
... | 'use strict';
describe('controllers', function() {
var httpBackend, scope, createController;
beforeEach(module('polyflix'));
beforeEach(inject(function($rootScope, $httpBackend, $controller) {
httpBackend = $httpBackend;
scope = $rootScope.$new();
httpBackend.whenGET(mocks.configUrl).respond(
... | Add mocks to movies controller tests | Add mocks to movies controller tests
| JavaScript | mit | ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix |
75cb05b23b6267665a59e1cc3d53ac6abdd2e11d | adventofcode/day10.js | adventofcode/day10.js | /*
* Run in: http://adventofcode.com/day/10
*/
;(function () {
let input = document.querySelector('.puzzle-input').textContent
console.log(
'Day09/first:',
first(input)
)
console.log(
'Day09/second:',
second(input)
)
function first (input) {
return Array(40).fill().reduce(lookAndSa... | /*
* Run in: http://adventofcode.com/day/10
*/
;(function () {
let input = document.querySelector('.puzzle-input').textContent
console.log(
'Day10/first:',
first(input)
)
console.log(
'Day10/second:',
second(input)
)
function first (input) {
return Array(40).fill().reduce(lookAndSa... | Fix typo on console message | Fix typo on console message
| JavaScript | mit | stefanmaric/scripts,stefanmaric/scripts |
3f425c1e15751fd8ea7d857b417a2932208b4366 | client/app/modules/sandbox/controllers/sandbox.forms.ctrl.js | client/app/modules/sandbox/controllers/sandbox.forms.ctrl.js | 'use strict';
angular.module('com.module.sandbox')
.controller('SandboxFormsCtrl', function ($scope, CoreService) {
var now = new Date();
$scope.formOptions = {};
$scope.formData = {
name: null,
description: null,
startDate: now,
startTime: now,
endDate: now,
endTime... | 'use strict';
angular.module('com.module.sandbox')
.controller('SandboxFormsCtrl', function ($scope, CoreService) {
var now = new Date();
$scope.formOptions = {};
$scope.formData = {
name: null,
description: null,
startDate: now,
startTime: now,
endDate: now,
endTime... | Remove obsolete object from scope | Remove obsolete object from scope
| JavaScript | mit | TNick/loopback-angular-admin,igormusic/referenceData,gxr1028/loopback-angular-admin,shalkam/loopback-angular-admin,igormusic/referenceData,colmena/colmena,jingood2/loopbackadmin,Jeff-Lewis/loopback-angular-admin,colmena/colmena-cms,telemed-duth/eclinpro,senorcris/loopback-angular-admin,colmena/colmena-cms,shalkam/loopb... |
f05b9ad8b3c8f7bb201fccbbb0267c01e7eabbbf | lib/game-engine.js | lib/game-engine.js | 'use strict';
const Game = require('./game');
// todo: this class got refactored away to almost nothing. does it still have value?
// hmm, yes, since we are decorating it
class GameEngine {
constructor(repositorySet, commandHandlers) {
this._repositorySet = repositorySet;
this._handlers = command... | 'use strict';
const Game = require('./game-state');
// todo: this class got refactored away to almost nothing. does it still have value?
// hmm, yes, since we are decorating it
class GameEngine {
constructor(repositorySet, commandHandlers) {
this._repositorySet = repositorySet;
this._handlers = c... | Fix module name in require after rename | Fix module name in require after rename
| JavaScript | mit | dshaneg/text-adventure,dshaneg/text-adventure |
5240db9f7366808a612e6ad722b16e63ba23baa6 | package.js | package.js | Package.describe({
name: '255kb:cordova-disable-select',
version: '1.0.2',
summary: 'Disables user selection and iOS magnifying glass / longpress menu in Cordova applications.',
git: 'https://github.com/255kb/cordova-disable-select',
documentation: 'README.md'
});
Package.onUse(function(api) {
... | Package.describe({
name: '255kb:cordova-disable-select',
version: '1.0.2',
summary: 'Disables user selection and iOS magnifying glass / longpress menu in Cordova applications.',
git: 'https://github.com/255kb/cordova-disable-select',
documentation: 'README.md'
});
Package.onUse(function(api) {
... | Add css file as 'web.cordova' is more accurate. | Add css file as 'web.cordova' is more accurate.
If application is browser and cordova in the same time, it will have impact on browser. | JavaScript | mit | 255kb/cordova-disable-select |
775ca23e5d251e27012b9ddb43843840958deae2 | distributionviewer/core/static/js/app/components/views/logout-button.js | distributionviewer/core/static/js/app/components/views/logout-button.js | import React from 'react';
export default function LogoutButton(props) {
return (
<div className="sign-out-wrapper">
<span>{props.email}</span>
<span className="button" onClick={props.signOut}>Sign Out</span>
</div>
);
}
LogoutButton.propTypes = {
email: React.PropTypes.string.isRequired,
... | import React from 'react';
export default function LogoutButton(props) {
return (
<div className="sign-out-wrapper">
<span>{props.email}</span>
<span className="button" onClick={props.signOut}>Sign Out</span>
</div>
);
}
LogoutButton.propTypes = {
email: React.PropTypes.string.isRequired,
... | Fix logout button prop type warning | Fix logout button prop type warning
| JavaScript | mpl-2.0 | openjck/distribution-viewer,openjck/distribution-viewer,openjck/distribution-viewer,openjck/distribution-viewer |
088438040d865c219cd602cc59bfb66d2b6f2486 | scripts/pre-publish.js | scripts/pre-publish.js | const { join } = require('path')
const { writeFile } = require('fs').promises
const { default: players } = require('../lib/players')
const generateSinglePlayers = async () => {
for (const { key, name } of players) {
const file = `
const { createReactPlayer } = require('./lib/ReactPlayer')
const Playe... | const { join } = require('path')
const { writeFile } = require('fs').promises
const { default: players } = require('../lib/players')
const generateSinglePlayers = async () => {
for (const { key, name } of players) {
const file = `
const createReactPlayer = require('./lib/ReactPlayer').createReactPlayer
... | Fix single player imports on IE11 | Fix single player imports on IE11
Fixes https://github.com/CookPete/react-player/issues/954
| JavaScript | mit | CookPete/react-player,CookPete/react-player |
af31fac9ce0fcc39d6d8e079cc9c534261c2d455 | wherehows-web/tests/integration/components/datasets/containers/dataset-acl-access-test.js | wherehows-web/tests/integration/components/datasets/containers/dataset-acl-access-test.js | import { moduleForComponent, skip } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import notificationsStub from 'wherehows-web/tests/stubs/services/notifications';
import userStub from 'wherehows-web/tests/stubs/services/current-user';
import sinon from 'sinon';
moduleForComponent(
'datasets/cont... | import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import notificationsStub from 'wherehows-web/tests/stubs/services/notifications';
import userStub from 'wherehows-web/tests/stubs/services/current-user';
import sinon from 'sinon';
moduleForComponent(
'datasets/cont... | Undo skip test after fix | Undo skip test after fix
| JavaScript | apache-2.0 | mars-lan/WhereHows,linkedin/WhereHows,linkedin/WhereHows,camelliazhang/WhereHows,mars-lan/WhereHows,camelliazhang/WhereHows,camelliazhang/WhereHows,camelliazhang/WhereHows,alyiwang/WhereHows,theseyi/WhereHows,linkedin/WhereHows,mars-lan/WhereHows,theseyi/WhereHows,alyiwang/WhereHows,theseyi/WhereHows,camelliazhang/Wher... |
b463c1709faf3da73b907dc842d83aa2709a1e77 | app/services/redux.js | app/services/redux.js | import Ember from 'ember';
import redux from 'npm:redux';
import reducers from '../reducers/index';
import enhancers from '../enhancers/index';
import optional from '../reducers/optional';
import middlewareConfig from '../middleware/index';
const { assert, isArray } = Ember;
// Util for handling the case where no set... | import Ember from 'ember';
import redux from 'npm:redux';
import reducers from '../reducers/index';
import enhancers from '../enhancers/index';
import optional from '../reducers/optional';
import middlewareConfig from '../middleware/index';
const { assert, isArray, K } = Ember;
// Handle "classic" middleware exports ... | Use Ember.K instead of noOp | Use Ember.K instead of noOp
| JavaScript | mit | ember-redux/ember-redux,dustinfarris/ember-redux,dustinfarris/ember-redux,toranb/ember-redux,toranb/ember-redux,ember-redux/ember-redux |
78e163a1867cc996a47213fcef248b288793c3cd | src/music-collection/groupSongsIntoCategories.js | src/music-collection/groupSongsIntoCategories.js | import _ from 'lodash'
const grouping = [
{ title: 'Custom Song', criteria: song => song.custom },
{ title: 'Tutorial', criteria: song => song.tutorial },
{ title: 'Unreleased', criteria: song => song.unreleased },
{
title: 'New Songs',
criteria: song =>
song.added && Date.now() - Date.parse(song... | import _ from 'lodash'
const grouping = [
{ title: 'Custom Song', criteria: song => song.custom },
{ title: 'Tutorial', criteria: song => song.tutorial },
{ title: 'Unreleased', criteria: song => song.unreleased },
{
title: 'New Songs',
criteria: song =>
song.added && Date.now() - Date.parse(song... | Put songs as new for 2 months | :wrench: Put songs as new for 2 months
| JavaScript | agpl-3.0 | bemusic/bemuse,bemusic/bemuse,bemusic/bemuse,bemusic/bemuse,bemusic/bemuse |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.