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 |
|---|---|---|---|---|---|---|---|---|---|
fba049eecf0689317634e892fd2f3c59f221d0f9 | tests/e2e/utils/activate-amp-and-set-mode.js | tests/e2e/utils/activate-amp-and-set-mode.js |
/**
* WordPress dependencies
*/
import { activatePlugin, visitAdminPage } from '@wordpress/e2e-test-utils';
/**
* The allow list of AMP modes.
*/
export const allowedAMPModes = {
standard: 'standard',
transitional: 'transitional',
reader: 'disabled',
};
/**
* Activate AMP and set it to the correct mode.
*
... |
/**
* WordPress dependencies
*/
import { activatePlugin, visitAdminPage } from '@wordpress/e2e-test-utils';
/**
* The allow list of AMP modes.
*/
export const allowedAMPModes = {
primary: 'standard',
secondary: 'transitional',
standard: 'standard',
transitional: 'transitional',
reader: 'disabled',
};
/**
*... | Add aliase for primary and secondary AMP modes. | Add aliase for primary and secondary AMP modes.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp |
d2f7499fc65d63769027f2498dccb5d9b4924fd6 | pages/index.js | pages/index.js | import React from 'react'
import Head from 'next/head'
import {MDXProvider} from '@mdx-js/react'
import IndexMDX from './index.mdx'
import CodeBlock from '../doc-components/CodeBlock'
const components = {
pre: props => <div {...props} />,
code: CodeBlock
}
export default () => (
<MDXProvider components={compon... | import React from 'react'
import Head from 'next/head'
import {MDXProvider} from '@mdx-js/react'
import IndexMDX from './index.mdx'
import CodeBlock from '../doc-components/CodeBlock'
const components = {
pre: props => <div {...props} />,
code: CodeBlock
}
export default () => (
<MDXProvider components={compon... | Add canonical url for docs | Add canonical url for docs
| JavaScript | mit | miduga/react-slidy |
d85d4bc34ad869b20b4027d5f32c5ca64e4e4c3e | public/utility.js | public/utility.js | module.exports = {
generateQueryString: function (data) {
var ret = []
for (var d in data)
if (data[d])
ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d]))
return ret.join("&")
},
base64Encoding: function (data) {
return new Buffer(data).toString('base64')
},
ba... | module.exports = {
generateQueryString: function (data) {
var ret = []
for (var d in data)
if (data[d])
ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d]))
return ret.join("&")
},
base64Encoding: function (data) {
return new Buffer(data).toString('base64')
},
ba... | Add Input White List Checker to Utility | Add Input White List Checker to Utility
| JavaScript | mit | Flieral/Publisher-Service,Flieral/Publisher-Service |
be3aab27fb4ec87679a0734335fb5f67b1c691fe | lib/themes/dosomething/paraneue_dosomething/js/url/helpers.js | lib/themes/dosomething/paraneue_dosomething/js/url/helpers.js | /**
* Get a specified segment from the pathname.
*
* @param {String} pathname
* @param {Number} segment
* @return {Boolean}
*/
export function getPathnameSegment(pathname = window.location.pathname, segmentIndex = 0) {
let segments = pathname.split('/');
segments.splice(0,1);
return segments[segmentInde... | /**
* Get a specified segment from the pathname.
*
* @param {String} pathname
* @param {Number} segment
* @return {Boolean}
*/
export function getPathnameSegment(pathname = window.location.pathname, segmentIndex = 0) {
let segments = pathname.split('/');
segmentIndex++;
return segments[segmentIndex];
}
| Update to increase index insted of splicing first item off array. | Update to increase index insted of splicing first item off array.
| JavaScript | mit | DoSomething/dosomething,sergii-tkachenko/phoenix,mshmsh5000/dosomething-1,mshmsh5000/dosomething-1,DoSomething/dosomething,DoSomething/phoenix,sergii-tkachenko/phoenix,DoSomething/dosomething,deadlybutter/phoenix,deadlybutter/phoenix,sergii-tkachenko/phoenix,mshmsh5000/dosomething-1,DoSomething/dosomething,DoSomething/... |
3c95819895253b77edcfcdd6760a846f590c9210 | src/InputHeader.js | src/InputHeader.js | import React from 'react'
import { Component } from 'react'
class InputHeader extends Component {
focus = () => {
this.refs.inputHeader.focus()
}
blur = () => {
this.refs.inputHeader.blur()
}
render() {
return (
<div className="selectize-input items not-full has-options">
<input t... | import React from 'react'
import { Component } from 'react'
class InputHeader extends Component {
focus = () => {
this._input.focus()
}
blur = () => {
this._input.blur()
}
render() {
return (
<div className="selectize-input items not-full has-options">
<input type="text" classNam... | Change ref from string to callback | Change ref from string to callback
| JavaScript | mit | andynoelker/react-data-select |
83bea17aff9f4c3d6adcdf88b3f1661be9b92c15 | middleware/protect.js | middleware/protect.js | var UUID = require('./../uuid' );
function forceLogin(keycloak, request, response) {
var host = request.hostname;
var headerHost = request.headers.host.split(':');
var port = headerHost[1] || '';
var protocol = request.protocol;
var redirectUrl = protocol + '://' + host + ( port === '' ? '' : ':' + port ) +... | var UUID = require('./../uuid' );
function forceLogin(keycloak, request, response) {
var host = request.hostname;
var headerHost = request.headers.host.split(':');
var port = headerHost[1] || '';
var protocol = request.protocol;
var redirectUrl = protocol + '://' + host + ( port === '' ? '' : ':' + port ) +... | Use token.hasRole to check for roles of other apps | Use token.hasRole to check for roles of other apps
| JavaScript | apache-2.0 | keycloak/keycloak-nodejs-connect,keycloak/keycloak-nodejs-connect,abstractj/keycloak-nodejs-connect,abstractj/keycloak-nodejs-connect,abstractj/keycloak-nodejs-connect,keycloak/keycloak-nodejs-connect |
1352d718c2229c64dd6e981937efebfe6c3ddf60 | dxr/static/js/panel.js | dxr/static/js/panel.js | $(function() {
var panelContent = $('#panel-content');
/**
* Toggles the ARIA expanded and hidden attributes' state.
*
* @param Object elem The element on which to toggle the attribute.
*/
function toggleAria(elem) {
var expandedState = elem.attr('aria-expanded') === 'true' ? 'f... | $(function() {
var panelContent = $('#panel-content');
/**
* Toggles the ARIA expanded and hidden attributes' state.
*
* @param Object elem The element on which to toggle the attribute.
*/
function toggleAria(elem) {
var expandedState = elem.attr('aria-expanded') === 'true' ? 'f... | Make ARIA attrs actually update. | Make ARIA attrs actually update.
| JavaScript | mit | pombredanne/dxr,pelmers/dxr,gartung/dxr,erikrose/dxr,jbradberry/dxr,jbradberry/dxr,kleintom/dxr,srenatus/dxr,srenatus/dxr,pombredanne/dxr,gartung/dxr,bozzmob/dxr,KiemVM/Mozilla--dxr,jay-z007/dxr,jbradberry/dxr,pombredanne/dxr,bozzmob/dxr,pombredanne/dxr,pelmers/dxr,jay-z007/dxr,nrc/dxr,jay-z007/dxr,kleintom/dxr,nrc/dxr... |
cf3d28d03ef9761001799e4224ce38f65c869de4 | src/networking/auth.js | src/networking/auth.js | import * as ACTION_TYPES from '../constants/action_types'
function extractToken(hash, oldToken) {
const match = hash.match(/access_token=([^&]+)/)
let token = !!match && match[1]
if (!token) {
token = oldToken
}
return token
}
export function checkAuth(dispatch, oldToken, location) {
const token = ext... | import * as ACTION_TYPES from '../constants/action_types'
function extractToken(hash, oldToken) {
const match = hash.match(/access_token=([^&]+)/)
let token = !!match && match[1]
if (!token) {
token = oldToken
}
return token
}
export function checkAuth(dispatch, oldToken, location) {
const token = ext... | Remove unnecessary whitespace from url string. | Remove unnecessary whitespace from url string. | JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
41ffe8f6551fcf98eaba292a82e94a6bfa382486 | chrome/background.js | chrome/background.js | /*global chrome, console*/
console.log("background.js");
chrome.runtime.getBackgroundPage(function() {
console.log("getBackgroundPage", arguments);
});
chrome.runtime.onMessageExternal.addListener(function(message, sender, sendResponse) {
console.log("onMessageExternal", arguments);
});
| /*global chrome, console*/
// NOT USED
console.log("background.js");
chrome.runtime.getBackgroundPage(function() {
console.log("getBackgroundPage", arguments);
});
chrome.runtime.onMessageExternal.addListener(function(message, sender, sendResponse) {
console.log("onMessageExternal", arguments);
});
| Add comment to say this file isn't used. | Add comment to say this file isn't used.
| JavaScript | mit | gitgrimbo/settlersonlinesimulator,gitgrimbo/settlersonlinesimulator |
975685740c083d4e3d73a238e8220ce7255777f1 | bookmarklet.js | bookmarklet.js | /**
* Download FuckMyDom and call slowly()
**/
(function( window, document, undefined ) {
var stag;
if( !window.FuckMyDom ) {
stag = document.createElement( 'script' );
stag.setAttribute( 'src', 'http://mhgbrown.github.io/fuck-my-dom/fuck-my-dom.js' );
stag.onload = function(){ FuckMyDom.slowly(); }... | /**
* Download FuckMyDom and call slowly()
**/
(function( window, document, undefined ) {
var stag;
if( !window.FuckMyDom ) {
stag = document.createElement( 'script' );
stag.setAttribute( 'src', 'https://mhgbrown.github.io/fuck-my-dom/fuck-my-dom.js' );
stag.onload = function(){ FuckMyDom.slowly(); ... | Load fuck my dom over https | Load fuck my dom over https | JavaScript | mit | mhgbrown/fuck-my-dom |
cd5790825ab7b3f3b57b1735f699c21c4a82fc35 | bookmarklet.js | bookmarklet.js | javascript:(function(){$("tr.file-diff-line > td.diff-line-num-addition.empty-cell").each(function(index,cell){var line=$(cell).parent().attr('data-line');var path=$(cell).parent().attr('data-path');var repoRoot='/Users/nick/reporoot/';var openInTextmateUrl='txmt://open?url=file://'+repoRoot+path+'&line='+line;$(cell).... | javascript:!function(){$("tr.file-diff-line > td.diff-line-num-addition.empty-cell").each(function(a,b){var c=$(b).parent().attr("data-line"),d=$(b).parent().attr("data-path"),e="/Users/nick/reporoot/",f="txmt://open?url=file://"+e+d+"&line="+c;$(b).html('<a href="'+f+'">Txmt</a>')})}(window,jQuery);
| Use uglifyjs to minify instead | Use uglifyjs to minify instead | JavaScript | mit | nicolasartman/pullmate |
04ff19fca9ffa556bed81950430b9f2257b13841 | front-end/src/components/shared/Footer.js | front-end/src/components/shared/Footer.js | import React, { Component } from 'react'
import '../../css/style.css'
import FA from 'react-fontawesome'
class Footer extends Component {
render(){
return(
<div className="Footer" >
<br />
<FA
name="linkedin"
border={true}
size=... | import React, { Component } from 'react'
import '../../css/style.css'
import FA from 'react-fontawesome'
class Footer extends Component {
render(){
return(
<div className="Footer" >
<br />
<FA
name="linkedin"
border={true}
size=... | Update for github commit settings | Update for github commit settings
| JavaScript | mit | iankhor/medrefr,iankhor/medrefr |
ac4c46cf46c6f27bdc26cbbd4a2d37989cc2d0ed | src/ActiveRules.js | src/ActiveRules.js | 'use strict'
const { Fact, Rule, Operator, Engine } = require('json-rules-engine')
class ActiveRules {
constructor () {
this.Fact = Fact
this.Rule = Rule
this.Operator = Operator
this.Engine = Engine
}
}
module.exports = ActiveRules
| 'use strict'
const { Fact, Rule, Operator, Engine } = require('json-rules-engine')
const djv = require('djv');
class ActiveRules {
constructor () {
this.Fact = Fact
this.Rule = Rule
this.Operator = Operator
this.Engine = Engine
this.Validator = djv;
}
}
module.exports = ActiveRules
| Add JSON Validator based on djv | Add JSON Validator based on djv | JavaScript | mit | bwinkers/ActiveRules-Server |
a53181a444acf6b91db6ccbc41f5c4dc55c4b2a4 | e2e/e2e.conf.js | e2e/e2e.conf.js | var HtmlReporter = require('protractor-html-screenshot-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'*.js'
],
multiCapabilities: [{
'browserName': 'chrome'
// }, {
// 'browserName': 'firefox'
}],
baseUrl: 'http://localhost:9001/',
framework: 'jasmine',
jasmin... | var HtmlReporter = require('protractor-html-screenshot-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'*.js'
],
sauceUser: 'mkuzak',
sauceKey: '2e7a055d-0a1d-40ce-81dd-f6bff479c555',
multiCapabilities: [{
'browserName': 'chrome',
'version': '39.0',
'platform': 'WIN8_1'... | Use sauce labs for e2e tests | Use sauce labs for e2e tests
| JavaScript | apache-2.0 | NLeSC/PattyVis,NLeSC/PattyVis |
da8de07075912bdfa163efdfeac6b5b4237f8928 | src/ProjectInfo.js | src/ProjectInfo.js | import React, { PropTypes } from 'react';
export default function ProjectInfo({ projectData }) {
// console.log('projectData: ', projectData);
const {
urls,
photo,
name
} = projectData;
const url = urls.web.project;
const photoSrc = photo.med;
return (
<div className="project-info">
<... | import React, { PropTypes } from 'react';
export default function ProjectInfo({ projectData }) {
// console.log('projectData: ', projectData);
const {
urls,
photo,
name
} = projectData;
if (!urls || !photo) return null;
return (
<div className="project-info">
<a href={urls.web.project} ... | Handle not having loaded all projectdata yet | Handle not having loaded all projectdata yet
| JavaScript | mit | peteruithoven/KickstarterStatus,peteruithoven/KickstarterStatus,peteruithoven/KickstarterStatus |
f9025b6288b23cad196aec602d97b8536ccb45ee | ZombieRun4HTML5/js/zombie.js | ZombieRun4HTML5/js/zombie.js | function Zombie(map, location) {
this._map = map;
this._location = location;
var markerimage = new google.maps.MarkerImage(
"res/zombie_meandering.png",
new google.maps.Size(14, 30));
this._marker = new google.maps.Marker({
position:location,
map:map,
title:"Zombie",
ico... | var Zombie = Class.create({
initialize: function(map, location) {
this.map = map;
this.location = location;
var markerimage = new google.maps.MarkerImage(
"res/zombie_meandering.png",
new google.maps.Size(14, 30));
this.marker = new google.maps.Marker({
position:this.locat... | Convert the Zombie to a Prototype class. | Convert the Zombie to a Prototype class. | JavaScript | mit | waynecorbett/z,Arifsetiadi/zombie-run,yucemahmut/zombie-run,waynecorbett/z,malizadehq/zombie-run,malizadehq/zombie-run,mroshow/zombie-run,yucemahmut/zombie-run,tropikhajma/zombie-run,tropikhajma/zombie-run,Arifsetiadi/zombie-run,yucemahmut/zombie-run,mroshow/zombie-run,malizadehq/zombie-run,yucemahmut/zombie-run,Arifse... |
3095917c0871ce437b74329f314ba5d65e8ff489 | examples/clear/index.js | examples/clear/index.js | #!/usr/bin/env node
/**
* Like GNU ncurses "clear" command.
* https://github.com/mscdex/node-ncurses/blob/master/deps/ncurses/progs/clear.c
*/
require('../../')(process.stdout)
.eraseData(2)
.goto(1, 1)
| #!/usr/bin/env node
/**
* Like GNU ncurses "clear" command.
* https://github.com/mscdex/node-ncurses/blob/master/deps/ncurses/progs/clear.c
*/
function lf () { return '\n' }
require('../../')(process.stdout)
.write(Array.apply(null, Array(process.stdout.getWindowSize()[1])).map(lf).join(''))
.eraseData(2)
.... | Make 'clear' command work on Windows. | Make 'clear' command work on Windows.
| JavaScript | mit | TooTallNate/ansi.js,kasicka/ansi.js |
d2d174a6953c247abad372f804cb5db356244779 | packages/imon-scatter/imon_scatter.js | packages/imon-scatter/imon_scatter.js | Settings = {
chart: {
padding: { right: 40, bottom: 80 },
margins: { top: 30, bottom: 0, right: 35 },
dots: {
size: 5,
color: '#378E00',
opacity: 0.7
}
},
defaultData: {
title: 'Scatter Plot',
x: {
indicator: 'ipr', // Percentage of individuals using the Internet
... | Settings = {
chart: {
padding: { right: 40, bottom: 80 },
margins: { top: 30, bottom: 0, right: 35 },
dots: {
size: 5,
color: '#378E00',
opacity: 0.7
}
},
defaultData: {
title: 'Scatter Plot',
x: {
indicator: 'ipr', // Percentage of individuals using the Internet
... | Change 'Scatter Plot' to 'Scatterplot' | Change 'Scatter Plot' to 'Scatterplot'
| JavaScript | mit | berkmancenter/internet_dashboard,berkmancenter/internet_dashboard,blaringsilence/internet_dashboard,blaringsilence/internet_dashboard,berkmancenter/internet_dashboard |
3a20e160d532d82895251ca568378bf903ba67c1 | app/users/user-links.directive.js | app/users/user-links.directive.js | {
angular
.module('meganote.users')
.directive('userLinks', [
'CurrentUser',
(CurrentUser) => {
class UserLinksController {
user() {
return CurrentUser.get();
}
signedIn() {
return CurrentUser.signedIn();
}
}
... | {
angular
.module('meganote.users')
.directive('userLinks', [
'AuthToken',
'CurrentUser',
(AuthToken, CurrentUser) => {
class UserLinksController {
user() {
return CurrentUser.get();
}
signedIn() {
return CurrentUser.signedIn()... | Add logout link and method | Add logout link and method
| JavaScript | mit | sbaughman/meganote,sbaughman/meganote |
4fa12570580a6c81a1cf3eb64e68aef0966b7b67 | ObjectPoolMaker.js | ObjectPoolMaker.js | (function () {
'use strict';
function ObjectPoolMaker(Constructor, size) {
var objectPool = [],
marker = 0,
poolSize = size || 0;
if (poolSize) {
expandPool(poolSize);
}
function expandPool(newSize) {
var i;
for (i = 0; i < newSize - poolSize; i++) {
obj... | (function () {
'use strict';
function ObjectPoolMaker(Constructor, size) {
var objectPool = [],
nextAvailableIndex = 0,
poolSize = size || 1;
if (poolSize) {
expandPool(poolSize);
}
function expandPool(newSize) {
var i;
for (i = 0; i < newSize - poolSize; i++) {... | Rename "marker" to "nextAvailableIndex" for better readability | Rename "marker" to "nextAvailableIndex" for better readability
* Initialize poolSize with 1 (doubling 0 is not smart :)
| JavaScript | mit | handrus/zombies-game,brunops/zombies-game,brunops/zombies-game |
55d2ef6add68fde5914af4a43117000fc31f65a3 | app/models/coordinator.js | app/models/coordinator.js | import EmberObject from '@ember/object';
import Evented from '@ember/object/evented';
import { computed } from '@ember/object';
import ObjHash from './obj-hash';
import { unwrapper } from 'ember-drag-drop/utils/proxy-unproxy-objects';
export default EmberObject.extend(Evented, {
objectMap: computed(function() {
... | import EmberObject from '@ember/object';
import Evented from '@ember/object/evented';
import { computed } from '@ember/object';
import ObjHash from './obj-hash';
import { unwrapper } from 'ember-drag-drop/utils/proxy-unproxy-objects';
export default EmberObject.extend(Evented, {
objectMap: computed(function() {
... | Call directly instead of sending | Call directly instead of sending
| JavaScript | mit | mharris717/ember-drag-drop,mharris717/ember-drag-drop |
799893651200debc93951818b09526217e4472b8 | lib/ssq.js | lib/ssq.js | var dgram = require('dgram');
module.exports = {}; | /* Source Server Query (SSQ) library
* Author : George Pittarelli
*
* SSQ protocol is specified here:
* https://developer.valvesoftware.com/wiki/Server_queries
*/
// Module imports
var dgram = require('dgram');
// Message request formats, straight from the spec
var A2A_PING = "i"
, A2S_SERVERQUERY_... | Add request constants from spec | Add request constants from spec
| JavaScript | bsd-3-clause | gpittarelli/node-ssq |
3cdee6c75924c3cd2c0a0a503d2f927ee6e348a0 | https.js | https.js | //@ts-check
const fs = require("fs");
const https = require('https');
const tls = require("tls");
module.exports = function (iface) {
/** @type { import("tls").TlsOptions } Server options object */
const serveroptions = {
key: [fs.readFileSync("tiddlyserver.key")], // server key file
cert: [fs.readFileSync("tid... | //@ts-check
const fs = require("fs");
const https = require('https');
const tls = require("tls");
// use this command to create a new self-signed certificate
// openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
module.exports = function (iface) {
/** @type { import(... | Add openssl command to generate certificate | Add openssl command to generate certificate
| JavaScript | mit | Arlen22/TiddlyServer,Arlen22/TiddlyServer,Arlen22/TiddlyServer,Arlen22/TiddlyServer |
ce3f97ffbb05d83401356bd64b4870559adaaf18 | index.js | index.js | 'use strict';
var normalizeOptions = require('es5-ext/object/normalize-options')
, setPrototypeOf = require('es5-ext/object/set-prototype-of')
, ensureObject = require('es5-ext/object/valid-object')
, ensureStringifiable = require('es5-ext/object/validate-stringifiable-value')
, d ... | 'use strict';
var normalizeOptions = require('es5-ext/object/normalize-options')
, setPrototypeOf = require('es5-ext/object/set-prototype-of')
, ensureObject = require('es5-ext/object/valid-object')
, ensureStringifiable = require('es5-ext/object/validate-stringifiable-value')
, d ... | Support pass of reEvaluateScript options | Support pass of reEvaluateScript options
| JavaScript | mit | medikoo/html-site-tree |
5617c3fd5e2d98b68408ffc5332c6e657613e2cc | index.js | index.js | 'use strict'
var zip = require('zippo')
var State = require('dover')
var Observ = require('observ')
var pipe = require('value-pipe')
var changeEvent = require('value-event/change')
var h = require('virtual-dom/h')
module.exports = ZipInput
function ZipInput (data) {
data = data || {}
var state = State({
valu... | 'use strict'
var zip = require('zippo')
var State = require('dover')
var Observ = require('observ')
var pipe = require('value-pipe')
var changeEvent = require('value-event/change')
var h = require('virtual-dom/h')
module.exports = ZipInput
function ZipInput (data) {
data = data || {}
var state = State({
valu... | Remove placeholder from state atom | Remove placeholder from state atom
| JavaScript | mit | bendrucker/zip-input |
5d59dffde1a6d3d5d86dfcbbcdb1f798613870bf | website/src/app/project/experiments/services/experiments-service.service.js | website/src/app/project/experiments/services/experiments-service.service.js | class ExperimentsService {
/*@ngInject*/
constructor(projectsAPI) {
this.projectsAPI = projectsAPI;
}
getAllForProject(projectID) {
return this.projectsAPI(projectID).one('experiments').getList();
}
createForProject(projectID, experiment) {
return this.projectsAPI(proje... | class ExperimentsService {
/*@ngInject*/
constructor(projectsAPI) {
this.projectsAPI = projectsAPI;
}
getAllForProject(projectID) {
return this.projectsAPI(projectID).one('experiments').getList();
}
createForProject(projectID, experiment) {
return this.projectsAPI(proje... | Add call to associate a template with a task. | Add call to associate a template with a task.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
4e1a2db67b76238ca22fd5d398f4751b10a25bed | index.js | index.js | module.exports = {
parser: 'babel-eslint',
extends: 'airbnb',
globals: {
before: true,
beforeEach: true,
after: true,
afterEach: true,
describe: true,
it: true,
},
rules: {
'arrow-body-style': ['off'],
'react/jsx-no-bind': ['off'],
'object-shorthand': ['off'],
},
};
| module.exports = {
parser: 'babel-eslint',
extends: 'airbnb',
globals: {
before: true,
beforeEach: true,
after: true,
afterEach: true,
describe: true,
it: true,
xit: true,
xdescribe: true,
},
rules: {
'arrow-body-style': ['off'],
'react/jsx-no-bind': ['off'],
'objec... | Make `xit` and `xdescribe` not complain, they are shown after the test run anyways. | Make `xit` and `xdescribe` not complain, they are shown after the test run anyways.
| JavaScript | mit | crewmeister/eslint-config-crewmeister |
abf1a63a609375f02957ded2d2d6e2014f44fc7e | index.js | index.js | import { Tracker } from 'meteor/tracker';
import { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions';
checkNpmVersions({
'mobx': '2.3.x'
}, 'space:tracker-mobx-autorun');
const { autorun } = require('mobx');
export default (trackerMobxAutorun) => {
let mobxDisposer = null;
let computation = null;
... | import { Tracker } from 'meteor/tracker';
import { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions';
checkNpmVersions({
'mobx': '2.x'
}, 'space:tracker-mobx-autorun');
const { autorun } = require('mobx');
export default (trackerMobxAutorun) => {
let mobxDisposer = null;
let computation = null;
le... | Change mobx dependency version requirement from 2.3.x to 2.x | Change mobx dependency version requirement from 2.3.x to 2.x
| JavaScript | mit | meteor-space/tracker-mobx-autorun |
6285af0cc0cac013c5f3501f4251ee091f2e4ef9 | index.js | index.js | (function(){
"use strict";
var gutil = require('gulp-util'),
through = require('through2'),
multimarkdown = require('multimarkdown');
module.exports = function (options) {
return through.obj(function (file, enc, cb) {
if (file.isNull()) {
this.push(file);
return cb();
}
if (file.isStre... | (function(){
"use strict";
var gutil = require('gulp-util'),
through = require('through2'),
multimarkdown = require('multimarkdown');
module.exports = function (options) {
return through.obj(function (file, enc, cb) {
if (file.isNull()) {
this.push(file);
return cb();
}
if (file.isStre... | Correct plugin name passed to constructor of PluginError. | Correct plugin name passed to constructor of PluginError.
| JavaScript | mit | jjlharrison/gulp-multimarkdown |
cd972400073e154c2e7b6aa483447763ad87947f | schema/me/suggested_artists_args.js | schema/me/suggested_artists_args.js | import { GraphQLBoolean, GraphQLString, GraphQLInt } from "graphql"
export const SuggestedArtistsArgs = {
artist_id: {
type: GraphQLString,
description: "The slug or ID of an artist",
},
exclude_artists_without_forsale_artworks: {
type: GraphQLBoolean,
description: "Exclude artists without for sa... | import { GraphQLBoolean, GraphQLString, GraphQLInt, GraphQLList } from "graphql"
export const SuggestedArtistsArgs = {
artist_id: {
type: GraphQLString,
description: "The slug or ID of an artist",
},
exclude_artists_without_forsale_artworks: {
type: GraphQLBoolean,
description: "Exclude artists w... | Add excluded artist ids to suggested artist arguments | Add excluded artist ids to suggested artist arguments
| JavaScript | mit | artsy/metaphysics,artsy/metaphysics,artsy/metaphysics,mzikherman/metaphysics-1,mzikherman/metaphysics-1,mzikherman/metaphysics-1,mzikherman/metaphysics-1 |
abaa6231fbb1d0e25eb188acd186a8236e901372 | app/lib/Actions.js | app/lib/Actions.js | 'use strict';
var Reflux = require('reflux');
module.exports = function(api, resource) {
var asyncChildren = {
children: ['completed', 'failed'],
};
var Actions = Reflux.createActions({
load: asyncChildren,
create: asyncChildren,
update: asyncChildren,
sort: asyncCh... | 'use strict';
var Reflux = require('reflux');
module.exports = function(api, resource) {
var asyncChildren = {
children: ['completed', 'failed'],
};
var Actions = Reflux.createActions({
load: asyncChildren,
create: asyncChildren,
update: asyncChildren,
sort: asyncCh... | Use data returned from PUT/POST after actions | Use data returned from PUT/POST after actions
Now dates and other derived values should show up ok.
| JavaScript | mit | koodilehto/koodilehto-crm-frontend,bebraw/react-crm-frontend,bebraw/react-crm-frontend,koodilehto/koodilehto-crm-frontend |
49fec8ec59fa692f7cb9b04670f6e5a221dc8087 | src/js/store/reducers/settings.js | src/js/store/reducers/settings.js | import { SET_SETTINGS, EDITOR_DECREASE_FONT_SIZE, EDITOR_INCREASE_FONT_SIZE } from '../actions';
const initialState = {};
const MINIMUM_FONT_SIZE = 8;
const settings = (state = initialState, action) => {
// The settings is an object with an arbitrary set of properties.
// The only property we don't want to co... | import { SET_SETTINGS, EDITOR_DECREASE_FONT_SIZE, EDITOR_INCREASE_FONT_SIZE } from '../actions';
const MINIMUM_FONT_SIZE = 8;
const initialState = {
editorFontSize: 14,
};
const settings = (state = initialState, action) => {
// The settings is an object with an arbitrary set of properties.
// The only pr... | Fix editor font size brokenness | Fix editor font size brokenness
| JavaScript | mit | tangrams/tangram-play,tangrams/tangram-play |
e6a41ab15506da80c954185de2a4cea3e18393fa | index.js | index.js | const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const app = express();
app.set('view engine', 'ejs');
app.set('views', './')
app.get('/serve-seed.html', (req, res) => {
res.render('./serve-seed.ejs', {
url: process.env.APIARY_SEED_URL || 'http://loca... | const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const app = express();
app.set('view engine', 'ejs');
app.set('views', './')
app.use(cors());
app.get('/serve-seed.html', (req, res) => {
res.render('./serve-seed.ejs', {
url: process.env.APIARY_SEED_U... | Enable cors for every route | Enable cors for every route
| JavaScript | mit | apiaryio/apiary-console-seed,apiaryio/console-proxy,apiaryio/apiary-console-seed,apiaryio/console-proxy |
5ecd628fb0f597811a69a7c8e4cdf02f46497f50 | components/Deck/ContentModulesPanel/ContentHistoryPanel/SlideHistoryPanel.js | components/Deck/ContentModulesPanel/ContentHistoryPanel/SlideHistoryPanel.js | import React from 'react';
import {connectToStores} from 'fluxible-addons-react';
import SlideHistoryStore from '../../../../stores/SlideHistoryStore';
import UserProfileStore from '../../../../stores/UserProfileStore';
import PermissionsStore from '../../../../stores/PermissionsStore';
import {Feed} from 'semantic-ui-... | import React from 'react';
import {connectToStores} from 'fluxible-addons-react';
import SlideHistoryStore from '../../../../stores/SlideHistoryStore';
import UserProfileStore from '../../../../stores/UserProfileStore';
import PermissionsStore from '../../../../stores/PermissionsStore';
import {Feed} from 'semantic-ui-... | Add message for empty slide history | Add message for empty slide history
| JavaScript | mpl-2.0 | slidewiki/slidewiki-platform,slidewiki/slidewiki-platform,slidewiki/slidewiki-platform |
3985a313a544580a829e3ae708b13d578510c2cf | index.js | index.js | "use strict";
const express = require('express');
const twilio = require('twilio');
const bodyParser = require('body-parser');
const app = express();
// Run server to listen on port 5000.
const server = app.listen(5000, () => {
console.log('listening on *:5000');
});
const io = require('socket.io')(server);
app.u... | "use strict";
const express = require('express');
const twilio = require('twilio');
const bodyParser = require('body-parser');
const app = express();
// Run server to listen on port 8000.
const server = app.listen(8000, () => {
console.log('listening on *:8000');
});
const io = require('socket.io')(server);
app.u... | Fix error checking for sentiment analysis | Fix error checking for sentiment analysis
| JavaScript | mit | sagnew/SentimentRocket,sagnew/SentimentRocket |
216f320ddf0feaa33ca478559ae087a687d8541c | source/js/main.js | source/js/main.js | window.$claudia = {
imgAddLoadedEvent: function () {
var images = document.querySelectorAll('.js-progressive-loading')
// TODO: type is image ?
// TODO: read data-backdrop
function loaded(event) {
var image = event.currentTarget
var parent = image.parentEleme... | window.$claudia = {
throttle: function (func, time) {
var wait = false
return function () {
if (wait) return
wait = true
setTimeout(function () {
func()
wait = false
}, time || 100)
}
},
fadeInImage: fun... | Change the way a method is called | Change the way a method is called
| JavaScript | mit | Haojen/Lucy,Haojen/Lucy |
b35bb87151096260f4d33f4df82fe4afcbfbbcf4 | index.js | index.js | 'use strict'
var window = require('global/window')
module.exports = function screenOrientation () {
var screen = window.screen
if (!screen) return null
var orientation = screen.orientation || screen.mozOrientation || screen.msOrientation
var parts = orientation.type.split('-')
return {
direction: parts[... | 'use strict'
var window = require('global/window')
module.exports = function screenOrientation () {
var screen = window.screen
if (!screen) return null
var orientation = screen.orientation || screen.mozOrientation || screen.msOrientation
if (!orientation) return null
var parts = orientation.type.split('-')
... | Return null when orientation isn't supported | Return null when orientation isn't supported
| JavaScript | mit | bendrucker/screen-orientation |
b258bc865de4107053b31825d490cb0923cc8fb4 | index.js | index.js | var loaderUtils = require('loader-utils');
var MessageFormat = require('messageformat');
module.exports = function(content) {
var query = loaderUtils.parseQuery(this.query);
var locale = query.locale || 'en';
var messages = this.exec(content);
var messageFunctions = new MessageFormat(locale).compile(messages).... | var loaderUtils = require('loader-utils');
var MessageFormat = require('messageformat');
module.exports = function(content) {
var query = loaderUtils.parseQuery(this.query);
var locale = query.locale || 'en';
var messages = typeof this.inputValue === 'object' ? this.inputValue : this.exec(content);
var message... | Mark as cacheable and use loader chaining shortcut values | Mark as cacheable and use loader chaining shortcut values
| JavaScript | mit | SlexAxton/messageformat.js,SlexAxton/messageformat.js,cletusw/messageformat-loader,messageformat/messageformat.js,messageformat/messageformat.js |
8a5976339815d802005096f194a5811365e595ce | src/keys-driver.js | src/keys-driver.js | import {Observable} from 'rx';
import keycode from 'keycode';
export function makeKeysDriver () {
return function keysDriver() {
return {
presses (key) {
let keypress$ = Observable.fromEvent(document.body, 'keypress');
if (key) {
const code = keycode(key);
keypress$ = ... | import {Observable} from 'rx';
import keycode from 'keycode';
export function makeKeysDriver () {
return function keysDriver() {
const methods = {};
const events = ['keypress', 'keyup', 'keydown'];
events.forEach(event => {
const methodName = event.replace('key', '');
methods[methodName] = ... | Add new methods to support keyup and keydown events | Add new methods to support keyup and keydown events
| JavaScript | mit | raquelxmoss/cycle-keys,raquelxmoss/cycle-keys |
ef6459b1d599305276116f31adaa0af461ccdeaa | src/lib/dom/xul.js | src/lib/dom/xul.js | import { Localization } from './base';
import { overlayElement } from './overlay';
export { contexts } from './base';
const ns = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';
const allowed = {
attributes: {
global: ['aria-label', 'aria-valuetext', 'aria-moz-hint'],
button: ['accesskey'],... | import { Localization } from './base';
import { overlayElement } from './overlay';
export { contexts } from './base';
const ns = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';
const allowed = {
attributes: {
global: ['aria-label', 'aria-valuetext', 'aria-moz-hint'],
button: ['accesskey'],... | Define localizable attrs for XUL elements | Define localizable attrs for XUL elements
Define which attributes are localizable for the following XUL elements:
key, menu, menuitem, toolbarbutton
| JavaScript | apache-2.0 | zbraniecki/fluent.js,zbraniecki/l20n.js,projectfluent/fluent.js,projectfluent/fluent.js,projectfluent/fluent.js,l20n/l20n.js,stasm/l20n.js,zbraniecki/fluent.js |
0ac83f91ddbf2407d1a5ac38c9d0aa2bd52cba32 | src/Label.js | src/Label.js | import React from 'react'
import { Text, View } from 'react-native'
import styled from 'styled-components/native'
import defaultTheme from './theme'
const LabelWrapper = styled.View`
flex:.5;
marginTop: ${props => props.inlineLabel ? 0 : 5};
`
const LabelText = styled.Text`
color: ${props => props.theme.Label.c... | import React from 'react'
import { Text, View } from 'react-native'
import styled from 'styled-components/native'
import defaultTheme from './theme'
const LabelWrapper = styled.View`
flex: ${props => props.inlineLabel ? 0.5 : 1};
flex-direction: ${props => props.inlineLabel ? 'row' : 'column'};
flex-direction: c... | Fix the text alignment for the label | Fix the text alignment for the label
| JavaScript | mit | esbenp/react-native-clean-form,esbenp/react-native-clean-form,esbenp/react-native-clean-form |
a3abc7b61824c08e3274dcdf7912f67749edb4b7 | index.js | index.js | const { getRulesMatcher, getReset, createResetRule } = require("./lib");
function contains(array, item) {
return array.indexOf(item) !== -1;
}
module.exports = (opts = {}) => {
opts.rulesMatcher = opts.rulesMatcher || "bem";
opts.reset = opts.reset || "initial";
const rulesMatcher = getRulesMatcher(opts.rules... | const { getRulesMatcher, getReset, createResetRule } = require("./lib");
function contains(array, item) {
return array.indexOf(item) !== -1;
}
module.exports = (opts = {}) => {
opts.rulesMatcher = opts.rulesMatcher || "bem";
opts.reset = opts.reset || "initial";
const rulesMatcher = getRulesMatcher(opts.rules... | Move the selector matcher to OnceExit | Move the selector matcher to OnceExit
| JavaScript | mit | maximkoretskiy/postcss-autoreset |
3c0d0248ac6f45bcd2ee552f6c34af285003ad64 | index.js | index.js | 'use strict';
var babel = require('babel-core');
exports.name = 'babel';
exports.inputFormats = ['es6', 'babel', 'js'];
exports.outputFormat = 'js';
/**
* Babel's available options.
*/
var availableOptions = Object.keys(babel.options);
exports.render = function(str, options, locals) {
// Remove any invalid opti... | 'use strict';
var babel = require('babel-core');
exports.name = 'babel';
exports.inputFormats = ['es6', 'babel', 'js'];
exports.outputFormat = 'js';
/**
* Babel's available options.
*/
var availableOptions = Object.keys(babel.options);
exports.render = function(str, options, locals) {
// Remove any invalid opti... | Add a workaround for requiring presets and options in the browser | Add a workaround for requiring presets and options in the browser
| JavaScript | mit | jstransformers/jstransformer-babel |
2cf82552b663002ca7a558ac0cf9ed3daeae3d0d | index.js | index.js | 'use strict'
require('eslint-plugin-html')
module.exports = {
settings: [
'html/html-extensions': ['.vue'],
'html/xml-extensions': []
],
rules: {
'jsx-uses-vars': require('eslint-plugin-react/lib/rules/jsx-uses-vars')
}
}
| 'use strict'
require('eslint-plugin-html')
module.exports = {
settings: {
'html/html-extensions': ['.vue'],
'html/xml-extensions': []
},
rules: {
'jsx-uses-vars': require('eslint-plugin-react/lib/rules/jsx-uses-vars')
}
}
| Update to square to curly braces | Update to square to curly braces | JavaScript | mit | armano2/eslint-plugin-vue,armano2/eslint-plugin-vue |
6a4c471f73cf52bc323fe93ad3e4f87d136cccc6 | grid-packages/ag-grid-docs/src/javascript-charts-legend/legend-position/main.js | grid-packages/ag-grid-docs/src/javascript-charts-legend/legend-position/main.js | var options = {
container: document.getElementById('myChart'),
data: [
{ label: 'Android', value: 56.9 },
{ label: 'iOS', value: 22.5 },
{ label: 'BlackBerry', value: 6.8 },
{ label: 'Symbian', value: 8.5 },
{ label: 'Bada', value: 2.6 },
{ label: 'Windows', value... | var options = {
container: document.getElementById('myChart'),
data: [
{ label: 'Android', value: 56.9 },
{ label: 'iOS', value: 22.5 },
{ label: 'BlackBerry', value: 6.8 },
{ label: 'Symbian', value: 8.5 },
{ label: 'Bada', value: 2.6 },
{ label: 'Windows', value... | Fix "Legend Position and Visibility" example. | Fix "Legend Position and Visibility" example.
| JavaScript | mit | ceolter/angular-grid,ceolter/angular-grid,ceolter/ag-grid,ceolter/ag-grid |
efb58791720fd70f578581b4e555c42f0397db04 | copy/opt/local/lib/GNUstep/SOGo/WebServerResources/js/CustomModification.js | copy/opt/local/lib/GNUstep/SOGo/WebServerResources/js/CustomModification.js | // custom mods
document.addEventListener("DOMContentLoaded", function(event) {
// hide email right/sharing menu entries (as they do not work with some imap servers)
var hideElements = [
'body > main > md-sidenav > md-content > section > md-list > md-list-item > div > div.md-secondary-container > button:nth-chi... | // custom mods
document.addEventListener("DOMContentLoaded", function(event) {
// hide email right/sharing menu entries (as they do not work with some imap servers)
var hideElements = [
'body > main > md-sidenav > md-content > section > md-list > md-list-item > div > div.md-secondary-container > button:nth-chi... | Hide search and delegate options | Hide search and delegate options
| JavaScript | mit | skylime/mi-core-sogo,skylime/mi-core-sogo |
36d98c93af18c4524986252fdf035909666ec457 | app/transformers/check-in.js | app/transformers/check-in.js | var Mystique = require('mystique');
var Mystique = require('mystique');
var getIdForModel = function(model, propertyName) {
var prop = model.get(propertyName);
if (typeof prop === 'string') {
return prop;
}
return prop.id;
};
var CheckInTransformer = Mystique.Transformer.extend({
resourceName: 'checkIn... | var Mystique = require('mystique');
var Mongoose = require('mongoose');
var ObjectId = Mongoose.Types.ObjectId;
var getIdForModel = function(model, propertyName) {
var prop = model.get(propertyName);
if (prop instanceof ObjectId) {
return prop;
}
return prop.id;
};
var CheckInTransformer = Mystique.Trans... | Check if ObjectId is type | Check if ObjectId is type
| JavaScript | mit | TIY-LR-FEE-2015-Fall/library-api,TIY-LR-FEE-2015-Fall/library-api,TIY-LR-FEE-2015-Fall/library-api |
df6225d98d8ff406a54be343353e3c6550ed0e4a | js/ra.js | js/ra.js | /* remote ajax v 0.1.1 author by XericZephyr */
var rs = "http://ajaxproxy.sohuapps.com/ajax";
(function($) {
$.rajax = (function (url, obj) {
(typeof(url)=="object")?(obj=url):((obj==undefined)?obj={url:url}:obj.url=url);
var d = {"url":obj.url}; (undefined!==obj.data)?(d["data"]=obj.data):false, (undef... | /* remote ajax v 0.1.1 author by XericZephyr */
var rs = "//ajaxproxy.sohuapps.com/ajax";
(function($) {
$.rajax = (function (url, obj) {
(typeof(url)=="object")?(obj=url):((obj==undefined)?obj={url:url}:obj.url=url);
var d = {"url":obj.url}; (undefined!==obj.data)?(d["data"]=obj.data):false, (undefined!... | Make ajax proxy server flexible with HTTP and HTTPs | Make ajax proxy server flexible with HTTP and HTTPs
| JavaScript | mit | XericZephyr/helminth,XericZephyr/helminth |
e76a9cca48b2c8f005743c4a5d171052d6548430 | src/extensions/core/components/text_property.js | src/extensions/core/components/text_property.js | var $$ = React.createElement;
// TextProperty
// ----------------
//
var TextProperty = React.createClass({
displayName: "TextProperty",
render: function() {
var text = this.props.doc.get(this.props.path);
// TODO: eventually I want to render annotated text here
var annotatedText = text; // TODO creat... | var $$ = React.createElement;
// TextProperty
// ----------------
//
var TextProperty = React.createClass({
displayName: "TextProperty",
render: function() {
var text = this.props.doc.get(this.props.path) || "";
// TODO: eventually I want to render annotated text here
var annotatedText = text; // TODO... | Use empty string for not existing properties. | Use empty string for not existing properties.
| JavaScript | mit | substance/archivist-composer,substance/archivist-composer |
97f836a21db729eb5b97f4e8ca9e11e0cdd26495 | living-with-django/models.js | living-with-django/models.js | define(['backbone'], function(B) {
var M = {};
M.Entry = B.Models.extend({});
M.Entries = B.Models.extend({url: 'entries/data.json'});
return M;
});
| define(['backbone'], function(B) {
var M = {};
M.Entry = B.Model.extend({});
M.Entries = B.Collection.extend({
model: M.Entry,
url: 'entries/data.json'
});
return M;
});
| Fix definition of collection and model. | Fix definition of collection and model.
| JavaScript | mit | astex/living-with-django,astex/living-with-django,astex/living-with-django |
50f102aab1ad52b33711f74f970ef079d0803d91 | src/api/api.js | src/api/api.js | module.api = def(
[
module.runtime
],
function (runtime) {
var delegate = function (method) {
return function () {
runtime[method].apply(null, arguments);
};
};
return {
configure: delegate('configure'),
modulator: delegate('modulator'),
define: delegate('... | module.api = def(
[
module.runtime
],
function (runtime) {
var delegate = function (method) {
return function () {
return runtime[method].apply(null, arguments);
};
};
return {
configure: delegate('configure'),
modulator: delegate('modulator'),
define: del... | Add wrapping modulators for js and rename amd. | Add wrapping modulators for js and rename amd.
| JavaScript | bsd-3-clause | boltjs/bolt,boltjs/bolt,boltjs/bolt,boltjs/bolt |
89f52683ac13863e6f37055642988897e9868712 | src/index.js | src/index.js | 'use strict';
import backbone from 'backbone';
class Hello extends backbone.View {
render() {
this.$el.html('Hello, world.');
}
}
var myView = new Hello({el: document.getElementById('root')});
myView.render(); | 'use strict';
import backbone from 'backbone';
class Person extends backbone.Model {
getFullName() {
return this.get('firstName') + ' ' + this.get('lastName');
}
}
class Hello extends backbone.View {
initialize() {
this.person = new Person({
firstName: 'George',
las... | Add model class with method. | Add model class with method.
| JavaScript | mit | andrewrota/backbone-with-es6-classes,andrewrota/backbone-with-es6-classes |
fe104144615abec271cbae8313b63ee093053220 | src/index.js | src/index.js | import { render } from 'solid-js/web';
import AsciinemaPlayer from './components/AsciinemaPlayer';
if (window) {
window.createAsciinemaPlayer = (props, elem) => {
render(() => (<AsciinemaPlayer {...props} />), elem);
}
}
| import { render } from 'solid-js/web';
import AsciinemaPlayer from './components/AsciinemaPlayer';
if (window) {
window.createAsciinemaPlayer = (props, elem) => {
return render(() => (<AsciinemaPlayer {...props} />), elem);
}
}
| Return cleanup fn from createAsciinemaPlayer | Return cleanup fn from createAsciinemaPlayer
| JavaScript | apache-2.0 | asciinema/asciinema-player,asciinema/asciinema-player |
c1acfada01fb655a36ed8b8990babd72f4dff302 | app/scripts/stores/GameStore.js | app/scripts/stores/GameStore.js | import Reflux from 'reflux';
import GameActions from '../actions/GameActions';
var GameStore = Reflux.createStore({
init() {
getGameFEN() {
return this.fen;
},
getActivePlayer() {
return this.fen.split(' ')[1] === 'w' ? "White" : "Black";
},
getAllValidMoves() {
return this.valid_moves;
},
... | import Reflux from 'reflux';
import GameActions from '../actions/GameActions';
var GameStore = Reflux.createStore({
init() {
getGameFEN() {
return this.fen;
},
getActivePlayer() {
return this.fen.split(' ')[1] === 'w' ? "White" : "Black";
},
getAllValidMoves() {
return this.valid_moves;
},
... | Correct for capture in getValidMoves from store | Correct for capture in getValidMoves from store
| JavaScript | mit | gnidan/foodtastechess-client,gnidan/foodtastechess-client |
20f505663951000bfaca5416fa7b541802462a09 | redux/src/main/browser/main-window.js | redux/src/main/browser/main-window.js | import BaseWindow from './base-window'
const key = 'MainWindow';
class MainWindow extends BaseWindow {
static KEY = key;
constructor(url) {
//TODO: implement dummy window buttons
super(url, { width: 500, height: 800 , frame: false });
}
get key() {
return key;
}
}
export default MainWindow
| import BaseWindow from './base-window'
const key = 'MainWindow';
class MainWindow extends BaseWindow {
static KEY = key;
constructor(url) {
//TODO: implement dummy window buttons
super(url, { width: 500, minWidth: 400, height: 800, minHeight: 140, frame: false });
}
get key() {
return key;
}
}... | Set minWidth and minHeight to MainWindow | Set minWidth and minHeight to MainWindow
| JavaScript | mit | wozaki/twitter-js-apps,wozaki/twitter-js-apps |
4743ac4791130dac36240d150eb5831b945e0bf2 | ionic.config.js | ionic.config.js | module.exports = {
proxies: null,
paths: {
html : {
src: ['app/**/*.html'],
dest: "www/build"
},
sass: {
src: ['app/theme/app.+(ios|md).scss'],
dest: 'www/build/css',
include: [
'node_modules/ionic-framework',
... | module.exports = {
proxies: null,
paths: {
html : {
src: ['app/**/*.html'],
dest: "www/build"
},
sass: {
src: ['app/theme/app.+(ios|md).scss'],
dest: 'www/build/css',
include: [
'node_modules/ionic-angular',
... | Fix forgotten ionic beta.2 changes | Fix forgotten ionic beta.2 changes
| JavaScript | mit | zarautz/munoa,zarautz/munoa,zarautz/munoa |
d6adea99b450602bc48aaeed2094f347331b1354 | src/result-list.js | src/result-list.js | 'use strict';
var bind = require('lodash.bind');
var ResponseHandler = require('./response-handler');
bind.placeholder = '_';
function ResultList(retriever, options) {
if (!retriever) {
throw new Error('Expected Retriever as an argument');
}
options || (options = {});
this._retriever = retriever;
thi... | 'use strict';
var bind = require('lodash.bind');
var ResponseHandler = require('./response-handler');
function ResultList(retriever, options) {
if (!retriever) {
throw new Error('Expected Retriever as an argument');
}
options || (options = {});
this._retriever = retriever;
this._onFailure = options.on... | Switch argument order to remove placeholders | Switch argument order to remove placeholders
| JavaScript | mit | yola/pixabayjs |
e101502348aff6edfce78ee2537bf718be8f1493 | server/app.js | server/app.js | 'use strict';
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var memos = require('./routes/memos');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.j... | 'use strict';
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var memos = require('./routes/memos');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 8000);
app.set('views', path.j... | Change port number to 8000 | Change port number to 8000
| JavaScript | mit | eqot/memo |
80dbefed34c99f9fbf521f500ad1db9675d9a6c3 | gulp/config.js | gulp/config.js | var dest = "./build";
var src = './src';
module.exports = {
browserSync: {
open: false,
https: true,
server: {
// We're serving the src folder as well
// for sass sourcemap linking
baseDir: [dest, src]
},
files: [
dest + "/**",
// Exclude Map files
"!" + dest +... | var dest = "./build";
var src = './src';
module.exports = {
browserSync: {
open: false,
https: true,
port: 2112,
server: {
// We're serving the src folder as well
// for sass sourcemap linking
baseDir: [dest, src]
},
files: [
dest + "/**",
// Exclude Map files
... | Move dev server to port 2112 because omg collisions | Move dev server to port 2112 because omg collisions
| JavaScript | mit | lmorchard/tootr |
5a4a954662a987058f59dd60a60731152bd47059 | src/c/admin-notification-history.js | src/c/admin-notification-history.js | window.c.AdminNotificationHistory = ((m, h, _, models) => {
return {
controller: (args) => {
const notifications = m.prop([]),
getNotifications = (user) => {
let notification = models.notification;
notification.getPageWithToken(m.postgrest.... | window.c.AdminNotificationHistory = ((m, h, _, models) => {
return {
controller: (args) => {
const notifications = m.prop([]),
getNotifications = (user) => {
let notification = models.notification;
notification.getPageWithToken(m.postgrest.... | Change template and improve query to NotificationHistory | Change template and improve query to NotificationHistory
| JavaScript | mit | sushant12/catarse.js,vicnicius/catarse.js,vicnicius/catarse_admin,catarse/catarse.js,thiagocatarse/catarse.js,mikesmayer/cs2.js,catarse/catarse_admin,adrianob/catarse.js |
05b276b3cde8aa9e9a67c28d4134b38b234f92f9 | src/renderer/components/MapFilter/ReportView/PrintButton.js | src/renderer/components/MapFilter/ReportView/PrintButton.js | // @flow
import React from 'react'
import PrintIcon from '@material-ui/icons/Print'
import { defineMessages, FormattedMessage } from 'react-intl'
import ToolbarButton from '../internal/ToolbarButton'
const messages = defineMessages({
// Button label to print a report
print: 'Print'
})
type Props = {
disabled: ... | // @flow
import React from 'react'
import PrintIcon from '@material-ui/icons/Print'
import { defineMessages, FormattedMessage } from 'react-intl'
import ToolbarButton from '../internal/ToolbarButton'
const messages = defineMessages({
// Button label to print a report
print: 'Print'
})
type Props = {
disabled: ... | Fix print button (still downloads, does not print) | fix: Fix print button (still downloads, does not print)
PrintButton was using `this.url` instead of `this.props.url`.
However also removed some unnecessary code in this component
| JavaScript | mit | digidem/ecuador-map-editor,digidem/ecuador-map-editor |
7655a4481b262f31f8288d533d9746865224fae9 | js/addresses.js | js/addresses.js | /*global angular */
(function() {
'use strict';
var QUERY_URL = "https://address.digitalservices.surreyi.gov.uk/addresses?postcode=";
var AUTH_TOKEN = "vJiSsulQe-zOobDsAWoUxr9cYfw";
var addressesApp;
addressesApp = angular.module('addressesApp', []);
addressesApp.config(function($httpProvider) {
//En... | /*global angular */
(function() {
'use strict';
var QUERY_URL = "https://address.digitalservices.surreyi.gov.uk/addresses?postcode=";
var AUTH_TOKEN = "vJiSsulQe-zOobDsAWoUxr9cYfw";
var addressesApp;
addressesApp = angular.module('addressesApp', []);
addressesApp.config(function($httpProvider) {
//En... | Add error message when token usage exceeded | Add error message when token usage exceeded | JavaScript | mit | surreydigitalservices/sds-addresses,folklabs/sds-addresses,surreydigitalservices/sds-addresses,surreydigitalservices/sds-addresses,folklabs/sds-addresses,folklabs/sds-addresses |
585d4c685596764e9f25a5dc988453f8d5197aaf | js/heartbeat.js | js/heartbeat.js | (function($, document, window) {
"use strict"
window.animationHeartBeat = function (steps)
{
var max = steps;
var delay = 70;
var current = 0;
var interval;
var beat;
$(document).bind('animation.stop', function()
{
console.log('animation.... | (function($, document, window) {
"use strict"
window.animationHeartBeat = function (steps)
{
var max = steps;
var delay = 70;
var current = 0;
var interval;
var beat;
$(document).bind('animation.stop', function()
{
console.log('animation.... | Allow current frame modifictation by event | [HeartBeat] Allow current frame modifictation by event
| JavaScript | mit | marekkalnik/jquery-mdm-animatics |
6eb45ba6e1a3db0036e829769d059813b16b5df8 | server/publications/pinnedMessages.js | server/publications/pinnedMessages.js | Meteor.publish('channelPinnedMessages', function (search) {
if (this.userId) {
// TODO: checking if the user has access to these messages
const channel = Channels.findOne({ $or: [{ _id: search }, { slug: search }] });
return Messages.find({
_id: {$in: channel.pinnedMessageIds}
});
}
this.re... | Meteor.publish('channelPinnedMessages', function (search) {
if (this.userId) {
// TODO: checking if the user has access to these messages
const channel = Channels.findOne({ $or: [{ _id: search }, { slug: search }] });
if (channel.pinnedMessageIds) {
return Messages.find({
_id: {$in: channel... | Fix subscription in error in channelPinnedMessages | Fix subscription in error in channelPinnedMessages
| JavaScript | mit | tamzi/SpaceTalk,foysalit/SpaceTalk,MarkBandilla/SpaceTalk,MarkBandilla/SpaceTalk,foysalit/SpaceTalk,lhaig/SpaceTalk,mauricionr/SpaceTalk,bright-sparks/SpaceTalk,mGhassen/SpaceTalk,mGhassen/SpaceTalk,yanisIk/SpaceTalk,anjneymidha/SpaceTalk,SpaceTalk/SpaceTalk,anjneymidha/SpaceTalk,dannypaton/SpaceTalk,dannypaton/SpaceTa... |
21d6320759b1a78049f52c7052ac36f17a6ee1cc | src/utils/index.js | src/utils/index.js | import * as columnUtils from './columnUtils';
import * as compositionUtils from './compositionUtils';
import * as dataUtils from './dataUtils';
import * as rowUtils from './rowUtils';
import * as sortUtils from './sortUtils';
export default {
columnUtils,
compositionUtils,
dataUtils,
rowUtils,
sortUtils,
};
| import * as columnUtils from './columnUtils';
import * as compositionUtils from './compositionUtils';
import * as dataUtils from './dataUtils';
import * as rowUtils from './rowUtils';
import * as sortUtils from './sortUtils';
import { connect } from './griddleConnect';
export default {
columnUtils,
compositionUtil... | Add connect to utils out | Add connect to utils out
| JavaScript | mit | ttrentham/Griddle,GriddleGriddle/Griddle,GriddleGriddle/Griddle,joellanciaux/Griddle,joellanciaux/Griddle |
1c76ad5e14992f493a02accb6c753fbd422114ec | src/article/metadata/CollectionEditor.js | src/article/metadata/CollectionEditor.js | import { Component } from 'substance'
import CardComponent from '../shared/CardComponent'
export default class CollectionEditor extends Component {
getActionHandlers () {
return {
'remove-item': this._removeCollectionItem
}
}
render ($$) {
const model = this.props.model
let items = model.g... | import { Component } from 'substance'
import CardComponent from '../shared/CardComponent'
export default class CollectionEditor extends Component {
getActionHandlers () {
return {
'remove-item': this._removeCollectionItem
}
}
render ($$) {
const model = this.props.model
let items = model.g... | Put a ref for item editor. | Put a ref for item editor.
| JavaScript | mit | substance/texture,substance/texture |
f12cd07dabf68b29e6ad05e3609b5f4e2920213a | src/meta/intro.js | src/meta/intro.js | (function(mod) {
// CommonJS, Node.js, browserify.
if (typeof exports === "object" && typeof module === "object") {
module.exports = mod(require('d3'),
require('d3.chart'),
require('d3.chart.base'),
requure('lodash'))... | // We should use `grunt-umd` instead of this explicit intro, but the tool does
// not camelize lib names containing '.' or '-', making the generated JS
// invalid; needs a pull request.
(function(mod) {
// CommonJS, Node.js, browserify.
if (typeof exports === "object" && typeof module === "object") {
mo... | Add comment about explicit UMD | Add comment about explicit UMD
| JavaScript | mit | benbria/d3.chart.bubble-matrix,leebecker-hapara/d3.chart.heatmap-matrix,benbria/d3.chart.bubble-matrix,leebecker-hapara/d3.chart.heatmap-matrix,leebecker-hapara/d3.chart.heatmap-matrix |
9eb08435f9c05197d5df424c1be86560bfab7c1a | tests/atms-test.js | tests/atms-test.js | 'use strict';
var chai = require('chai');
var supertest = require('supertest');
var api = supertest('https://apis-bank-dev.apigee.net'); // supertest init;
chai.should();
describe('/atms', function() {
describe('get', function() {
it('should respond with 200 OK', function(done) {
this.timeout(0);
api.... | 'use strict';
var chai = require('chai');
var supertest = require('supertest');
var api = supertest('https://apis-bank-dev.apigee.net'); // supertest init;
chai.should();
describe('/atms', function() {
describe('get', function() {
it('should respond with 200 OK', function(done) {
this.timeout(0);
api.... | Change to check build pass in CI | Change to check build pass in CI | JavaScript | apache-2.0 | siriscac/apigee-ci-demo |
532c17d07761f89158b4be8ea4e3b9c29ff35941 | findminmax/src/findminmax.js | findminmax/src/findminmax.js | 'use strict'
module.exports = {
// This function finds the minimum and maximum values in an array of numbers.
findMinMax: function(numlist) {
numlist.sort( function (a,b) {return a - b} );
return [ numlist[0], numlist[numlist.length - 1] ];
}
} | 'use strict'
module.exports = {
// This function finds the minimum and maximum values in an array of numbers.
findMinMax: function(numlist) {
numlist.sort( function (a,b) {return a - b} );
if (numlist[0] == numlist[numlist.length - 1]) {
return [numlist[0]];
}
else return [ numlist[0], numlist[numlist.le... | Implement functionality for equal min and max values. | Implement functionality for equal min and max values.
| JavaScript | mit | princess-essien/andela-bootcamp-slc |
90518f85616a9ae5c67e3e6fc71a9406c3787724 | src/js/views/pro/PlayHistoryView.js | src/js/views/pro/PlayHistoryView.js | /**
* View for the room users list
* @module views/pro/PlayHistoryView
*/
var panes = require('./panes');
var PlayHistoryView = Backbone.View.extend({
id: "plugpro-play-history",
className: "media-list history",
initialize: function(){
var JST = window.plugPro.JST;
this.historyHTML = JST['play_history.html... | /**
* View for the room users list
* @module views/pro/PlayHistoryView
*/
var panes = require('./panes');
var PlayHistoryView = Backbone.View.extend({
id: "plugpro-play-history",
className: "media-list history",
initialize: function(){
var JST = window.plugPro.JST;
this.historyHTML = JST['play_history.html... | Make play history stay up to date | Make play history stay up to date
| JavaScript | mit | traviswimer/PlugPro,traviswimer/PlugPro,SkyGameRus/PlugPro,SkyGameRus/PlugPro |
6938bbeac68d0764fd0b95baf69481a64fc8aab7 | src/components/Members/MembersPreview.js | src/components/Members/MembersPreview.js | import React, { Component } from 'react';
class MembersPreview extends Component {
render() {
const {displayName, image, intro, slug} = this.props;
// TODO: remove inline styles and implement a system
return (
<div style={{
height: '200px',
}}>
<img src={image.uri} style={{
... | import React, { Component } from 'react';
class MembersPreview extends Component {
render() {
const {displayName, image, intro, slug} = this.props;
// TODO: remove inline styles and implement a system
return (
<div style={{
height: '200px',
}}>
<img src={image.uri} style={{
... | Make image preview slightly wider for mockup | Make image preview slightly wider for mockup
| JavaScript | cc0-1.0 | cape-io/acf-client,cape-io/acf-client |
1507d27109ad65abcb115a498ae8bc4b9701286b | src/core/middleware/005-favicon/index.js | src/core/middleware/005-favicon/index.js | import {join} from "path"
import favicon from "koa-favicon"
// TODO: Rewrite this middleware from scratch because of synchronous favicon
// reading.
const FAVICON_PATH = join(
process.cwd(), "static/assets/img/icns/favicon/twi.ico"
)
const configureFavicon = () => favicon(FAVICON_PATH)
export default configureF... | // Based on koajs/favicon
import {resolve, join, isAbsolute} from "path"
import {readFile} from "promise-fs"
import invariant from "@octetstream/invariant"
import isPlainObject from "lodash/isPlainObject"
import isString from "lodash/isString"
import ms from "ms"
import getType from "core/helper/util/getType"
const... | Rewrite favicon middleware from scratch. | Rewrite favicon middleware from scratch.
| JavaScript | mit | twi-project/twi-server,octet-stream/ponyfiction-js,octet-stream/ponyfiction-js,octet-stream/twi |
4af6210c0aae1b09d754f73b9a5755e5af81dff1 | test/unit/dummySpec.js | test/unit/dummySpec.js | describe('Test stuff', function () {
it('should just work', function () {
angular.mock.module('hdpuzzles');
expect(true).toBe(true);
});
}); | describe('Test stuff', function () {
it('should just work', function () {
angular.mock.module('hdpuzzles');
expect(true).toBe(false);
});
}); | Test if Travis CI reports a failure for failing unit tests. | Test if Travis CI reports a failure for failing unit tests.
| JavaScript | mit | ErikNijland/hdpuzzles,ErikNijland/hdpuzzles |
0193fceb10b4d266945e00967726ab5549cd77a0 | src/Marker.js | src/Marker.js | import Leaflet from "leaflet";
import latlngType from "./types/latlng";
import PopupContainer from "./PopupContainer";
export default class Marker extends PopupContainer {
componentWillMount() {
super.componentWillMount();
const {map, position, ...props} = this.props;
this.leafletElement = Leaflet.marke... | import Leaflet from "leaflet";
import latlngType from "./types/latlng";
import PopupContainer from "./PopupContainer";
export default class Marker extends PopupContainer {
componentWillMount() {
super.componentWillMount();
const {map, position, ...props} = this.props;
this.leafletElement = Leaflet.marke... | Implement dynamic changing of marker icon | Implement dynamic changing of marker icon
| JavaScript | mit | dantman/react-leaflet,TerranetMD/react-leaflet,marcello3d/react-leaflet,ericsoco/react-leaflet,snario/react-mapbox-gl,yavuzmester/react-leaflet,uniphil/react-leaflet,itoldya/react-leaflet,marcello3d/react-leaflet,snario/react-mapbox-gl,KABA-CCEAC/react-leaflet,yavuzmester/react-leaflet,yavuzmester/react-leaflet,itoldya... |
e86977f2bed532a344b2df4c09ed84a9b04fee17 | probes/cpu.js | probes/cpu.js | /*
* CPU statistics
*/
var exec = require('child_process').exec;
/*
* Unfortunately the majority of systems are en_US based, so we go with
* the wrong spelling of 'utilisation' for the least hassle ;)
*/
function get_cpu_utilization(callback)
{
switch (process.platform) {
case 'linux':
exec('mpstat -u -P... | /*
* CPU statistics
*/
var exec = require('child_process').exec;
/*
* Unfortunately the majority of systems are en_US based, so we go with
* the wrong spelling of 'utilisation' for the least hassle ;)
*/
function get_cpu_utilization(callback)
{
switch (process.platform) {
case 'linux':
exec('mpstat -u -P... | Simplify things with better use of split(). | Simplify things with better use of split().
| JavaScript | isc | jperkin/node-statusmon |
87396bd2a640d12026ade031340b292ee2ec1c08 | src/sandbox.js | src/sandbox.js | /*global __WEBPACK_DEV_SERVER_DEBUG__*/
/*global __WEBPACK_DEV_SERVER_NO_FF__*/
let SAVE;
if (__WEBPACK_DEV_SERVER_DEBUG__) { // for webpack-dev-server auto simulate
SAVE = require('./webpack-dev-server-util');
if (!__WEBPACK_DEV_SERVER_NO_FF__) require('./webpack-dev-server-fetch');
}
window.SAVE2 = {
VERS... | /*global __WEBPACK_DEV_SERVER_DEBUG__*/
/*global __WEBPACK_DEV_SERVER_NO_FF__*/
let SAVE;
let host = window.location.hostname;
if (__WEBPACK_DEV_SERVER_DEBUG__) { // for webpack-dev-server auto simulate
SAVE = require('./webpack-dev-server-util');
if (!__WEBPACK_DEV_SERVER_NO_FF__) require('./webpack-dev-server-... | Fix for host not being correct | Fix for host not being correct
| JavaScript | apache-2.0 | SRI-SAVE/react-components |
7b44cd38ea5741ebaba29da17aa091c7c8dddf6a | array/#/flatten.js | array/#/flatten.js | // Stack grow safe implementation
'use strict';
var ensureValue = require('../../object/valid-value')
, isArray = Array.isArray;
module.exports = function () {
var input = ensureValue(this), remaining, l, i, result = [];
main: //jslint: ignore
while (input) {
l = input.length;
for (i = 0; i < l; ++i) {
... | // Stack grow safe implementation
'use strict';
var ensureValue = require('../../object/valid-value')
, isArray = Array.isArray;
module.exports = function () {
var input = ensureValue(this), index = 0, remaining, remainingIndexes, l, i, result = [];
main: //jslint: ignore
while (input) {
l = input.length;... | Optimize to not use slice | Optimize to not use slice
| JavaScript | isc | medikoo/es5-ext |
b119297ac01748e7b91a7e6d8cf3f5ea193e29f6 | src/config.js | src/config.js | import fs from 'fs'
import rc from 'rc'
import ini from 'ini'
import path from 'path'
import mkdirp from 'mkdirp'
import untildify from 'untildify'
const conf = rc('tickbin', {
api: 'https://api.tickbin.com/',
local: '~/.tickbin'
})
conf.local = untildify(conf.local)
conf.db = path.join(conf.local, 'data')
if (!... | import fs from 'fs'
import rc from 'rc'
import ini from 'ini'
import path from 'path'
import mkdirp from 'mkdirp'
import untildify from 'untildify'
const conf = rc('tickbin', {
api: 'https://api.tickbin.com/',
local: '~/.tickbin'
})
conf.local = untildify(conf.local)
conf.db = path.join(conf.local, 'data')
if (!... | Add a setUser function and change setConfig to setKey | Add a setUser function and change setConfig to setKey
| JavaScript | agpl-3.0 | jonotron/tickbin,tickbin/tickbin,chadfawcett/tickbin |
f217d11b36613ab49314e8ba9f83ab8a76118ed0 | src/config.js | src/config.js | export default {
gameWidth: 1080,
gameHeight: 1613,
images: {
'background-game': './assets/images/background-game.png',
'background-landing': './assets/images/background-landing.png',
'background-face': './assets/images/ui/background-face.png',
'background-game-over': './asse... | export default {
gameWidth: 1080,
gameHeight: 1613,
images: {
'background-game': './assets/images/background-game.png',
'background-landing': './assets/images/background-landing.png',
'background-face': './assets/images/ui/background-face.png',
'background-game-over': './asse... | Tweak difficulty - adjust drink + food decrements | Tweak difficulty - adjust drink + food decrements
| JavaScript | mit | MarcL/see-it-off,MarcL/see-it-off |
d517724e6875365ff2e49440b13d01837e748fd6 | test/test.js | test/test.js | const request = require('supertest');
const app = require('../app');
describe('name to point', function () {
it('should return JSON object with geolocation',
function (done) {
request(app)
.get('/point?name=OldCity&lat=53.66&lon=23.83')
.expect(200)
.expect({
lat: '53.70177... | const request = require('supertest');
const app = require('../app');
describe('name to point', function () {
it('should return JSON object with geolocation',
function (done) {
request(app)
.get('/point?name=OldCity&lat=53.66&lon=23.83')
.expect(200)
.expect({
lat: '53.70177... | Write a correct postal address | Write a correct postal address
| JavaScript | mit | pub-t/name-to-point |
93b9428ad5232974ad73e02941f7b647f2a4a804 | content/photography/index.11ty.js | content/photography/index.11ty.js | const { downloadGalleryPhoto } = require("../../gallery-helpers");
const html = require("../../render-string");
const quality = 40;
const size = 300;
module.exports = class Gallery {
data() {
return {
layout: "photography"
};
}
async render({ collections }) {
return html`
<div class="gri... | const { downloadGalleryPhoto } = require("../../gallery-helpers");
const html = require("../../render-string");
const quality = 40;
const size = 300;
module.exports = class Gallery {
data() {
return {
layout: "photography"
};
}
async render({ collections }) {
return html`
<div class="gri... | Use lazy loading attribute on gallery | Use lazy loading attribute on gallery
| JavaScript | mit | surma/surma.github.io,surma/surma.github.io |
3d4d507c75826fd957939fc7c999fd3460aa8cd2 | src/asset-picker/AssetPickerFilter.js | src/asset-picker/AssetPickerFilter.js | import React, { PropTypes, PureComponent } from 'react';
import { findDOMNode } from 'react-dom';
import { InputGroup } from 'binary-components';
import { isMobile } from 'binary-utils';
import { actions } from '../_store';
import MarketSubmarketPickerContainer from './MarketSubmarketPickerContainer';
export default c... | import React, { PropTypes, PureComponent } from 'react';
import { findDOMNode } from 'react-dom';
import { InputGroup } from 'binary-components';
import { isMobile } from 'binary-utils';
import { actions } from '../_store';
import MarketSubmarketPickerContainer from './MarketSubmarketPickerContainer';
export default c... | Fix asset picker input focus | Fix asset picker input focus
| JavaScript | mit | nazaninreihani/binary-next-gen,nazaninreihani/binary-next-gen,binary-com/binary-next-gen,nuruddeensalihu/binary-next-gen,nazaninreihani/binary-next-gen,binary-com/binary-next-gen,nuruddeensalihu/binary-next-gen,nuruddeensalihu/binary-next-gen,binary-com/binary-next-gen |
d55d600d9e3b8fadeabe51445ebac4c04860f808 | src/AppBundle/Resources/public/scripts/menu.js | src/AppBundle/Resources/public/scripts/menu.js | $('.nav a').on('click', function(){
$(".navbar-toggle").click();
}); | $('.nav a').on('click', function(){
if ($(window).width() <= 767) {
$(".navbar-toggle").click();
}
}); | Hide close animation for non mobile. | Hide close animation for non mobile.
| JavaScript | mit | Clastic/clastic-marketing,Clastic/clastic-marketing,Clastic/clastic-marketing,Clastic/clastic-marketing |
f327771057d2ad38c8a7fa8d893c37197c7fde8b | src/HashMap.js | src/HashMap.js | /**
* @requires Map.js
* @requires ArrayList.js
*/
/**
* @see http://download.oracle.com/javase/6/docs/api/java/util/HashMap.html
*
* @implements {javascript.util.Map}
* @constructor
* @export
*/
javascript.util.HashMap = function() {
this.object = {};
};
/**
* @type {Object}
* @private
*/
javascript.u... | /**
* @requires Map.js
* @requires ArrayList.js
*/
/**
* @see http://download.oracle.com/javase/6/docs/api/java/util/HashMap.html
*
* @implements {javascript.util.Map}
* @constructor
* @export
*/
javascript.util.HashMap = function() {
this.object = {};
};
/**
* @type {Object}
* @private
*/
javascript.u... | Fix so that get returns null instead of undefined when key not found. | Fix so that get returns null instead of undefined when key not found. | JavaScript | mit | sshiting/javascript.util,sshiting/javascript.util,bjornharrtell/javascript.util,bjornharrtell/javascript.util |
0ea7667da177e969fe9dc0e04db977db50c9d4fa | src/tap/schema.js | src/tap/schema.js | /**
* [schema defines validation schemas for Mongo documents being inserted into db:ibu collection:ibuerrors]
*
*
*/
var ibuErrorSchema = new Schema({
filename: {
type: String,
validate: {
validator: function(v){
return /^[^.]+$/.test(v);
},
message: 'Filename is not valid!'
... | 'use strict';
/**
* [schema defines validation schemas for Mongo documents being inserted into db:ibu collection:ibuerrors]
*
*
*/
// Mongoose connection to MongoDB
const mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ibuErrorSchema = new Schema({
filename: {
type: String,
trim: true
... | Add Fields & removed Validate | Add Fields & removed Validate
Remove validate until Schema is working on all code.
Renamed "collection", conflict with core naming in Mongoose
| JavaScript | mit | utkdigitalinitiatives/ibu,utkdigitalinitiatives/ibu |
844806fb7bbad77a5b507e0e26519575bbf3124e | js/services/Storage.js | js/services/Storage.js | define(['app'], function (app) {
"use strict";
return app.service('storageService', ['$window', function (win) {
this.available = 'localStorage' in win;
this.get = function (key) {
return win.localStorage.getItem(key);
};
this.set = function (key, value) {
return win.local... | define(['app', 'angular'], function (app, angular) {
"use strict";
return app.service('storageService', ['$window', function (win) {
this.available = 'localStorage' in win;
this.get = function (key) {
return win.localStorage.getItem(key);
};
this.set = function (key, value) {
... | Use angular's JSON lib, since it strips off $hashKey that angular adds to scope objects | Use angular's JSON lib, since it strips off $hashKey that angular adds to scope objects
| JavaScript | mit | BrettBukowski/tomatar |
17c826741636990088061d32d2e1ed76beeb3d59 | lib/helpers.js | lib/helpers.js | 'use babel'
import {getPath} from 'consistent-path'
export {tempFile} from 'atom-linter'
const assign = Object.assign || function(target, source) {
for (const key in source) {
target[key] = source[key]
}
return target
}
export function getEnv() {
const env = assign({}, process.env)
env.PATH =... | 'use babel'
import getEnvironment from 'consistent-env'
export {tempFile} from 'atom-linter'
const assign = Object.assign || function(target, source) {
for (const key in source) {
target[key] = source[key]
}
return target
}
export function getEnv() {
return getEnvironment()
}
| Use consistent-env instead of consistent-path | :new: Use consistent-env instead of consistent-path
| JavaScript | mit | steelbrain/autocomplete-swift |
692437cd611c8cfc9222ec4cc17b0d852aa26e72 | libs/layout.js | libs/layout.js | import { Dimensions } from 'react-native'
module.exports = {
get visibleHeight() {
return Dimensions.get('window').height
},
}
| import { Dimensions } from 'react-native'
module.exports = {
get visibleHeight() {
return Dimensions.get('screen').height
},
}
| Use screen dimension as visible height | Use screen dimension as visible height
| JavaScript | mit | octopitus/rn-sliding-up-panel |
91beb6edb16bfe61a85c407caaa8bbf56881f366 | src/events/console/request_message.js | src/events/console/request_message.js | 'use strict';
const { protocolHandlers } = require('../../protocols');
const { rpcHandlers } = require('../../rpc');
// Build message of events of type `request` as:
// STATUS [ERROR] - PROTOCOL METHOD RPC /PATH COMMAND...
const getRequestMessage = function ({
protocol,
rpc,
method,
path,
error = 'SUCCESS'... | 'use strict';
const { protocolHandlers } = require('../../protocols');
const { rpcHandlers } = require('../../rpc');
// Build message of events of type `request` as:
// STATUS [ERROR] - PROTOCOL METHOD RPC /PATH COMMAND...
const getRequestMessage = function ({
protocol,
rpc,
method,
path,
error = 'SUCCESS'... | Fix summary not showing up in console logs | Fix summary not showing up in console logs
| JavaScript | apache-2.0 | autoserver-org/autoserver,autoserver-org/autoserver |
8bc9e027d6ed0a94ee995893d2cc8dd955550c33 | tesla.js | tesla.js | var fs = require('fs');
function getInitialCharge() {
var initialCharge = 100,
body = fs.readFileSync('tesla.out').toString().split('\n');
for (var i = body.length - 1; i >= 0; i--) { // Pick out valid part of file.
if (body[i].indexOf('battery_level:') != -1) { // Pick out the last object.
initia... | var fs = require('fs');
function getInitialCharge() {
var initialCharge = 100,
body = fs.readFileSync('tesla.out').toString().split('\n');
for (var i = body.length - 1; i >= 0; i--) { // Pick out valid part of file.
if (body[i].indexOf('battery_level:') != -1) { // Pick out the last object.
initia... | Check if called from command line. | Check if called from command line.
| JavaScript | mit | PrajitR/ChargePlan |
4a0fa2527ad0a5765a8f846f7723158037e0520a | test/errors.js | test/errors.js | import test from 'ava';
import Canvas from 'canvas';
import mergeImages from '../';
import fixtures from './fixtures';
test('mergeImages rejects Promise if image load errors', async t => {
t.plan(1);
t.throws(mergeImages([1], { Canvas }));
});
| import test from 'ava';
import Canvas from 'canvas';
import mergeImages from '../';
import fixtures from './fixtures';
test('mergeImages rejects Promise if node-canvas instance isn\'t passed in', async t => {
t.plan(1);
t.throws(mergeImages([]));
});
test('mergeImages rejects Promise if image load errors', async t ... | Test mergeImages rejects Promise if node-canvas instance isn\'t passed in | Test mergeImages rejects Promise if node-canvas instance isn\'t passed in
| JavaScript | mit | lukechilds/merge-images |
cfdc5729e8b71c88baad96d1b06cafe643600636 | test/issues.js | test/issues.js | 'use strict';
/*global describe */
describe('Issues.', function () {
require('./issues/issue-8.js');
require('./issues/issue-17.js');
require('./issues/issue-19.js');
require('./issues/issue-26.js');
require('./issues/issue-33.js');
require('./issues/issue-46.js');
require('./issues/issue-54.js');
req... | 'use strict';
/*global describe */
var path = require('path');
var fs = require('fs');
describe('Issues.', function () {
var issues = path.resolve(__dirname, 'issues');
fs.readdirSync(issues).forEach(function (file) {
if ('.js' === path.extname(file)) {
require(path.resolve(issues, file));
}
... | Automate loading of issue test units. | Automate loading of issue test units.
| JavaScript | mit | crissdev/js-yaml,minj/js-yaml,doowb/js-yaml,djchie/js-yaml,joshball/js-yaml,cesarmarinhorj/js-yaml,nodeca/js-yaml,joshball/js-yaml,vogelsgesang/js-yaml,pombredanne/js-yaml,rjmunro/js-yaml,rjmunro/js-yaml,SmartBear/js-yaml,jonnor/js-yaml,SmartBear/js-yaml,bjlxj2008/js-yaml,denji/js-yaml,denji/js-yaml,isaacs/js-yaml,cris... |
048eb86cd16a0bcff04bf4fe9129131c367ce95e | test/runner.js | test/runner.js | var cp = require('child_process');
var walk = require('walk');
var walker = walk.walk(__dirname + '/spec', {followLinks: false});
walker.on('file', function(root, stat, next) {
var filepath = root + '/' + stat.name;
cp.fork('node_modules/mocha/bin/_mocha', [filepath]);
next();
});
| var cp = require('child_process');
var join = require('path').join;
var walk = require('walk');
var mochaBin = join(__dirname, '..', 'node_modules', '.bin', 'mocha');
var walker = walk.walk(__dirname + '/spec', {followLinks: false});
walker.on('file', function(root, stat, next) {
var filepath = root + '/' + stat.nam... | Replace child_process.fork with child_process.spawn to correctly handle child's output. | Replace child_process.fork with child_process.spawn to correctly handle child's output.
| JavaScript | mit | vogdb/pulsar-rest-api,cargomedia/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,vogdb/pulsar-rest-api,cargomedia/pulsar-rest-api,vogdb/pulsar-rest-api,njam/pulsar-rest-api,njam/pulsar-rest-api |
b4b4997ff9b0d9c7ec17021f08d1da74e06225c7 | tasks/less.js | tasks/less.js | 'use strict'
const fs = require('fs')
const gulp = require('gulp')
const lessModule = require('less')
const less = require('gulp-less')
const sourcemaps = require('gulp-sourcemaps')
const rename = require('gulp-rename')
const mkdirp = require('mkdirp')
const postcss = require('gulp-postcss')
const autoprefixer = requ... | 'use strict'
const fs = require('fs')
const gulp = require('gulp')
const lessModule = require('less')
const less = require('gulp-less')
const sourcemaps = require('gulp-sourcemaps')
const rename = require('gulp-rename')
const mkdirp = require('mkdirp')
const postcss = require('gulp-postcss')
const autoprefixer = requ... | Use sync fs method (to suppress no callback error) | Use sync fs method (to suppress no callback error)
| JavaScript | mit | thebitmill/gulp |
7ae46169e9383f9bc71bf1715b19441df8e5be30 | lib/download-station.js | lib/download-station.js | module.exports = function(syno) {
return {
};
};
| 'use strict';
var util = require('util');
function info() {
/*jshint validthis:true */
var
userParams =
typeof arguments[0] === 'object' ? arguments[0] :
{},
callback =
typeof arguments[1] === 'function' ? arguments[1] :
typeof arguments[0] === 'function' ? arguments[0] :
nul... | Add Synology.downloadStation.info, Synology.downloadStation.getConfig and Synology.downloadStation.setConfig | Add Synology.downloadStation.info, Synology.downloadStation.getConfig and Synology.downloadStation.setConfig
| JavaScript | mit | yannickcr/node-synology |
aa6565b0e3c788e3edd278058092b4ae80063685 | lib/dujs/scopefinder.js | lib/dujs/scopefinder.js | /*
* Find scopes from AST
* @lastmodifiedBy ChengFuLin(chengfulin0806@gmail.com)
* @lastmodifiedDate 2015-07-27
*/
var walkes = require('walkes');
/**
* ScopeFinder
* @constructor
*/
function ScopeFinder() {
}
/**
* Find function scopes of AST parsed from source
* @param {Object} ast JS parse... | /*
* Find scopes from AST
* @lastmodifiedBy ChengFuLin(chengfulin0806@gmail.com)
* @lastmodifiedDate 2015-07-27
*/
var walkes = require('walkes');
/**
* ScopeFinder
* @constructor
*/
function ScopeFinder() {
}
/**
* Find function scopes of AST parsed from source
* @param {Object} ast JS parsed AST
* @return... | Modify default line separator from CRLF to LF | Modify default line separator from CRLF to LF
| JavaScript | mit | chengfulin/dujs,chengfulin/dujs |
68740b554194b5318eaedc507a285d66ccf1ecd3 | test/index.js | test/index.js | global.XMLHttpRequest = require('xhr2');
global.dataLayer = [];
var test = require('blue-tape');
var GeordiClient = require('../index');
test('Instantiate a client with default settings', function(t) {
var geordi = new GeordiClient();
t.equal(geordi.env, 'staging');
t.equal(geordi.projectToken, 'unspecified');
... | global.XMLHttpRequest = require('xhr2');
global.dataLayer = [];
var test = require('blue-tape');
var GeordiClient = require('../index');
test('Instantiate a client with default settings', function(t) {
var geordi = new GeordiClient();
t.equal(geordi.env, 'staging');
t.equal(geordi.projectToken, 'unspecified');
... | Test that server config hasn't broken | Test that server config hasn't broken
| JavaScript | apache-2.0 | zooniverse/geordi-client |
d08660202911ad0739d90de24c16614a510df4c0 | lib/SymbolShim.js | lib/SymbolShim.js | var objectTypes = {
"boolean": false,
"function": true,
"object": true,
"number": false,
"string": false,
"undefined": false
};
/*eslint-disable */
var _root = (objectTypes[typeof self] && self) || (objectTypes[typeof window] && window);
var freeGlobal = objectTypes[typeof global] && global;
i... | var objectTypes = {
"boolean": false,
"function": true,
"object": true,
"number": false,
"string": false,
"undefined": false
};
/*eslint-disable */
var _root = (objectTypes[typeof self] && self) || (objectTypes[typeof window] && window);
var freeGlobal = objectTypes[typeof global] && global;
i... | Fix transpilation error to support React Native | Fix transpilation error to support React Native
Recent versions of Babel will throw a TransformError in certain
runtimes if any property on `Symbol` is assigned a value.
This fixes the issue, which is the last remaining issue for
React Native support.
| JavaScript | apache-2.0 | Netflix/falcor,sdesai/falcor,Netflix/falcor,sdesai/falcor |
97b03822bb8d700a326417decfb5744a71998d9c | tests/index.js | tests/index.js | var should = require('should'),
stylus = require('stylus'),
fs = require('fs');
var stylusMatchTest = function() {
var files = fs.readdirSync(__dirname + '/fixtures/stylus/styl/');
files.forEach(function(file) {
var fileName = file.replace(/.{5}$/, '');
describe(fileName + ' method', function() {... | var stylus = require('stylus'),
fs = require('fs'),
should = require('should');
function compare(name, done) {
var str = fs.readFileSync(__dirname + '/fixtures/stylus/styl/' + name + '.styl', { encoding: 'utf8' });
stylus(str)
.import('stylus/jeet')
.render(function(err, result) {
fs.r... | Make testing function more solid | Make testing function more solid | JavaScript | mit | lucasoneves/jeet,jakecleary/jeet,durvalrafael/jeet,ccurtin/jeet,nagyistoce/jeet,pramodrhegde/jeet,mojotech/jeet,rafaelstz/jeet,mojotech/jeet,greyhwndz/jeet,macressler/jeet,travisc5/jeet |
78a92e702daedff605c76be0eeebaeb10241fcd1 | lib/less/less-error.js | lib/less/less-error.js |
module.exports = LessError;
function LessError(parser, e, env) {
var input = parser.getInput(e, env),
loc = parser.getLocation(e.index, input),
line = loc.line,
col = loc.column,
callLine = e.call && parser.getLocation(e.call, input).line,
lines = input.split('\n');
th... |
var LessError = module.exports = function LessError(parser, e, env) {
var input = parser.getInput(e, env),
loc = parser.getLocation(e.index, input),
line = loc.line,
col = loc.column,
callLine = e.call && parser.getLocation(e.call, input).line,
lines = input.split('\n');
... | Fix LessError being used before being defined | Fix LessError being used before being defined
| JavaScript | apache-2.0 | bhavyaNaveen/project1,evocateur/less.js,jjj117/less.js,paladox/less.js,Nastarani1368/less.js,waiter/less.js,yuhualingfeng/less.js,SkReD/less.js,SomMeri/less-rhino.js,yuhualingfeng/less.js,mcanthony/less.js,christer155/less.js,royriojas/less.js,cgvarela/less.js,royriojas/less.js,idreamingreen/less.js,ridixcr/less.js,dec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.