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 |
|---|---|---|---|---|---|---|---|---|---|
2bba64bf352c3897cc21157e9af41fb903e68f51 | www/LocalStorageHandle.js | www/LocalStorageHandle.js | var NativeStorageError = require('./NativeStorageError');
// args = [reference, variable]
function LocalStorageHandle(success, error, intent, operation, args) {
var reference = args[0];
var variable = args[1];
if (operation.startsWith('put') || operation.startsWith('set')) {
try {
var ... | var NativeStorageError = require('./NativeStorageError');
// args = [reference, variable]
function LocalStorageHandle(success, error, intent, operation, args) {
var reference = args[0];
var variable = args[1];
if (operation.startsWith('put') || operation.startsWith('set')) {
try {
var ... | Use var for compatibility with Android 4.x | Use var for compatibility with Android 4.x
| JavaScript | apache-2.0 | TheCocoaProject/cordova-plugin-nativestorage,TheCocoaProject/cordova-plugin-nativestorage |
184a0341b5b8303f1966fd6ef3cbedf8033a2d8b | app/routes/arrivals.js | app/routes/arrivals.js | import Ember from 'ember';
import request from 'ic-ajax';
import ENV from './../config/environment';
var run = Ember.run;
const POLL_INTERVAL = 15 * 1000;
export default Ember.Route.extend({
pendingRefresh: null,
model: function(params) {
// Eagerly load template
request(`${ENV.APP.SERVER}/api/arrivals/$... | import Ember from 'ember';
import request from 'ic-ajax';
import ENV from './../config/environment';
var run = Ember.run;
const POLL_INTERVAL = 15 * 1000;
export default Ember.Route.extend({
pendingRefresh: null,
model: function(params) {
request(`${ENV.APP.SERVER}/api/arrivals/${params.stop_id}`).then(run.b... | Fix bug where heading was not always updated | Fix bug where heading was not always updated | JavaScript | mit | bus-detective/web-client,bus-detective/web-client |
8d455015a6a8783fa6d91ce94a5e9b113dc9a71c | packages/navy-plugin-nodejs/src/hooks/rewrite-linked-node-modules.js | packages/navy-plugin-nodejs/src/hooks/rewrite-linked-node-modules.js | import findit from 'findit'
import path from 'path'
import fs from 'fs'
export default () => {
const finder = findit(path.join(process.cwd(), 'node_modules'))
finder.on('link', link => {
if (link.indexOf('.bin') !== -1) return
const absolutePath = fs.realpathSync(link)
fs.unlinkSync(link)
fs.syml... | import findit from 'findit'
import path from 'path'
import fs from 'fs'
import os from 'os'
import {name as pluginName} from '../../package.json'
export default () => {
const finder = findit(path.join(process.cwd(), 'node_modules'))
finder.on('error', err => {
console.error(`${pluginName} failed to traverse ... | Handle errors when traversing the node_modules dir to stop EventEmitter throwing an exception | Handle errors when traversing the node_modules dir to stop EventEmitter throwing an exception
| JavaScript | mit | momentumft/navy,momentumft/navy,momentumft/navy |
a9e10209eddc194b4b4ccc37bd610d69761b03ec | bin/storj-monitor.js | bin/storj-monitor.js | #!/usr/bin/env node
'use strict';
const program = require('commander');
const Config = require('../lib/config');
const Monitor = require('../lib/monitor');
program.version(require('../package').version);
program.option('-c, --config <path_to_config_file>', 'path to the config file');
program.parse(process.argv);
va... | #!/usr/bin/env node
'use strict';
const program = require('commander');
const Config = require('../lib/monitor/config');
const Monitor = require('../lib/monitor');
program.version(require('../package').version);
program.option('-c, --config <path_to_config_file>', 'path to the config file');
program.parse(process.ar... | Update config in monitor bin | Update config in monitor bin
| JavaScript | agpl-3.0 | bookchin/storj-bridge,Storj/metadisk-api,Storj/bridge,bookchin/storj-bridge,braydonf/storj-bridge,Storj/bridge,braydonf/storj-bridge,Storj/metadisk-api |
e06d72d3ede08b786e06c734f2ecd8ff592e60b5 | lib/node_modules/@stdlib/types/ndarray/base/assert/is-order/lib/main.js | lib/node_modules/@stdlib/types/ndarray/base/assert/is-order/lib/main.js | 'use strict';
// MODULES //
var indexOf = require( '@stdlib/utils/index-of' );
var orders = require( '@stdlib/types/ndarray/base/orders' );
// VARIABLES //
var ORDERS = orders();
// MAIN //
/**
* Tests whether an input value is an ndarray order.
*
* @param {*} v - value to test
* @returns {boolean} boolean indi... | 'use strict';
// MODULES //
var orders = require( '@stdlib/types/ndarray/base/orders' );
// VARIABLES //
var ORDERS = orders();
var len = ORDERS.length;
// MAIN //
/**
* Tests whether an input value is an ndarray order.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating whether an input va... | Refactor to inline value search | Refactor to inline value search
| JavaScript | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib |
e7aea7c181a5a7619d0756e4e02f7694446c9289 | src/helpers/util.js | src/helpers/util.js | import _ from 'lodash';
/**
* Returns copy of an object with mapped values. Works really similar to
* lodash's mapValues, with difference that also EVERY nested object is
* also mapped with passed function.
*
* @param {Object} obj - object to map values of
* @param {Function} fn - function to map values with
*
... | import _ from 'lodash';
/**
* Returns copy of an object with mapped values. Works really similar to
* lodash's mapValues, with difference that also EVERY nested object is
* also mapped with passed function.
*
* @param {Object} obj - object to map values of
* @param {Function} fn - function to map values with
*
... | Remove not needed functions and move from other files | Remove not needed functions and move from other files
| JavaScript | mit | devlucky/Kakapo.js,devlucky/Kakapo.js |
284f33c5784ddf56813eb75fbce8e17568f7c870 | app/tests/scrambler.js | app/tests/scrambler.js | describe('scrambler tests', function(){
beforeEach(function() {
fixture.setBase('fixtures')
});
beforeEach(function(){
this.sample = fixture.load('sample.html');
runSpy = spyOn(scrambler._scrambler, "run").and.callThrough();
jasmine.clock().install();
});
afterEach... | function removeWhitespace(string) {
return string.replace(/\s+/g, '');
}
describe('scrambler tests', function(){
beforeEach(function() {
fixture.setBase('fixtures')
});
beforeEach(function(){
this.sample = fixture.load('sample.html');
runSpy = spyOn(scrambler._scrambler, "run"... | Check if text content has been changed | Check if text content has been changed
| JavaScript | mit | grudelsud/ScramblerJS,RufousWork/ScramblerJS,RufousWork/ScramblerJS,grudelsud/ScramblerJS |
d3887cee9624f8cdefd243649d3280ad2231aff8 | babel-es2015.config.js | babel-es2015.config.js | module.exports = {
plugins: ['@babel/plugin-proposal-async-generator-functions'],
env: {
es: {
plugins: ['./babel-plugin-pure-curry']
},
cjs: {
plugins: [
'add-module-exports',
'@babel/plugin-transform-modules-commonjs'
]
}
}
};
| module.exports = {
plugins: [
['@babel/plugin-transform-runtime', { useESModules: true, corejs: 2 }],
'@babel/plugin-proposal-async-generator-functions'
],
env: {
test: {
plugins: [['@babel/plugin-transform-runtime', { corejs: 2 }]]
},
es: {
plugins: ['./babel-plugin-pure-curry']
... | Use babel helper modules on es2015 sources | Use babel helper modules on es2015 sources
Fixes #183
| JavaScript | mit | sithmel/iter-tools,sithmel/iter-tools |
21170be839a7ace82dcd5cb59b10071e3df95672 | src/routes/onboarding/index.js | src/routes/onboarding/index.js | function getRoute(path, subComponentName) {
return {
path: path,
subComponentName: subComponentName,
getComponents(location, cb) {
require.ensure([], (require) => {
cb(null, require('../../components/views/OnboardingView'))
})
},
}
}
export default {
path: 'onboarding',
onEn... | function getRoute(path, subComponentName) {
return {
path: path,
subComponentName: subComponentName,
onEnter() {
require('../../networking/auth')
},
getComponents(location, cb) {
require.ensure([], (require) => {
cb(null, require('../../components/views/OnboardingView'))
... | Add the auth path for onboarding | Add the auth path for onboarding | JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
21ec062c9a6c9661b7a3808fbbbaf1681701760a | src/elements/linkedin-icon/index.js | src/elements/linkedin-icon/index.js | //@flow
import React from "react";
import { Link } from "react-router-dom";
import { pure, compose, withState, withHandlers } from "recompose";
import { ThemeProvider } from "styled-components";
import mainTheme from "../../global/style/mainTheme";
import { Logo } from "./Logo";
const enhance = compose(
withState(... | //@flow
import React from "react";
import { pure, compose, withState, withHandlers } from "recompose";
import { ThemeProvider } from "styled-components";
import mainTheme from "../../global/style/mainTheme";
import { Logo } from "./Logo";
const enhance = compose(
withState("isActive", "setActive", false),
withHa... | Change Link component for a tag in LinkedIn logo | Change Link component for a tag in LinkedIn logo
external links require an a tag to work correctly | JavaScript | mit | slightly-askew/portfolio-2017,slightly-askew/portfolio-2017 |
077242d046e3e755ff82ba4b29cce2477fd50bea | config/seneca-options.js | config/seneca-options.js | 'use strict';
var senecaOptions = {
transport: {
web: {
port: process.env.PORT || 8080
}
},
apiBaseUrl: process.env.API_BASE_URL || 'http://localhost:3000',
apiSecret: process.env.API_SECRET || ''
};
module.exports = senecaOptions;
| 'use strict';
var senecaOptions = {
transport: {
web: {
port: process.env.BADGES_SERVICE_PORT || 10305
}
},
apiBaseUrl: process.env.API_BASE_URL || 'http://localhost:8080',
apiSecret: process.env.API_SECRET || ''
};
module.exports = senecaOptions;
| Change ports and env variable names | Change ports and env variable names
| JavaScript | mit | CoderDojo/cp-badges-service,bmatthews68/cp-badges-service,CoderDojo/cp-badges-service,bmatthews68/cp-badges-service |
5cbd75f443a87c9a966ffe0320d8258c6691d4ba | blueprints/ember-cli-changelog/files/config/changelog.js | blueprints/ember-cli-changelog/files/config/changelog.js | // jshint node:true
// For details on each option run `ember help release`
module.exports = {
// ember style guide: https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md#commit-tagging
// angular style guide: https://github.com/angular/angular.js/blob/v1.4.8/CONTRIBUTING.md#commit
// jquery style guid... | // jshint node:true
// For details on each option run `ember help release`
module.exports = {
// ember style guide: https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md#commit-tagging
// angular style guide: https://github.com/angular/angular.js/blob/v1.4.8/CONTRIBUTING.md#commit
// jquery style guid... | Set angular as default in blueprint | Set angular as default in blueprint | JavaScript | mit | runspired/ember-cli-changelog,runspired/ember-cli-changelog |
d72326fe7646a6c44d08637141f7df5f7d293fb7 | src/helpers/seeder.js | src/helpers/seeder.js | #!/usr/bin/env node
const storage = require('../storage')
const fixtures = require('./fixtures')
const recipes = fixtures.createRecipes(10)
function save (recipe) {
return storage.put(recipe.id, recipe)
}
storage.connect()
.then(() => {
return Promise.all(recipes.map(recipe => save(recipe)))
})
.then(()... | #!/usr/bin/env node
const storage = require('../storage')
const fixtures = require('./fixtures')
const recipes = fixtures.createRecipes(10)
function save (db, recipe) {
return storage.put(db, recipe.id, recipe)
}
storage.connect(process.env.NODE_ENV)
.then((db) => {
return Promise.all(recipes.map(recipe => ... | Fix issues with the seed script | Fix issues with the seed script
| JavaScript | mit | ruiquelhas/electron-recipes,ruiquelhas/electron-recipes |
532fb8e2150c70c627d57f9f72f8232606976a4a | app/javascript/flavours/glitch/reducers/domain_lists.js | app/javascript/flavours/glitch/reducers/domain_lists.js | import {
DOMAIN_BLOCKS_FETCH_SUCCESS,
DOMAIN_BLOCKS_EXPAND_SUCCESS,
DOMAIN_UNBLOCK_SUCCESS,
} from '../actions/domain_blocks';
import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutable';
const initialState = ImmutableMap({
blocks: ImmutableMap(),
});
export default function domainLists... | import {
DOMAIN_BLOCKS_FETCH_SUCCESS,
DOMAIN_BLOCKS_EXPAND_SUCCESS,
DOMAIN_UNBLOCK_SUCCESS,
} from '../actions/domain_blocks';
import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutable';
const initialState = ImmutableMap({
blocks: ImmutableMap({
items: ImmutableOrderedSet(),
}),
}... | Fix error when unmuting a domain without listing muted domains first | Fix error when unmuting a domain without listing muted domains first
| JavaScript | agpl-3.0 | Kirishima21/mastodon,Kirishima21/mastodon,glitch-soc/mastodon,im-in-space/mastodon,glitch-soc/mastodon,Kirishima21/mastodon,glitch-soc/mastodon,Kirishima21/mastodon,im-in-space/mastodon,im-in-space/mastodon,im-in-space/mastodon,glitch-soc/mastodon |
08eaac64daa1b7bb5137261967cd7c655b7dbc1f | jquery.sortBy-0.1.js | jquery.sortBy-0.1.js | /* uses schwartzian transform to sort the selected elements in-place */
(function($) {
$.fn.sortBy = function(sortfn) {
var values = [],
$self = this;
this.children().each(function(i,o) {
values.push([ $(o), sortfn($(o)) ]);
});
values.sort(function(a,b) {
return a[1] > b[1] ? 1
: a[1] == b[1]... | /* uses schwartzian transform to sort the selected elements in-place */
(function($) {
$.fn.sortBy = function(sortfn) {
var values = [],
$self = this;
values = this.children().map(function(o) {
return [ $(o), sortfn($(o)) ];
});
$.sort(values, function(a,b) {
return a[1] > b[1] ? 1
: a[1] == b... | Use jQuery helpers for simplification and compat | Use jQuery helpers for simplification and compat
| JavaScript | bsd-2-clause | propcom/jquery-sortBy |
9494ce3faf614483079b6bfe85ae1f48e8373e22 | data/clothing.js | data/clothing.js | const request = require('request');
/**
* Function checks that a string given is string with some number of
* characters
*
* @params {string} str string value to check for validity
* @return true if the string is valid; otherwise, return false
*/
function isValidString(str) {
if ((str === undefined) || (typeo... | const request = require('request');
/**
* Function checks that a string given is string with some number of
* characters
*
* @params {string} str string value to check for validity
* @return true if the string is valid; otherwise, return false
*/
function isValidString(str) {
if ((str === undefined) || (typeo... | Refactor to better define data helper | Refactor to better define data helper
| JavaScript | mit | tsangjustin/CS546-Product_Forum,tsangjustin/CS546-Product_Forum |
0b36c6109e9a96403d6c779c56c1b1482df0a48f | app/assets/javascripts/vue/fluent_log.js | app/assets/javascripts/vue/fluent_log.js | (function(){
"use strict";
$(function(){
if($('#fluent-log').length === 0) return;
new Vue({
el: "#fluent-log",
paramAttributes: ["logUrl"],
data: {
"autoFetch": false,
"logs": [],
"limit": 30
},
created: function(){
this.fetchLogs();
... | (function(){
"use strict";
$(function(){
if($('#fluent-log').length === 0) return;
new Vue({
el: "#fluent-log",
paramAttributes: ["logUrl"],
data: {
"autoFetch": false,
"logs": [],
"limit": 30,
"processing": false
},
created: function(){
... | Add reaction while fetching logs | Add reaction while fetching logs
| JavaScript | apache-2.0 | fluent/fluentd-ui,mt0803/fluentd-ui,fluent/fluentd-ui,mt0803/fluentd-ui,mt0803/fluentd-ui,fluent/fluentd-ui |
54b9597c9a01ed7904d0b9ed12cb46cbe211e7b8 | packages/@sanity/desk-tool/src/components/Diff.js | packages/@sanity/desk-tool/src/components/Diff.js | import PropTypes from 'prop-types'
import React from 'react'
import {diffJson} from 'diff'
import styles from './styles/Diff.css'
function getDiffStatKey(part) {
if (part.added) {
return 'added'
}
if (part.removed) {
return 'removed'
}
return 'neutral'
}
export default class Diff extends React.PureC... | /**
*
*
*
*
*
*
*
* HEADSUP: This is not in use, but keep for later reference
*
*
*
*
*
*
*
*/
import PropTypes from 'prop-types'
import React from 'react'
import {diffJson} from 'diff'
import styles from './styles/Diff.css'
function getDiffStatKey(part) {
if (part.added) {
return 'added'
}
... | Add a note about keeping unused component for later reference | [desk-tool] Add a note about keeping unused component for later reference
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
85641e0db06224488dab96f69eed31f0b2a0d4ba | tests/integration/config-ci.js | tests/integration/config-ci.js | // this file is for use in CircleCI continuous integration environment
var browserName = ['chrome', 'firefox', 'internet explorer', 'android'][process.env.CIRCLE_NODE_INDEX];
module.exports = {
seleniumServerURL: {
hostname: 'ondemand.saucelabs.com',
port: 80
},
driverCapabilities: {
'tunnel-identif... | // this file is for use in CircleCI continuous integration environment
var capabilities = [
{browserName: 'chrome'},
{browserName: 'firefox'},
{browserName: 'internet explorer'},
{
deviceName: 'Samsung Galaxy S6 GoogleAPI Emulator',
browserName: 'Chrome',
platformName: 'Android',
platformVersio... | Use a more recent Android for integration tests | Use a more recent Android for integration tests
| JavaScript | agpl-3.0 | openfisca/legislation-explorer |
2ab41ec1f71f405f7e718db2f11acbc010862b0d | packages/babel/src/transformation/transformers/internal/block-hoist.js | packages/babel/src/transformation/transformers/internal/block-hoist.js | import sortBy from "lodash/collection/sortBy";
export var metadata = {
group: "builtin-trailing"
};
/**
* [Please add a description.]
*
* Priority:
*
* - 0 We want this to be at the **very** bottom
* - 1 Default node position
* - 2 Priority over normal nodes
* - 3 We want this to be at the **very** top
... | import sortBy from "lodash/collection/sortBy";
export var metadata = {
group: "builtin-trailing"
};
/**
* [Please add a description.]
*
* Priority:
*
* - 0 We want this to be at the **very** bottom
* - 1 Default node position
* - 2 Priority over normal nodes
* - 3 We want this to be at the **very** top
... | Break loop as soon as change detected. | Break loop as soon as change detected.
| JavaScript | mit | mcanthony/babel,aalluri-navaratan/babel,iamstarkov/babel,abdulsam/babel,thorikawa/babel,existentialism/babel,greyhwndz/babel,spicyj/babel,zorosteven/babel,sethcall/babel,rn0/babel,hzoo/babel,rn0/babel,codenamejason/babel,andrewwilkins/babel,nmn/babel,moander/babel,plemarquand/babel,guybedford/babel,VukDukic/babel,VukDu... |
29bdb0a226c76279193033bf2d0e777381d2a870 | tests/test.config.circle-ci.js | tests/test.config.circle-ci.js | module.exports = {
store_url: 'http://localhost:8080',
account_user: 'test',
account_password: 'testing',
account_name: 'tester',
container_name: 'test_container',
object_name: 'test_object',
segment_container_name: 'segment_test_container',
segment_object_name: 'segment_test_object',
... | module.exports = {
store_url: 'http://localhost:8080',
account_user: 'test:tester',
account_password: 'testing',
account_name: 'AUTH_test',
container_name: 'test_container',
object_name: 'test_object',
segment_container_name: 'segment_test_container',
segment_object_name: 'segment_test_o... | Fix circleci test config file | Fix circleci test config file
| JavaScript | mit | Tezirg/os2 |
94558f5dcf5ce15b7b1964dd36e1a7fa26c730fd | packages/purgecss-webpack-plugin/rollup.config.js | packages/purgecss-webpack-plugin/rollup.config.js | import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'
export default {
entry: './src/index.js',
targets: [
{
dest: './lib/purgecss-webpack-plugin.es.js',
format: 'es'
},
{
... | import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'
export default {
entry: './src/index.js',
targets: [
{
dest: './lib/purgecss-webpack-plugin.es.js',
format: 'es'
},
{
... | Add fs & path as external | Add fs & path as external
| JavaScript | mit | FullHuman/purgecss,FullHuman/purgecss,FullHuman/purgecss,FullHuman/purgecss |
2343d77cd75492c4b1bda09b4c87d406a8e3a87d | frontend/app/routes/visualize/graph.js | frontend/app/routes/visualize/graph.js | import { inject as service } from '@ember/service';
import fetch from 'fetch';
import Route from '@ember/routing/route';
import ResetScrollPositionMixin from 'frontend/mixins/reset-scroll-position';
export default Route.extend(ResetScrollPositionMixin, {
intl: service(),
session: service(),
queryParams: {
... | import { inject as service } from '@ember/service';
import fetch from 'fetch';
import Route from '@ember/routing/route';
import ResetScrollPositionMixin from 'frontend/mixins/reset-scroll-position';
export default Route.extend(ResetScrollPositionMixin, {
intl: service(),
session: service(),
queryParams: {
... | Send authorization tokens in `fetch` | Send authorization tokens in `fetch`
| JavaScript | mit | roschaefer/rundfunk-mitbestimmen,roschaefer/rundfunk-mitbestimmen,roschaefer/rundfunk-mitbestimmen |
196b1746e17241d764f35d67d257da8b0c111a7c | public/visifile_drivers/ui_components/editorComponent.js | public/visifile_drivers/ui_components/editorComponent.js | function component( args ) {
/*
base_component_id("editorComponent")
load_once_from_file(true)
*/
//alert(JSON.stringify(args,null,2))
var uid = uuidv4()
var uid2 = uuidv4()
var mm = Vue.component(uid, {
data: function () {
return {
text: args.text,
uid2: uid2
... | function component( args ) {
/*
base_component_id("editorComponent")
load_once_from_file(true)
*/
//alert(JSON.stringify(args,null,2))
var uid = uuidv4()
var uid2 = uuidv4()
var mm = Vue.component(uid, {
data: function () {
return {
text: args.text,
uid2: uid2
... | Disable errors in Ace Editor | Disable errors in Ace Editor
I did this as errors always seem to show in the editor and this can be very offputting for the end user
| JavaScript | mit | zubairq/AppShare,zubairq/AppShare,zubairq/yazz,zubairq/AppShare,zubairq/gosharedata,zubairq/gosharedata,zubairq/yazz,zubairq/AppShare |
c04a3b26c6b1859bf77df6a84936c95b457bf65c | src/generators/background-colors.js | src/generators/background-colors.js | const postcss = require('postcss')
const _ = require('lodash')
function findColor(colors, color) {
const colorsNormalized = _.mapKeys(colors, (value, key) => {
return _.camelCase(key)
})
return _.get(colorsNormalized, _.camelCase(color), color)
}
module.exports = function ({ colors, backgroundColors }) {
... | const postcss = require('postcss')
const _ = require('lodash')
function findColor(colors, color) {
const colorsNormalized = _.mapKeys(colors, (value, key) => {
return _.camelCase(key)
})
return _.get(colorsNormalized, _.camelCase(color), color)
}
module.exports = function ({ colors, backgroundColors }) {
... | Add support for mixed "plain color string" and "color map" background defintitions | Add support for mixed "plain color string" and "color map" background defintitions
Lets you do this:
```
backgroundColors: [
'blue',
'purple',
'pink',
{
primary: 'white',
secondary: 'orange',
},
]
```
| JavaScript | mit | tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss |
62bffcab761d3ca395e821e1cd259dab9ed60bc5 | blocks/data/index.js | blocks/data/index.js | var Data = require('../../lib/data');
module.exports = {
className: 'data',
template: require('./index.html'),
data: {
name: 'Data',
icon: '/images/blocks_text.png',
attributes: {
label: {
label: 'Header Text',
type: 'string',
... | var Data = require('../../lib/data');
module.exports = {
className: 'data',
template: require('./index.html'),
data: {
name: 'Data',
icon: '/images/blocks_text.png',
attributes: {
label: {
label: 'Header Text',
type: 'string',
... | Resolve style errors on data block | Resolve style errors on data block
| JavaScript | mpl-2.0 | cadecairos/webmaker-android,gvn/webmaker-android,toolness/webmaker-android,j796160836/webmaker-android,k88hudson/webmaker-android,secretrobotron/webmaker-android,secretrobotron/webmaker-android,alicoding/webmaker-android,codex8/webmaker-app,vazquez/webmaker-android,bolaram/webmaker-android,j796160836/webmaker-android,t... |
247efe2dfbd2762628415137ac1a2f9023cabbf3 | boot/kernal/index.js | boot/kernal/index.js | var mkdirp = require('mkdirp');
var clicolour = require("cli-color");
var exec = require('child_process').exec;
exports.createTmp = function createTmp(argument) {
mkdirp("./tmp", function(err){
console.log(clicolour.cyanBright('Created ./tmp...')+clicolour.greenBright("OK"));
})
}
exports.clean = function cle... | var mkdirp = require('mkdirp');
var clicolour = require("cli-color");
var exec = require('child_process').exec;
exports.createTmp = function createTmp(argument) {
mkdirp("./tmp", function(err){
console.log(clicolour.cyanBright('Created ./tmp...')+clicolour.greenBright("OK"));
})
}
exports.clean = function cle... | Add cleaning of tmp into nodejs | Add cleaning of tmp into nodejs
| JavaScript | mit | Gum-Joe/boss.js,Gum-Joe/Web-OS,Gum-Joe/boss.js,Gum-Joe/boss.js,Gum-Joe/Web-OS,Gum-Joe/boss.js,Gum-Joe/Web-OS,Gum-Joe/boss.js,Gum-Joe/Web-OS,Gum-Joe/Web-OS,Gum-Joe/Web-OS,Gum-Joe/boss.js,Gum-Joe/Web-OS,Gum-Joe/boss.js |
2ada6c33fca5a88ae22411408b7f6e35fd309831 | app/assets/javascripts/angular/controllers/winged_monkey_controllers.js | app/assets/javascripts/angular/controllers/winged_monkey_controllers.js | var wingedMonkeyControllers = angular.module('wingedMonkeyControllers',[]);
wingedMonkeyControllers.controller("ProviderAppsCtrl", function($scope, $filter, ProviderApplication) {
$scope.appsLoaded = false;
$scope.refreshProviderApps = function() {
ProviderApplication.query(function(data){
$scope.provid... | var wingedMonkeyControllers = angular.module('wingedMonkeyControllers',[]);
wingedMonkeyControllers.controller("ProviderAppsCtrl", function($scope, $filter, ProviderApplication) {
$scope.appsLoaded = false;
$scope.refreshProviderApps = function() {
ProviderApplication.query(function(data){
$scope.provid... | Stop functionality wont remove the application untill the refresh occurs | Stop functionality wont remove the application untill the refresh occurs
| JavaScript | apache-2.0 | jtomasek/wingedmonkey,jtomasek/wingedmonkey |
b4dbc7fdda88de3c18a2b1d23fb29894ae407903 | app/imports/ui/components/alerts/alert-ending-soon/alert-ending-soon.js | app/imports/ui/components/alerts/alert-ending-soon/alert-ending-soon.js | import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import moment from 'moment';
import './alert-ending-soon.html';
Template.AlertEndingSoon.onCreated(function onCreated() {
const self = this;
self.threshold = moment.duration(20... | import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import moment from 'moment';
import './alert-ending-soon.html';
Template.AlertEndingSoon.onCreated(function onCreated() {
const self = this;
self.threshold = moment.duration(20... | Add event handlers for links in ending soon alert | Add event handlers for links in ending soon alert
| JavaScript | mit | athyuttamre/signmeup,etremel/signmeup,athyuttamre/signmeup,gregcarlin/signmeup,etremel/signmeup,gregcarlin/signmeup,signmeup/signmeup,etremel/signmeup,gregcarlin/signmeup,signmeup/signmeup |
65326a10745b64c6518868a83c5ce0aa7ff8097b | prelim/renderPuzzle.js | prelim/renderPuzzle.js | function renderPuzzle( levelNumber, canvas, width, height ) {
document.body.appendChild(canvas);
canvas.width = width;
canvas.height = height;
canvas.style.backgroundColor = '#333333';
canvas.id = 'gameView';
var levels = new Levels( new XSPRNG(1), 70, new MonochromaticPaletteBuilder())... | function renderPuzzle( levelNumber, canvas, width, height ) {
document.body.appendChild(canvas);
canvas.width = width;
canvas.height = height;
canvas.style.backgroundColor = '#333333';
canvas.id = 'gameView';
var levels = new Levels( new XSPRNG(1), 70, new MonochromaticPaletteBuilder())... | Add touch input to puzzle rendering function | Add touch input to puzzle rendering function
| JavaScript | mit | mnito/factors-game,mnito/factors-game |
de54880d4ef939358cba6687a109b792475e03d0 | conf/server.js | conf/server.js | // This module is the server of my site.
// Require external dependecies.
var http = require('http');
var filed = require('filed');
var path = require('path');
var readFile = require('fs').readFile;
var publish = require('./publish');
// Start the site.
module.exports = function (config) {
var isInvalid
= !conf... | // This module is the server of my site.
// Require external dependecies.
var http = require('http');
var filed = require('filed');
var path = require('path');
var readFile = require('fs').readFile;
var publish = require('./publish');
var bake = require('blake').bake;
// Start the site.
module.exports = function (con... | Add tweet and like interval | Add tweet and like interval
| JavaScript | mit | michaelnisi/troubled,michaelnisi/troubled,michaelnisi/troubled |
8f89c947b4d12ddc7222843c0fc60300df96e72f | tests/util-tests.js | tests/util-tests.js | var util = require('../js/util');
var assert = require('assert');
describe('Hello World function', function() {
it('should always fail', function() {
assert.equal(false, false);
});
it('should just say hello', function() {
var answer = util.helloWorld();
assert.equal('Hello World... | var util = require('../js/util');
var assert = require('assert');
describe('Hello World function', function() {
it('should always fail', function() {
assert.equal(false, false);
});
it('should just say hello', function() {
var answer = util.helloWorld();
assert.equal('Hello World... | FIX Fix test to match production code | FIX Fix test to match production code
| JavaScript | mit | fhinkel/SimpleChatServer,fhinkel/SimpleChatServer |
aecea1524533c36829bc9ebc933a925acb091f74 | config/site.js | config/site.js | module.exports = function(config) {
if(!config.port || !_.isNumber(config.port)) throw new Error('Port undefined or not a number');
var domain = 'changethisfool.com';
var c = {
defaults: {
title: 'Change This Fool',
name: 'change-this-fool',
protocol: 'http',
get host() {
return this.port ? this.... | module.exports = function(config) {
if(!config.port || !_.isNumber(config.port)) throw new Error('Port undefined or not a number');
var domain = 'changethisfool.com';
var c = {
defaults: {
title: 'Change This Fool',
name: 'change-this-fool',
protocol: 'http',
get host() {
return this.port ? this.... | Check for process.env.PORT before using config.port | Check for process.env.PORT before using config.port
| JavaScript | mit | thecodebureau/epiphany |
5a18e7bc20eea459c4cef4fe41aa94b5c6f87175 | controllers/hemera/updateSlackProfile.js | controllers/hemera/updateSlackProfile.js | var hemera = require('./index');
var controller;
/**
* Every time a user posts a message, we update their slack profile so we can stay up to date on their profile
* @param {Object} bot
* @param {Object} message
*/
module.exports = function updateSlackProfile(bot, message) {
controller = hemerga.getController... | var hemera = require('./index');
var controller;
/**
* Every time a user posts a message, we update their slack profile so we can stay up to date on their profile
* @param {Object} bot
* @param {Object} message
*/
module.exports = function updateSlackProfile(bot, message) {
controller = hemera.getController(... | Create a user if they don't exist | Create a user if they don't exist
| JavaScript | mit | tgolen/node-multi-slack |
ba3147083f0d41be4835098a77f988b2d49b545c | www/js/controllers/home_controller.js | www/js/controllers/home_controller.js | controllers.controller('HomeCtrl', function($scope, Settings, AdUtil) {
function showHomeAd() {
if(AdMob){//Because android need this on start up apparently
var platform = Settings.getPlatformSettings();
console.log('<GFF> HomeCtrl showHomeAd Banner AdUnit: ' + platform.developerBanner );
AdUti... | controllers.controller('HomeCtrl', function($scope, Settings, AdUtil) {
function showHomeAd() {
if(AdMob){//Because android need this on start up apparently
var platform = Settings.getPlatformSettings();
console.log('<GFF> HomeCtrl showHomeAd Banner AdUnit: ' + platform.developerBanner );
AdUti... | Add twitter and Facebook links | Add twitter and Facebook links
| JavaScript | mit | flashquartermaster/Give-For-Free,flashquartermaster/Give-For-Free,flashquartermaster/Give-For-Free,flashquartermaster/Give-For-Free,flashquartermaster/Give-For-Free,flashquartermaster/Give-For-Free |
2caea723c87b1b7726264e7ff03621ad101ec0f9 | main.js | main.js | 'use strict';
var app = require('app');
var mainWindow = null;
var dribbbleData = null;
var menubar = require('menubar')
var mb = menubar({
index: 'file://' + __dirname + '/app/index.html',
icon: __dirname + '/app/assets/HotshotIcon.png',
width: 400,
height: 700,
'max-width': 440,
'min-height': 300,
'm... | 'use strict';
var app = require('app');
var ipc = require('ipc');
var mainWindow = null;
var dribbbleData = null;
var menubar = require('menubar')
var mb = menubar({
index: 'file://' + __dirname + '/app/index.html',
icon: __dirname + '/app/assets/HotshotIcon.png',
width: 400,
height: 700,
'max-width': 440,
... | Add way to quit application via offcanvas menu | Add way to quit application via offcanvas menu
| JavaScript | cc0-1.0 | andrewnaumann/hotshot,andrewnaumann/hotshot |
2df528d81a60e1a8a71d5cdc3fb7ac063d235902 | test/special/index.js | test/special/index.js | 'use strict';
var _ = require('lodash');
var fs = require('fs');
var hljs = require('../../build');
var jsdom = require('jsdom').jsdom;
var utility = require('../utility');
describe('special cases tests', function() {
before(function() {
var blocks,
filename = utility.buildPath('fixtures... | 'use strict';
var _ = require('lodash');
var fs = require('fs');
var hljs = require('../../build');
var jsdom = require('jsdom').jsdom;
var utility = require('../utility');
describe('special cases tests', function() {
before(function(done) {
var filename = utility.buildPath('fixtures', 'index.ht... | Use the async version of readFile | Use the async version of readFile
| JavaScript | bsd-3-clause | lead-auth/highlight.js,StanislawSwierc/highlight.js,MakeNowJust/highlight.js,carlokok/highlight.js,VoldemarLeGrand/highlight.js,Sannis/highlight.js,0x7fffffff/highlight.js,isagalaev/highlight.js,dbkaplun/highlight.js,VoldemarLeGrand/highlight.js,highlightjs/highlight.js,Sannis/highlight.js,isagalaev/highlight.js,sourru... |
a1284f1be70ba643b23b17285b13119488e15bcc | dependument.js | dependument.js | #!/usr/bin/env node
(function() {
"use strict";
const fs = require('fs');
const CONFIG_FILE = "package.json";
console.log(readFile(CONFIG_FILE));
function readFile(path) {
let contents = fs.readFileSync(path);
return JSON.parse(contents);
}
})();
| #!/usr/bin/env node
(function() {
"use strict";
const fs = require('fs');
const CONFIG_FILE = "package.json";
(function() {
let file = readFile(CONFIG_FILE);
let dependencies = getDependencies(file);
console.log(dependencies);
})();
function getDependencies(file) {
let dependencies = f... | Read the dependencies from the file | Read the dependencies from the file
| JavaScript | unlicense | Jameskmonger/dependument,dependument/dependument,dependument/dependument,Jameskmonger/dependument |
9f3ac4bd9932a0d2dc991199e41001ce30f8eecd | lib/plugins/write-file.js | lib/plugins/write-file.js | var fs = require('fs');
module.exports = function(context) {
//
// Write some data to a file.
//
context.writeFile = function(data, file) {
fs.writeFile(file, data, function(err) {
if (err) {
throw err;
}
});
};
};
| var fs = require('fs');
module.exports = function(context) {
//
// Write some data to a file.
// Creates new file with the name supplied if the file doesnt exist
//
context.writeFile = function(data, file) {
fs.open(file, 'a+', function(err, fd) {
if(err) {
throw err;
}
var bu... | Create file if file doesnt exist | Create file if file doesnt exist
| JavaScript | isc | fiveisprime/screpl |
590abe07d9af483dea0e82b1ee481e191821edc9 | aura-components/src/main/components/uiExamples/radio/radioController.js | aura-components/src/main/components/uiExamples/radio/radioController.js | /*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | /*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | Remove use of getElement() in example | Remove use of getElement() in example
@rev W-3224090@
@rev goliver@ | JavaScript | apache-2.0 | madmax983/aura,forcedotcom/aura,forcedotcom/aura,forcedotcom/aura,madmax983/aura,forcedotcom/aura,madmax983/aura,forcedotcom/aura,madmax983/aura,madmax983/aura,madmax983/aura |
d458223003e0a110549c03862e7a00984a211719 | packages/@sanity/core/src/actions/dataset/import/getBatchedAssetImporter.js | packages/@sanity/core/src/actions/dataset/import/getBatchedAssetImporter.js | import through from 'through2'
import getAssetImporter from './getAssetImporter'
import promiseEach from 'promise-each-concurrency'
const batchSize = 10
const concurrency = 6
export default options => {
const assetImporter = getAssetImporter(options)
const documents = []
return through.obj(onChunk, onFlush)
... | import through from 'through2'
import getAssetImporter from './getAssetImporter'
import promiseEach from 'promise-each-concurrency'
const batchSize = 10
const concurrency = 6
export default options => {
const assetImporter = getAssetImporter(options)
const documents = []
return through.obj(onChunk, onFlush)
... | Add try/catch around asset importing and emit error to stream | [core] Add try/catch around asset importing and emit error to stream
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
14d6dad3991c6a5f37cc801550bbdf4fc1475d75 | connectors/v2/baidu.js | connectors/v2/baidu.js | 'use strict';
/* global Connector */
Connector.playerSelector = '#playPanel > .panel-inner';
Connector.artistSelector = '.artist';
Connector.trackSelector = '.songname';
Connector.isPlaying = function () {
return !$('.play').hasClass('stop');
};
| 'use strict';
/* global Connector */
Connector.playerSelector = '#playPanel > .panel-inner';
Connector.artistSelector = '.artist';
Connector.trackSelector = '.songname';
Connector.currentTimeSelector = '.curTime';
Connector.durationSelector = '.totalTime';
Connector.isPlaying = function () {
return !$('.play').... | Add current time and duration processing to Baidu | Add current time and duration processing to Baidu
| JavaScript | mit | inverse/web-scrobbler,Paszt/web-scrobbler,alexesprit/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,ex47/web-scrobbler,alexesprit/web-scrobbler,carpet-berlin/web-scrobbler,Paszt/web-scrobbler,usdivad/web-scrobbler,david-sabata/web-scrobbler,ex47/web-scrobbler,carpet-berlin/web-scrobbl... |
88440db50bce90f918beb61c0335294389015f69 | topics/about_scope.js | topics/about_scope.js | module("About Scope (topics/about_scope.js)");
thisIsAGlobalVariable = 77;
test("global variables", function() {
equal(__, thisIsAGlobalVariable, 'is thisIsAGlobalVariable defined in this scope?');
});
test("variables declared inside of a function", function() {
var outerVariable = "outer";
// this is a... | module("About Scope (topics/about_scope.js)");
thisIsAGlobalVariable = 77;
test("global variables", function() {
equal(77, thisIsAGlobalVariable, 'is thisIsAGlobalVariable defined in this scope?');
});
test("variables declared inside of a function", function() {
var outerVariable = "outer";
// this is a... | Complete scope tests to pass | Complete scope tests to pass
| JavaScript | mit | supportbeam/javascript_koans,supportbeam/javascript_koans |
abf3f9d87828d7159c3c04a46b5e6630a6af43b7 | app/scripts/services/resources-service.js | app/scripts/services/resources-service.js | 'use strict';
(function() {
angular.module('ncsaas')
.service('resourcesService', ['RawResource', 'currentStateService', '$q', resourcesService]);
function resourcesService(RawResource, currentStateService, $q) {
var vm = this;
vm.getResourcesList = getResourcesList;
vm.getRawResourcesList = getRa... | 'use strict';
(function() {
angular.module('ncsaas')
.service('resourcesService', ['RawResource', 'currentStateService', '$q', resourcesService]);
function resourcesService(RawResource, currentStateService, $q) {
var vm = this;
vm.getResourcesList = getResourcesList;
vm.getRawResourcesList = getRa... | Remove method update from RawResource service | Remove method update from RawResource service
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport |
ae0e43c40e037a7631efc0e631c7b09a0c930909 | spec/renderer.spec.js | spec/renderer.spec.js | const MarkdownRenderer = require('../src/renderer').MarkdownRenderer
describe ('Renderer', () => {
var renderer
var callback
beforeEach(() => {
callback = jasmine.createSpy('callback')
renderer = new MarkdownRenderer(callback)
})
it('converts a markdown file', (done) => {
const markdownFilePath... | const MarkdownRenderer = require('../src/renderer').MarkdownRenderer
describe ('Renderer', () => {
var renderer
var callback
beforeEach(() => {
callback = jasmine.createSpy('callback')
renderer = new MarkdownRenderer(callback)
})
it('converts a markdown file', (done) => {
const markdownFilePath... | Add failing test for rendering markdown string | Add failing test for rendering markdown string
| JavaScript | unlicense | pfertyk/mauve,pfertyk/mauve |
25b98d508c2b9eb70a73c363ae6c29c54ad3920f | www/loginchecker.js | www/loginchecker.js | var _IsLoggedIn = undefined;
function checkIfLoggedInAndTriggerEvent(notifyLoggedOutEveryTime){
request({module:"user", type: "IsLoggedIn"}, function(res){
if(_IsLoggedIn === undefined){
$(document).trigger("InitialUserStatus", res.loggedIn);
}
if(res.loggedIn != _IsLoggedIn){
_IsLoggedIn = res.loggedI... | var _IsLoggedIn = undefined;
function checkIfLoggedInAndTriggerEvent(notifyLoggedOutEveryTime){
request({module:"user", type: "IsLoggedIn"}, function(res){
if(_IsLoggedIn === undefined){
$(document).trigger("InitialUserStatus", res.loggedIn);
}
if(res.loggedIn != _IsLoggedIn){
_IsLoggedIn = res.loggedIn... | Fix indefinite event loop on connection error | Fix indefinite event loop on connection error | JavaScript | mit | palantus/mod-user |
1dc9e07b3eba41f48806cc2545b190f048ab9019 | src/DataLinkMixin.js | src/DataLinkMixin.js | "use strict";
/**
* Since only a single constructor is being exported as module.exports this comment isn't documented.
* The class and module are the same thing, the contructor comment takes precedence.
* @module DataLinkMixin
*/
var EventEmitter = require('wolfy87-eventemitter');
var eventEmitter = new E... | "use strict";
/**
* Since only a single constructor is being exported as module.exports this comment isn't documented.
* The class and module are the same thing, the contructor comment takes precedence.
* @module DataLinkMixin
*/
var EventEmitter = require('wolfy87-eventemitter');
var eventEmitter = new E... | Switch it around, mixin everything that doesn't override a method already on the target. | Switch it around, mixin everything that doesn't override a method already on the target.
| JavaScript | mit | chad-autry/data-chains |
42fead0aa8484ea83c91781ee4c298248e0cccf2 | dom/Component.js | dom/Component.js | var Class = require('../Class'),
Publisher = require('../Publisher'),
create = require('./create'),
style = require('./style'),
getOffset = require('./getOffset')
module.exports = Class(Publisher, function() {
this.init = function() {
Publisher.prototype.init.apply(this)
}
this.render = function(win) {
th... | var Class = require('../Class'),
Publisher = require('../Publisher'),
create = require('./create'),
style = require('./style'),
getOffset = require('./getOffset')
module.exports = Class(Publisher, function() {
this._tag = 'div'
this.init = function() {
Publisher.prototype.init.apply(this)
}
this.render =... | Allow specifying the tag type of a dom component, and allow passing in the element a component should render in | Allow specifying the tag type of a dom component, and allow passing in the element a component should render in
| JavaScript | mit | ASAPPinc/std.js,marcuswestin/std.js |
1e90e61bfe9b5fd6b0de0bc83b931bf7034ae885 | src/matchers/index.js | src/matchers/index.js | const _ = require('lodash/fp')
const fs = require('fs')
const path = require('path')
const matchers = _.flow(
_.map(file => path.basename(file, '.js')),
_.without(['index'])
)(fs.readdirSync(__dirname))
module.exports = _.flow(
_.map(matcher => require(`./${matcher}`)),
_.zipObject(matchers)
)(matchers)
| module.exports = {
Given: require('./Given'),
Nested: require('./Nested'),
Prop: require('./Prop'),
Rejects: require('./Rejects'),
Required: require('./Required'),
Resolves: require('./Resolves'),
Returns: require('./Returns'),
Test: require('./Test'),
Throws: require('./Throws')
}
| Use explicit exports for matchers. | Use explicit exports for matchers.
This was causing issues with importing *.test.js files and making this explicit
should also make it easier to convert to ES modules.
| JavaScript | isc | nickmccurdy/purespec |
4b4020d9c2c489b8f113ed817e9b13d8f6003427 | app/components/html-editor.js | app/components/html-editor.js | /* eslint ember/order-in-components: 0 */
import $ from 'jquery';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { computed } from '@ember/object';
const defaultButtons = [
'bold',
'italic',
'subscript',
'superscript',
'formatOL',
'formatUL',
'insertL... | /* eslint ember/order-in-components: 0 */
import $ from 'jquery';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { computed } from '@ember/object';
const defaultButtons = [
'bold',
'italic',
'subscript',
'superscript',
'formatOL',
'formatUL',
'insertL... | Update our Froala Editor license key | Update our Froala Editor license key
| JavaScript | mit | jrjohnson/frontend,thecoolestguy/frontend,jrjohnson/frontend,djvoa12/frontend,ilios/frontend,dartajax/frontend,ilios/frontend,thecoolestguy/frontend,djvoa12/frontend,dartajax/frontend |
767bb63da813da20d02ba4dc938750d283fb10de | test/integration/fixtures/sampleapp/config/local.js | test/integration/fixtures/sampleapp/config/local.js | module.exports = {
log: {
level: 'silent'
},
views: {
locals: {
foo: '!bar!'
}
},
blueprints: {
defaultLimit: 10
},
models: {
migrate: 'alter'
},
globals: false
};
| module.exports = {
log: {
level: 'silent'
},
views: {
locals: {
foo: '!bar!'
}
},
models: {
migrate: 'alter'
},
globals: false
};
| Remove `defaultLimit` from test fixture app | Remove `defaultLimit` from test fixture app
| JavaScript | mit | rlugojr/sails,balderdashy/sails,rlugojr/sails |
76c587ac9c7619aa9788daf960b7556b323fb08e | config/karma.conf.js | config/karma.conf.js | basePath = '../';
files = [
JASMINE,
JASMINE_ADAPTER,
'app/lib/jquery/jquery-*.js',
'app/lib/angular/angular.js',
'app/lib/angular/angular-*.js',
'app/lib/underscore.js',
'test/lib/angular/angular-mocks.js',
'app/lib/angular-ui/angular-ui-0.4.0/build/**/*.js',
'app/js/directives/*.js',
'app/js/**/*... | basePath = '../';
files = [
JASMINE,
JASMINE_ADAPTER,
'app/lib/jquery/jquery-*.js',
'app/lib/angular/angular.js',
'app/lib/angular/angular-*.js',
'app/lib/underscore.js',
'test/lib/angular/angular-mocks.js',
'app/lib/angular-ui/angular-ui-0.4.0/build/**/*.js',
'app/js/directives/*.js',
'app/js/**/*... | Set karma options up for faster unit tests | Set karma options up for faster unit tests
| JavaScript | mit | DerekDomino/forms-angular,behzad88/forms-angular,behzad88/forms-angular,DerekDomino/forms-angular,forms-angular/forms-angular,b12consulting/forms-angular,forms-angular/forms-angular,b12consulting/forms-angular,forms-angular/forms-angular,DerekDomino/forms-angular |
0605156573b379514f243119d20f55fb8ce8b660 | view/dbjs/active-managers-select.js | view/dbjs/active-managers-select.js | 'use strict';
var d = require('d')
, db = require('mano').db
, _ = require('mano').i18n.bind('View: Manager Select');
module.exports = function (descriptor) {
Object.defineProperties(descriptor, {
inputOptions: d({
list: db.User.instances.filterByKey('isManagerActive').toArray(function (a, b) {
return a... | 'use strict';
var d = require('d')
, activeManagers = require('../../users/active-managers')
, _ = require('mano').i18n.bind('View: Manager Select');
module.exports = function (descriptor) {
Object.defineProperties(descriptor, {
inputOptions: d({
list: activeManagers.toArray(function (a, b) {
return a.f... | Use managers list + case insensitive comparison | Use managers list + case insensitive comparison
| JavaScript | mit | egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations |
7daab629eaccd22f474da04a9d83f560dbeb4685 | src/post/LikesList.js | src/post/LikesList.js | import React, { Component } from 'react';
import { Link } from 'react-router';
import Avatar from '../widgets/Avatar';
import './LikesList.scss';
export default class LikesList extends Component {
constructor(props) {
super(props);
this.state = {
show: 10,
};
}
handleShowMore() {
this.setS... | import React, { Component } from 'react';
import { Link } from 'react-router';
import Avatar from '../widgets/Avatar';
import './LikesList.scss';
export default class LikesList extends Component {
constructor(props) {
super(props);
this.state = {
show: 10,
};
}
handleShowMore() {
this.setS... | Add red color on dislikes | Add red color on dislikes
| JavaScript | mit | ryanbaer/busy,Sekhmet/busy,Sekhmet/busy,ryanbaer/busy,busyorg/busy,busyorg/busy |
e197f10b72a8f3dea6d25d06c4c902e6c7d80ad8 | backend/servers/mcapid/lib/dal/files.js | backend/servers/mcapid/lib/dal/files.js | module.exports = function(r) {
const {addFileToDirectoryInProject} = require('./dir-utils')(r);
const uploadFileToProjectDirectory = async(file, projectId, directoryId, userId) => {
let upload = await addFileToDirectoryInProject(file, directoryId, projectId, userId);
return upload;
};
... | module.exports = function(r) {
const {addFileToDirectoryInProject} = require('./dir-utils')(r);
const uploadFileToProjectDirectory = async(file, projectId, directoryId, userId) => {
let upload = await addFileToDirectoryInProject(file, directoryId, projectId, userId);
return upload;
};
... | Throw an error if nothing is changed on a file move | Throw an error if nothing is changed on a file move
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
19faa2f7d98a8a9212bf253668bc0f8ab066d3ee | bundles/ranvier-combat/commands/kill.js | bundles/ranvier-combat/commands/kill.js | 'use strict';
module.exports = (srcPath) => {
const Broadcast = require(srcPath + 'Broadcast');
const Parser = require(srcPath + 'CommandParser').CommandParser;
return {
aliases: ['attack', 'slay'],
command : (state) => (args, player) => {
args = args.trim();
if (!args.length) {
ret... | 'use strict';
module.exports = (srcPath) => {
const Broadcast = require(srcPath + 'Broadcast');
const Parser = require(srcPath + 'CommandParser').CommandParser;
return {
aliases: ['attack', 'slay'],
command : (state) => (args, player) => {
args = args.trim();
if (!args.length) {
ret... | Allow player to engage multiple enemies at once | Allow player to engage multiple enemies at once
| JavaScript | mit | shawncplus/ranviermud |
dec162c8555fadb12abf8c390f0d899061f5775c | server/models/index.js | server/models/index.js | import fs from 'fs';
import path from 'path';
import Sequelize from 'sequelize';
// import configs from '../config/config';
const basename = path.basename(module.filename);
// const env = process.env.NODE_ENV || 'development';
// const config = configs[env];
const db = {};
let sequelize;
if (process.env.DATABASE_URL... | import fs from 'fs';
import path from 'path';
import Sequelize from 'sequelize';
const basename = path.basename(module.filename);
const db = {};
let sequelize;
if (process.env.DATABASE_URL || process.env.DATABASE_URL_TEST) {
sequelize = new Sequelize(process.env.DATABASE_URL
|| process.env.DATABASE_URL_TEST);
... | Fix app crash on travis CI and heroku | Fix app crash on travis CI and heroku
| JavaScript | apache-2.0 | larrystone/BC-26-More-Recipes,larrystone/BC-26-More-Recipes |
47135b7ca6c91ff4ae7f714d316f15a6ed3d3cc6 | index.js | index.js | 'use strict';
var color = require('color')
, hex = require('text-hex');
/**
* Generate a color for a given name. But be reasonably smart about it by
* understanding name spaces and coloring each namespace a bit lighter so they
* still have the same base color as the root.
*
* @param {String} name The namespace... | 'use strict';
var color = require('color')
, hex = require('text-hex');
/**
* Generate a color for a given name. But be reasonably smart about it by
* understanding name spaces and coloring each namespace a bit lighter so they
* still have the same base color as the root.
*
* @param {String} name The namespace... | Return early when no namespace is used | [minor] Return early when no namespace is used
| JavaScript | mit | bigpipe/colorspace |
187269cfc24909ee5c21d33d9680f7d1467ab03b | app/components/Settings/components/notifications-panel.js | app/components/Settings/components/notifications-panel.js | import React from 'react';
import PropTypes from 'prop-types';
import { RadioGroup, Radio, Checkbox } from '@blueprintjs/core';
import { NotificationTypes } from 'enums';
const NotificationsPanel = ({
notificationType,
onSettingsChange,
setNotificationType,
continuousMode,
setContinuousMode
}) => (
<div c... | import React from 'react';
import PropTypes from 'prop-types';
import { RadioGroup, Radio, Checkbox } from '@blueprintjs/core';
import { NotificationTypes } from 'enums';
const NotificationsPanel = ({
notificationType,
onSettingsChange,
setNotificationType,
continuousMode,
setContinuousMode
}) => (
<div c... | Remove label and just show checkbox | feat: Remove label and just show checkbox
| JavaScript | mit | builtwithluv/ZenFocus,builtwithluv/ZenFocus |
dbd5d56fe2fa39c89d063bfbbf0f0fdfedae8168 | packages/lesswrong/server/mapsUtils.js | packages/lesswrong/server/mapsUtils.js | import { getSetting } from 'meteor/vulcan:core';
import googleMaps from '@google/maps'
const googleMapsApiKey = getSetting('googleMaps.serverApiKey', null)
let googleMapsClient = null
if (googleMapsApiKey) {
googleMapsClient = googleMaps.createClient({
key: googleMapsApiKey,
Promise: Promise
});
} else {
... | import { getSetting } from 'meteor/vulcan:core';
import googleMaps from '@google/maps'
const googleMapsApiKey = getSetting('googleMaps.serverApiKey', null)
let googleMapsClient = null
if (googleMapsApiKey) {
googleMapsClient = googleMaps.createClient({
key: googleMapsApiKey,
Promise: Promise
});
} else {
... | Improve error handling without API key | Improve error handling without API key
| JavaScript | mit | Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Telescope |
4961e4c984cee1c13f15966b670fccb0360391ee | src/main/web/js/app/pym-interactive.js | src/main/web/js/app/pym-interactive.js |
$(function() {
$('div.pym-interactive').each(function(index, element) {
new pym.Parent($(element).attr('id'), $(element).data('url'));
});
});
|
$(function() {
$('div.pym-interactive').each(function(index, element) {
var pymParent = new pym.Parent($(element).attr('id'), $(element).data('url'));
pymParent.onMessage('height', function(height) {
addIframeHeightToEmbedCode($(this), height);
});
});
});
function addIfram... | Build embed code including height attrbute on height message from pym child | Build embed code including height attrbute on height message from pym child
| JavaScript | mit | ONSdigital/babbage,ONSdigital/babbage,ONSdigital/babbage,ONSdigital/babbage |
91c61c8d9ad1fc6ed7561f95de347334ea387f04 | app/assets/javascripts/frontend.js | app/assets/javascripts/frontend.js | // Frontend manifest
//= require transactions
//= require media-player-loader
//= require checkbox-filter
//= require support
//= require live-search
//= require shared_mustache
//= require templates
//= require track-external-links
//= require search
| // Frontend manifest
// Note: The ordering of these JavaScript includes matters.
//= require transactions
//= require media-player-loader
//= require checkbox-filter
//= require support
//= require live-search
//= require shared_mustache
//= require templates
//= require track-external-links
//= require search
| Add comment: explain JS deps ordering matters | Add comment: explain JS deps ordering matters
Make it clear to others looking at the frontend.js file that the
ordering of the JS includes matters.
| JavaScript | mit | alphagov/frontend,alphagov/frontend,alphagov/frontend,alphagov/frontend |
e781a6a037ae7f7888b84d6f83801305bf2d1205 | plugins/auth/flat_file.js | plugins/auth/flat_file.js | // Auth against a flat file
exports.register = function () {
this.inherits('auth/auth_base');
}
exports.hook_capabilities = function (next, connection) {
// don't allow AUTH unless private IP or encrypted
if (!net_utils.is_rfc1918(connection.remote_ip) && !connection.using_tls) return next();
var conf... | // Auth against a flat file
var net_utils = require('./net_utils');
exports.register = function () {
this.inherits('auth/auth_base');
}
exports.hook_capabilities = function (next, connection) {
// don't allow AUTH unless private IP or encrypted
if (!net_utils.is_rfc1918(connection.remote_ip) && !connectio... | Fix ReferenceError: net_utils is not defined reported on IRC | Fix ReferenceError: net_utils is not defined reported on IRC | JavaScript | mit | craigslist/Haraka,hiteshjoshi/my-haraka-config,AbhilashSrivastava/haraka_sniffer,Synchro/Haraka,danucalovj/Haraka,hatsebutz/Haraka,typingArtist/Haraka,hatsebutz/Haraka,pedroaxl/Haraka,craigslist/Haraka,MignonCornet/Haraka,MignonCornet/Haraka,fredjean/Haraka,MignonCornet/Haraka,typingArtist/Haraka,Dexus/Haraka,slattery/... |
67830a4214f33ee1e9c94fdfc5dd27747563579e | src/app/api/Actions.js | src/app/api/Actions.js | import {
REQUESTING,
RECEIVE_TOP_RATED,
RECEIVE_NOW_SHOWING,
RECEIVE_POPULAR
} from "./ActionTypes"
export function request() {
return {
type: REQUESTING
}
}
export function receivedNowShowing(data) {
return {
type: RECEIVE_NOW_SHOWING,
data
}
}
export function receivedPopular(data) {
return {
type:... | import {
REQUESTING,
RECEIVE_TOP_RATED,
RECEIVE_NOW_SHOWING,
RECEIVE_POPULAR
} from "./ActionTypes"
export function request() {
return {
type: REQUESTING
}
}
export function receivedNowShowing(data) {
return {
type: RECEIVE_NOW_SHOWING,
data
}
}
export function receivedPopular(data) {
return {
type:... | Use proper action type for different movies | Use proper action type for different movies
| JavaScript | mit | Guru107/test_app |
b0bc5f4bbef6c297119146f3528bfdb15138a4fd | test/minify/config.js | test/minify/config.js | // just to make sure this file is being minified properly
var foobar = (function() {
var anotherLongVariableName = "foo";
var baz = "baz";
return anotherLongVariableName + baz;
}());
System.paths.foo = "bar";
| // just to make sure this file is being minified properly
// this code is a noop meant to force UglifyJS to include the
// `anotherLongVariableName` (with the mangle flag off) in the minified code
// for testing purposes
var anotherLongVariableName;
function funcName(firstLongName, lastLongName) {
anotherLongVariab... | Adjust code to workaround UglifyJS dead code removal | Adjust code to workaround UglifyJS dead code removal
| JavaScript | mit | stealjs/steal-tools,stealjs/steal-tools |
5807a4997fb651adba6665ccf9f7edf1517c86d8 | test/registry.spec.js | test/registry.spec.js | import test from 'ava';
test.todo('Write test for Registry');
| import test from 'ava';
import Registry from '../src/registry';
test('Registry returns a registry', t => {
let registry = Registry([document.body]);
t.deepEqual(registry, {
current: [],
elements: [document.body],
handlers: { enter: [], exit: [] },
singles: { enter: [], exit: [] ... | Add initial tests for Registry | Add initial tests for Registry
| JavaScript | mit | kudago/in-view,camwiegert/in-view |
67d8f92bc99e95ec0c567250eae0f8aca5cadd76 | app/components/organization/Welcome.js | app/components/organization/Welcome.js | import React from 'react';
import PipelineIcon from '../icons/Pipeline';
class Welcome extends React.Component {
static propTypes = {
organization: React.PropTypes.string.isRequired
}
render() {
return (
<div className="center p4">
<PipelineIcon />
<h1 className="h3 m0 mt2 mb4">Cr... | import React from 'react';
import PipelineIcon from '../icons/Pipeline';
class Welcome extends React.Component {
static propTypes = {
organization: React.PropTypes.string.isRequired
}
render() {
return (
<div className="center p4">
<PipelineIcon />
<h1 className="h3 m0 mt2 mb4">Cr... | Make 'example pipelines' link the same blue link | Make 'example pipelines' link the same blue link
| JavaScript | mit | fotinakis/buildkite-frontend,buildkite/frontend,fotinakis/buildkite-frontend,buildkite/frontend |
ebccc846b56b4591a011666953a6ad75ef35fabc | src/components/Head.js | src/components/Head.js | import React from 'react'
export default class Head extends React.Component {
render() {
return (
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-compatible" content="IE=edge, chrome=1"/>
<meta name="viewport" content="width=device-width, initial-s... | import React from 'react'
export default class Head extends React.Component {
render() {
return (
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-compatible" content="IE=edge, chrome=1"/>
<meta name="viewport" content="width=device-width, initial-s... | Add type text/css to stylesheet | Add type text/css to stylesheet
| JavaScript | mit | mlcdf/website,mlcdf/website |
fab4325bf85c8aa4386464b09781d385b07f5c77 | src/browser_tools/chrome_new_tab_pretty.user.js | src/browser_tools/chrome_new_tab_pretty.user.js | // ==UserScript==
// @name Chrome New Tab Prettify.
// @namespace https://github.com/kilfu0701
// @version 0.1
// @description Prettify UI on Chrome new tab.
// @author kilfu0701
// @match /^http[s]?:\/\/www.google*/
// @run-at document-ready
// @include /^http[s]?:\/\/www.googl... | // ==UserScript==
// @name Chrome New Tab Prettify.
// @namespace https://github.com/kilfu0701
// @version 0.1
// @description Prettify UI on Chrome new tab.
// @author kilfu0701
// @match /^http[s]?:\/\/www.google*/
// @run-at document-ready
// @include /^http[s]?:\/\/www.googl... | Hide logo and search bar in chrome new tab. | Hide logo and search bar in chrome new tab.
| JavaScript | mit | kilfu0701/thk-user-script |
6cf484c9a3ce5aa141363ae67c58fa94d055a105 | app/assets/javascripts/app/views/bookmarklet_view.js | app/assets/javascripts/app/views/bookmarklet_view.js | app.views.Bookmarklet = Backbone.View.extend({
separator: ' - ',
initialize: function(opts) {
// init a standalone publisher
app.publisher = new app.views.Publisher({standalone: true});
app.publisher.on('publisher:add', this._postSubmit, this);
app.publisher.on('publisher:sync', this._postSuccess,... | app.views.Bookmarklet = Backbone.View.extend({
separator: ' - ',
initialize: function(opts) {
// init a standalone publisher
app.publisher = new app.views.Publisher({standalone: true});
app.publisher.on('publisher:add', this._postSubmit, this);
app.publisher.on('publisher:sync', this._postSuccess,... | Make sure publisher is totally hidden in bookmarklet after post success | Make sure publisher is totally hidden in bookmarklet after post success
| JavaScript | agpl-3.0 | geraspora/diaspora,jhass/diaspora,Flaburgan/diaspora,diaspora/diaspora,Amadren/diaspora,diaspora/diaspora,geraspora/diaspora,despora/diaspora,Amadren/diaspora,Amadren/diaspora,Muhannes/diaspora,SuperTux88/diaspora,jhass/diaspora,KentShikama/diaspora,spixi/diaspora,jhass/diaspora,SuperTux88/diaspora,SuperTux88/diaspora,... |
829082a9fdb07be6892b9fc552e874e9b1eeb81c | addon/components/data-visual.js | addon/components/data-visual.js | import Ember from 'ember';
import layout from '../templates/components/data-visual';
import Stage from '../system/stage';
export default Ember.Component.extend({
classNames: [ 'data-visual' ],
layout,
width: 300,
height: 150,
stage: null,
initializeGraphicsContext() {
var element = this.element;
... | import Ember from 'ember';
import Stage from '../system/stage';
export default Ember.Component.extend({
classNames: [ 'data-visual' ],
width: 300,
height: 150,
stage: null,
initializeGraphicsContext() {
var element = this.element;
var fragment = document.createDocumentFragment();
Stage.stage... | Remove explicit layout; too eager | Remove explicit layout; too eager | JavaScript | mit | ming-codes/ember-cli-d3,ming-codes/ember-cli-d3 |
f073042945f2f876cccc35c59c4eff0b0cfb4535 | app/assets/javascripts/bootstrap-dropdown-submenu.js | app/assets/javascripts/bootstrap-dropdown-submenu.js | $(document).ready(function () {
$('ul.dropdown-menu [data-toggle=dropdown]').on('click', function (event) {
event.preventDefault();
event.stopPropagation();
$(this).parent().addClass('open');
var menu = $(this).parent().find("ul");
var menupos = menu.offset();
if ((menupos.left + menu.width(... | $(document).ready(function () {
function openSubMenu(event) {
if (this.pathname === '/') {
event.preventDefault();
}
event.stopPropagation();
$(this).parent().addClass('open');
var menu = $(this).parent().find("ul");
var menupos = menu.offset();
if ((menupos.left + menu.width()) +... | Enable menu access on hover and links from section titles | Enable menu access on hover and links from section titles
| JavaScript | bsd-3-clause | openHPI/codeocean,openHPI/codeocean,openHPI/codeocean,openHPI/codeocean,openHPI/codeocean,openHPI/codeocean |
70b62a39c353ff3ebe4847868feb24907d27cea3 | app/assets/javascripts/lga_filter.js | app/assets/javascripts/lga_filter.js | $(function() {
$('#lga_filter').keyup(function(ev) {
var list = $('#lga_list');
var filter = $(this).val();
if (filter === '') {
// Show all when the filter is cleared
list.find('div.lga').show();
} else {
// Hide all LGAs that don't match the filter
var filterRegexp = new Reg... | $(function() {
function strip(from) {
if(from !== undefined) {
from = from.replace(/^\s+/, '');
for (var i = from.length - 1; i >= 0; i--) {
if (/\S/.test(from.charAt(i))) {
from = from.substring(0, i + 1);
break;
}
}
return from;
} else ... | Fix filter bugs for council list filter | Fix filter bugs for council list filter
| JavaScript | apache-2.0 | NSWPlanning/data-verification-tool,NSWPlanning/data-verification-tool,NSWPlanning/data-verification-tool |
10ce33fdc1035c764f27c69562b8f2a409e419fa | src/server/routes.js | src/server/routes.js | const listenerUser = require ('./listenerUser');
const listenerApp = require ('./listenerApp');
// Initialize routes.
function init (app) {
listenerUser.init ();
listenerApp.init ();
app.post ('/api/login', listenerUser.login);
app.post ('/api/logout', listenerUser.logout);
app.get ('/api/verifylogin', list... | const listenerUser = require ('./listenerUser');
const listenerApp = require ('./listenerApp');
// Initialize routes.
function init (app) {
listenerUser.init ();
listenerApp.init ();
app.post ('/api/login', listenerUser.login);
app.post ('/api/logout', listenerUser.logout);
app.get ('/api/verifylogin', list... | Correct return handling for authentication middleware function | Correct return handling for authentication middleware function
| JavaScript | mit | fcc-joemcintyre/pollster,fcc-joemcintyre/pollster,fcc-joemcintyre/pollster |
344b2d6018ba63f139da4529978587e209d9566b | lib/run_cmd.js | lib/run_cmd.js | 'use strict'
var path = require('path')
var async = require('async')
var config = require('./config')
var child_process = require('child_process')
function runCmd (cwd, argv) {
var scripts = argv._.slice(1)
var pkg = require(path.join(cwd, 'package.json'))
if (!scripts.length) {
var availableScripts = Obje... | 'use strict'
var path = require('path')
var async = require('async')
var config = require('./config')
var child_process = require('child_process')
var assign = require('object-assign')
function runCmd (cwd, argv) {
var scripts = argv._.slice(1)
var pkg = require(path.join(cwd, 'package.json'))
if (!scripts.len... | Refactor env in run command | Refactor env in run command
| JavaScript | mit | alexanderGugel/ied,alexanderGugel/mpm |
e7477b991a2f452d25ac35475e8adecceb7fac85 | 2017/01.js | 2017/01.js | // Part 1
[...document.body.textContent.trim()].reduce((s,c,i,a)=>(c==a[(i+1)%a.length])*c+s,0)
// Part 2
[...document.body.textContent.trim()].reduce((s,c,i,a)=>(l=>c==a[(i+l/2)%l])(a.length)*c+s,0)
| // Part 1
[...document.body.innerText.trim()].reduce((s,c,i,a)=>(c==a[(i+1)%a.length])*c+s,0)
// Part 2
[...document.body.innerText.trim()].reduce((s,c,i,a)=>(l=>c==a[(i+l/2)%l])(a.length)*c+s,0)
| Use body.innerText instead of textContent | Use body.innerText instead of textContent
| JavaScript | mit | yishn/adventofcode,yishn/adventofcode |
fce850eeb8b91f00d4cdeaf7cfa3d74e7b47b4c0 | lib/cli/src/generators/WEB-COMPONENTS/template-csf/.storybook/preview.js | lib/cli/src/generators/WEB-COMPONENTS/template-csf/.storybook/preview.js | /* global window */
import {
configure,
addParameters,
// setCustomElements,
} from '@storybook/web-components';
// import customElements from '../custom-elements.json';
// setCustomElements(customElements);
addParameters({
docs: {
iframeHeight: '200px',
},
});
// configure(require.context('../storie... | // import { setCustomElements } from '@storybook/web-components';
// import customElements from '../custom-elements.json';
// setCustomElements(customElements);
| Fix project template for web-components | CLI: Fix project template for web-components
| JavaScript | mit | storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook |
702c888a12716d96f7382fbf2d995fbaf4243a4a | store/search/quick-search/index.js | store/search/quick-search/index.js | let SearchStore = require('../search-store');
/**
* Class standing for all advanced search information.
* The state should be the complete state of the page.
*/
class QuickSearchStore extends SearchStore{
constructor(conf){
conf = conf || {};
conf.definition = {
query: 'query',
scope: 'scope',
... | let SearchStore = require('../search-store');
/**
* Class standing for all advanced search information.
* The state should be the complete state of the page.
*/
class QuickSearchStore extends SearchStore{
constructor(conf){
conf = conf || {};
conf.definition = {
query: 'query',
scope: 'scope',
... | Add missing property, the facets (used for group counts) | [quick-search-store] Add missing property, the facets (used for group counts)
| JavaScript | mit | Jerom138/focus,KleeGroup/focus-core,Jerom138/focus,Jerom138/focus |
8599b9c74d4273843cb5ae4f11a5799c2f1f8cc5 | koans/AboutPromises.js | koans/AboutPromises.js | describe("About Promises", function () {
describe("Asynchronous Flow", function () {
it("should understand promise declaration usage", function () {
});
});
});
| describe("About Promises", function () {
describe("Asynchronous Flow", function () {
it("should understand promise usage", function () {
function isZero(number) {
return new Promise(function(resolve, reject) {
if(number === 0) {
resolve();
} else {
reje... | Add type test for promises | feat: Add type test for promises
| JavaScript | mit | tawashley/es6-javascript-koans,tawashley/es6-javascript-koans,tawashley/es6-javascript-koans |
bf32038659afa4a77cdd79c59c52d9a9adb9b1d8 | lathe/js/box-colors.js | lathe/js/box-colors.js | /* eslint-env es6 */
/* global THREE */
window.applyBoxVertexColors = (function() {
'use strict';
return function vertexColors( geometry ) {
const red = new THREE.Color( '#f00');
const green = new THREE.Color( '#0f0' );
const blue = new THREE.Color( '#00f' );
geometry.faces.forEach( face => {
... | /* eslint-env es6 */
/* global THREE, Indices */
window.applyBoxVertexColors = (function() {
'use strict';
function setFaceVertexColor( face, index, color ) {
if ( face.a === index ) {
face.vertexColors[ 0 ] = color;
}
if ( face.b === index ) {
face.vertexColors[ 1 ] = color;
}
if... | Add BoxGeometry vertex colors helper. | lathe[cuboid}: Add BoxGeometry vertex colors helper.
| JavaScript | mit | razh/experiments-three.js,razh/experiments-three.js |
41e40acc7a7afe8d5bde99ed41a730cd88d73e86 | reddit/old-reddit-hide-offline-presence.user.js | reddit/old-reddit-hide-offline-presence.user.js | // ==UserScript==
// @name Hide offline presence dot on old reddit
// @namespace https://mathemaniac.org
// @version 1.0
// @description Hides the offline presence dot from old reddit. Only hides offline presence, so you notice if you're displayed as online. https://old.reddit.com/r/changelog/comments/... | // ==UserScript==
// @name Hide offline presence dot on old reddit
// @namespace https://mathemaniac.org
// @version 1.0.1
// @description Hides the offline presence dot from old reddit. Only hides offline presence, so you notice if you're displayed as online. https://old.reddit.com/r/changelog/comment... | Make script run on document start to help on dot flashes | Make script run on document start to help on dot flashes
| JavaScript | mit | Eckankar/userscripts,Eckankar/userscripts |
838745ae7fea6685498bab8b66a043090a582774 | server/channels/__tests__/authAdmin.js | server/channels/__tests__/authAdmin.js | jest.mock('../../models/meeting');
jest.mock('../../utils');
const { emit, broadcast } = require('../../utils');
const { createGenfors } = require('../../models/meeting');
const { generateGenfors, generateSocket } = require('../../utils/generateTestData');
const { createGenfors: createGenforsListener } = require('../au... | jest.mock('../../models/meeting');
jest.mock('../../utils');
const { emit, broadcast } = require('../../utils');
const { createGenfors } = require('../../models/meeting');
const { generateGenfors, generateSocket } = require('../../utils/generateTestData');
const { createGenfors: createGenforsListener } = require('../au... | Make mocked admin password be a constant | Make mocked admin password be a constant
| JavaScript | mit | dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta |
e457d0dcb9af16528f6d84ff7b5c726edb2f1478 | prolific.syslog/syslog.argv.js | prolific.syslog/syslog.argv.js | /*
___ usage ___ en_US ___
usage: prolific syslog <options>
-a, --application <string>
The application name to display in the syslog record. Defaults to
the value of `process.title` which will always be `node`.
-h, --hostname <string>
The hostname to display... | /*
___ usage ___ en_US ___
usage: prolific syslog <options>
-a, --application <string>
The application name to display in the syslog record. Defaults to
the value of `process.title` which will always be `node`.
-h, --hostname <string>
The hostname to display... | Add flag for new module loader. | Add flag for new module loader.
| JavaScript | mit | bigeasy/prolific,bigeasy/prolific |
651bc5ecf574d4716683343c9f543d88263fd4cb | models/base.js | models/base.js | var Arrow = require('arrow');
module.exports = Arrow.createModel('base', {
connector: 'appc.redis',
fields: { },
expire: function expire(seconds, callback){
return this.getConnector().expire(this.getModel(), this, seconds, callback);
},
expireAt: function expireAt(date, callback){
... | var Arrow = require('arrow');
var Base = Arrow.Model.extend('base', {
connector: 'appc.redis',
fields: { },
expire: function expire(seconds, callback){
return this.getConnector().expire(this.getModel(), this, seconds, callback);
},
expireAt: function expireAt(date, callback){
re... | Switch out 'createModel' for 'extend' | Switch out 'createModel' for 'extend'
| JavaScript | apache-2.0 | titanium-forks/appcelerator.appc.redis |
a25dadd4f4078965e647ec34265cdfe5fd879826 | client/src/components/LastVotes.js | client/src/components/LastVotes.js | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import css from './LastVotes.css';
import { voteWithNameSelector } from '../selectors/voting';
const LastVotes = ({ votes }) => (
<div className={css.component}>
<h3>Siste stemmer</h3>
{ votes.length > 0 ? v... | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import css from './LastVotes.css';
import { voteWithNameSelector } from '../selectors/voting';
import { activeIssueExists, getOwnVote, getIssueKey } from '../selectors/issues';
const LastVotes = ({ votes, hideVotes })... | Hide last votes unless there is an active issue with public votes and user has voted | Hide last votes unless there is an active issue with public votes and
user has voted
| JavaScript | mit | dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta |
ea7cba4da1698273cb0023c30ae4f00268129e1c | lib/tests/dashboard.js | lib/tests/dashboard.js | var Mocha = require('mocha'),
_ = require('underscore'),
moduleTest = require('./module');
module.exports = function (browser, dashboard, suite, config) {
suite = Mocha.Suite.create(suite, dashboard.title);
suite.beforeAll(function () {
return browser.get(config.baseUrl + dashboard.slug)
.$('bo... | var Mocha = require('mocha'),
_ = require('underscore'),
moduleTest = require('./module');
module.exports = function (browser, dashboard, suite, config) {
suite = Mocha.Suite.create(suite, dashboard.title);
suite.beforeAll(function () {
return browser.get(config.baseUrl + dashboard.slug)
.setWi... | Set window size to desktop display dimensions | Set window size to desktop display dimensions
Some tests were failing because the default window dimensions cause the site to display in "mobile" format, truncating some elements and causing tests to fail.
| JavaScript | mit | alphagov/cheapseats |
07d763d5ce597abba1193cccee3ad7fca0d4cd97 | plugins/cloudimport/templates/load_buttons.js | plugins/cloudimport/templates/load_buttons.js | PluginsAPI.Dashboard.addNewTaskButton(
["cloudimport/build/ImportView.js"],
function(args, ImportView) {
return React.createElement(ImportView, {
onNewTaskAdded: args.onNewTaskAdded,
projectId: args.projectId,
apiURL: "{{ api_url }}",
});
}
);
PluginsA... | PluginsAPI.Dashboard.addNewTaskButton(
["cloudimport/build/ImportView.js"],
function(args, ImportView) {
return React.createElement(ImportView, {
onNewTaskAdded: args.onNewTaskAdded,
projectId: args.projectId,
apiURL: "{{ api_url }}",
});
}
);
PluginsA... | Fix to show task button | Fix to show task button
| JavaScript | agpl-3.0 | pierotofy/WebODM,OpenDroneMap/WebODM,pierotofy/WebODM,pierotofy/WebODM,pierotofy/WebODM,OpenDroneMap/WebODM,OpenDroneMap/WebODM,OpenDroneMap/WebODM,OpenDroneMap/WebODM,pierotofy/WebODM |
70b72554e264bb3d06f6116080252c20b19bce25 | take-002-nodejs-server-clone/server.js | take-002-nodejs-server-clone/server.js | var express = require('express'),
mongoose = require('mongoose'),
app = express()
app.set('port', process.env.PORT || 3000)
app.set('mongodb-url', process.env.MONGODB_URL || 'mongodb://localhost/hangman')
if ('test' === app.get('env')) {
app.set('port', 9000)
app.set('mongodb-url', 'mongodb://localhost/ha... | var express = require('express'),
mongoose = require('mongoose'),
util = require('util'),
_ = require('lodash'),
app = express()
app.set('port', process.env.PORT || 3000)
app.set('mongodb-url', process.env.MONGODB_URL || 'mongodb://localhost/hangman')
if ('test' === app.get('env')) {
app.set('port',... | Create User document after POST /me | [take-002] Create User document after POST /me
| JavaScript | mit | gabrielelana/hangman-http-kata |
cde94167d2bb18a2873a943c7df25dd8258e117f | client/components/FileDescription.js | client/components/FileDescription.js | import React from 'react';
export default class FileDescription extends React.Component {
render() {
return <div className="file-description">
<span className="file-name">{this.props.file.name}</span>
<span className="file-size">{this.props.file.size}</span>
<span className="file-type">{this.p... | import React from 'react';
export default class FileDescription extends React.Component {
render() {
return <div className="file-description">
<span className="file-name">{this.props.file.name}</span>
</div>;
}
}
| Remove file size and type descriptors. | Remove file size and type descriptors.
| JavaScript | bsd-3-clause | gramakri/filepizza,bradparks/filepizza_javascript_send_files_webrtc,hanford/filepizza,Ribeiro/filepizza,pquochoang/filepizza,jekrb/filepizza,codevlabs/filepizza,codebhendi/filepizza |
9ff4f729ba2970cd1407f47d7d1ceecc52dd7f61 | lib/common/annotate.js | lib/common/annotate.js | define(['../is', '../array/last', '../functional'], function(is, last, functional) {
var map = functional.map;
var filter = functional.filter;
var forEach = functional.forEach;
function annotate() {
var args = Array.prototype.slice.call(arguments);
var fn = args.shift();
if(is.... | define(['../is', '../array/last', '../functional'], function(is, last, functional) {
var map = functional.map;
var filter = functional.filter;
var forEach = functional.forEach;
function annotate() {
var args = Array.prototype.slice.call(arguments);
var fn = args.shift();
var doc... | Attach metadata to the right function | Attach metadata to the right function
| JavaScript | mit | bebraw/funkit,bebraw/funkit |
3789c3c739f450188cdb50ffd25fe3099f8b458c | react/components/UI/LoadingIndicator/index.js | react/components/UI/LoadingIndicator/index.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { space, width, height } from 'styled-system';
import { preset } from 'react/styles/functions';
import Text from 'react/components/UI/Text';
const Container = styled.div`
box-sizing: border-... | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { space, width, height } from 'styled-system';
import { preset } from 'react/styles/functions';
import Text from 'react/components/UI/Text';
const Container = styled.div`
box-sizing: border-... | Support color/font size in loading indicator | Support color/font size in loading indicator
| JavaScript | mit | aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell |
753c56b41f2d7564dd660995d24606f17b0ffbbd | assets/src/stories-editor/helpers/test/addAMPExtraProps.js | assets/src/stories-editor/helpers/test/addAMPExtraProps.js | /**
* Internal dependencies
*/
import { addAMPExtraProps } from '../';
describe( 'addAMPExtraProps', () => {
it( 'does not modify non-child blocks', () => {
const props = addAMPExtraProps( {}, { name: 'foo/bar' }, {} );
expect( props ).toStrictEqual( {} );
} );
it( 'generates a unique ID', () => {
const p... | /**
* Internal dependencies
*/
import { addAMPExtraProps } from '../';
describe( 'addAMPExtraProps', () => {
it( 'does not modify non-child blocks', () => {
const props = addAMPExtraProps( {}, { name: 'foo/bar' }, {} );
expect( props ).toStrictEqual( {} );
} );
it( 'adds a font family attribute', () => {
... | Remove tests that are not relevant anymore. | Remove tests that are not relevant anymore.
| JavaScript | apache-2.0 | ampproject/amp-toolbox-php,ampproject/amp-toolbox-php |
0a77c621aed25a004b0347bf8adfdf1888dc554f | app-frontend/src/app/components/channelHistogram/channelHistogram.controller.js | app-frontend/src/app/components/channelHistogram/channelHistogram.controller.js | export default class ChannelHistogramController {
constructor() {
'ngInject';
}
$onInit() {
this.histOptions = {
chart: {
type: 'lineChart',
showLegend: false,
showXAxis: false,
showYAxis: false,
mar... | export default class ChannelHistogramController {
constructor() {
'ngInject';
}
$onInit() {
this.histOptions = {
chart: {
type: 'lineChart',
showLegend: false,
showXAxis: false,
showYAxis: false,
int... | Remove interactivity from cc histogram | Remove interactivity from cc histogram
| JavaScript | apache-2.0 | azavea/raster-foundry,azavea/raster-foundry,azavea/raster-foundry,aaronxsu/raster-foundry,aaronxsu/raster-foundry,raster-foundry/raster-foundry,raster-foundry/raster-foundry,aaronxsu/raster-foundry,aaronxsu/raster-foundry,azavea/raster-foundry,azavea/raster-foundry,raster-foundry/raster-foundry |
ffeca8d1b1e312864f75e859babbc3a5abb53d8f | web/gulpfile.babel.js | web/gulpfile.babel.js | import bg from 'gulp-bg';
import eslint from 'gulp-eslint';
import gulp from 'gulp';
import runSequence from 'run-sequence';
import webpackBuild from './webpack/build';
const runEslint = () => {
return gulp.src([
'gulpfile.babel.js',
'src/**/*.js',
'webpack/*.js'
// '!**/__tests__/*.*'
])
.pipe(e... | import bg from 'gulp-bg';
import eslint from 'gulp-eslint';
import gulp from 'gulp';
import runSequence from 'run-sequence';
import webpackBuild from './webpack/build';
import os from 'os';
const runEslint = () => {
return gulp.src([
'gulpfile.babel.js',
'src/**/*.js',
'webpack/*.js'
// '!**/__tests_... | Fix gulp nodemon commang for windows environments | Fix gulp nodemon commang for windows environments
original fix by @mannro
| JavaScript | mit | Brainfock/este |
66ce8257b0164f8618b53d2fbe15bda4fa73fb33 | src/prototype/off.js | src/prototype/off.js | define([
'jquery',
'var/eventStorage',
'prototype/var/EmojioneArea'
],
function($, eventStorage, EmojioneArea) {
EmojioneArea.prototype.off = function(events, handler) {
if (events) {
var id = this.id;
$.each(events.toLowerCase().replace(/_/g, '.').split(' '), function(i,... | define([
'jquery',
'var/eventStorage',
'prototype/var/EmojioneArea'
],
function($, eventStorage, EmojioneArea) {
EmojioneArea.prototype.off = function(events, handler) {
if (events) {
var id = this.id;
$.each(events.toLowerCase().replace(/_/g, '.').split(' '), function(i,... | Fix typo which causes memory leak. | Fix typo which causes memory leak.
| JavaScript | mit | mervick/emojionearea |
07059d2cc11db8cdddedc82de931c2c80d4faff4 | lib/cli.js | lib/cli.js | 'use strict';
const _ = require('lodash');
const updateNotifier = require('update-notifier');
/**
* Expose a CLI with given actions as subcommands
* @param {Array} actions Array of subclasses of Action
* @param {Object} pkg The package.json contents
* @returns {Array}
*/
module.exports = function (a... | 'use strict';
const _ = require('lodash');
const updateNotifier = require('update-notifier');
/**
* Expose a CLI with given actions as subcommands
* @param {Array} actions Array of subclasses of Action
* @param {Object} pkg The package.json contents
* @returns {Array}
*/
module.exports = function (a... | Fix error caused by aliasing "v" to "version" on yargs | Fix error caused by aliasing "v" to "version" on yargs
| JavaScript | mit | launchdeckio/shipment |
554d3977a180989956124761c4178fc01f69ed78 | lib/client/hooks.js | lib/client/hooks.js | Router.hooks = {
dataNotFound: function (pause) {
var data = this.data();
var tmpl;
if (data === null || typeof data === 'undefined') {
tmpl = this.lookupProperty('notFoundTemplate');
if (tmpl) {
this.render(tmpl);
this.renderRegions();
pause();
}
}
},
... | Router.hooks = {
dataNotFound: function (pause) {
var data = this.data();
var tmpl;
if (!this.ready())
return;
if (data === null || typeof data === 'undefined') {
tmpl = this.lookupProperty('notFoundTemplate');
if (tmpl) {
this.render(tmpl);
this.renderRegions();
... | Make dataNotFoundHook return if data not ready. | Make dataNotFoundHook return if data not ready.
| JavaScript | mit | firdausramlan/iron-router,Aaron1992/iron-router,TechplexEngineer/iron-router,abhiaiyer91/iron-router,tianzhihen/iron-router,ecuanaso/iron-router,DanielDornhardt/iron-router-2,Aaron1992/iron-router,jg3526/iron-router,assets1975/iron-router,leoetlino/iron-router,TechplexEngineer/iron-router,Sombressoul/iron-router,appoet... |
37b8b0c2a0c887b942653eaa832c5c4d15e3b205 | test/Client.connect.js | test/Client.connect.js |
var Client = require('../index').Client;
var Transport = require('./mock/Transport');
var OutgoingFrameStream = require('./mock/OutgoingFrameStream');
var assert = require('assert');
describe('Client.connect', function() {
var client, transport, framesOut, framesIn;
beforeEach(function() {
transport = new ... |
var Client = require('../index').Client;
var Transport = require('./mock/Transport');
var OutgoingFrameStream = require('./mock/OutgoingFrameStream');
var assert = require('assert');
describe('Client.connect', function() {
var client, transport, framesOut, framesIn;
beforeEach(function() {
transport = new ... | Test for heart-beat header handling | Test for heart-beat header handling
| JavaScript | mit | gdaws/node-stomp |
fa6f1f516775a84db71769b07f11fd23d5b39f7e | addon/helpers/-ui-component-class.js | addon/helpers/-ui-component-class.js | import Ember from 'ember';
export default Ember.Helper.helper(function ([prefix, ...classNames]) {
var classString = '';
classNames.forEach(function(name) {
if (!name) return;
var trimmedName = name.replace(/\s/g, '');
if (trimmedName === '') return;
if (trimmedName === ':component') {
cla... | import Ember from 'ember';
const FONT_SIZE_PATTERN = /font-size/;
export default Ember.Helper.helper(function ([prefix, ...classNames]) {
return classNames.reduce(function(string, name) {
if (!name) return string;
let trimmedName = name.replace(/\s/g, '');
if (trimmedName === '') return string;
sw... | Whitelist font-size classes from prefixing | Whitelist font-size classes from prefixing
| JavaScript | mit | prototypal-io/untitled-ui,prototypal-io/untitled-ui,prototypal-io/ui-base-theme,prototypal-io/ui-base-theme |
f0aad1536f204a108876fea8bbda7aa8ba102749 | server/mappings/windowslive.js | server/mappings/windowslive.js | module.exports = profile => {
return {
uid: profile.username || profile.id,
mail: profile.emails && profile.emails[0] && profile.emails[0].value,
cn: profile.displayName,
displayName: profile.displayName,
givenName: profile.name.familyName,
sn: profile.name.givenName
}
}
| module.exports = profile => {
return {
uid: profile.username || profile.id,
mail: profile.emails && profile.emails[0] && profile.emails[0].value,
cn: profile.displayName,
displayName: profile.displayName,
givenName: profile.name.givenName,
sn: profile.name.familyName
}
}
| Fix typo in windows live mapping | Fix typo in windows live mapping
| JavaScript | apache-2.0 | GluuFederation/gluu-passport,GluuFederation/gluu-passport |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.