commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
5a3680cd0fb114b27d7208fd517f134054759094 | spec/helpers/client.js | spec/helpers/client.js | const http = require("http");
/**
* Sends an HTTP request to the server and returns a Promise which resolve
* with the HTTP response containing the body too.
*
* @param {String} host
* @param {String} port
* @param {String} method
* @param {String} path
* @return {Promise}
*/
module.exports.request = (ho... | const http = require("http");
/**
* Sends an HTTP request to the server and returns a Promise which resolve
* with the HTTP response containing the body too.
*
* @param {String} host
* @param {String} port
* @param {String} method
* @param {String} path
* @return {Promise}
*/
module.exports.request = (ho... | Allow to set body and headers | Allow to set body and headers
| JavaScript | mit | spreaker/node-mock-http-server |
81dca348fe40531562b057b625facab26f0b7e70 | src/components/Main.js | src/components/Main.js | require('normalize.css');
require('styles/App.css');
import React from 'react';
let someUnusedStuff = 'hello';
let yeomanImage = require('../images/yeoman.png');
const colors = ['red', 'white', 'green'];
let currentIndex = 0;
function nextColor() {
let color = colors[currentIndex % colors.length];
currentIndex = ... | require('normalize.css');
require('styles/App.css');
import React from 'react';
let someUnusedStuff = 'hello';
let yeomanImage = require('../images/yeoman.png');
const colors = ['red', 'white', 'green'];
let currentIndex = 0;
function nextColor() {
let color = colors[currentIndex % colors.length];
currentIndex = ... | Use ecmascript 6, cancel interval | Use ecmascript 6, cancel interval
| JavaScript | mit | univa-new-user/my-app,univa-new-user/my-app |
e79456308f80027f014a6d700e634b907a9ac086 | lib/database/index.js | lib/database/index.js | 'use strict';
var configuration = require('../config');
var util = require('util');
var databases = {};
/**
* register database provider
* @param {string} name database provider identifier
* @param {constructor} provider database provider constructor function
*/
function register(name, provider) {
databa... | 'use strict';
var configuration = require('../config');
var util = require('util');
var databases = {};
/**
* register database provider
* @param {string} name database provider identifier
* @param {constructor} provider database provider constructor function
*/
function register(name, provider) {
databa... | Check if database config does exist | Check if database config does exist
| JavaScript | mit | restorecommerce/chassis-srv,restorecommerce/chassis-srv |
e4443fe9e7dae172ee34c96926430fba2e63f8e4 | src/__tests__/index.js | src/__tests__/index.js | import test from 'ava';
import sha1 from '..';
import { nativeSha1, randomBytes } from './_helpers';
test('Invalid data should throw type error', t => {
t.throws(() => sha1('hello there'), TypeError);
});
test('Sample text', t => {
const buffer = Buffer.from('The quick brown fox jumps over the lazy dog');
t.is(... | import test from 'ava';
import sha1 from '..';
import { getUint8Array } from '../utils';
import { nativeSha1, randomBytes } from './_helpers';
test('Invalid data should throw type error', t => {
t.throws(() => sha1('hello there'), TypeError);
});
test('Sample text', t => {
const buffer = Buffer.from('The quick br... | Add more tests to reach 100% coverage | Add more tests to reach 100% coverage
| JavaScript | mit | maxdavidson/tiny-sha1 |
76acda2b6e8ed9bbf5370481b18e393a2f587d62 | app/assets/javascripts/mutations/import/toggle.es6.js | app/assets/javascripts/mutations/import/toggle.es6.js | import Relay from 'react-relay';
export default class extends Relay.Mutation {
getMutation() {
return Relay.QL`mutation{ ToggleAchievement }`;
}
getFatQuery() {
return Relay.QL`
fragment on ToggleAchievementPayload {
developer {
id,
connections,
achievements,
... | import Relay from 'react-relay';
export default class extends Relay.Mutation {
getMutation() {
return Relay.QL`mutation{ ToggleAchievement }`;
}
getFatQuery() {
return Relay.QL`
fragment on ToggleAchievementPayload {
developer {
id,
achievements,
},
conn... | Add toggle mutation for adding achievement | Add toggle mutation for adding achievement
| JavaScript | artistic-2.0 | gauravtiwari/hireables,gauravtiwari/hireables,gauravtiwari/techhire,Hireables/hireables,Hireables/hireables,gauravtiwari/techhire,gauravtiwari/techhire,gauravtiwari/hireables,Hireables/hireables |
cfd253ca3f6dec0d50d9d907ac84e46980c281e9 | src/index.js | src/index.js | 'use strict';
import 'source-map-support/register';
import http from 'http';
import express from 'express';
import RED from 'node-red';
// Create an Express app
let app = express();
// Create a server
let server = http.createServer(app);
// Create the settings object - see default settings.js file for other options... | 'use strict';
import 'source-map-support/register';
import http from 'http';
import express from 'express';
import RED from 'node-red';
// Create an Express app
let app = express();
// Create a server
let server = http.createServer(app);
// Create the settings object - see default settings.js file for other options... | Remove nodesDir since plugin nodes loaded from the directories don't handle i18n message resources | Remove nodesDir since plugin nodes loaded from the directories don't handle i18n message resources
This was discussed in the thread: https://groups.google.com/forum/#!msg/node-red/Ag0RH_mLfvA/e53K6Dn0BQAJ.
Resource bundles per node is available only when the node is installed as a node package, i.e. it should be place... | JavaScript | unknown | dbaba/candy-red,dbaba/candy-red,CANDY-LINE/candy-red,CANDY-LINE/candy-red,CANDY-LINE/candy-red,dbaba/candy-red |
23ff90d6334987ecff65539309acb93652f665d0 | src/index.js | src/index.js | import mixins from './mixins/index.js'
import {
Bar,
HorizontalBar,
Doughnut,
Line,
Pie,
PolarArea,
Radar,
Bubble,
Scatter,
generateChart
} from './BaseCharts'
const VueCharts = {
Bar,
HorizontalBar,
Doughnut,
Line,
Pie,
PolarArea,
Radar,
Bubble,
Scatter,
mixins,
generateChar... | import mixins from './mixins/index.js'
import {
Bar,
HorizontalBar,
Doughnut,
Line,
Pie,
PolarArea,
Radar,
Bubble,
Scatter,
generateChart
} from './BaseCharts'
const VueCharts = {
Bar,
HorizontalBar,
Doughnut,
Line,
Pie,
PolarArea,
Radar,
Bubble,
Scatter,
mixins,
generateChar... | Add fake render method with error message | feat(ux): Add fake render method with error message
Closes #380
| JavaScript | mit | apertureless/vue-chartjs,apertureless/vue-chartjs,apertureless/vue-chartjs |
e71f0a5664ee1c0938f8f540418d37d8c4cb5795 | src/gatsby-node.js | src/gatsby-node.js | import webpack from 'webpack'
import FaviconsWebpackPlugin from 'favicons-webpack-plugin'
exports.modifyWebpackConfig = ({ config, stage }, { logo, icons }) => {
if (stage === 'develop-html' || stage === 'build-html') {
config.plugin(`Favicon`, FaviconsWebpackPlugin, [
{
logo: logo || './src/favico... | import webpack from 'webpack'
import FaviconsWebpackPlugin from 'favicons-webpack-plugin'
exports.modifyWebpackConfig = ({ config, stage }, { logo, icons, title, background }) => {
if (stage === 'develop-html' || stage === 'build-html') {
config.plugin(`Favicon`, FaviconsWebpackPlugin, [
{
logo: lo... | Add background and title to the configuration | Add background and title to the configuration
| JavaScript | mit | Creatiwity/gatsby-plugin-favicon |
5384a8fb8e50e535c88d966fe02db0c8d7726dfb | src/components/List.js | src/components/List.js | import { bool, string } from 'prop-types'
import React from 'react'
import Text from './Text'
const OrderedTagType = {
[false]: 'ul',
[true]: 'ol'
}
const List = ({ ordered, type, ...props }) => {
if (!type) {
if (ordered) {
type = 'disc'
} else {
type = 'decimal'
}
}
return (
<T... | import { bool, string } from 'prop-types'
import React from 'react'
import Text from './Text'
const OrderedTagType = {
[false]: 'ul',
[true]: 'ol'
}
const List = ({ ordered, type, ...props }) => {
if (!type) {
if (ordered) {
type = 'decimal'
} else {
type = 'disc'
}
}
return (
<T... | Fix bug that swapped default list style types... | Fix bug that swapped default list style types...
| JavaScript | mit | dlindahl/stemcell,dlindahl/stemcell |
f6046c023c1f48a962993061647b451270e25d82 | src/ol/format/filter/Within.js | src/ol/format/filter/Within.js | /**
* @module ol/format/filter/Within
*/
import {inherits} from '../../util.js';
import Spatial from '../filter/Spatial.js';
/**
* @classdesc
* Represents a `<Within>` operator to test whether a geometry-valued property
* is within a given geometry.
*
* @constructor
* @param {!string} geometryName Geometry nam... | /**
* @module ol/format/filter/Within
*/
import Spatial from '../filter/Spatial.js';
/**
* @classdesc
* Represents a `<Within>` operator to test whether a geometry-valued property
* is within a given geometry.
*/
class Within extends Spatial {
/**
* @param {!string} geometryName Geometry name to use.
* ... | Clean up remaining ol/format/filter class | Clean up remaining ol/format/filter class
| JavaScript | bsd-2-clause | fredj/ol3,openlayers/openlayers,bjornharrtell/ol3,stweil/openlayers,oterral/ol3,fredj/ol3,geekdenz/openlayers,geekdenz/ol3,geekdenz/ol3,geekdenz/ol3,mzur/ol3,fredj/ol3,mzur/ol3,stweil/ol3,adube/ol3,geekdenz/openlayers,ahocevar/ol3,openlayers/openlayers,bjornharrtell/ol3,ahocevar/openlayers,oterral/ol3,geekdenz/ol3,tsch... |
d50f5a8099313d8207c60733ea4a50ee06c15f8f | src/selectors/NewsSelectors.js | src/selectors/NewsSelectors.js | /* NewsSelector.js
* Use reselect.js library for our seearch functionlity which has two types of selectors: input and memoized
* Dependencies: ActionTypes
* Modules: NewsActions, and NewsFeed
* Author: Tiffany Tse
* Created: July 29, 2017
*/
//import dependencies
import {createSelector } from 'reselect';
//import... | /* NewsSelector.js
* Use reselect.js library for our seearch functionlity which has two types of selectors: input and memoized
* Dependencies: reselect
* Modules: reshapeNewsData
* Author: Tiffany Tse
* Created: August 12, 2017
*/
//import dependencies
import {createSelector } from 'reselect';
//import modules
im... | Update header comment with correct date creation, dependencies, and modules needed | Update header comment with correct date creation, dependencies, and modules needed
| JavaScript | mit | titse/NYTimes-Clone,titse/NYTimes-Clone,titse/NYTimes-Clone |
9eb240e072cd44f0c8d9d9ca1ce89294226de1c2 | src/matchAction.js | src/matchAction.js | import match from './requirejs-finder/match';
const fakeInstance = {
get _super() {
return () => {};
},
set _super(fn) {},
execute() {},
};
export default function matchAction(method, url, regex, params) {
if (url) {
return match(m =>
m.prototype &&
m.prototype.type === method &&
... | import match from './requirejs-finder/match';
export default function matchAction(method, url, regex, params) {
if (url) {
return match(m =>
m.prototype &&
m.prototype.type === method &&
m.prototype.route === url
);
} else if (regex) {
return match(m => {
if (!m.prototype ||... | Fix matching actions with routes on their prototype. | Fix matching actions with routes on their prototype.
| JavaScript | mit | ExtPlug/plug-modules |
b45176462fbbb7fbf29f437d140bc97b1de11752 | frontend/app/js/containers/serverboard/board/index.js | frontend/app/js/containers/serverboard/board/index.js | import BoardView from 'app/components/serverboard/board'
import store from 'app/utils/store'
import {
serverboards_widget_list,
serverboard_update_widget_catalog,
board_update_now
} from 'app/actions/serverboard'
const Board = store.connect({
state: (state) => ({
widgets: state.serverboard.widgets,
w... | import BoardView from 'app/components/serverboard/board'
import store from 'app/utils/store'
import {
serverboards_widget_list,
serverboard_update_widget_catalog,
board_update_now
} from 'app/actions/serverboard'
const Board = store.connect({
state: (state) => ({
widgets: state.serverboard.widgets,
w... | Refresh widget when config changes | Refresh widget when config changes
| JavaScript | apache-2.0 | serverboards/serverboards,serverboards/serverboards,serverboards/serverboards,serverboards/serverboards,serverboards/serverboards |
cb4e7792a2fad90f34edde41af4c9e528cab0078 | phaser/ohhman/js/Blinky.js | phaser/ohhman/js/Blinky.js | Blinky = function () {
this.sprite = null;
this.speed = 10;
this.direction; //LEFT, RIGHT, UP, DOWN
};
Blinky.prototype = {
preload : function() {
//Carrega o sprite do fantasminha blinky
game.load.image('blinky', 'assets/images/blinky_36-36.png');
},
create : function() {
//Adiciona o blinky na tela
... | Blinky = function () {
this.sprite = null;
this.speed = 10;
this.direction; //LEFT, RIGHT, UP, DOWN
};
Blinky.prototype = {
preload : function() {
//Carrega o sprite do fantasminha blinky
game.load.image('blinky', 'assets/images/blinky_36-36.png');
},
create : function() {
//Adiciona o blinky na tela
... | Change function name according to diagram | [Ohhman][Phaser] Change function name according to diagram
| JavaScript | mit | jucimarjr/html5games,jucimarjr/html5games |
5a9c5458de48253151c44804d7b4a06c4663d3e4 | website/static/js/pages/share-embed-page.js | website/static/js/pages/share-embed-page.js | 'use strict';
var pym = require('pym.js');
var register = window.contextVars.share.urls.register;
new pym.Parent(
'share_registration_iframe',
register,
{}
);
| 'use strict';
var pym = require('pym.js');
var register = window.contextVars.share.urls.register;
var pymParent = new pym.Parent(
'share_registration_iframe',
register,
{}
);
function scrollToTop(data) {
window.scrollTo(0, 0);
}
pymParent.onMessage('scroll_top_now', scrollToTop)
| Add js function to call when scroll message is recieved | Add js function to call when scroll message is recieved
| JavaScript | apache-2.0 | danielneis/osf.io,RomanZWang/osf.io,TomBaxter/osf.io,KAsante95/osf.io,baylee-d/osf.io,chennan47/osf.io,chrisseto/osf.io,baylee-d/osf.io,ckc6cz/osf.io,MerlinZhang/osf.io,barbour-em/osf.io,zamattiac/osf.io,pattisdr/osf.io,bdyetton/prettychart,sloria/osf.io,sloria/osf.io,DanielSBrown/osf.io,DanielSBrown/osf.io,GageGaskins... |
fb8f3fdb9822ac3efa84fa830b2041fd8bd84823 | public/javascripts/show.js | public/javascripts/show.js | document.observe("dom:loaded", function()
{
function get_index()
{
var index = parseInt(location.hash.substr(1));
if(isNaN(index)) index = 0;
return index;
}
function go_next_page()
{
var index = get_index();
index += 1;
if(index >= pages.length) index = pages.length - 1;
loc... | document.observe("dom:loaded", function()
{
function get_index()
{
var index = parseInt(location.hash.substr(1));
if(isNaN(index)) index = 0;
return index;
}
function go_next_page()
{
var index = get_index();
index += 1;
if(index >= pages.length) index = pages.length - 1;
loc... | Add back button support back in | Add back button support back in
| JavaScript | mit | bloopletech/mangar,bloopletech/mangar,bloopletech/pictures,bloopletech/pictures,bloopletech/mangar,bloopletech/mangar |
55a225d3e6226b3128bd2f35bd593d12d7056a65 | src/store.js | src/store.js | import { createStore, applyMiddleware } from 'redux'
import createSagaMiddleware from 'redux-saga'
import reducer from './reducers'
// create the saga middleware
export const sagaMiddleware = createSagaMiddleware()
// mount it on the Store
const store = createStore(
reducer,
applyMiddleware(sagaMiddleware)
)
ex... | import { createStore, applyMiddleware, compose } from 'redux'
import createSagaMiddleware from 'redux-saga'
import reducer from './reducers'
// create the saga middleware
export const sagaMiddleware = createSagaMiddleware()
const composeEnhancers =
process.env.NODE_ENV !== 'production' &&
typeof window === 'obje... | Add support for Redux Dev Tools | Add support for Redux Dev Tools
| JavaScript | apache-2.0 | matobet/userportal,oVirt/ovirt-web-ui,mareklibra/userportal,mareklibra/userportal,mareklibra/userportal,matobet/userportal,matobet/userportal,mareklibra/userportal,oVirt/ovirt-web-ui,mkrajnak/ovirt-web-ui,oVirt/ovirt-web-ui,matobet/userportal,mkrajnak/ovirt-web-ui,mkrajnak/ovirt-web-ui,mkrajnak/ovirt-web-ui |
fb96c3f8713f905772f0f58fc8d3c556cdbf1b30 | src/app/store/createDevStore.js | src/app/store/createDevStore.js | export default function createDevToolsStore(onDispatch) {
let currentState = {
committedState: {},
stagedActions: [],
computedStates: [],
skippedActions: {},
currentStateIndex: 0
};
let listeners = [];
let initiated = false;
function dispatch(action) {
if (action.type[0] !== '@') onDi... | export default function createDevToolsStore(onDispatch) {
let currentState = {
actionsById: {},
computedStates: [],
currentStateIndex: 0,
monitorState: {},
nextActionId: 0,
skippedActionIds: [],
stagedActionIds: []
};
let listeners = [];
let initiated = false;
function dispatch(ac... | Change lifted store structure to fit Redux DevTools 3.0 | Change lifted store structure to fit Redux DevTools 3.0
| JavaScript | mit | zalmoxisus/remotedev-app,zalmoxisus/remotedev-app |
354a6a4005ea5fbadf341f9d83a584160d877d54 | addon/services/is-mobile.js | addon/services/is-mobile.js | import Service from '@ember/service';
import { computed, get, getProperties, set } from '@ember/object';
import { getOwner } from '@ember/application';
import { isBlank } from '@ember/utils';
import isMobile from 'ismobilejs';
export default Service.extend({
fastboot: computed(function() {
return getOwner(this)... | import Service from '@ember/service';
import { computed, get, set } from '@ember/object';
import { getOwner } from '@ember/application';
import { isBlank } from '@ember/utils';
import isMobile from 'ismobilejs';
/**
* The attributes returned by isMobile are accessible. However, they should be
* accessed using the `g... | Fix edge-case with blank user agent in FastBoot | Fix edge-case with blank user agent in FastBoot
* Call the isMobile class with the current context to avoid leaking the global.
| JavaScript | mit | sandydoo/ember-is-mobile,sandydoo/ember-is-mobile |
f9a5daeb5bd3ad7d450547ae64a306312c6c00e4 | addon/utils/dom.js | addon/utils/dom.js | /*
* Implement some helpers methods for interacting with the DOM,
* be it Fastboot's SimpleDOM or a browser's version.
*/
export function getActiveElement() {
if (typeof document === 'undefined') {
return null;
} else {
return document.activeElement;
}
}
function childNodesOfElement(element) {
let ... | /*
* Implement some helpers methods for interacting with the DOM,
* be it Fastboot's SimpleDOM or a browser's version.
*/
export function getActiveElement() {
if (typeof document === 'undefined') {
return null;
} else {
return document.activeElement;
}
}
function childNodesOfElement(element) {
let ... | Use native doc.getElementById when available | Use native doc.getElementById when available
SimpleDOM doesn't have `getElementById`, but in a browser it is
more efficient to use the native `getElementById` instead of walking the
dom.
| JavaScript | mit | yapplabs/ember-wormhole,yapplabs/ember-wormhole |
3863ca33c35b9572aa7340e61a9ac92b918bc516 | src/components/confirm/index.js | src/components/confirm/index.js | import React, {Component, PropTypes} from 'react';
import ReactDOM from 'react-dom';
import {component as ConfirmationModal} from '../../application/confirmation-popin';
import Connect from '../../behaviours/store/connect';
import {application} from 'focus-core';
const {builtInStore: applicationStore} = application;
co... | import React, {Component, PropTypes} from 'react';
import ReactDOM from 'react-dom';
import {component as ConfirmationModal} from '../../application/confirmation-popin';
import Connect from '../../behaviours/store/connect';
import {application} from 'focus-core';
const {builtInStore: applicationStore} = application;
co... | Rename handlers to math confirmation popin props. | [confirm] Rename handlers to math confirmation popin props.
| JavaScript | mit | sebez/focus-components,KleeGroup/focus-components,sebez/focus-components,KleeGroup/focus-components,asimsir/focus-components,asimsir/focus-components,JabX/focus-components,get-focus/focus-components,JabX/focus-components |
192585745d19bcdf94924453300fd7d2f6937e0e | src/components/home/index.js | src/components/home/index.js | import React from 'react';
import { Link } from 'react-router';
import Cycle from 'cycle-react';
let Rx = Cycle.Rx;
class Testink extends React.Component {
render() {
return <div> Cheers { this.props.test } </div>;
}
}
let Clicker = Cycle.component( 'Counter', ( interactions ) => {
return interactions.get( 'plus... | import React from 'react';
import { Link } from 'react-router';
import Cycle from 'cycle-react';
let Rx = Cycle.Rx;
class Testink extends React.Component {
render() {
return <div> Cheers { this.props.test } </div>;
}
}
let Clicker = Cycle.component( 'Counter', ( interactions ) => {
return Rx.Observable.merge(
... | Add minus button as well and combine streams | Add minus button as well and combine streams
| JavaScript | mit | Tsarpf/reaktive,Tsarpf/reaktive |
04fef2c10ce7d3ad4c6f2e2e4fab37164df34e97 | client/src/js/jobs/components/Jobs.js | client/src/js/jobs/components/Jobs.js | import React from "react";
import { connect } from "react-redux";
import { Switch, Route } from "react-router-dom";
import { findJobs } from "../actions";
import JobsList from "./List";
import JobDetail from "./Detail";
import JobsResources from "./Resources";
import Resources from "../../administration/components/Job... | import React from "react";
import { connect } from "react-redux";
import { Switch, Route } from "react-router-dom";
import JobsList from "./List";
import JobDetail from "./Detail";
import JobsResources from "./Resources";
import Resources from "../../administration/components/Jobs/Resources";
import Tasks from "../../a... | Remove unused statements from jobs | Remove unused statements from jobs
| JavaScript | mit | igboyes/virtool,igboyes/virtool,virtool/virtool,virtool/virtool |
21bcec33b41e1697b4888ee8ad29c375ab587671 | viewer/front/components/ChannelMessagesHeader.js | viewer/front/components/ChannelMessagesHeader.js | import React from 'react';
import { connect } from 'react-redux'
import find from 'lodash/find';
import ChannelName from './ChannelName'
import SlackActions from '../actions/SlackActions';
import firebase from 'firebase/app';
const ChannelMessagesHeader = ({ channels, ims, currentChannelId, openSidebar }) => {
const... | import React from 'react';
import { connect } from 'react-redux'
import find from 'lodash/find';
import ChannelName from './ChannelName'
import SlackActions from '../actions/SlackActions';
const ChannelMessagesHeader = ({ channels, ims, currentChannelId, openSidebar }) => {
const allChannels = Object.assign({}, chan... | Revert "implement sign out button" | Revert "implement sign out button"
This reverts commit b1e5d72e01ebdf8fbbc61e7fd2cc181ff0e413dc.
| JavaScript | mit | tyage/slack-patron,tyage/slack-patron,tyage/slack-patron,tyage/slack-patron |
02e7738a6c698f4f488e95f2932490b26f0b53a7 | src/js/components/TimeColumn.js | src/js/components/TimeColumn.js | import React, { Component, PropTypes } from 'react';
export default class TimeColumn extends Component {
// static propTypes = {
// times: PropTypes.array.isRequired
// };
render() {
const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
const minutes = ['00', '15', '30', '45... | import React, { Component, PropTypes } from 'react';
export default class TimeColumn extends Component {
// static propTypes = {
// times: PropTypes.array.isRequired
// };
render() {
const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
const minutes = ['00', '15', '30', '45']
const... | Update length of Times to go to 10pm | Update length of Times to go to 10pm
| JavaScript | mit | gregRV/myoutsidelands-frontend,gregRV/myoutsidelands-frontend |
35949719fbc65de1268e25f7e119973ad2b2789a | v03/index.js | v03/index.js | const Cloudevent = require("../lib/cloudevent.js");
const Spec = require("../lib/specs/spec_0_3.js");
const StructuredHTTPEmitter = require("../lib/bindings/http/emitter_binary.js");
const BinaryHTTPEmitter = require("../lib/bindings/http/emitter_binary_0_3.js");
function event() {
return new Cloudevent(Spec);
}
mo... | const Cloudevent = require("../lib/cloudevent.js");
const Spec = require("../lib/specs/spec_0_3.js");
const StructuredHTTPEmitter =
require("../lib/bindings/http/emitter_structured.js");
const BinaryHTTPEmitter = require("../lib/bindings/http/emitter_binary_0_3.js");
function event() {
return new Cloudevent(Spec);... | Fix the import of structured emitter | Fix the import of structured emitter
Signed-off-by: Fabio José <34f3a7e4e4d9fe971c99ebc4af947a5309eca653@gmail.com>
| JavaScript | apache-2.0 | cloudevents/sdk-javascript,cloudevents/sdk-javascript |
4847b320702f05d73828e22d156e530e313b35de | validator.js | validator.js | "use strict";
var ManifestValidator = (function() {
function _check(string) {
var json = "";
var logs = [];
try {
json = JSON.parse(string);
} catch (e) {
logs.push("File isn't valid JSON.");
return [ false, logs ];
}
logs.push("JSON parsed successfuly.");
return [ tr... | "use strict";
var ManifestValidator = (function() {
var _manifest = {};
var _logs = [];
function _checkName(manifest) {
if (!_manifest.name) {
_logs.push('Manifest has no `name` property.')
return;
}
if (typeof _manifest.name != "string") {
_logs.push('ERROR: Manifest\'s `name` p... | Add checks for 'name' and 'short_name'. | Add checks for 'name' and 'short_name'.
| JavaScript | apache-2.0 | mounirlamouri/manifest-validator,mounirlamouri/manifest-validator,mounirlamouri/manifest-validator |
4a98f412671b6c873ca1cf5ad21df8bc871d4290 | src/services/google-calendar.js | src/services/google-calendar.js | import request from 'request';
import config from '../config/config';
export default {
getFromConfig(callback) {
let now = new Date();
let later = new Date().setDate(now.getDate() + 2);
let url = `https://www.googleapis.com/calendar/v3/calendars/${config.google.calendarId}/events?key=${con... | import request from 'request';
import config from '../config/config';
export default {
getFromConfig(callback) {
let now = new Date();
let later = new Date().setDate(now.getDate() + 2);
let url = 'https://www.googleapis.com/calendar/v3/calendars' +
`/${config.google.calendarId}... | Break up long, long line | Break up long, long line
| JavaScript | mit | chatrealm/dctvbot |
de2a087dba8a621289fa0e96208fe745e3b7a6d9 | js/RobotCore.js | js/RobotCore.js | /*
* Game core for Robots Order BreakOut Trepidation!
*
* @canvas = reference to an HTML5 canvas element.
*/
'use strict';
import Actors from 'Actors.js';
export default class {
constructor(canvas) {
this._canvas = canvas;
this._ctx = this._canvas.getContext("2d");
this._actors = new Actors(this._c... | /*
* Game core for Robots Order BreakOut Trepidation!
*
* @canvas = reference to an HTML5 canvas element.
*/
'use strict';
import Actors from 'Actors.js';
export default class {
constructor(canvas) {
this._canvas = canvas;
this._ctx = this._canvas.getContext("2d");
this._actors = new Actors(this._c... | Make it possible for visible actors to move | Make it possible for visible actors to move
| JavaScript | mit | BAJ-/robot-breakout,BAJ-/robot-breakout |
4d87506befd11dd11adbcd86264eb27e374c92bf | lambda/index.js | lambda/index.js | const execFile = require('child_process').execFile;
exports.handler = function(event, context) {
const chunkSize = process.env.CHUNK_SIZE || 10;
var records = event.Records;
var context = context;
console.log("Received " + records.length + " records.")
var chunkOffset = 0;
var chunks = []
while (chun... | const execFile = require('child_process').execFile;
const fs = require("fs");
exports.handler = function(event, context) {
const chunkSize = process.env.CHUNK_SIZE || 10;
var records = event.Records;
var context = context;
console.log("Received " + records.length + " records.")
var fileName = "/tmp/" + co... | Write records to a temp file that can be read by Ruby | Write records to a temp file that can be read by Ruby
| JavaScript | mit | ezcater/rumbda,ezcater/rumbda,ezcater/rumbda |
c7655bbff696025023fdea879ccaee8ad83b5b3a | lib/commands.js | lib/commands.js | 'use strict';
var mongoose = require('mongoose');
var slack = require('./slack.js');
var Rejection = mongoose.model('Rejection');
exports.reject = reject;
function reject(args, message) {
var companyName = args[0];
var rejection = new Rejection({
companyName: companyName,
user: message.user,
timesta... | 'use strict';
var mongoose = require('mongoose');
var slack = require('./slack.js');
var Rejection = mongoose.model('Rejection');
exports.reject = reject;
function reject(args, message) {
var channel = slack.getChannelGroupOrDMByID(message.channel);
var companyName = args[0];
var rejection = new Rejection({
... | Make sure rejection isn't duplicated | Make sure rejection isn't duplicated
| JavaScript | mit | remotebeta/codybot |
9c9fcef759b30742aa601e311a87e3db21cb1fd1 | bin/test-server.js | bin/test-server.js | // Shamelessly pulled from Modernizr
// https://github.com/Modernizr/Modernizr/blob/master/test/js/server.js
var express = require('express'),
path = require('path'),
fs = require('fs'),
args = process.argv.slice(2),
root = path.join(__dirname, '..');
folder = path.join(root, 'test'),
port = args[1] || '80'; ... | // Shamelessly pulled from Modernizr
// https://github.com/Modernizr/Modernizr/blob/master/test/js/server.js
var express = require('express'),
path = require('path'),
fs = require('fs'),
args = process.argv.slice(2),
root = path.join(__dirname, '..'),
folder = path.join(root, 'build'),
port = args[1] || '80';... | Update test server for build directory | Update test server for build directory | JavaScript | mit | walmartlabs/thorax,eastridge/thorax-form-helpers,FormidableLabs/thorax,Khan/lorax,liorch88/thorax |
2ed9a3ccb7a9496903ac2cbc81accb5e2819e6fa | git-deploy.js | git-deploy.js | /*
@method gitPull
Takes a flightplan instance and transport
@param remote {Object} Flightplan transport instance
@param webRoot {string} path to run git pull on the remote server
e.g. /var/www/project
*/
var gitPull = function (remote, webRoot) {
// git pull
remote.with('cd ' + webRoot, function() {
... | /*
@method gitPull
Takes a flightplan instance and transport
@param remote {Object} Flightplan transport instance
@param webRoot {string} path to run git pull on the remote server
@param [gitIdentifier=master] {string} branch/tag/commit identifier
e.g. /var/www/project
*/
var gitPull = function (remote, we... | Add option to deploy specific branch/tag which defaults to master | Add option to deploy specific branch/tag which defaults to master | JavaScript | mit | grahamgilchrist/flightplan-git-deploy |
bccd2d9aac14edbdc9b40e55454c57ed71b1fe9e | lib/js-transform.js | lib/js-transform.js | const babelify = require('babelify')
const envify = require('envify/custom')
const markdown = require('browserify-markdown')
const through = require('through2')
const YAML = require('yamljs')
const babelConfig = require('./babel-config')
const util = require('./util')
module.exports = function transform ({
config,
... | const babelify = require('babelify')
const envify = require('envify/custom')
const markdown = require('browserify-markdown')
const through = require('through2')
const YAML = require('yamljs')
const babelConfig = require('./babel-config')
const util = require('./util')
module.exports = function transform ({
config,
... | Apply envify globally so that local react files get processed by it. | fix(envify): Apply envify globally so that local react files get processed by it.
| JavaScript | mit | conveyal/mastarm,conveyal/mastarm |
95958a7845590d14f52e2c67269ab6b5c27fa815 | lib/sections.js | lib/sections.js | var _ = require('lodash');
// Split a page up into sections (lesson, exercises, ...)
function split(nodes) {
var section = [];
return _.chain(nodes)
.reduce(function(sections, el) {
if(el.type === 'hr') {
sections.push(section);
section = [];
section.links = nod... | var _ = require('lodash');
// Split a page up into sections (lesson, exercises, ...)
function split(nodes) {
var section = [];
var sections = _.chain(nodes)
.reduce(function(sections, el) {
if(el.type === 'hr') {
sections.push(section);
section = [];
} else {
... | Fix carrying kramed links around | Fix carrying kramed links around
| JavaScript | apache-2.0 | GitbookIO/plugin-exercises,datchley/plugin-exercises,datchley/plugin-exercises,GitbookIO/plugin-exercises |
7282bf75fad890a40f43e9c1c046b5a818278199 | lib/unbemify.js | lib/unbemify.js | const logger = require('./utils/logger'),
argsParser = require('./parsers/argsParser'),
styleParser = require('./parsers/styleParser'),
filesReader = require('./utils/filesReader'),
filesWriter = require('./utils/filesWriter'),
minificationReport = require('./utils/minificationReport'),
... | const logger = require('./utils/logger'),
argsParser = require('./parsers/argsParser'),
styleParser = require('./parsers/styleParser'),
filesReader = require('./utils/filesReader'),
filesWriter = require('./utils/filesWriter'),
minificationReport = require('./utils/minificationReport'),
... | Change args order for report function | Change args order for report function
| JavaScript | mit | acupofspirt/unbemify |
ff86d78e54043fb04c588d01f4c26f943c94955c | lib/Client.js | lib/Client.js | const socket = require('socket.io-client')();
class Client {
constructor(board, boardElement) {
this.board = board;
this.boardElement = boardElement;
socket.on('login', ({id}) => {
this.board.selfNumber = id;
this.boardElement.update();
});
socket.on('update', (data) => {
this.board.fromData(data);... | const socket = require('socket.io-client')();
class Client {
constructor(board, boardElement) {
this.board = board;
this.boardElement = boardElement;
socket.on('login', ({id}) => {
this.board.selfNumber = id;
this.boardElement.update();
});
socket.on('update', (data) => {
this.board.fromData(data);... | Disable moving after the game is over | Disable moving after the game is over
| JavaScript | mit | kurgm/octas,kurgm/octas,kurgm/octas |
a347ae9d671d81afb863bb5d64b2921e6f5db48e | template/client/router/index.js | template/client/router/index.js | import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
// Codesplit based on route
const Home = ()=> System.import('pages/Home')
const Test = ()=> System.import('pages/Test')
const NotFound = ()=> System.import('pages/NotFound')
const options = {
mode: 'history',
scrollBehavior(to, from, saved... | import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
const loadPage = name=> ()=> import(`pages/${name}`)
const pages = [
'Home',
'Test',
'NotFound'
]
.map(page=> ({ name: page, component: loadPage(page) }))
.reduce((sum, { name, component })=> ({...sum, [name]: component}), {})
... | Use import() instead of System.import() | Use import() instead of System.import()
| JavaScript | mit | Narkoleptika/webpack-everything,Narkoleptika/webpack-everything |
06f1265a8bb84d383d4d14671825746b54db12e6 | src/bundles/rollbar.umd.js | src/bundles/rollbar.umd.js | var globalnotifier = require('../globalnotifier');
var notifier = require('../notifier');
function setupJSON() {
var JSONObject = JSON;
if (__USE_JSON__) {
// This adds the script to this context. We need it since this library
// is not a CommonJs or AMD module.
require("script!../../vendor/json2.min.... | var globalnotifier = require('../globalnotifier');
var notifier = require('../notifier');
function setupJSON() {
var JSONObject = JSON;
if (__USE_JSON__) {
// This adds the script to this context. We need it since this library
// is not a CommonJs or AMD module.
require("script!../../vendor/json2.min.... | Initialize notifier if window._rollbarConfig is found. @coryvirok. | Initialize notifier if window._rollbarConfig is found. @coryvirok.
| JavaScript | mit | Crisfole/rollbar.js,rollbar/rollbar.js |
086c12fb654fb1a71eb6df9a047f1f2cace8a979 | app/assets/javascripts/admin/modules/analytics.js | app/assets/javascripts/admin/modules/analytics.js | (function (GOVUK) {
'use strict'
GOVUK.Analytics.load()
GOVUK.analyticsVars = { primaryLinkedDomains: [document.domain] }
GOVUK.analytics = new GOVUK.Analytics({
universalId: 'UA-26179049-6', // GOVUK Apps GA ID
cookieDomain: document.domain
})
GOVUK.analytics.trackPageview()
})(window.GOVUK)
| (function (GOVUK) {
'use strict'
GOVUK.Analytics.load()
GOVUK.analyticsVars = { primaryLinkedDomains: [document.domain] }
GOVUK.analytics = new GOVUK.Analytics({
universalId: 'UA-26179049-6', // GOVUK Apps GA ID
cookieDomain: document.domain
})
GOVUK.analytics.trackPageview()
GOVUK.analyticsPlug... | Enable external link tracking plugin | Enable external link tracking plugin
This is needed to track external links on whitehall.
Previously, we had external link tracking but this was lost during the transition. It was assumed that external links were automatically tracked but the implementation requires the plugin to be called.
| JavaScript | mit | alphagov/whitehall,alphagov/whitehall,alphagov/whitehall,alphagov/whitehall |
f17d29c5a20258b83971caa8826abce10951e866 | core/server/events/index.js | core/server/events/index.js | var events = require('events'),
util = require('util'),
EventRegistry,
EventRegistryInstance;
EventRegistry = function () {};
util.inherits(EventRegistry, events.EventEmitter);
EventRegistryInstance = new EventRegistry();
EventRegistryInstance.setMaxListeners(100);
module.exports = EventRegistryInsta... | var events = require('events'),
util = require('util'),
EventRegistry,
EventRegistryInstance;
EventRegistry = function () {
events.EventEmitter.call(this);
};
util.inherits(EventRegistry, events.EventEmitter);
EventRegistryInstance = new EventRegistry();
EventRegistryInstance.setMaxListeners(100);... | Make sure events gets initialized | Make sure events gets initialized
| JavaScript | mit | syaiful6/Ghost,disordinary/Ghost,singular78/Ghost,syaiful6/Ghost,novaugust/Ghost,jorgegilmoreira/ghost,janvt/Ghost,ErisDS/Ghost,Kikobeats/Ghost,vainglori0us/urban-fortnight,Kaenn/Ghost,dbalders/Ghost,leonli/ghost,novaugust/Ghost,JohnONolan/Ghost,leonli/ghost,GroupxDev/javaPress,NovaDevelopGroup/Academy,BlueHatbRit/Ghos... |
82a5da61df9879799c1dfa056da35ae95ac1af70 | client/lib/i18n.js | client/lib/i18n.js | // We save the user language preference in the user profile, and use that to set
// the language reactively. If the user is not connected we use the language
// information provided by the browser, and default to english.
Tracker.autorun(() => {
const currentUser = Meteor.user();
let language;
if (currentUser) {... | // We save the user language preference in the user profile, and use that to set
// the language reactively. If the user is not connected we use the language
// information provided by the browser, and default to english.
Tracker.autorun(() => {
const currentUser = Meteor.user();
let language;
if (currentUser) {... | Use the navigator's language properties even if a user exists but the user has not yet choosen a profile language. If the browser provides multiple preferred languages via `navigator.languages`, select the most-preferred one. | Use the navigator's language properties even if a user exists but the user has not yet choosen a profile language. If the browser provides multiple preferred languages via `navigator.languages`, select the most-preferred one.
WKN-47
| JavaScript | mit | johnleeming/wekan,libreboard/libreboard,wekan/wekan,mario-orlicky/wekan,wekan/wekan,wekan/wekan,jtickle/wekan,ddanssaert/wekan,libreboard/libreboard,nztqa/wekan,Serubin/wekan,Serubin/wekan,mario-orlicky/wekan,jtickle/wekan,wekan/wekan,GhassenRjab/wekan,ddanssaert/wekan,oliver4u/sap-wekan,johnleeming/wekan,Serubin/wekan... |
c26ae6523de0ddeba827a6dddb96a9be7d1a3ba0 | lib/raspar.js | lib/raspar.js | const fs = require('fs');
const {join} = require('path');
const {promisify} = require('util');
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const mkdirp = promisify(require('mkdirp'));
const request = promisify(require('request'));
const checkCacheExpiry = require('../utils/che... | const fs = require('fs');
const {join} = require('path');
const {promisify} = require('util');
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const mkdirp = promisify(require('mkdirp'));
const request = promisify(require('request'));
const checkCacheExpiry = require('../utils/che... | Support passing an array of urls. | Support passing an array of urls.
| JavaScript | mit | neogeek/raspar |
c9d377e30d19e13cb2bef69e55fd35342e659f32 | lib/router.js | lib/router.js | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound',
});
Router.route('/', {
name: 'home',
waitOn: function() {
return subscriptions.subscribe('allVolunteers');
},
fastRender: true
});
Router.route('/myProfile', {
name... | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound',
});
Router.route('/', {
name: 'home',
waitOn: function() {
return subscriptions.subscribe('allVolunteers');
},
fastRender: true
});
Router.route('/myProfile', {
name... | Add admin routes and layout management | Add admin routes and layout management
| JavaScript | mit | EKlore/EKlore,EKlore/EKlore |
86e1c68677e10b313a8dbd6675caeea31d6cdc01 | lib/floats.js | lib/floats.js | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var postcss = require('postcss')
var cssstats = require('cssstats')
var floats = require('tachyons-floats/package.json')
var floatsCss = fs.readFileSync('node_modules/tachyons-floats/tachyons-floats.min.... | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var postcss = require('postcss')
var cssstats = require('cssstats')
var floats = require('tachyons-floats/package.json')
var floatsCss = fs.readFileSync('node_modules/tachyons-floats/tachyons-floats.min.... | Update with reference to global nav partial | Update with reference to global nav partial
| JavaScript | mit | pietgeursen/pietgeursen.github.io,fenderdigital/css-utilities,fenderdigital/css-utilities,tachyons-css/tachyons,matyikriszta/moonlit-landing-page,topherauyeung/portfolio,getfrank/tachyons,cwonrails/tachyons,topherauyeung/portfolio,topherauyeung/portfolio |
3b4e28cc798ea8c73791e8bbc55e813671dc163e | lib/output.js | lib/output.js | /*
* Optics / output.js
* copyright (c) 2016 Susisu
*/
/**
* @module output
*/
"use strict";
function endModule() {
module.exports = Object.freeze({
Output,
std
});
}
/**
* The `Output` class represents pair of output and error output function.
* An instance of this class is used as t... | /*
* Optics / output.js
* copyright (c) 2016 Susisu
*/
/**
* @module output
*/
"use strict";
function endModule() {
module.exports = Object.freeze({
Output,
std
});
}
/**
* The `Output` class represents pair of output and error output function.
* An instance of this class is used as t... | Fix the Output constructor does not throw TypeError | Fix the Output constructor does not throw TypeError
| JavaScript | mit | susisu/Optics |
0d09a3c0b1c377848a5d5e60e6d9e2ee53eaf7b6 | src/stores/profileStore.js | src/stores/profileStore.js | import { observable, action } from 'mobx'
class ProfileStore {
@observable profile
@action
updateProfile(profile) {
this.profile = profile
}
}
export default new ProfileStore()
| import { action, observable, runInAction, useStrict } from 'mobx'
useStrict(true)
class ProfileStore {
@observable profile
@action
updateProfile = async (accessToken) => {
let userInfoResponse = await fetch(
`https://graph.facebook.com/me?access_token=${accessToken}&fields=id,name,picture.type(large)... | Update profile by passing accessToken, not profile data | Update profile by passing accessToken, not profile data
| JavaScript | mit | OpenHackFarm/tshansik-app |
b60ea101b41e93864c2e850b95abc257266c422a | stories/user-input.stories.js | stories/user-input.stories.js | /**
* User Input Component Stories.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-... | /**
* User Input Component Stories.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-... | Refactor user input story with padding parameter. | Refactor user input story with padding parameter.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp |
177a5b6925c2a77b7e3017299a2fa93db9d79594 | src/Component/ContextMenuProvider.js | src/Component/ContextMenuProvider.js | import React, {
PureComponent,
createElement,
Children,
cloneElement
} from 'react';
import PropTypes from 'prop-types';
import eventManager from './../util/eventManager';
class ContextMenuProvider extends PureComponent {
static propTypes = {
id: PropTypes.oneOfType([
PropTypes.string,
PropT... | import React, {
PureComponent,
createElement,
Children,
cloneElement,
isValidElement
} from 'react';
import PropTypes from 'prop-types';
import eventManager from './../util/eventManager';
class ContextMenuProvider extends PureComponent {
static propTypes = {
id: PropTypes.oneOfType([
PropTypes.s... | Clone only valid react element | Clone only valid react element
| JavaScript | mit | fkhadra/react-contexify,fkhadra/react-contexify,fkhadra/react-contexify |
ba8565eae8a04bba7ad4dab065c8df8c0a96f1e2 | src/index.js | src/index.js | import React, { Component } from 'react';
import ReactDom from 'react-dom';
import YTSearch from 'youtube-api-search';
import SearchBar from './components/search_bar';
import VideoList from './components/video_list';
import VideoDetail from './components/video_detail';
// const API_KEY = 'PLACE_YOUR_API_KEY_HERE';
cla... | import React, { Component } from 'react';
import ReactDom from 'react-dom';
import YTSearch from 'youtube-api-search';
import SearchBar from './components/search_bar';
import VideoList from './components/video_list';
import VideoDetail from './components/video_detail';
// const API_KEY = 'PLACE_YOUR_API_KEY_HERE';
cla... | Add a property onto VideoList that calls a function which updates App state with a selectVideo. | Add a property onto VideoList that calls a function which updates App state with a selectVideo.
| JavaScript | mit | JosephLeon/redux-simple-starter-tutorial,JosephLeon/redux-simple-starter-tutorial |
0e7902f59fc32b68cc08d7d5e782f2cb2f5ca04b | src/index.js | src/index.js | export function configure(config) {
config.globalResources("./page-pod");
}
| export { PagePod } from "./page-pod";
export function configure(config) {
config.globalResources("./page-pod");
}
| Add export to fix bundle problem | Add export to fix bundle problem
| JavaScript | mit | cusi-dev/page-pod,cusi-dev/page-pod |
9f508d3cec56860b29c872c94c535d3e42a8a790 | src/index.js | src/index.js | var uniqueRandomArray = require('unique-random-array');
var starWarsNames = require('./starwars-names.json');
var getRandomItem = uniqueRandomArray(starWarsNames);
module.exports = {
all: starWarsNames,
random: random
};
function random(number) {
if (number === undefined) {
return getRandomItem();
} else... | var uniqueRandomArray = require('unique-random-array');
var starWarsNames = require('./starwars-names.json');
var getRandomItem = uniqueRandomArray(starWarsNames);
module.exports = {
all: starWarsNames,
random: random
};
function random(number) {
if (number === undefined) {
return getRandomItem();
} else... | Fix random with a number issue | fix(random): Fix random with a number issue
It was returning an array of empty values because I have no idea how to program :-(
| JavaScript | mit | opagani/github-follow-names,geordanex/alien-names,suwigyarathore/random-names,GAntoine/retro-game-names,Eetin/warcraft-names,jdinartejesus/lordofthering-names |
f8ed32b7850514392a7a9ea2532d50dc233b0efb | background.js | background.js | (function () {
'use strict';
// Awesome Browser Shortcuts
chrome.commands.onCommand.addListener(function (command) {
console.log(command);
if (command === 'toggle-pin') {
// Get current tab in the active window
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
var currentTab = tab... | (function () {
'use strict';
// Awesome Browser Shortcuts
chrome.commands.onCommand.addListener(function (command) {
if (command === 'toggle-pin') {
// Get current tab in the active window
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
var currentTab = tabs[0];
chrome.tabs.up... | Fix toggle-pin and clean code | Fix toggle-pin and clean code
| JavaScript | mit | djadmin/browse-awesome |
fa5162792ad9fb0afe0a60c1fbb62dcf3e8ab990 | src/construct.js | src/construct.js | import Joi from 'joi'
import { graph } from 'helpers/sparql'
export default [
{
path: '/pipelines',
query: `
PREFIX core: <http://mu.semte.ch/vocabularies/core/>
CONSTRUCT {
?pipeline ?p ?o .
?step ?x ?y
}
FROM <${graph}>
WHERE {
?pipeline core:uuid ?uuid... | import Joi from 'joi'
import { graph } from 'helpers/sparql'
export default [
{
path: '/pipelines',
query: `
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
PREFIX pwo: <http://purl.org/spar/pwo/>
CONSTRUCT {
?pipeline ?p ?o .
?step ?x ?y
}
FROM <${graph}>
... | Use prefixes in SPARQL query | Use prefixes in SPARQL query
| JavaScript | mit | big-data-europe/mu-pipeline-export-service |
b28a2c466e6f6c05cf588364cab409dcf50646e5 | src/components/Tickets/AddProject.js | src/components/Tickets/AddProject.js | import React, { Component } from 'react';
export default class AddProject extends Component {
constructor() {
super();
this.state = {
projectId: '',
};
this.submit = this.submit.bind(this);
}
submit(e) {
e.preventDefault();
this.props.onAdd(this.state.projectId);
}
render() ... | import React, { Component } from 'react';
export default class AddProject extends Component {
constructor() {
super();
this.state = {
projectId: '',
};
this.submit = this.submit.bind(this);
}
submit(e) {
e.preventDefault();
this.props.onAdd(this.state.projectId);
}
render() ... | Add placeholder of example ID to manual project entry | Add placeholder of example ID to manual project entry
| JavaScript | mit | nadavspi/UnwiseConnect,nadavspi/UnwiseConnect,nadavspi/UnwiseConnect |
7b67cb7591c1ffe8f556e23261e055a8a5c60775 | src/router/createLocaleMiddleware.js | src/router/createLocaleMiddleware.js | export default ({
defaultLocale,
siteLocales,
} = {}) => (req, res, next) => {
if (typeof defaultLocale !== 'string') {
throw new Error(`Expected defaultLocale to be a locale string.`);
}
if (typeof siteLocales !== 'object' || siteLocales.constructor !== Array || siteLocales.length === 0) {
throw new ... | export default ({
defaultLocale,
siteLocales,
} = {}) => (req, res, next) => {
if (typeof defaultLocale !== 'string') {
throw new Error(`Expected defaultLocale to be a locale string.`);
}
if (typeof siteLocales !== 'object' || siteLocales.constructor !== Array || siteLocales.length === 0) {
throw new ... | Fix server-side locale matching logic | Fix server-side locale matching logic
| JavaScript | mit | traveloka/soya-next |
6d80a0a2941895a2afdaaf43dfb04ca8b0ec7a42 | src/Store.js | src/Store.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2020
*/
import AsyncStorage from '@react-native-community/async-storage';
import { persistStore, persistReducer } from 'redux-persist';
import { applyMiddleware, createStore } from 'redux';
import thunk from 'redux-thunk';
import { navigationMiddleware } from ... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2020
*/
import AsyncStorage from '@react-native-community/async-storage';
import { persistStore, persistReducer } from 'redux-persist';
import { applyMiddleware, createStore } from 'redux';
import thunk from 'redux-thunk';
import { navigationMiddleware } from ... | Add remove temperatureSync from blacklist | Add remove temperatureSync from blacklist
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
86a0e92e29327c933941ca5b9e813868a1244296 | simpleform.js | simpleform.js | SimpleForm = {
processForm: function(target) {
var form = {};
array = $(target).serializeArray();
_.each(array, function(formItem) {
type = $(target).find("input[name='" + formItem.name + "']").attr('type')
if (type === 'date') {
return form[formItem.name] = new Date(formItem.value);
... | SimpleForm = {
processForm: function(target) {
var form = {};
array = $(target).serializeArray();
_.each(array, function(formItem) {
type = $(target).find("input[name='" + formItem.name + "']").attr('type')
if (type === 'date') {
return form[formItem.name] = new Date(formItem.value + "... | Add midnight time to date stamps. | Add midnight time to date stamps.
| JavaScript | mit | meteorclub/simple-form |
0c2a9a4be5b3228e4ce2cd425bc974782e58d7d7 | secrets-template.js | secrets-template.js | /* cp to secrets.js and fill w/ yr api keys as needed */
export default function secrets() {
return {
echoNest: '',
};
}
| /* cp to secrets.js and fill w/ yr api keys as needed */
export default function secrets() {
return {
echoNest: '',
'7digital': '',
};
}
| Add 7digital api key spot | Add 7digital api key spot
| JavaScript | mit | freeformpdx/pollard,freeformpdx/pollard,spencerliechty/pollard,spncrlkt/pollard,spencerliechty/pollard,spncrlkt/pollard,spncrlkt/pollard,freeformpdx/pollard,spencerliechty/pollard |
2c605dbf3b154bd1bcdf4cb17ca76a986374fd62 | src/Regex.js | src/Regex.js | var _curry = require('./internal/_curry');
var Regex = require('./internal/_primitives').Regex;
/**
* Point-free, curried form of regular expression's test method.
*
* @sig String -> RegExp -> Boolean
* @since 0.6.0
*/
Regex.test = _curry(function(str, re){
return re.test(str);
});
/**
* Point-free, currie... | var _curry = require('./internal/_curry');
var Regex = require('./internal/_primitives').Regex;
/**
* Point-free, curried form of regular expression's test method.
*
* @sig String -> RegExp -> Boolean
* @since 0.6.0
*/
Regex.test = _curry(function(str, re){
return re.test(str);
});
/**
* Point-free, currie... | Update to regex exec so returns array if no match found | Update to regex exec so returns array if no match found
| JavaScript | mit | mwardle/lambdash,mwardle/funkit |
4e4d5a937044f3f4bbedc8bf9de668c028b756e6 | src/entry.js | src/entry.js | import Calendar from './Calendar';
import CenturyView from './CenturyView';
import DecadeView from './DecadeView';
import YearView from './YearView';
import MonthView from './MonthView';
export default Calendar;
export {
CenturyView,
DecadeView,
YearView,
MonthView,
};
| import Calendar from './Calendar';
import CenturyView from './CenturyView';
import DecadeView from './DecadeView';
import YearView from './YearView';
import MonthView from './MonthView';
export default Calendar;
export {
Calendar,
CenturyView,
DecadeView,
YearView,
MonthView,
};
| Allow importing Calendar by destructuring | Allow importing Calendar by destructuring
| JavaScript | mit | wojtekmaj/react-calendar,wojtekmaj/react-calendar,wojtekmaj/react-calendar |
9a9c8cdb666e51cf25f3c30715cbf54ae3514df6 | src/updater/twitter/ScheduleTweet.js | src/updater/twitter/ScheduleTweet.js | const TwitterPostBase = require('./TwitterPostBase');
const { captureScheduleScreenshot } = require('../screenshots');
const { readData } = require('../utilities');
class ScheduleTweet extends TwitterPostBase {
getKey() { return 'schedule'; }
getName() { return 'Schedule'; }
getSchedules() {
retur... | const TwitterPostBase = require('./TwitterPostBase');
const { captureScheduleScreenshot } = require('../screenshots');
const { readData, readJson } = require('../utilities');
const path = require('path');
const stagesPath = path.resolve('storage/stages.json');
class ScheduleTweet extends TwitterPostBase {
getKey(... | Use alternate text for the schedule tweet when there's a new stage | Use alternate text for the schedule tweet when there's a new stage
| JavaScript | mit | misenhower/splatoon2.ink,misenhower/splatoon2.ink,misenhower/splatoon2.ink |
c6a6625f4fe44b70bc7351c876872d1f1b219c15 | src/index.js | src/index.js | const React = require('react');
const ReactDOM = require('react-dom');
const { Provider } = require('react-redux');
const { initializeApp } = require('./actions');
const Root = require('./components/Root');
const config = require('./config');
const { configureStore } = require('./store');
/**
* @namespace Immut... | const React = require('react');
const ReactDOM = require('react-dom');
const { Provider } = require('react-redux');
const { initializeApp } = require('./actions');
const Root = require('./components/Root');
const config = require('./config');
const acts = require('./immutable/acts');
const constants = require('./... | Define some variables for manual debugging | Define some variables for manual debugging
| JavaScript | apache-2.0 | kjirou/developers-defense,kjirou/developers-defense |
11be565af68faeac318816367d294ada91f25b9c | src/index.js | src/index.js | const { response } = require('./util/lambda')
function handler(event, context, callback) {
const { body } = event;
const {
SPOTIFY_USER_ACCESS_TOKEN,
SPOTIFY_LOCAL_URL,
SLACK_TOKEN
} = process.env;
let message = 'no token...';
if (SPOTIFY_USER_ACCESS_TOKEN) {
messa... | const { response } = require('./util/lambda')
function handler(event, context, callback) {
const { body } = event;
const { SPOTIFY_CLIENT_ID, SPOTIFY_SECRET } = process.env;
callback(null, response({
message: 'It works!',
body: body
}));
}
module.exports = {
handler
};
| Revert "verifying token is present. deploy test" | Revert "verifying token is present. deploy test"
This reverts commit 58bf3a514f5c3ea77062ebee8b4fc16ed10f81f8.
| JavaScript | apache-2.0 | chrisdevwords/spotify-playlist-lambda,chrisdevwords/spotify-playlist-lambda |
47fa0a8f7efd295c9752f0c37e7bed2c54d11803 | spec/specs.js | spec/specs.js | describe('pingPongOutput', function() {
it("is the number for most input numbers", function() {
expect(pingPongOutput(2)).to.equal(2);
});
});
| describe('pingPongOutput', function() {
it("is the number for most input numbers", function() {
expect(pingPongOutput(2)).to.equal(2);
});
it("is 'ping' for numbers divisible by 3", function() {
expect(pingPongOutput(6)).to.equal("ping");
});
});
| Add spec for divisible by 3 | Add spec for divisible by 3
| JavaScript | mit | JeffreyRuder/ping-pong-app,JeffreyRuder/ping-pong-app |
c668a3395d2b5988386a0a84ad1a177c3c21ea21 | src/index.js | src/index.js | import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import { BrowserRouter, Route } from 'react-router-dom';
import promise from 'redux-promise';
import reducers from './reducers';
import PostsIndex from './component... | import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import promise from 'redux-promise';
import reducers from './reducers';
import PostsIndex from './c... | Use Switch instead of exact | Use Switch instead of exact
| JavaScript | mit | monsteronfire/redux-learning-blog,monsteronfire/redux-learning-blog |
02c90befd410d5eb7d5a26cef27bb6c789dc0cf5 | src/index.js | src/index.js | 'use strict'
import React from 'react'
import { render } from 'react-dom'
import { version } from '../package.json'
import redirectToHttps from './utils/https'
import { BigSpinner } from './components/Spinner'
import './styles/normalize.css'
import './styles/Fonts.scss'
import './styles/Main.scss'
import './styles... | 'use strict'
import React from 'react'
import { render } from 'react-dom'
import { version } from '../package.json'
import redirectToHttps from './utils/https'
import { BigSpinner } from './components/Spinner'
import './styles/normalize.css'
import './styles/Fonts.scss'
import './styles/Main.scss'
import './styles... | Allow subdomain gateway to use http | Allow subdomain gateway to use http
go-ipfs 0.5.0 can use a subdomain as gateway to preserve origin security. This updates orbit.chat to be able to load without an https error. | JavaScript | mit | orbitdb/orbit-web,orbitdb/orbit-web,orbitdb/orbit-web |
079944f510220305689ea2d6db15457386362cec | src/index.js | src/index.js | define([
"src/views/manager",
"less!src/stylesheets/main.less"
], function(TabsManager) {
var hr = codebox.require("hr/hr");
var manager = new TabsManager();
// Add tabs to grid
codebox.app.grid.addView(manager);
// Add a view
manager.add(hr.View, {}, {
title: "Test"
});
... | define([
"src/views/manager",
"less!src/stylesheets/main.less"
], function(TabsManager) {
var hr = codebox.require("hr/hr");
var manager = new TabsManager();
// Add tabs to grid
codebox.app.grid.addView(manager);
// Add a view
manager.add(hr.View, {}, {
title: "Test"
});
... | Make the tabs manager global | Make the tabs manager global
| JavaScript | apache-2.0 | etopian/codebox-package-tabs,CodeboxIDE/package-tabs |
bab95a0a17ae94f2363d789eb70ab50b1eaebf91 | src/index.js | src/index.js | // Import NPM dependencies like this:
import React from 'react';
import ReactDOM from 'react-dom';
// Import styles like this:
import './styles/main.scss';
// Import dependencies like this:
import Goat from './components/goat-component';
class App extends React.Component {
render() {
return (
<div>I hear... | import React from 'react';
import { render } from 'react-dom';
const CHALLENGES = [
{
title: "Here is a question title",
optionList: [
{
id: 0,
title: "First",
order: 1
},
{
id: 1,
title: "Second",
order: 2
},
{
id: 2,
... | Add basic parts of app. | Add basic parts of app.
| JavaScript | mit | codeschool/silo,codeschool/silo |
3ed1ed8b3675bbd3369eae1583e6a293a00bf233 | test/test-all.js | test/test-all.js | "use strict";
exports["test filter"] = require("./filter")
exports["test map"] = require("./map")
exports["test take"] = require("./take")
exports["test take while"] = require("./take-while")
exports["test drop"] = require("./drop")
exports["test drop while"] = require("./drop-while")
exports["test into"] = require(".... | "use strict";
exports["test filter"] = require("./filter")
exports["test map"] = require("./map")
exports["test take"] = require("./take")
exports["test take while"] = require("./take-while")
exports["test drop"] = require("./drop")
exports["test drop while"] = require("./drop-while")
exports["test into"] = require(".... | Add delay test to the test index. | Add delay test to the test index. | JavaScript | mit | Gozala/reducers |
92d9ff9b88026c9cdc6d743107fe2b6089e3fe50 | test/fake/fake-request-entry-data.js | test/fake/fake-request-entry-data.js | var chance = require('./fake-extension.js'),
glimpse = require('glimpse');
function publishEntry() {
var mvc = chance.mvc(),
serverLowerTime = chance.integerRange(5, 10),
serverUpperTime = chance.integerRange(60, 100),
networkTime = chance.integerRange(0, 15),
clientTime = cha... | var chance = require('./fake-extension.js'),
glimpse = require('glimpse'),
maxEvents = chance.integerRange(25, 35),
currentEvent = 0;
function publishEntry() {
var mvc = chance.mvc(),
serverLowerTime = chance.integerRange(5, 10),
serverUpperTime = chance.integerRange(60, 100),
... | Put in a max for how many entities will be generated | Put in a max for how many entities will be generated
| JavaScript | unknown | avanderhoorn/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype,avanderhoorn/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype |
43b2bd42a4f39ffec12ae3b052806db76c6d8117 | src/index.js | src/index.js | import express from 'express'
import mongoose from 'mongoose'
import winston from 'winston'
import courses from './api/courses'
import buildings from './api/buildings'
import db from './db'
// Database connection setup
let test = process.argv.join().match('/ava/')
mongoose.connect(process.env.COBALT_MONGO_URI || 'mong... | import express from 'express'
import mongoose from 'mongoose'
import winston from 'winston'
import courses from './api/courses'
import buildings from './api/buildings'
import db from './db'
let test = process.argv.join().match('/ava/')
let enableSync = process.env.COBALT_ENABLE_DB_SYNC || true
// Database connection ... | Add DB sync toggle via environment variable | Add DB sync toggle via environment variable | JavaScript | mit | kshvmdn/cobalt,cobalt-uoft/cobalt,cobalt-io/cobalt,cobalt-io/cobalt |
ec468a921c14c4758719e1a8c5428e9d7261a321 | modal-example/app.js | modal-example/app.js | /* global Backbone */
/* global $ */
/* global _ */
(function(){
"use strict";
var app = app || {};
$(document).ready(function() {
var myData = {
type : 'confirm',
height : '400px',
width : '500px',
template : $('#my-modal-template').html(), // Customizable template
// fun... | /* global Backbone */
/* global $ */
/* global _ */
(function(){
"use strict";
var app = app || {};
$(document).ready(function() {
var myData = {
type : 'confirm',
height : '400px',
width : '500px',
template : $('#my-modal-template').html(), // Customizable template
// fun... | Fix - Removed obsolete code | Fix - Removed obsolete code
| JavaScript | mit | ashgkwd/backpack,ashgkwd/backpack |
125ebe9d417e18c6a299e13f0593126882a78923 | src/index.js | src/index.js | import * as actions from './actions'
import plugins from './plugins'
export default {
build (options) {
const env = plugins({ ...options, buildTarget: 'build' })
actions.buildAndDistribute(env)
},
dist (options) {
const env = plugins({ ...options, buildTarget: 'dist' })
actions.buildAndDistribut... | import * as actions from './actions'
import plugins from './plugins'
export default {
build (options) {
const env = plugins({ ...options, buildTarget: 'build' })
actions.buildAndDistribute(env)
},
dist (options) {
const env = plugins({ ...options, buildTarget: 'dist' })
actions.buildAndDistribut... | Remove unnecessary buildTarget from install action | Remove unnecessary buildTarget from install action | JavaScript | mit | saguijs/sagui,saguijs/sagui |
5bd7daccfdc406ac6ddd49c4020ed49172f88c89 | src/index.js | src/index.js | /* eslint-disable import/no-import-module-exports */
import React from 'react';
import ReactDOM from 'react-dom';
import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
import Analytics from './components/Analytics';
import Routes from './components/Routes';
import { setup as sentrySetup } from './... | /* eslint-disable import/no-import-module-exports */
import React, { StrictMode } from 'react';
import ReactDOM from 'react-dom';
import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
import Analytics from './components/Analytics';
import Routes from './components/Routes';
import { setup as sentry... | Enable strict mode (no warnings) | Enable strict mode (no warnings)
| JavaScript | mit | bjacobel/rak,bjacobel/rak,bjacobel/rak |
352dc9fa5dd099a023d7852b5e5034052114d2b2 | src/index.js | src/index.js | {
function say({ domNodeId, message }) {
const domNode = document.getElementById(domNodeId);
domNode.innerHTML = message;
}
say({ domNodeId: 'root', message: 'Hello World' });
} | {
function sayHello({ domNodeId = 'root', message: name }) {
const domNode = document.getElementById(domNodeId);
domNode.innerHTML = `Hello ${name}!`;
}
sayHello({ message: 'World' });
} | Use default dom node id and template | Use default dom node id and template
| JavaScript | mit | myklt/es6-mvb,myklt/es6-mvb |
3ac5b44ac12d4142e6f4eda630acd45bf8263ecd | src/index.js | src/index.js | // Global
const doc = document;
// Loaded ready states
const loadedStates = ['interactive', 'complete'];
// Return Promise
module.exports = cb => new Promise(resolve => {
// Handle DOM load
const done = () => resolve(cb && cb());
// Resolve now if DOM has already loaded
// Otherwise wait for DOMContentLoaded
if... | // Loaded ready states
const loadedStates = ['interactive', 'complete'];
// Return Promise
module.exports = (cb, doc) => new Promise(resolve => {
// Use global document if we don't have one
doc = doc || document;
// Handle DOM load
const done = () => resolve(cb && cb());
// Resolve now if DOM has already loaded... | Make function pure by allowing doc to be passed in | Make function pure by allowing doc to be passed in
| JavaScript | mit | lukechilds/when-dom-ready |
0c1fab90a93dc99d1a3c1a00f09f00872aaef782 | settings/Settings.js | settings/Settings.js | define(function (require, exports) {
"use strict";
var Strings = require("i18n!nls/strings");
/**
* Configuration of settings for use in `setupPreferences()`
*/
var _settings = [
{
// Windows 7 does not resolve hostname `0.0.0.0`
// @see https://github.com/sbr... | define(function (require, exports) {
"use strict";
var Strings = require("i18n!nls/strings");
/**
* Configuration of settings for use in `setupPreferences()`
*/
var _settings = [
{
default: "localhost",
id: "hostname",
label: Strings.SETTING_HOSTNA... | Use localhost as default hostname on all platforms | Use localhost as default hostname on all platforms
| JavaScript | mit | sbruchmann/brackets-static-preview,sbruchmann/brackets-static-preview |
28900b2ab84c7a3bd126053efe7c0162caa9fe44 | src/picker.js | src/picker.js |
var Picker = function(context) {
this.context = context;
}
Picker.prototype = {
pick: function(node, x, y, lx, ly) {
var ctx = this.context;
var tx = node.x || 0;
var ty = node.y || 0;
ctx.save();
ctx.translate(tx, ty);
// Apply transform to local coordinate values
lx -= tx;
ly... |
var Picker = function(context) {
this.context = context;
}
Picker.prototype = {
pick: function(node, x, y, lx, ly) {
var ctx = this.context;
var tx = node.x || 0;
var ty = node.y || 0;
ctx.save();
ctx.translate(tx, ty);
// Apply transform to local coordinate values
lx -= tx;
ly... | Fix early return failure to reset context | Fix early return failure to reset context
| JavaScript | mit | unchartedsoftware/pathjs |
50cf94343b55537c4b976de83c55ffd2c7b10c7c | task/init.js | task/init.js | var fs = require('fs');
var lodash = require('lodash');
var path = require('path');
var package = require(path.join(process.cwd(), 'package.json'));
var initDir = path.join(__dirname, '..', 'init');
var files = [
'src/index.js',
'src/version.js',
'.editorconfig',
'.eslintignore',
'.eslintrc',
'.gitignore',... | var fs = require('fs');
var lodash = require('lodash');
var path = require('path');
var package = require(path.join(process.cwd(), 'package.json'));
var initDir = path.join(__dirname, '..', 'init');
var files = [
'src/index.js',
'src/version.js',
'.editorconfig',
'.eslintignore',
'.eslintrc',
'.gitignore',... | Add way to notify the task when finished. | Add way to notify the task when finished.
| JavaScript | mit | skatejs/build,skatejs/build |
38624b67ba557c19ea16e3ed8950cb3aabc72a05 | test/test.js | test/test.js | require('coffee-script');
var roaster = require("roaster");
var taskLists = require("../src/index");
var fs = require("fs");
var options = {};
options.isFile = true;
roaster("./markdown.md", options, function(err, contents) {
contents = taskLists(contents);
fs.writeFileSync("./markdown.html", contents, "utf8");
... | require('coffee-script').register();
var roaster = require("roaster");
var taskLists = require("../src/index");
var fs = require("fs");
var options = {};
options.isFile = true;
roaster("./markdown.md", options, function(err, contents) {
contents = taskLists(contents);
fs.writeFileSync("./markdown.html", contents... | Make compatible with coffee-script 1.7 | Make compatible with coffee-script 1.7 | JavaScript | mit | gjtorikian/task-lists-js,gjtorikian/task-lists-js,pombredanne/task-lists-js,gjtorikian/task-lists-js,pombredanne/task-lists-js,pombredanne/task-lists-js |
3bb2d2daee07983c340c9b71a97b7d41f5fb4851 | src/vnode.js | src/vnode.js | /**
* Virtual DOM Node
* @typedef VNode
* @property {string | function} nodeName The string of the DOM node to create or Component constructor to render
* @property {Array<VNode | string>} children The children of node
* @property {string | number | undefined} key The key used to identify this VNode in a list
* @... | /**
* Virtual DOM Node
* @typedef VNode
* @property {string | function} nodeName The string of the DOM node to create or Component constructor to render
* @property {Array<VNode | string>} children The children of node
* @property {string | number | undefined} key The key used to identify this VNode in a list
* @... | Use var VNode to fix reduce_funcs uglify | Use var VNode to fix reduce_funcs uglify
| JavaScript | mit | developit/preact,developit/preact |
31f4ff1b2679a6ace25683d6d4c5d5180d308d91 | api/ordbok.js | api/ordbok.js | import express from 'express';
import cheerio from 'cheerio';
import request from 'request';
const router = new express.Router();
router.post('/', (req, res) => {
const url = `http://ordbok.uib.no/perl/ordbok.cgi?OPP=${req.body.text.replace(' ', '+')}`;
request.get(url, (rq, rs) => {
const $ = cheerio.load(r... | import express from 'express';
import cheerio from 'cheerio';
import request from 'request';
const router = new express.Router();
router.post('/', (req, res) => {
const url = `http://ordbok.uib.no/perl/ordbok.cgi?OPP=${req.body.text.replace(' ', '+')}`;
request.get(url, (rq, rs) => {
const $ = cheerio.load(r... | Add search word to response | Add search word to response
| JavaScript | mit | draperunner/readme-slack |
15c93685f57e791e44bc3c8d60e8aa7fdd5fbe3d | test/util.js | test/util.js | // A mock stream implementation that breaks up provided data into
// random-sized chunks and emits 'data' events. This is used to simulate
// data arriving with arbitrary packet boundaries.
var Buffer = require('buffer').Buffer;
var EventEmitter = require('events').EventEmitter;
var sys = require('sys');
var TestStre... | // A mock stream implementation that breaks up provided data into
// random-sized chunks and emits 'data' events. This is used to simulate
// data arriving with arbitrary packet boundaries.
var Buffer = require('buffer').Buffer;
var EventEmitter = require('events').EventEmitter;
var sys = require('sys');
var TestStre... | Create Buffer with encoding 'binary'. | Create Buffer with encoding 'binary'.
| JavaScript | bsd-3-clause | pgriess/node-strtok |
d9b2a6a3739a67cbfbcd46d22200db9e1261e616 | sendbeacon.js | sendbeacon.js | const isString = val => typeof val === 'string';
const isBlob = val => val instanceof Blob;
polyfill.call(typeof window === 'object' ? window : this);
function polyfill() {
if (isSupported.call(this)) return;
if (!('navigator' in this)) this.navigator = {};
this.navigator.sendBeacon = sendBeacon.bind(this);
};... | const isString = val => typeof val === 'string';
const isBlob = val => val instanceof Blob;
polyfill.call(typeof window === 'object' ? window : this);
function polyfill() {
if (isSupported.call(this)) return;
if (!('navigator' in this)) this.navigator = {};
this.navigator.sendBeacon = sendBeacon.bind(this);
};... | Revert "fix: so that sync will not always be false" | Revert "fix: so that sync will not always be false"
| JavaScript | mit | miguelmota/Navigator.sendBeacon |
dc89f06507c19c10b1f9a153fff3fb2a1943aaaf | src/containers/DraggableMinion/DraggableMinion.js | src/containers/DraggableMinion/DraggableMinion.js | import React, { Component, PropTypes } from 'react';
import { getEmptyImage } from 'react-dnd-html5-backend';
import { DragSource as dragSource } from 'react-dnd';
import { CardModel } from 'redux/modules/card';
import { Minion } from 'components';
export class DraggableMinion extends Component {
static propTypes = ... | import React, { Component, PropTypes } from 'react';
import { getEmptyImage } from 'react-dnd-html5-backend';
import { DragSource as dragSource } from 'react-dnd';
import { CardModel } from 'redux/modules/card';
import { Minion } from 'components';
export class DraggableMinion extends Component {
static propTypes = ... | Add canDrag validation when card has no attack | Add canDrag validation when card has no attack
| JavaScript | mit | inooid/react-redux-card-game,inooid/react-redux-card-game |
93c49204175d58bb8d91f3d038882154cd896dc5 | src/Navbar.js | src/Navbar.js | import React from 'react';
import cx from 'classnames';
import Col from './Col';
import Icon from './Icon';
class Navbar extends React.Component {
constructor(props) {
super(props);
this.renderSideNav = this.renderSideNav.bind(this);
}
componentDidMount() {
if ($ !== undefined) {
$('.button-co... | import React from 'react';
import cx from 'classnames';
import Col from './Col';
import Icon from './Icon';
class Navbar extends React.Component {
constructor(props) {
super(props);
this.renderSideNav = this.renderSideNav.bind(this);
}
componentDidMount() {
if ($ !== undefined) {
$('.button-co... | Add classname prop to render | Add classname prop to render
| JavaScript | mit | 15lyfromsaturn/react-materialize,jsbranco/react-materialize,chris-gooley/react-materialize,react-materialize/react-materialize,react-materialize/react-materialize,mattBlackDesign/react-materialize,jhernandezme/react-materialize,react-materialize/react-materialize |
05f4e2747839ef1d438d985835adfdb928a8355d | test/test.js | test/test.js | /*
* git-exec - test script
*
* Copyright (c) 2013 Alex J Burke
* Licensed under the MIT license.
*/
// imports
var fs = require('fs');
// local imports
var Git = require('../lib/git-exec');
var rimraf = require('rimraf');
// constants
var TEST_REPO = 'test_repo';
// node <0.8 compat
var exists = fs.exists || ... | /*
* git-exec - test script
*
* Copyright (c) 2013 Alex J Burke
* Licensed under the MIT license.
*/
// imports
var fs = require('fs');
// local imports
var Git = require('../lib/git-exec');
var rimraf = require('rimraf');
// constants
var TEST_REPO = 'test_repo';
// node <0.8 compat
var exists = fs.exists || ... | Test both clone and init static methods. | Test both clone and init static methods.
| JavaScript | mit | alexjeffburke/node-git-exec |
241e34e8f8db8490951a32a91b91fbc7c3f44fd8 | web/cypress/integration/namespace.spec.js | web/cypress/integration/namespace.spec.js | describe('Namespace', () => {
beforeEach(() => {
cy.visit('/');
});
it('namespaces navigation', () => {
cy.exec(
`kubectl config view --minify --output 'jsonpath={..namespace}'`
).then(result => {
cy.contains(/Namespaces/).click();
cy.contains(result.stdout).should('be.visible');
... | describe('Namespace', () => {
beforeEach(() => {
cy.visit('/', {
onBeforeLoad: spyOnAddEventListener
}).then(waitForAppStart);
});
it('namespaces navigation', () => {
cy.exec(
`kubectl config view --minify --output 'jsonpath={..namespace}'`
).then(result => {
cy.contains(/Namesp... | Fix flaky namespace dropdown test | Fix flaky namespace dropdown test
Signed-off-by: GuessWhoSamFoo <8c93751a21b6f76ce6eea67135428b7f11f28a78@vmware.com>
| JavaScript | apache-2.0 | vmware/octant,vmware/octant,vmware/octant,vmware/octant,vmware/octant |
7d0d698e11140c092b0adc51b80257b321ee56cb | bin/grunt-init-completion.js | bin/grunt-init-completion.js | #!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var tab = require('tabalot');
var noop = function() {}
var homedir = path.resolve(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.grunt-init');
if (process.argv.indexOf('completion') !== -1 && process.argv.indexOf('--') ===... | #!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var tab = require('tabalot');
var noop = function() {}
var homedir = path.resolve(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.grunt-init');
if (process.argv.indexOf('completion') !== -1 && process.argv.indexOf('--') ===... | Add workaround that makes completion actually work. | Add workaround that makes completion actually work.
| JavaScript | mit | JoshTheGeek/grunt-init-completion |
febc5d33da3892bb071594b759d74e3fbb77acd8 | test/event.js | test/event.js | import assert from 'power-assert';
import {element} from '../src/event';
describe('Event helpers:', () => {
describe('element', () => {
let input;
beforeEach(() => {
input = document.createElement('input');
});
it('executes callback if the event is emitted', (done) => {
const f = eleme... | import assert from 'power-assert';
import {element} from '../src/event';
describe('Event helpers:', () => {
describe('element', () => {
let input;
beforeEach(() => {
input = document.createElement('input');
});
it('executes callback if the event is emitted', (done) => {
const f = eleme... | Fix test case to adapt web standard | Fix test case to adapt web standard
| JavaScript | mit | ktsn/vq |
5d902bfbe175d1d4d3a3462ca5a8a98a450b5025 | test/index.js | test/index.js | describe("Almacen", function() {
it("should set data in the localStorage", function() {
almacen.local.set("string", "hello");
almacen.local.set("number", 23);
almacen.local.set("boolean", true);
almacen.local.set("array", [1,2,3,4,5,6]);
almacen.local.set("object", { "foo": "bar" });
expect... | describe("Almacen", function() {
it("should set data in the localStorage", function() {
almacen.local.set("string", "hello");
almacen.local.set("number", 23);
almacen.local.set("boolean", true);
almacen.local.set("array", [1,2,3,4,5,6]);
almacen.local.set("object", { "foo": "bar" });
almacen... | Test that null values are also stored | Test that null values are also stored
| JavaScript | mit | rojo2/almacen,rojo2/almacen |
5e35c65936868ed29ac099ca22a240aa7047d523 | index.android.js | index.android.js | import 'es6-symbol/implement';
import {Provider} from 'react-redux';
import store from './src/redux/store';
import AppViewContainer from './src/modules/AppViewContainer';
import React from 'react';
import {setConfiguration} from './src/utils/configuration';
import {AppRegistry, BackAndroid} from 'react-native';
import ... | import 'es6-symbol/implement';
import {Provider} from 'react-redux';
import store from './src/redux/store';
import AppViewContainer from './src/modules/AppViewContainer';
import React from 'react';
import {setConfiguration} from './src/utils/configuration';
import {AppRegistry, BackAndroid} from 'react-native';
import ... | Set backend to production backend | Set backend to production backend
| JavaScript | mit | futurice/PelaryHemmo,futurice/PelaryHemmo,futurice/PelaryHemmo |
32cb78b0bce0d5ed6def654bf5de52ddd0183025 | src/models/ApiModel.js | src/models/ApiModel.js | var curry = require('curry');
var EventEmitter = require('events').EventEmitter;
var registeredRoute = new EventEmitter()
, registeredRouteError = new EventEmitter();
const PUBLIC = "public"
, SECURED = "secured"
, ADMINISTRATION = { SYSTEM: "systemAdministration", USER: "userAdministration", STREAM: "st... | var curry = require('curry');
var EventEmitter = require('events').EventEmitter;
var registeredRoute = new EventEmitter()
, registeredRouteError = new EventEmitter();
const PUBLIC = "public"
, SECURED = "secured"
, ADMINISTRATION = { SYSTEM: "systemAdministration", USER: "userAdministration", STREAM: "st... | Add route declaration to route dictionary | Add route declaration to route dictionary
| JavaScript | mit | james-gibson/agrig8,james-gibson/agrig8 |
5821d63fff37f45500273c6dafb8db8ae588c06e | tests/router.js | tests/router.js | "use strict";
var Router = require("../router");
exports.testValidAcceptHeader = function (test) {
var results = Router.prototype._parseAcceptHeader("application/json");
test.deepEqual([{
"type": "application",
"subtype": "json",
"params": {}
}], results);
test.done();
};
exports.testValidAcceptHeaderWithP... | "use strict";
var Router = require("../router");
exports.testCompileRegex = function (test) {
var compile = Router.prototype._compile;
test.equal(compile("/foo").toString(), "/^\/+foo$/");
test.equal(compile("/foo/bar").toString(), "/^\/+foo\/+bar$/");
test.done();
};
exports.testValidAcceptHeader = function (te... | Add tests for compiling regexps | Add tests for compiling regexps
| JavaScript | isc | whymarrh/mattress |
d39a6a709209371a3e2c3eafc650717009028f57 | src/store/configure.js | src/store/configure.js | import { createStore, applyMiddleware } from 'redux';
import thunkMiddleware from 'redux-thunk';
import loggerMiddleware from 'redux-logger';
import rootReducer from '../reducers';
const createStoreWithMiddleware = applyMiddleware(
thunkMiddleware,
loggerMiddleware
)(createStore);
export default function config... | import { createStore, applyMiddleware } from 'redux';
import thunkMiddleware from 'redux-thunk';
import createLogger from 'redux-logger';
import rootReducer from '../reducers';
const loggerMiddleware = createLogger({
level: 'info',
collapsed: true
});
const createStoreWithMiddleware = applyMiddleware(
thunkMi... | Change logger middleware due the new version | Change logger middleware due the new version
The new version requires use the createLogger function | JavaScript | mit | sqlectron/sqlectron-gui,sqlectron/sqlectron-gui,sqlectron/sqlectron-gui,sqlectron/sqlectron-gui |
cabe6d4a04698c5380d8c9a008c8a300bc2d62c3 | src/utils/load-json.js | src/utils/load-json.js | define(['utils/ajax'], function (Ajax) {
/**
* Loads a JSON File and passes the content to a callback function
* @param {string} jsonFile The location of the JSON file in which to load.
* @param {Function} callback A function in which to run on load complete of file.
*
* @example
* ... | define(['utils/ajax'], function (Ajax) {
function LoadJson () {
this.ajax = new Ajax();
}
/**
* Loads a JSON File and passes the content to a callback function
* @param {string} jsonFile The location of the JSON file in which to load.
* @param {Function} callback A function in whi... | Refactor loadJson so it can be tested. | Refactor loadJson so it can be tested.
| JavaScript | mit | rockabox/Auxilium.js |
643fe58c81096611218b365d92c3a0e940e951ee | appsrc/store/browser-store.js | appsrc/store/browser-store.js |
import {createStore, applyMiddleware, compose} from 'redux'
import {electronEnhancer} from 'redux-electron-enhancer'
import createLogger from 'redux-cli-logger'
import createSagaMiddleware from 'redux-saga'
import sagas from '../sagas'
import reducer from '../reducers'
import env from '../env'
const middleware = [
... |
import {createStore, applyMiddleware, compose} from 'redux'
import {electronEnhancer} from 'redux-electron-enhancer'
import createLogger from 'redux-cli-logger'
import createSagaMiddleware from 'redux-saga'
import sagas from '../sagas'
import reducer from '../reducers'
import env from '../env'
const crashGetter = (s... | Add homebrew redux middleware to catch all errors.. | Add homebrew redux middleware to catch all errors..
| JavaScript | mit | itchio/itchio-app,itchio/itch,itchio/itch,leafo/itchio-app,itchio/itch,itchio/itch,itchio/itch,leafo/itchio-app,itchio/itchio-app,itchio/itch,leafo/itchio-app,itchio/itchio-app |
f1594f436f13fac7723c64b641c5be4a80819420 | transform.js | transform.js | var moment = require('moment');
// Returned format from original API is a bit strange and very deeply nested.
// Original API url: http://dev.hsl.fi/siriaccess/vm/json?operatorRef=HSL
function transform(data) {
var vehicles = data.Siri.ServiceDelivery.VehicleMonitoringDelivery[0].VehicleActivity;
return {
... | var moment = require('moment');
// Returned format from original API is a bit strange and very deeply nested.
// Original API url: http://dev.hsl.fi/siriaccess/vm/json?operatorRef=HSL
function transform(data) {
var vehicles = data.Siri.ServiceDelivery.VehicleMonitoringDelivery[0].VehicleActivity;
return {
... | Remove origin and destination fields. They are not in Helsinki API | Remove origin and destination fields. They are not in Helsinki API
| JavaScript | mit | kimmobrunfeldt/busse-api-helsinki |
9efe39642602f29273e02b5e5c5d4ab564b6a91a | utils/send.js | utils/send.js | const request = require('request'),
TOKEN = process.env.PAGE_ACCESS_TOKEN;
/**
* Send message to API.
*
* @param {object} json Data to send.
* @param {function} callback Called at end.
*/
module.exports = (json, callback = null) => {
request({
json,
method: 'POST',
qs: {access_token: TOKEN}... | const request = require('request'),
TOKEN = process.env.PAGE_ACCESS_TOKEN;
/**
* Send message to API.
*
* @param {object} json Data to send.
* @param {function} callback Called at end.
*/
module.exports = (json, callback = null) => {
request({
json,
method: 'POST',
qs: {access_token: TOKEN}... | Fix payload structure for text | Fix payload structure for text
| JavaScript | mit | bryanjhv/filesbot |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.