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 |
|---|---|---|---|---|---|---|---|---|---|
89383971aabd669623e69a1b653bb9e736157314 | gulpfile.js | gulpfile.js | var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Larave... | var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Larave... | Add cache-busting filename to home page bg image | Add cache-busting filename to home page bg image
| JavaScript | mit | aag/fillmysuitcase,aag/fillmysuitcase,aag/fillmysuitcase |
b545c17083f00aa04134a862b1951009b7fa6e63 | gulpfile.js | gulpfile.js | var del = require('del');
var gulp = require('gulp');
var sass = require('gulp-sass');
var postcss = require('gulp-postcss')
var autoprefixer = require('autoprefixer-core');
var cssmin = require('gulp-minify-css');
var sourcemaps = require('gulp-sourcemaps');
var rename = require('gulp-rename');
var watch = require('gu... | var del = require('del');
var gulp = require('gulp');
var sass = require('gulp-sass');
var postcss = require('gulp-postcss')
var autoprefixer = require('autoprefixer-core');
var cssmin = require('gulp-minify-css');
var sourcemaps = require('gulp-sourcemaps');
var rename = require('gulp-rename');
var watch = require('gu... | Update gulp watch to not croak on error | Update gulp watch to not croak on error
| JavaScript | mit | Ticketmaster/tm-nucleus,Ticketmaster/tm-nucleus |
a87ebe65e1e8d81470b7990d2bf97968c7910a89 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var plumber = require('gulp-plumber');
var BROWSERS = [
"> 5%",
"ie > 0",
"Firefox > 0",
"Chrome > 0",
"Opera > 0",
"OperaMobile > 0",
"OperaMini > 0",
"Safari > 0",
"iOS > 0",
"Blackberry ... | var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var plumber = require('gulp-plumber');
var BROWSERS = [
"> 5%",
"ie > 0",
"Firefox > 0",
"Chrome > 0",
"Opera > 0",
"OperaMobile > 0",
"OperaMini > 0",
"Safari > 0",
"iOS > 0",
"Blackberry ... | Add comments to gulp sass task | Add comments to gulp sass task
| JavaScript | apache-2.0 | carbon-design-system/carbon-components,carbon-design-system/carbon-components,carbon-design-system/carbon-components |
ebf366edb27e4919a09dbd7b7a74f9ddd1a0b1f4 | routes/index/build.js | routes/index/build.js | module.exports = function(question, callback) {
var apiai = require('apiai');
var app = apiai("76ccb7c7acea4a6884834f6687475222", "8b3e68f16ac6430cb8c40d49c315aa7a");
var request = app.textRequest(question);
request.on('response', function(response) {
var kantSucks = require('./deontologyYo')(respon... | module.exports = function(question, callback) {
var apiai = require('apiai');
var app = apiai("YOUR KEY", "YOUR KEY");
var request = app.textRequest(question);
request.on('response', function(response) {
var kantSucks = require('./deontologyYo')(response);
if(kantSucks == 0)
if(response... | Integrate front end with deontology model.1 | Integrate front end with deontology model.1
| JavaScript | mpl-2.0 | Moralit-ai/Moralit-beta,Moralit-ai/Moralit-beta |
f516b424489bbf0a7bb1a1026116228855c90e13 | lib/blame.js | lib/blame.js | var NodeGit = require("../");
var normalizeOptions = NodeGit.Utils.normalizeOptions;
var Blame = NodeGit.Blame;
var _file = Blame.file;
/**
* Retrieve the blame of a file
*
* @async
* @param {Repository} repo that contains the file
* @param {String} path to the file to get the blame of
* @param {BlameOptions} [... | var NodeGit = require("../");
var normalizeOptions = NodeGit.Utils.normalizeOptions;
var Blame = NodeGit.Blame;
var _file = Blame.file;
/**
* Retrieve the blame of a file
*
* @async
* @param {Repository} repo that contains the file
* @param {String} path to the file to get the blame of
* @param {BlameOptions} [... | Add missing return type to Blame.file | Add missing return type to Blame.file | JavaScript | mit | jmurzy/nodegit,jmurzy/nodegit,jmurzy/nodegit,jmurzy/nodegit,nodegit/nodegit,nodegit/nodegit,nodegit/nodegit,jmurzy/nodegit,nodegit/nodegit,nodegit/nodegit |
fdd0cee38eb9d058f12d385bf6de8a26283c1719 | gulpfile.js | gulpfile.js | var gulp = require('gulp'),
connect = require('gulp-connect'),
proxy = require('http-proxy-middleware');
gulp.task('connect', function () {
connect.server({
port: 4200,
host: "0.0.0.0",
livereload: true,
middleware: function (connect, opt) {
return [ proxy('http://www.radio-browser.info/web... | var gulp = require('gulp'),
connect = require('gulp-connect'),
proxy = require('http-proxy-middleware');
gulp.task('connect', function () {
connect.server({
port: 4200,
host: "0.0.0.0",
livereload: true,
middleware: function (connect, opt) {
return [ proxy('http://www.radio-browser.info/web... | Add "production" target for gulp for production use | Add "production" target for gulp for production use
| JavaScript | agpl-3.0 | segler-alex/radiobrowser,segler-alex/radiobrowser,segler-alex/radiobrowser,segler-alex/radiobrowser |
21487f407414d0d689f2564fb7dc8838fc0df8c3 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var tsc = require('gulp-tsc');
var _ = require('lodash');
var shell = require('gulp-shell');
var options = {
module : 'amd',
target : 'ES5',
noImplicitAny : true
};
gulp.task('compile-test', function() {
return gulp.src(['./test/**/*.ts'])
.pipe(ts... | var gulp = require('gulp');
var tsc = require('gulp-tsc');
var _ = require('lodash');
var shell = require('gulp-shell');
var options = {
module : 'amd',
target : 'ES5',
noImplicitAny : true
};
gulp.task('compile-test', function() {
return gulp.src(['./test/**/*.ts'])
.pipe(ts... | Remove gulp generation of declaration files | Remove gulp generation of declaration files
| JavaScript | mit | parallax/ddt,parallax/ddt |
c5f14f2cbb577a8b0fbb7bb727cbf78a49233b2a | gulpfile.js | gulpfile.js | var gulp = require('gulp')
var shell = require('./')
var paths = {
js: ['*.js', 'test/*.js']
}
gulp.task('test', shell.task('mocha -R spec -r should'))
gulp.task('coverage', ['test'], shell.task('istanbul cover _mocha -- -R spec'))
gulp.task('coveralls', ['coverage'], shell.task('cat coverage/lcov.info | coveral... | var gulp = require('gulp')
var shell = require('./')
var paths = {
js: ['*.js', 'test/*.js']
}
gulp.task('test', shell.task('mocha -R spec -r should'))
gulp.task('coverage', ['test'], shell.task('istanbul cover _mocha -- -R spec'))
gulp.task('coveralls', ['coverage'], shell.task('cat coverage/lcov.info | coveral... | Remove dirty hack for keeping watch running on errors | Remove dirty hack for keeping watch running on errors
| JavaScript | mit | sun-zheng-an/gulp-shell,sun-zheng-an/gulp-shell |
47058708f45d5f22df203d6b8be8909192636e40 | lib/index.js | lib/index.js | "use strict";
var path = require("path"),
argv = require('minimist')(process.argv.slice(2));
function readDynamicConfig(basePath, fileName) {
var env = process.env.env || argv.env || argv.ENV || readDynamicConfig.options.defaultEnv,
filePath = path.join(basePath, env, fileName),
config;
i... | "use strict";
var use = require("alamid-plugin/use.js");
var path = require("path"),
argv = require("minimist")(process.argv.slice(2));
function dynamicConfig(basePath, fileName) {
var env = dynamicConfig.getEnv(),
filePath = dynamicConfig.getFilePath(basePath, env, fileName),
config;
i... | Refactor dynamic config using smaller function that can be intercepted by alamid-plugin | Refactor dynamic config using smaller function that can be intercepted by alamid-plugin
| JavaScript | mit | peerigon/dynamic-config,benurb/dynamic-config |
88e85e283c4ae773ba279e0f6010dc396e9ee352 | lib/index.js | lib/index.js | var thunkify = require('thunkify');
var Client = require('easymongo');
var methods = [
'find',
'findOne',
'findById',
'save',
'update',
'remove',
'removeById',
'count'
];
module.exports = function(server, options) {
var proto = Client.Collection.prototype;
methods.forEach(function(method) {
p... | var thunkify = require('thunkify');
var Client = require('easymongo');
var methods = [
'find',
'findOne',
'findById',
'save',
'update',
'remove',
'removeById',
'count'
];
module.exports = function(server, options) {
var proto = Client.Collection.prototype;
methods.forEach(function(method) {
p... | Fix code for updated thunkify dep | Fix code for updated thunkify dep
| JavaScript | mit | meritt/co-easymongo |
638c2ae6de8d68086041f1a6b337f4d51a7b720c | gulpfile.js | gulpfile.js | const { src, dest, watch, series } = require("gulp");
const sass = require("gulp-sass");
const autoPrefixer = require("gulp-autoprefixer");
const htmlmin = require("gulp-htmlmin");
const prettify = require("gulp-jsbeautifier");
const prettier = require("gulp-prettier");
/// Transpile Sass files to CSS
function scss() ... | const { src, dest, watch, series } = require("gulp");
const sass = require("gulp-sass");
const autoPrefixer = require("gulp-autoprefixer");
const htmlmin = require("gulp-htmlmin");
const prettify = require("gulp-jsbeautifier");
const prettier = require("gulp-prettier");
/// Transpile Sass files to CSS
function scss() ... | Add a watch gulp function | Add a watch gulp function
| JavaScript | mit | hisaac/hisaac.net,hisaac/hisaac.net |
0ab2ce9cf6f24bde13dd2d4c5ec7acf4f83b223b | lib/index.js | lib/index.js | var abbrev = require('abbrev');
var mout = require('mout');
var commands = require('./commands');
var PackageRepository = require('./core/PackageRepository');
var abbreviations = abbrev(expandNames(commands));
abbreviations.i = 'install';
abbreviations.rm = 'uninstall';
function expandNames(obj, prefix, stack) {
... | var abbrev = require('abbrev');
var mout = require('mout');
var commands = require('./commands');
var PackageRepository = require('./core/PackageRepository');
var abbreviations = abbrev(expandNames(commands));
abbreviations.i = 'install';
abbreviations.rm = 'uninstall';
abbreviations.ls = 'list';
function expandNames... | Add ls as an alias to the list command. | Add ls as an alias to the list command.
| JavaScript | mit | wenyanw/bower,adriaanthomas/bower,dreamauya/bower,haolee1990/bower,DrRataplan/bower,rajzshkr/bower,cgvarela/bower,krahman/bower,gorcz/bower,jisaacks/bower,pwang2/bower,jodytate/bower,pjump/bower,angeliaz/bower,akaash-nigam/bower,kevinjdinicola/hg-bower,Jinkwon/naver-bower-cli,Blackbaud-EricSlater/bower,jvkops/bower,ami... |
ee68b86185bf466c897bb02488f0ee180a59b2de | gulpfile.js | gulpfile.js | const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const changed = require('gulp-changed');
const plumber = require('gulp-plumber');
const sourcemaps = require('gulp-sourcemaps');
const rimraf = require('rimraf');
const package = require('./package.json');
const paths = {... | const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const changed = require('gulp-changed');
const plumber = require('gulp-plumber');
const sourcemaps = require('gulp-sourcemaps');
const rimraf = require('rimraf');
const package = require('./package.json');
const paths = {... | Clean expo-cli build folder in `gulp clean` | Clean expo-cli build folder in `gulp clean`
fbshipit-source-id: dc6ab70
| JavaScript | mit | exponentjs/exp |
810da3e808ee963a04e78f7d4cc5639c2e22146f | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var babel = require('gulp-babel');
var coffee = require('gulp-coffee');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('babel', function() {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel({
stage: 1,
blacklist: [
'es6.constants',
... | var gulp = require('gulp');
var babel = require('gulp-babel');
var coffee = require('gulp-coffee');
var sourcemaps = require('gulp-sourcemaps');
var paths = {
dest: 'build',
sourceMaps: 'sourcemaps',
};
gulp.task('babel', function() {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel({... | Write source maps out to a separate directory | [Build] Write source maps out to a separate directory
Rather than inlining them, write them to build/sourcemaps
| JavaScript | mit | lwansbrough/rem,rnplay/rem |
fe80e13c845bb49bdb3f826004bd4a63210abbf1 | client/components/App.js | client/components/App.js | import React, { Component } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { hot } from 'react-hot-loader';
import SignUpPage from './SignUp/SignUpPage';
import LoginPage from './Login/LoginPage';
import IndexPage from './Index';
import Books from './Books';
import User from './User';
im... | import React, { Component } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { hot } from 'react-hot-loader';
import PrivateRoute from './PrivateRoute';
import GuestRoute from './GuestRoute';
import AdminRoute from './AdminRoute';
import SignUpPage from './SignUp/SignUpPage';
import LoginP... | Add protected routes and 404 route | Add protected routes and 404 route
| JavaScript | mit | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books |
6e7860be4eac855279f7e5560ab611c0ba5eb391 | packages/@sanity/core/src/commands/dataset/datasetVisibilityCommand.js | packages/@sanity/core/src/commands/dataset/datasetVisibilityCommand.js | export default {
name: 'visibility',
group: 'dataset',
signature: 'get/set [dataset] [mode]',
description: 'Set visibility of a dataset',
// eslint-disable-next-line complexity
action: async (args, context) => {
const {apiClient, output} = context
const [action, ds, aclMode] = args.argsWithoutOption... | export default {
name: 'visibility',
group: 'dataset',
signature: 'get/set [dataset] [mode]',
description: 'Set visibility of a dataset',
// eslint-disable-next-line complexity
action: async (args, context) => {
const {apiClient, output} = context
const [action, ds, aclMode] = args.argsWithoutOption... | Check if @sanity/cli has dataset edit capabilities before using it | [core] Check if @sanity/cli has dataset edit capabilities before using it
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
089ae4eff3bbddd4e2cde2c712396cbdf42557dd | client/webpack.common.js | client/webpack.common.js | const webpack = require('webpack')
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'source-map',
output: {
path: path.resolve(__dirname, './dist'),
},
module: {
rules: [
... | const webpack = require('webpack')
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'source-map',
output: {
path: path.resolve(__dirname, './dist'),
},
module: {
rules: [
... | Add NamedModulesPlugin to webpack config | Add NamedModulesPlugin to webpack config
| JavaScript | mit | mbchoa/presence,mbchoa/presence |
ce46fc88de684d7e79c40f016183062d4fc00a5f | packages/pack/webpack/optimization.js | packages/pack/webpack/optimization.js | const os = require('os');
const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
/**
* parallel doesn't work yet for WSL (GNU/Linux on Windows)
* cf https://github.com/webpack-contrib/terser-webpack-plugin/issues/21
* https://github.com/webpack-con... | const os = require('os');
const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
/**
* parallel doesn't work yet for WSL (GNU/Linux on Windows)
* cf https://github.com/webpack-contrib/terser-webpack-plugin/issues/21
* https://github.com/webpack-con... | Add default async filter in split chunks | Add default async filter in split chunks
Using all chunks was causing conflict order issues in the css extraction
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
6f9e6abb9f5be5741757f3cf375e38097ebfd512 | src/services/ldap-config/hooks/index.js | src/services/ldap-config/hooks/index.js | const { authenticate } = require('@feathersjs/authentication');
const { iff, keepQuery, isProvider, disallow } = require('feathers-hooks-common');
const { populateCurrentSchool } = require('../../../hooks');
const fillDefaultValues = require('./fillDefaultValues');
const restrictToSchoolSystems = require('../../ldap/h... | const { authenticate } = require('@feathersjs/authentication');
const { iff, isProvider, disallow } = require('feathers-hooks-common');
const { populateCurrentSchool } = require('../../../hooks');
const fillDefaultValues = require('./fillDefaultValues');
const restrictToSchoolSystems = require('../../ldap/hooks/restri... | Remove hook that is obsolete with openapi validation | Remove hook that is obsolete with openapi validation
| JavaScript | agpl-3.0 | schul-cloud/schulcloud-server,schul-cloud/schulcloud-server,schul-cloud/schulcloud-server |
af19188ced4266e4ce0a055afc9ff14131caf667 | server/tests/unit/models/user.Test.js | server/tests/unit/models/user.Test.js | var User = require('../../../api/models/User.js');
var Sails = require('sails').Sails;
var sinon = require('sinon');
var expect = require('chai').expect;
describe('Users', function() {
before(function beforeRunningAnyTests(done) {
// Load the app without lifting sails
new Sails().load({
log: {
... | var User = require('../../api/models/User');
var Sails = require('sails').Sails;
var sinon = require('sinon');
var expect = require('chai').expect;
describe('Users', function() {
before(function beforeRunningAnyTests(done) {
// Load the app without lifting sails
new Sails().load({
log: {
leve... | Add additional test case ideas to build out later | Add additional test case ideas to build out later
Also, preparing to move user.Test.js up a level to flatten structure
| JavaScript | mit | johan--/how-to-sane,IanVS/how-to-sane,mgenev/how-to-sane,johan--/how-to-sane,YunnuY/xrp-old,YunnuY/xrp-old,IanVS/how-to-sane,mgenev/how-to-sane |
70c2c31ee50c4b9c20990ac201a9fb013199d41f | src/Initialize.js | src/Initialize.js | var stylesheet,
Fonts,
Styles,
Picker;
$(function(){
WFP.Stylesheet = stylesheet = new Stylesheet;
WFP.Fonts = Fonts;
WFP.Styles = Styles = new StyleList;
WFP.Picker = Picker = new PickerView;
document.body.appendChild(Picker.el);
Fonts.load('Open Sans'); // The font used by ... | var stylesheet,
Fonts,
Styles,
Picker;
$(function(){
WFP.Stylesheet = stylesheet = new Stylesheet;
WFP.Fonts = Fonts;
WFP.Styles = Styles = new StyleList;
WFP.Picker = Picker = new PickerView;
Fonts.load('Open Sans'); // The font used by the picker.
document.body.appendChild(... | Append font stylesheet before appending element | Append font stylesheet before appending element
| JavaScript | mit | danielgavrilov/WebFontPicker |
7f9687c9922e50d41b3dcf36695efbf46658a77f | src/VisionTool.js | src/VisionTool.js | import React from 'react'
import SanityVision from './SanityVision'
import {createRoute} from 'part:@sanity/base/router'
export default {
router: createRoute('/*'),
name: 'Vision',
icon: function VisionIcon() {
return <div />
},
component: SanityVision
}
| import React from 'react'
import SanityVision from './SanityVision'
import {route} from 'part:@sanity/base/router'
export default {
router: route('/*'),
name: 'Vision',
icon: function VisionIcon() {
return <div />
},
component: SanityVision
}
| Upgrade to new router syntax | Upgrade to new router syntax
| JavaScript | mit | rexxars/sanity-vision,rexxars/sanity-vision |
9d84e08a34f848b52ef6635f8ecb102645263aa0 | foursquare.js | foursquare.js | require('isomorphic-fetch')
const qs = require('querystring')
let [client_id, client_secret] = process.env.FOURSQUARE_PARAMS.split(';')
let params = {
client_id,
client_secret,
v: '20161230',
ll: '41.967985,-87.688307',
}
let url = 'https://api.foursquare.com/v2/venues/search?' + qs.stringify(params)
// consol... | require('isomorphic-fetch')
const qs = require('querystring')
let [client_id, client_secret] = process.env.FOURSQUARE_PARAMS.split(';')
let params = {
client_id,
client_secret,
v: '20161230',
sortByDistance: 1,
query: 'movie theater',
ll: '41.967985,-87.688307',
}
let url = 'https://api.foursquare.com/v2/v... | Modify the query to search for movie theaters only | Modify the query to search for movie theaters only
| JavaScript | apache-2.0 | feihong/node-examples,feihong/node-examples |
d0a8807e6e5fbe51234099c79d0448a48369e852 | gulpfile.js | gulpfile.js | var mandragora = require("mandragora-bucket/index.js"),
gulp = require("gulp"),
less = require("gulp-less");
mandragora(gulp, {
paths: {
bower: [
"bower_components/purescript-*/src/**/*.purs",
"bower_components/purescript-*/purescript-*/src/**/*.purs"
],
tes... | var mandragora = require("mandragora-bucket/index.js"),
gulp = require("gulp"),
less = require("gulp-less");
mandragora(gulp, {
paths: {
bower: [
"bower_components/purescript-*/src/**/*.purs",
"bower_components/purescript-*/purescript-*/src/**/*.purs"
],
tes... | Remove duplicate key from mandragora config | Remove duplicate key from mandragora config
Looks like this was just an accident. | JavaScript | apache-2.0 | shujuwen2013/slamdata,mossprescott/slamdata,jonsterling/slamdata,mossprescott/slamdata,wemrysi/slamdata,wemrysi/slamdata,sellout/slamdata,beckyconning/slamdata,zeeiyerWork/slamdata,cryogenian/slamdata,jonsterling/slamdata,natefaubion/slamdata,cryogenian/slamdata,drostron/slamdata,natefaubion/slamdata,beckyconning/slamd... |
0c4be9373f7a6edb32fc245d00a3f65b13a7bf64 | examples/DynamicCounters.js | examples/DynamicCounters.js |
import React from "react";
import {connectLean} from "../src/lean";
import {range} from "lodash/fp";
import Counter from "./Counter";
var DynamicCounters = ({counterCount, scope, addCounter, removeCounter}) => (
<div>
<button onClick={addCounter} >add counter</button>
<button onClick={removeCount... |
import React from "react";
import {connectLean} from "../src/lean";
import {range} from "lodash/fp";
import Counter from "./Counter";
var DynamicCounters = ({counterCount, scope, addCounter, removeCounter}) => (
<div>
<button onClick={addCounter} >add counter</button>
<button onClick={removeCount... | Remove counter data when it's removed | Remove counter data when it's removed
| JavaScript | mit | epeli/lean-redux |
3e9126632659dccfd06055d24b13110969b047cd | Arrays/getShortMessages.js | Arrays/getShortMessages.js | function getShortMessages(messages) {
// SOLUTION GOES HERE
}
module.exports = getShortMessages
| function getShortMessages(messages) {
return messages.filter(function(obj){
return obj['message'].length < 50;
}).map(function(v){
return v['message'];
});
}
module.exports = getShortMessages
| Add get short messages solution | Add get short messages solution
| JavaScript | mit | BrianLusina/JS-Snippets |
1ebd62981a3bb7fc664afe788609659cb5759a72 | js/build.js | js/build.js | ({
appDir: "../",
baseUrl: "js/",
include: "main",
wrap: true,
dir: "../../winamp2-js-prod",
optimizeCss: "standard",
removeCombined: true,
modules: [
{ name: 'main' },
{
name: 'almond',
include: 'embed',
}
],
map: {
'*': {
... | ({
appDir: "../",
baseUrl: "js/",
include: "main",
wrap: true,
dir: "../../winamp2-js-prod",
optimizeCss: "standard",
removeCombined: true,
modules: [
{ name: 'main' },
{
name: 'embed-built',
create: true,
include: [
'al... | Rename built embed js file | Rename built embed js file
| JavaScript | mit | YelaSeamless/winamp2-js,captbaritone/winamp2-js,captbaritone/winamp2-js,captbaritone/winamp2-js,YelaSeamless/winamp2-js |
7323526085d5bd107f920f89472d4a6e38699cb0 | src/lib/config.js | src/lib/config.js | var getMongoPodLabels = function() {
return process.env.LL_MONGO_POD_LABELS || false;
};
var getMongoPodLabelCollection = function() {
var podLabels = getMongoPodLabels();
if (!podLabels) {
return false;
}
var labels = process.env.LL_MONGO_POD_LABELS.split(',');
for (var i in labels) {
var keyAndV... | var getMongoPodLabels = function() {
return process.env.MONGO_SIDECAR_POD_LABELS || false;
};
var getMongoPodLabelCollection = function() {
var podLabels = getMongoPodLabels();
if (!podLabels) {
return false;
}
var labels = process.env.MONGO_SIDECAR_POD_LABELS.split(',');
for (var i in labels) {
v... | Set up the variable names | Set up the variable names
| JavaScript | mit | thesandlord/mongo-k8s-sidecar,cvallance/mongo-k8s-sidecar,kikov79/mongo-k8s-sidecar,leportlabs/mongo-k8s-sidecar |
39ceb95ce8bb31ae8083ffd8f11e825eeb02bb36 | configuration/default.js | configuration/default.js | module.exports = {
port: 8080,
database: {
type: 'SQLITE',
options: {
filename: 'data.sqlite'
}
},
mqtt: {
enable: false,
host: 'mqtt',
port: 1882,
topics: {
transaction: 'strichliste/transaction'
}
}
}; | module.exports = {
port: 8080,
database: {
type: 'SQLITE',
options: {
filename: 'data.sqlite'
}
},
mqtt: {
enable: false,
host: 'mqtt',
port: 1882,
topics: {
transactionValue: 'strichliste/transactionValue'
}
}... | Rename to mqtt topic transaction to transactionValue | Rename to mqtt topic transaction to transactionValue
| JavaScript | mit | hackerspace-bootstrap/strichliste |
4f953de2aa10259ce9b7cc9d5690ddfc0c632d96 | js/scripts.js | js/scripts.js | var pingPong = function(i) {
if (isPingPong) {
if (i % 15 === 0) {
return "pingpong";
} else if (i % 3 === 0) {
return "ping";
} else if (i % 5 === 0) {
return "pong";
}
} else {
return false;
}
}
var isPingPong = function(i) {
if ((i % 5 === 0) || (i % 3 === 0)){
retu... | var pingPong = function(i) {
if (isPingPong(i)) {
return pingPongType(i)
} else {
return false;
}
}
var pingPongType = function(i) {
if ((i % 3 === 0) && (i % 5 != 0)) {
return "ping";
} else if ((i % 5 === 0) && (i % 3 !=0)) {
return "pong";
} else if (i % 15 === 0){
return "... | Add new code for pingPongType | Add new code for pingPongType
| JavaScript | mit | kcmdouglas/pingpong,kcmdouglas/pingpong |
1f7eb63f61c473c97646677ccde3fcc1d42a4495 | json2xml.js | json2xml.js | 'use strict';
var xmlWrite = require('./xmlWrite');
var attributePrefix = '@';
function traverse(obj,parent) {
var result = [];
var array = Array.isArray(obj);
for (var key in obj) {
// skip loop if the property is from prototype
if (!obj.hasOwnProperty(key)) continue;
var propArray = Array.isArray(obj[ke... | 'use strict';
var xmlWrite = require('./xmlWrite');
function traverse(obj,parent,attributePrefix) {
var result = [];
var array = Array.isArray(obj);
for (var key in obj) {
// skip loop if the property is from prototype
if (!obj.hasOwnProperty(key)) continue;
var propArray = Array.isArray(obj[key]);
var o... | Simplify by making root element initially an array | Simplify by making root element initially an array
| JavaScript | bsd-3-clause | MikeRalphson/jgeXml,MikeRalphson/stax,MikeRalphson/jgeXml,MikeRalphson/stax |
d3bf9b923f9f215f7b85d401c5441de727b14409 | src/components/Nav.js | src/components/Nav.js | import React, { Component } from 'react'
import {
Link
} from 'react-router-dom'
import { connect } from 'react-redux'
class Nav extends Component {
handleLogout = () => this.props.logout()
render() {
return (
<ul>
<div className="navbar-left">
<li><Link to="/">Home</Link></li>
... | import React, { Component } from 'react'
import {
Link
} from 'react-router-dom'
import { connect } from 'react-redux'
class Nav extends Component {
handleLogout = () => this.props.logout()
render() {
return (
<ul>
<div className="navbar-left">
<li><Link to="/">Home</Link></li>
... | Hide Households link if not authenticated | Hide Households link if not authenticated
| JavaScript | mit | cernanb/personal-chef-react-app,cernanb/personal-chef-react-app |
cd75e29c01f3905abf95bc244fb002194d85a19f | src/createRenderer.js | src/createRenderer.js | import splat from "./splat";
import formatDeclarations from "./formatDeclarations";
export default function createRenderer(backend) {
let globalSpec = 0;
const specs = Object.create(null);
return function render(rules) {
let currentSpec = -1;
const classNames = splat(rules).map((rule) => ... | import splat from "./splat";
import formatDeclarations from "./formatDeclarations";
export default function createRenderer(backend) {
let globalSpec = 0;
const specs = Object.create(null);
return function render(rules) {
let currentSpec = -1;
const className = splat(rules).map((rule) => {... | Revert "support for preact 7" | Revert "support for preact 7"
This reverts commit 3d72ee045e2d89ba591f02d08c292afcdd393989.
| JavaScript | isc | BenoitZugmeyer/sans-sel,BenoitZugmeyer/sans-sel |
0c7fa994731414c0d28de0604e196a343a00c9c7 | components/about/index.js | components/about/index.js | const About = () => {
return (
<header id="header" className="component">
<img className="header-logo" src="assets/images/online_logo.svg" alt="" />
<h1>Velkommen til Online, linjeforeningen for informatikkstudenter ved <a href="http://ntnu.no/">NTNU</a>.</h1>
<p className="about-description">De... | const About = () => {
return (
<header id="header" className="component">
<img className="header-logo" src="assets/images/online_logo.svg" alt="" />
<h1>Velkommen til Online, linjeforeningen for informatikkstudenter ved <a href="http://ntnu.no/">NTNU</a>.</h1>
<p className="about-description">De... | Add go to main page in about section | Add go to main page in about section
| JavaScript | mit | dotKom/glowing-fortnight,dotKom/glowing-fortnight |
85170248db6ec6fd5e4f960300e1a132675c0c29 | lib/main.js | lib/main.js | Meteor.methods({
pushSong: function(song) {
song.owner = this.userId;
delete song.url;
return MusicCollection.insert(song);
}
});
| Meteor.methods({
pushSong: function(song) {
if(this.userId) {
song.owner = this.userId;
delete song.url;
return MusicCollection.insert(song);
}
}
});
| Check if user has valid id in method pushSong() | Check if user has valid id in method pushSong()
| JavaScript | mit | almightycouch/audiopia,redrabbit/audiopia,redrabbit/audiopia,almightycouch/audiopia |
ae84233dc88ad24762a6842b2e5b192c8a6d55e9 | lib/apis.js | lib/apis.js | module.exports = {};
function define( key, value ) {
module.exports[key] = value;
}
define( 'user', {
'getToken' : '/user/getToken',
'refresh' : '/user/refresh',
'checkOnline' : '/user/checkOnline',
'block' : '/user/block',
'unblock' : '/user/unblock',
'queryBlocked' : '/use... | module.exports = {};
function define( key, value ) {
module.exports[key] = value;
}
define( 'user', {
'getToken' : '/user/getToken',
'refresh' : '/user/refresh',
'checkOnline' : '/user/checkOnline',
'block' : '/user/block',
'unblock' : '/user/unblock',
'queryBlocked' : '/use... | Update the message API definitions. | Update the message API definitions.
| JavaScript | mit | rongcloud/server-sdk-nodejs,coocon/server-sdk-nodejs,crystaldust/server-sdk-nodejs |
d6c8d2a8027e79b35dd11d1eca27581e3b503a7d | lib/helper.js | lib/helper.js | 'use babel'
import {BufferedProcess} from 'atom'
export function installPackages(packageNames, callback) {
return new Promise(function(resolve, reject) {
const stdErr = []
new BufferedProcess({
command: atom.packages.getApmPath(),
args: ['--production', 'install'].concat(packageNames),
opt... | 'use babel'
import {BufferedProcess} from 'atom'
export function installPackages(packageNames, callback, failedCallback) {
const extractionRegex = /Installing (.*?) to .*? (.*)/
return new Promise(function(resolve, reject) {
let errorContents = []
const parameters = ['install'].concat(packageNames)
p... | Make installPackages work with buffers | :art: Make installPackages work with buffers
| JavaScript | mit | steelbrain/package-deps,openlawlibrary/package-deps,steelbrain/package-deps |
01c3d723859fcfdafe20812cd0cd884564f1c9ca | lib/hovers.js | lib/hovers.js | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-hovers/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-hovers/tachyons-hovers.min.css', 'utf8')
var moduleObj = css... | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-hovers/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-hovers/tachyons-hovers.min.css', 'utf8')
var moduleObj = css... | Update with reference to global nav partial | Update with reference to global nav partial
| JavaScript | mit | topherauyeung/portfolio,topherauyeung/portfolio,cwonrails/tachyons,matyikriszta/moonlit-landing-page,tachyons-css/tachyons,fenderdigital/css-utilities,fenderdigital/css-utilities,topherauyeung/portfolio,pietgeursen/pietgeursen.github.io,getfrank/tachyons |
734970ba25f7fb5f418a827c71aa84036bc6fafe | lib/i18n.js | lib/i18n.js | [].forEach.call(document.querySelectorAll("[data-i18n]"), function(el) {
const name = el.getAttribute("data-i18n");
const value = $STR(name);
if (name.startsWith("list_")) {
const values = value.split(";").map(v => v.trim()).filter(v => v != "");
if (values.length == 0) {
el.text... | [].forEach.call(document.querySelectorAll("[data-i18n]"), function(el) {
const name = el.getAttribute("data-i18n");
const value = $STR(name);
if (name.startsWith("list_")) {
const values = value.split(";").map(v => v.trim()).filter(v => v != "");
if (values.length == 0) {
el.text... | Enable translation of multiple HTML attributes | Enable translation of multiple HTML attributes
| JavaScript | agpl-3.0 | kee-org/browser-addon,kee-org/browser-addon,kee-org/browser-addon,kee-org/browser-addon |
817f5fffadb2624d13e1e74b47e83057f9171dac | lib/mdns.js | lib/mdns.js | var mdns = require('mdns'),
serviceType = mdns.makeServiceType({
name: 'radiodan-http', protocol: 'tcp', subtypes: ['radiodanv1']
}),
txtRecord = {radiodan: true, video: false, audio: true, stream: true};
module.exports.advertise = function(radiodan, port) {
var utils = radiodan.utils,
logge... | var mdns = require('mdns'),
serviceType = mdns.makeServiceType({
name: 'radiodan-http', protocol: 'tcp', subtypes: ['radiodanv1']
});
module.exports.advertise = function(radiodan, port) {
var utils = radiodan.utils,
logger = utils.logger(__filename),
txtRecord,
mdnsAd;
radiodan.cr... | Remove superfluous TXT records in MDNS | Remove superfluous TXT records in MDNS
| JavaScript | apache-2.0 | mediascape/discovery-audio-stream-controller,libbymiller/radiodan-client-podcast,radiodan/client-web-example,libbymiller/radiodan-client-podcast,libbymiller/radiodan-client-podcast,radiodan/client-web-example |
3e10f0e640f4fd51007dd5c3dd966fc57f9b4550 | lib/main.js | lib/main.js | 'use babel';
/* global atom */
import { exec } from 'child-process-promise';
import { dirname } from 'path';
export default {
config: {
vhdlCompiler: {
title: 'VHDL Compiler',
description: 'Path to your vhdl compiler',
type: 'string',
default: 'ghdl',
},
},
provideLinter() {
... | 'use babel';
/* global atom */
import { exec } from 'child-process-promise';
import { dirname } from 'path';
export default {
config: {
vhdlCompiler: {
title: 'VHDL Compiler',
description: 'Path to your vhdl compiler',
type: 'string',
default: 'ghdl',
},
},
provideLinter() {
... | Fix code to follow eslint rules | Fix code to follow eslint rules
| JavaScript | mit | graphman65/linter-vhdl |
2c6f779b9b41d4398d38ede99ae5e6f99616470b | lib/routes.js | lib/routes.js |
function createRoute(fn) {
if (fn.length == 1)
return function (message, context, cb) {
try {
cb(null, fn(message));
}
catch (err) {
cb(err, null);
}
}
if (fn.length == 2)
return function (message, ... |
function createRoute(fn) {
if (fn.length == 1)
return function (message, context, cb) {
try {
var newmsg = fn(message);
setImmediate(function () {
cb(null, newmsg);
});
}
catch (err) {
... | Refactor to use setImmediate in route creation | Refactor to use setImmediate in route creation
| JavaScript | mit | ajlopez/MessiJS |
29c59ea2197549d3a136baa79f7046f7268f2d63 | lib/user.js | lib/user.js | var path = require('path');
var fs = require('fs');
var os = require('os');
'use strict';
module.exports = {
User: User
}
/**
* Manages user settings and storage locations.
*/
// global cached config
var config;
// optional custom storage path
var customStoragePath;
function User() {
}
User.config = function... | var path = require('path');
var fs = require('fs');
var os = require('os');
'use strict';
module.exports = {
User: User
}
/**
* Manages user settings and storage locations.
*/
// global cached config
var config;
// optional custom storage path
var customStoragePath;
function User() {
}
User.config = function... | Resolve custom config path so plugins extracting it can work with it | Resolve custom config path so plugins extracting it can work with it
| JavaScript | apache-2.0 | nfarina/homebridge,nfarina/homebridge |
87ca4f415663915853d6cf1ce7f7556229f3eadd | generate_bootstrap_theme.js | generate_bootstrap_theme.js | const sass = require('node-sass');
const fs = require('fs');
const path = require('path');
const { apps_list, get_app_path, get_public_path, get_options_for_scss } = require('./rollup/rollup.utils');
const output_path = process.argv[2];
let scss_content = process.argv[3];
scss_content = scss_content.replace(/\\n/g, '... | const sass = require('node-sass');
const fs = require('fs');
const path = require('path');
const { apps_list, get_app_path, get_public_path, get_options_for_scss } = require('./rollup/rollup.utils');
const output_path = process.argv[2];
let scss_content = process.argv[3];
scss_content = scss_content.replace(/\\n/g, '... | Print error to avoid silent failure | fix: Print error to avoid silent failure
| JavaScript | mit | mhbu50/frappe,saurabh6790/frappe,adityahase/frappe,frappe/frappe,frappe/frappe,almeidapaulopt/frappe,frappe/frappe,yashodhank/frappe,yashodhank/frappe,StrellaGroup/frappe,yashodhank/frappe,adityahase/frappe,almeidapaulopt/frappe,mhbu50/frappe,mhbu50/frappe,StrellaGroup/frappe,almeidapaulopt/frappe,yashodhank/frappe,sau... |
e3d6734bc4c399a5f051fbe2121b36ca51906bd5 | constants/GoogleScopes.js | constants/GoogleScopes.js | var baseUrl = 'https://www.googleapis.com/auth/';
/**
* Google Calendar API url https://developers.google.com/google-apps/calendar/
* Google Calendar User Directory https://developers.google.com/admin-sdk/
*/
var scopeUrls = {
calendar: baseUrl + 'calendar',
userDirectory: baseUrl + 'admin.directory.user'
};... | const baseUrl = 'https://www.googleapis.com/auth/';
/**
* Google Calendar API url https://developers.google.com/google-apps/calendar/
* Google Calendar User Directory https://developers.google.com/admin-sdk/
*/
const scopeUrls = {
calendar: baseUrl + 'calendar',
userDirectory: baseUrl + 'admin.directory.user... | Update constants to es6 syntax | Update constants to es6 syntax
| JavaScript | apache-2.0 | cisco-ie/stenella |
d4973c3e924bd57ce56f8bbd955923c4d685a483 | src/user/index.js | src/user/index.js | var userBuiltInStore = require('./built-in-store');
var isArray = require('lodash/lang/isArray');
var intersection = require('lodash/array/intersection');
var dispatcher = require('../dispatcher');
module.exports = {
login: require('./login'),
profile: require('./profile'),
builtInStore: userBuiltInStore,
hasR... | const userBuiltInStore = require('./built-in-store');
const isArray = require('lodash/lang/isArray');
const intersection = require('lodash/array/intersection');
const dispatcher = require('../dispatcher');
function _setUserNode(name, value){
dispatcher.handleViewAction({data: {[name]: value}, type: 'update'});
}
mo... | Add method to update the user store. | [user] Add method to update the user store.
| JavaScript | mit | KleeGroup/focus-core |
1b18e963cc02a14d6f5f2f7775b49abb7a335b48 | src/roundpiecesbot.js | src/roundpiecesbot.js | 'use strict';
const Bot = require('slackbots');
const util = require('util');
const RoundpiecesBot = function Constructor(settings) {
this.settings = settings;
};
RoundpiecesBot.prototype.run = function () {
RoundpiecesBot.super_.call(this, this.settings);
this.on('start', this._onStart);
this.on('message',... | 'use strict';
const Bot = require('slackbots');
const util = require('util');
const RoundpiecesBot = function Constructor(settings) {
this.settings = settings;
};
RoundpiecesBot.prototype.run = function () {
RoundpiecesBot.super_.call(this, this.settings);
this.on('start', this._onStart);
this.on('message',... | Print help in console when user messages help or ? | Print help in console when user messages help or ?
| JavaScript | mit | jbroni/roundpieces-slackbot |
53d75732189fd3c6e2fa7eb409d6e8a7f8132d12 | src/config.js | src/config.js | import rc from 'rc'
export default rc('david', {
brains: {
cacheTime: 86400000
},
github: {
api: {
version: '3.0.0',
protocol: 'https',
host: 'api.github.com',
timeout: 5000,
caFile: null
},
protocol: 'https',
host: 'github.com',
oauth: {
clientId: null... | import rc from 'rc'
export default rc('david', {
brains: {
cacheTime: 86400000
},
github: {
api: {
version: '3.0.0',
protocol: 'https',
host: 'api.github.com',
pathPrefix: null,
timeout: 5000,
caFile: null
},
protocol: 'https',
host: 'github.com',
oauth... | Make it clear that you can set 'pathPrefix' | Make it clear that you can set 'pathPrefix'
| JavaScript | mit | alanshaw/david-www |
5e19ad66bcdb4985acb3a21ed894708e93a55a3d | stripytext.js | stripytext.js | var stripy = function (element, stripes) {
element.style.position = "relative";
element.style.display = "block";
var text = element.innerHTML;
var newstripe = function (size, name) {
var stripe = document.createElement("span");
stripe.setAttribute("data-stripe", name);
stripe.s... | var stripy = function (element, stripes) {
element.style.position = "relative";
element.style.display = "block";
var text = element.innerHTML;
var newstripe = function (size, name) {
var stripe = document.createElement("span");
stripe.setAttribute("data-stripe", name);
st... | Hide stripes from screen readers | Hide stripes from screen readers
| JavaScript | mit | FilipNest/stripytext,FilipNest/stripytext |
38bba6c0f6c97b6514ab2083446cc2ba615cf988 | config/environment.js | config/environment.js | /* eslint-env node */
var pkg = require('../package.json');
module.exports = function (environment) {
var rootURL = '/';
var ENV = {
modulePrefix: 'purecloud-skype',
environment: environment,
rootURL: rootURL,
locationType: 'hash',
EmberENV: {
FEATURES: {
... | /* eslint-env node */
var pkg = require('../package.json');
module.exports = function (environment) {
var rootURL = environment === 'production' ? '' : '/';
var ENV = {
modulePrefix: 'purecloud-skype',
environment: environment,
rootURL: rootURL,
locationType: 'hash',
Em... | Adjust root url setting for production build | Adjust root url setting for production build
| JavaScript | mit | MyPureCloud/skype-for-business-purecloud-app,MyPureCloud/skype-for-business-purecloud-app |
086772548695624d9138314cbb559c3275a69645 | lib/curry-provider.js | lib/curry-provider.js | 'use babel';
import completions from '../data/completions';
class CurryProvider {
constructor() {
this.scopeSelector = '.source.curry';
this.disableForScopeSelector = '.source.curry .comment';
this.suggestionPriority = 2;
this.filterSuggestions = true;
this.acpTypes = new Map([['types', 'type'... | 'use babel';
import completions from '../data/completions';
class CurryProvider {
constructor() {
this.scopeSelector = '.source.curry';
this.disableForScopeSelector = '.source.curry .comment';
this.suggestionPriority = 2;
this.filterSuggestions = true;
this.acpTypes = new Map([['types', 'type'... | Return null if the prefix is not valid | Return null if the prefix is not valid
| JavaScript | mit | matthesjh/autocomplete-curry |
98f620ab60d59e0a2ada7b8d2dd02f3e9d71a793 | lib/dom-select-box.js | lib/dom-select-box.js | 'use strict';
var Db = require('./base');
Db.Base.set('DOMSelectBox', Db.fixed(function () {
var Parent, Box, proto;
Parent = this.DOMInputBox;
Box = function (document) {
this.document = document;
this.dom = document.createElement('select');
this.options = {};
};
proto = Box.prototype = Object.create(Pare... | 'use strict';
var Db = require('./base');
Db.Base.set('DOMSelectBox', Db.fixed(function () {
var Parent, Box, proto;
Parent = this.DOMInputBox;
Box = function (document) {
this.document = document;
this.dom = document.createElement('select');
this.options = {};
};
proto = Box.prototype = Object.create(Pare... | Fix select of select controls | Fix select of select controls
| JavaScript | mit | medikoo/dbjs-dom |
def1fcd7ea92fec01a5264f8882256f845ef99d2 | src/states/Stats.js | src/states/Stats.js | class Stats extends Phaser.State {
create() {
this.totalScore = this.game.state.states['Main'].totalScore
this.game.stage.backgroundColor = '#DFF4FF';
let statsHeader = "STATS"
let continuePhrase = "Tap to Continue"
this.statsHeaderText = this.game.add.text(650, 50, statsHeader, { font: "250px Revali... | class Stats extends Phaser.State {
create() {
this.totalScore = this.game.state.states['Main'].totalScore
this.game.stage.backgroundColor = '#DFF4FF';
let statsHeader = "STATS"
let continuePhrase = "Tap to Continue"
this.statsHeaderText = this.game.add.text(650, 50, statsHeader, { font: "250px Revali... | Add total score to stats | Add total score to stats
| JavaScript | mit | joshmun/cornman-the-game,joshmun/cornman-the-game |
9d4061efdf7357109b6ad5f7372a8f69d0ca25a4 | spec/frontend/test_setup.js | spec/frontend/test_setup.js | import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import axios from '~/lib/utils/axios_utils';
import { initializeTestTimeout } from './helpers/timeout';
// wait for pending setTimeout()s
afterEach(() => {
jest.runAllTimers();
});
initializeTestTimeout(300);
// fail tests for unmocked requests... | import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import axios from '~/lib/utils/axios_utils';
import { initializeTestTimeout } from './helpers/timeout';
// wait for pending setTimeout()s
afterEach(() => {
jest.runAllTimers();
});
initializeTestTimeout(300);
// fail tests for unmocked requests... | Disable Vue tips when running Jest | Disable Vue tips when running Jest
| JavaScript | mit | mmkassem/gitlabhq,stoplightio/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,stoplightio/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,iiet/iiet-git,stoplightio/gitlabhq |
4073c2c07f3354c5783fe8718e6a0af6475cca88 | blueprints/component-test/files/tests/__testType__/__path__/__test__.js | blueprints/component-test/files/tests/__testType__/__path__/__test__.js | import { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'integration') { %>
import hbs from 'htmlbars-inline-precompile';<% } %>
moduleForComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>', {
<% if (testType === 'integration' ) { %>integration: true<% } else if(testType === 'un... | import { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'integration') { %>
import hbs from 'htmlbars-inline-precompile';<% } %>
moduleForComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>', {
<% if (testType === 'integration' ) { %>integration: true<% } else if(testType === 'un... | Remove Component Test Blueprint `assert.expect`s | Remove Component Test Blueprint `assert.expect`s
All steps in the generated exercise and assertion phases occur
synchronously. Therefore, the `assert.expect(n)` lines:
* add noise to the generated file
* make the resulting tests brittle
* encourages new Ember developers to unnecessarily add them to future
tests
| JavaScript | mit | trabus/ember-cli,seawatts/ember-cli,buschtoens/ember-cli,yaymukund/ember-cli,tsing80/ember-cli,jrjohnson/ember-cli,selvagsz/ember-cli,kriswill/ember-cli,raycohen/ember-cli,trabus/ember-cli,ember-cli/ember-cli,szines/ember-cli,cibernox/ember-cli,xtian/ember-cli,marcioj/ember-cli,josemarluedke/ember-cli,patocallaghan/emb... |
e4c1b16ea3aebd078dea4327402f4f61e3a7e579 | lib/modules/rocketLaunch.js | lib/modules/rocketLaunch.js | const axios = require('axios');
const chalk = require('chalk');
const time = require('./time');
function getLaunchDetails(launchId, callback) {
axios.get('https://launchlibrary.net/1.2/launch/' + launchId).then((response) => {
callback(response.data.launches[0]);
});
}
exports.nextLaunch = function (argv) {
... | const axios = require('axios');
const chalk = require('chalk');
const time = require('./time');
exports.nextLaunch = function (argv) {
axios.get('https://launchlibrary.net/1.2/launch/next/1').then((response) => {
let next = response.data.launches[0];
let timezone = argv.timezone;
let title = chalk.yell... | Remove unnecessary call for details | Remove unnecessary call for details
| JavaScript | mit | Belar/space-cli |
0dc1481667f5a38d0bec27a14d3c55e50960bed7 | src/JavaScriptPlayground.js | src/JavaScriptPlayground.js | "use strict"
var JavaScriptPlaygroundEditor = require("./JavaScriptPlaygroundEditor.js")
, vm = require("vm")
var JavaScriptPlayground = module.exports = function (playgroundElement, jsStubText) {
this._playgroundElem = playgroundElement
var jsEditorElement = document.createElement("div")
jsEditorElement.sty... | "use strict"
var JavaScriptPlaygroundEditor = require("./JavaScriptPlaygroundEditor.js")
, vm = require("vm")
var JavaScriptPlayground = module.exports = function (playgroundElement, jsStubText) {
this._playgroundElem = playgroundElement
var jsEditorElement = document.createElement("div")
jsEditorElement.sty... | Fix for running exported function instead of result of last statement. | Fix for running exported function instead of result of last statement.
| JavaScript | mit | limulus/svg-playground |
88ff05ce9a5b56f9be4ec7943fc65059015c7bcd | packages/ember-inflector/lib/ext/string.js | packages/ember-inflector/lib/ext/string.js | require('ember-inflector/system/string');
if (Ember.EXTEND_PROTOTYPES) {
/**
See {{#crossLink "Ember.String/pluralize"}}{{/crossLink}}
@method pluralize
@for String
*/
String.prototype.pluralize = function() {
return Ember.String.pluralize(this);
};
/**
See {{#crossLink "E... | require('ember-inflector/system/string');
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
/**
See {{#crossLink "Ember.String/pluralize"}}{{/crossLink}}
@method pluralize
@for String
*/
String.prototype.pluralize = function() {
return Ember.String.pluralize(thi... | Stop extending if `String` flag is `false` | Stop extending if `String` flag is `false`
Allow `Ember.EXTEND_PROTOTYPES.String` is `false`.
| JavaScript | mit | fivetanley/ember-inflector,stefanpenner/ember-inflector,greyhwndz/ember-inflector,jerel/ember-inflector,Eric-Guo/ember-inflector,grapho/ember-inflector,jerel/ember-inflector,grapho/ember-inflector,Eric-Guo/ember-inflector,greyhwndz/ember-inflector,fivetanley/ember-inflector,stefanpenner/ember-inflector |
5e1034756c7b7d8a8ca4164565de142b130b79ca | living-with-django/views.js | living-with-django/views.js | define(
[
'underscore', 'backbone',
'models',
'text!templates/main.utpl'
], function(_, B, M, t_main) {
var V = {};
V.Base = Backbone.View.extend({
initialize: function() { this.render(); },
render: function() { this.$el.html(this.template({model: this.model})); }
});
V.Mai... | define(
[
'jquery', 'underscore', 'backbone',
'models',
'text!templates/main.utpl',
'underscore.crunch'
], function($, _, B, M, t_main) {
var V = {};
V.Base = Backbone.View.extend({
initialize: function() {
var v = this;
v.fetch({
success: function() { v.ren... | Add fetch method to base view. | Add fetch method to base view.
| JavaScript | mit | astex/living-with-django,astex/living-with-django,astex/living-with-django |
dd0ea40290c9c04e74e5aec41d8576cd781bdb9c | lib/js/shared/src/ee/aoi.js | lib/js/shared/src/ee/aoi.js | const ee = require('ee')
const _ = require('lodash')
const toGeometry = aoi => {
switch (aoi.type) {
case 'POLYGON':
return polygon(aoi)
case 'EE_TABLE':
return eeTable(aoi).geometry()
}
}
const toFeatureCollection = aoi => {
switch (aoi.type) {
case 'POLYGON':
return e... | const ee = require('ee')
const _ = require('lodash')
const toGeometry = aoi => {
switch (aoi.type) {
case 'POLYGON':
return polygon(aoi)
case 'EE_TABLE':
return eeTable(aoi).geometry()
}
}
const toFeatureCollection = aoi => {
switch (aoi.type) {
case 'POLYGON':
return e... | Handle case where all rows in EE table should be included. | Handle case where all rows in EE table should be included.
| JavaScript | mit | openforis/sepal,openforis/sepal,openforis/sepal,openforis/sepal,openforis/sepal,openforis/sepal |
2ac1752e4b46764d72f36776122789e0aa85467c | data/widget/content-script.js | data/widget/content-script.js | /*global self: false */
/**
* Emits events for left and right clicks.
*/
(function (widget) {
'use strict';
widget.addEventListener('click', function (event) {
if (event.button === 0 && event.shiftKey === false) {
self.port.emit('left-click');
}
if (event.button === 2 ||... | /*global self: false */
/**
* Emits events for left and right clicks.
*/
(function (widget) {
'use strict';
widget.addEventListener('click', function (event) {
if (event.button === 0 && event.shiftKey === false) {
self.port.emit('left-click');
}
if (event.button === 2 ||... | Remove widget addon bar context menu workaround. | Remove widget addon bar context menu workaround.
Remove the widget 'Prevent the addon bar context menu from showing on right click' workaround. This bug was fixed in Addon SDK 1.6.
| JavaScript | mit | Rowno/jslinter-firefox |
5132f59526c5afec3edd86139ba797530c158474 | src/stateSelector.js | src/stateSelector.js | import invariant from 'invariant';
const getConsumerById = (id, consumers) => {
const consumer = consumers.find(x => x._info.id === id);
invariant(consumer, `Unable to find a consumer for ${id}`);
return consumer;
};
export default state => {
const fixPluginAnonymous = ({ name, attributes: { config,... | import invariant from 'invariant';
const getConsumerById = (id, consumers) => {
const consumer = consumers.find(x => x._info.id === id);
invariant(consumer, `Unable to find a consumer for ${id}`);
return consumer;
};
export default state => {
const fixPluginAnonymous = ({ name, attributes: { config,... | Fix not swapping global plugin anonymous consumer id to username | Fix not swapping global plugin anonymous consumer id to username
| JavaScript | mit | mybuilder/kongfig |
08dbdbf46c7b5b9c988bbeeeb2b96576696aa409 | lib/services/alter-items.js | lib/services/alter-items.js |
const errors = require('@feathersjs/errors');
const getItems = require('./get-items');
const replaceItems = require('./replace-items');
module.exports = function (func) {
if (!func) {
func = () => {};
}
if (typeof func !== 'function') {
throw new errors.BadRequest('Function required. (alter)');
}
... |
const errors = require('@feathersjs/errors');
const getItems = require('./get-items');
const replaceItems = require('./replace-items');
module.exports = function (func) {
if (!func) {
func = () => {};
}
if (typeof func !== 'function') {
throw new errors.BadRequest('Function required. (alter)');
}
... | Support a Promise result from alterItems to indicate mutations are complete. | Support a Promise result from alterItems to indicate mutations are complete.
| JavaScript | mit | feathersjs/feathers-hooks-common |
90c3dc607f95d55b4f1cc5573ecb94386e1ff0ed | src/widgets/index.js | src/widgets/index.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
export { Button, ProgressBar } from 'react-native-ui-components';
export { AutocompleteSelector } from './AutocompleteSelector';
export { ExpiryTextInput } from './ExpiryTextInput';
export { FinaliseButton } from './FinaliseButton';
export { GenericCho... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
export { Button, ProgressBar } from 'react-native-ui-components';
export { AutocompleteSelector } from './AutocompleteSelector';
export { ExpiryTextInput } from './ExpiryTextInput';
export { FinaliseButton } from './FinaliseButton';
export { GenericCho... | Add export of Step component | Add export of Step component
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
c624b895e66318b7f2b19b7663bc6d90c3fc72b2 | sandbox-chrome-dev-tools/tool/devtools.js | sandbox-chrome-dev-tools/tool/devtools.js | console.warn('devtools.js');
chrome.devtools.panels.create(
'sample',
'',
'./panel.html',
(panel) => {
let _panelWindow;
// a-0. connect to background
const backgroundPageConnection = chrome.runtime.connect({
name: 'devtools-page'
});
// a-4. pass t... | console.warn('devtools.js');
chrome.devtools.panels.create(
'sample',
'',
'./panel.html',
(panel) => {
let _panelWindow;
// a-0. connect to background
const backgroundPageConnection = chrome.runtime.connect({
name: 'devtools-page'
});
// a-4. pass t... | Update sample of google chrome developer tools | Update sample of google chrome developer tools
| JavaScript | mit | ohtomi/sandbox,ohtomi/sandbox,ohtomi/sandbox,ohtomi/sandbox,ohtomi/sandbox,ohtomi/sandbox,ohtomi/sandbox,ohtomi/sandbox,ohtomi/sandbox |
1018b38e5dba5c26378826bc9bdb9e64bb469eaa | js/mylib/popover.js | js/mylib/popover.js |
// ----------------------------------------------------------------
// Popover Class
class PopoverModel extends CommonModel {
constructor({
name = 'Popover',
selector = null,
help = 'popover',
trigger = 'hover'
} = {})
{
super({
name: name,
echoPermission: false
});
... |
// ----------------------------------------------------------------
// Popover Class
class PopoverModel extends CommonModel {
constructor({
name = 'Popover',
selector = null,
help = 'popover',
trigger = 'hover'
} = {})
{
super({
name: name
});
this.NAME = name;
this.SE... | Fix remove echoPermission option in PopoverModel | Fix remove echoPermission option in PopoverModel
| JavaScript | mit | AyaNakazawa/business_card_bank,AyaNakazawa/business_card_bank,AyaNakazawa/business_card_bank |
7b7e4134d2d87eb96df54355aaf328704a03c406 | docs/examples/CustomAriaLive.js | docs/examples/CustomAriaLive.js | // @flow
import React from 'react';
import Select from 'react-select';
import { colourOptions } from '../data';
export default function CustomAriaLive() {
return (
<form>
<label id="aria-live-select-label" htmlFor="select-aria-live-example">
Select a color
</label>
<Select
ari... | // @flow
import React, { useState } from 'react';
import Select from 'react-select';
import { colourOptions } from '../data';
export default function CustomAriaLive() {
const [ariaFocusMessage, setAriaFocusMessage] = useState('');
const style = {
blockquote: {
fontStyle: 'italic',
fontSize: '.75r... | Update custom aria message example | Update custom aria message example
| JavaScript | mit | JedWatson/react-select,JedWatson/react-select |
661c9c81a94c8a72d57128855e3aad7ae27b613a | lib/tab-bar/index.js | lib/tab-bar/index.js | 'use babel';
import toggleClassName from '../helper/toggle-class-name';
atom.config.observe('atom-material-ui.tabs.tintedTabBar', (value) => {
toggleClassName('amu-tinted-tab-bar', value);
});
atom.config.observe('atom-material-ui.tabs.compactTabs', (value) => {
toggleClassName('amu-compact-tab-bar', value);... | 'use babel';
import toggleClassName from '../helper/toggle-class-name';
atom.config.observe('atom-material-ui.tabs.tintedTabBar', (value) => {
toggleClassName('amu-tinted-tab-bar', value);
if (!value) {
atom.config.set('atom-material-ui.treeView.blendTabs', false);
}
});
atom.config.observe('ato... | Disable blend tree view when tab-bar isn't tinted | Disable blend tree view when tab-bar isn't tinted
| JavaScript | mit | thunsaker/atom-material-ui,atom-material/atom-material-ui,silvestreh/atom-material-ui |
e86b9021eb4376249f2840166114896e44a409c5 | test/spec/sqrtSpec.js | test/spec/sqrtSpec.js | describe("sqrt", function() {
it("should compute the square root of 4 as 2", function() {
expect(My.sqrt(4)).toEqual(2);
});
});
| describe("sqrt", function() {
it("should compute the square root of 4 as 2", function() {
expect(My.sqrt(4)).toEqual(2);
});
it("should throw an exception if given a negative number", function() {
expect(function(){ My.sqrt(-1); }).toThrow(new Error("sqrt can't work on negative number"));
});
});
| Add a test to check for thrown exception. | Add a test to check for thrown exception.
| JavaScript | mit | alexcodreanu86/tic_tac |
d66cf11ddd364ea6b498f75768baed1a269e46e2 | src/components/viewport/RefreshOnFocus.js | src/components/viewport/RefreshOnFocus.js | const REFRESH_PERIOD = 30 * 60 * 1000 // 30 minutes in microseconds
const focusSupported = typeof document.addEventListener !== 'undefined' &&
typeof document.visibilityState !== 'undefined'
let hiddenAt = null
function onHide() {
hiddenAt = new Date()
}
function onShow() {
const drift = n... | const REFRESH_PERIOD = 30 * 60 * 1000 // 30 minutes in microseconds
const focusSupported = typeof document !== 'undefined' &&
typeof document.addEventListener !== 'undefined' &&
typeof document.visibilityState !== 'undefined'
let hiddenAt = null
function onHide() {
hidd... | Disable refresh in iso mode. | Disable refresh in iso mode.
| JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
1b2a74abcee502b3dbff9f3bacdc92581752639c | Kinect2Scratch.js | Kinect2Scratch.js | (function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};
ext.my_first_block = fun... | (function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};
ext.my_first_block = fun... | Create function that works for someone else | Create function that works for someone else
| JavaScript | bsd-3-clause | visor841/SkelScratch,Calvin-CS/SkelScratch |
635b54b466b1b1d58267471e539599b95f6c4d26 | src/worker.js | src/worker.js | import Prism from './prism';
export default function rainbowWorker(e) {
const message = e.data;
const prism = new Prism(message.options);
const result = prism.refract(message.code, message.lang);
setTimeout(() => {
self.postMessage({
id: message.id,
lang: message.lang,... | import Prism from './prism';
export default function rainbowWorker(e) {
const message = e.data;
const prism = new Prism(message.options);
const result = prism.refract(message.code, message.lang);
function _reply(message, result) {
self.postMessage({
id: message.id,
lan... | Fix async Rainbow.color in node | Fix async Rainbow.color in node
For some reason node.js does not like the setTimeout inside the web
worker. I haven't had a chance to dig into it and see why, but for now
this works.
| JavaScript | apache-2.0 | ccampbell/rainbow,ccampbell/rainbow |
b803fdd51d197b72dc817fc836713ce2411453f7 | lib/VideoCapture.js | lib/VideoCapture.js | // This module is responsible for capturing videos
const config = require('config');
const PiCamera = require('pi-camera');
const myCamera = new PiCamera({
mode: 'video',
output: process.argv[2],
width: config.get('camera.videoWidth'),
height: config.get('camera.videoHeight'),
timeout: config.get('camera.vid... | // This module is responsible for capturing videos
const config = require('config');
const PiCamera = require('pi-camera');
const myCamera = new PiCamera({
mode: 'video',
output: process.argv[2],
width: config.get('camera.videoWidth'),
height: config.get('camera.videoHeight'),
timeout: config.get('camera.vid... | Fix issue sending photo command with video | Fix issue sending photo command with video
| JavaScript | mit | stetsmando/pi-motion-detection |
cd1dba997e6f33ae3d3427907ace20f8f5ab400c | example/webpack.config.babel.js | example/webpack.config.babel.js | import NpmInstallPlugin from "npm-install-webpack-plugin";
import path from "path";
export const defaults = {
context: process.cwd(),
externals: [],
module: {
loaders: [
{ test: /\.css$/, loader: "style-loader" },
{ test: /\.css$/, loader: "css-loader", query: { localIdentName: "[name]-[local]-... | import NpmInstallPlugin from "npm-install-webpack-plugin";
import path from "path";
export const defaults = {
context: process.cwd(),
externals: [],
module: {
loaders: [
{ test: /\.css$/, loader: "style" },
{ test: /\.css$/, loader: "css", query: { localIdentName: "[name]-[local]--[hash:base64:... | Update example to use more terse "-loader"-less format | Update example to use more terse "-loader"-less format
| JavaScript | mit | ericclemmons/babel-plugin-auto-install,ericclemmons/npm-install-webpack-plugin,ericclemmons/npm-install-webpack-plugin,ericclemmons/npm-install-loader |
ab49e9bad8173ef8123cee6ba1f4746246b22e97 | examples/composit_statements.js | examples/composit_statements.js | import Local
import Global
"Global.x:" <input data=Global.x dataType="number" style={ display:'block' }/>
"Global.y:" <input data=Global.y dataType="number" style={ display:'block' }/>
let five = 5,
two = 2,
greeting = "hello ",
name = "world"
<table>
<tr>
<th>"Global.x + Global.y"</th>
Global.x + Global.y
... | import Local
import Global
"Global.x:" <input data=Global.x dataType="number" style={ display:'block' }/>
"Global.y:" <input data=Global.y dataType="number" style={ display:'block' }/>
let five = 5,
two = 2,
greeting = "hello ",
name = "world"
<table>
<tr>
<th>"Global.x + Global.y"</th>
Global.x + Global.y
... | Add a text vs number composite statement example | Add a text vs number composite statement example
| JavaScript | mit | marcuswestin/fun |
3e9e9d5021c193678dd78113a2a717899531ec46 | app/js/services.js | app/js/services.js | 'use strict';
/* Services */
var splitcoinServices = angular.module('splitcoin.services', ['ngResource']);
// Demonstrate how to register services
// In this case it is a simple value service.
splitcoinServices.factory('Ticker', ['$resource',
function($resource){
return $resource('http://blockchain.info/... | 'use strict';
/* Services */
var splitcoinServices = angular.module('splitcoin.services', ['ngResource']);
// Demonstrate how to register services
// In this case it is a simple value service.
splitcoinServices.factory('Ticker', ['$resource',
function($resource){
return $resource('/sampledata/ticker.json... | Use local JSON for dev | Use local JSON for dev
| JavaScript | mit | kpeatt/splitcoin,kpeatt/splitcoin,kpeatt/splitcoin |
3e4d3ab7dbe7314f06f6e16fda77cfc3c455e231 | nisheviz.js | nisheviz.js | define([], function() {
'use strict';
function SvgPartitionRenderer(svgDocArg) {
var svgDoc = svgDocArg;
this.render = function(p) {
var draw = svgDoc.nested();
var domain = p.domain();
return draw.text(domain.join(' '));
};
}
return {
SvgPartitionRenderer: SvgPartitionRendere... | define([], function() {
'use strict';
var drawBbox = function(svg, draw) {
var bbox = svg.bbox();
draw.rect(bbox.width, bbox.height)
.fill('none')
.stroke({width:1})
.move(bbox.x, bbox.y);
};
function SvgPartitionRenderer(svgDoc) {
this.render = function(p) {
var draw... | Add a bit for drawing the bbox of some svg. | Add a bit for drawing the bbox of some svg.
| JavaScript | mit | b0ri5/nisheviz,b0ri5/nisheviz,b0ri5/nisheviz |
f55ac5aabd8f704d647f02387f9740e95c41f14e | test/cards.js | test/cards.js | 'use strict';
import test from 'tape';
import {cards} from '../';
test('all', (t) => {
t.equal(cards.all().length, 28);
t.end();
});
test('valid', (t) => {
t.equal(cards.valid().length, 20);
t.end();
});
test('fails', (t) => {
t.equal(cards.fails('check').length, 3, 'no filter');
t.equal(cards.fails('ch... | 'use strict';
import test from 'tape';
import {cards} from '../';
test('all', (t) => {
t.equal(cards.all().length, 28);
t.end();
});
test('valid', (t) => {
t.equal(cards.valid().length, 20);
t.end();
});
test('fails', (t) => {
t.equal(cards.fails('check').length, 3, 'no filter');
t.equal(cards.fails('ch... | Add more tests against filtering | Add more tests against filtering
| JavaScript | mit | bendrucker/stripe-test-data |
fb3bdca2056fc092ad786bf320f7873516bb9e4f | functions/chatwork/src/index.js | functions/chatwork/src/index.js | import template from './builder';
import kms from './kms';
import cw from './post';
import auth from './auth';
exports.handler = (event, context) => {
console.log('Received event:', JSON.stringify(event, null, 2));
// Encrypted Chatwork token
const encCwtoken = process.env.CHATWORK_API_TOKEN || '';
// Chatwo... | import template from './builder';
import kms from './kms';
import cw from './post';
import auth from './auth';
exports.handler = (event, context) => {
console.log('Received event:', JSON.stringify(event, null, 2));
// Encrypted Chatwork token
const encCwtoken = process.env.CHATWORK_API_TOKEN || '';
// Chatwo... | Rename variable for "no-shadow" in eslint | Rename variable for "no-shadow" in eslint
| JavaScript | mit | Nate-River56/hub2chat,Nate-River56/hub2chat,Nate-River56/hub2chat |
63949f178aae6659dee0ffde2611b04c5cc73736 | pageLoad.js | pageLoad.js | // listen for page navigations, detect if they're YT & include our disable
chrome.webNavigation.onBeforeNavigate.addListener((details) => {
if(detectYTURL(details.url) && details.url.indexOf("disable_polymer=true") === -1){
// append the disabling field
if(details.url.indexOf("?") !== -1){
chrome.tabs.u... | // listen for new tabs
chrome.tabs.onCreated.addListener(function (tabId , info) {
if(isYouTubeUrl(info.url) && doesUrlNotContainField(info.url)){
revertYT(tabId);
}
});
// listen for updated tabs
chrome.tabs.onUpdated.addListener(function (tabId , info) {
// check
if(isYouTubeUrl(info.url) && doesUrlNotCo... | Fix bug breaking webpages with yt embeds | :bug: Fix bug breaking webpages with yt embeds
| JavaScript | mit | PatrickOBoyle/yt-revert |
63b948584023c9079880371a7d177698d73c0373 | scheduler.js | scheduler.js | courses = {
0:{
'dept':'CS',
'num':383,
'sections':{
'A':{
'M':[],
'T':[],
'W':[],
'R':[],
'F':[]
}
}
}
}
/*
Start with classes with the least amount of sections, that should ... | courses = {
0:{
'dept':'CS',
'num':383,
'sections':{
'A':{
'M':[],
'T':[],
'W':[],
'R':[],
'F':[]
}
}
}
}
/*
Start with classes with the least amount of sections, that should ... | Add comment for xml-js lib | Add comment for xml-js lib
| JavaScript | mit | joshgrib/joshgrib.github.io,joshgrib/joshgrib.github.io |
e96e3dc766edf4003e8f404fd77748bfb69b8e7b | packages/webpack-loader/example/webpack.config.js | packages/webpack-loader/example/webpack.config.js | const { resolve } = require('path');
module.exports = {
entry: resolve(__dirname, 'src/index.js'),
output: {
filename: 'bundle.js',
path: resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\bmessages\.(json|ya?ml)$/,
type: 'javascript/auto',
loader: require.reso... | const { resolve } = require('path');
module.exports = {
entry: resolve(__dirname, 'src/index.js'),
output: {
filename: 'bundle.js',
path: resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: [/\bmessages\.(json|ya?ml)$/, /\.properties$/],
type: 'javascript/auto',
l... | Update example to match updated README | fix(loader): Update example to match updated README
| JavaScript | mit | SlexAxton/messageformat.js,SlexAxton/messageformat.js |
b1b80c214ce2e36f54cda6aca09bf4e4c4d31ebd | bin/wombat-cli.js | bin/wombat-cli.js | #!/usr/bin/env node
var updater = require('update-notifier'),
pkg = require('../package.json');
updater({pkg: pkg}).notify();
var yargs = require('yargs')
.option('registry', {
description: 'fully-qualified hostname of the registry to use',
default: 'registry.npmjs.org'
})
.help('help')
.version(functio... | #!/usr/bin/env node
var updater = require('update-notifier'),
pkg = require('../package.json');
updater({pkg: pkg}).notify();
var yargs = require('yargs')
.option('registry', {
description: 'fully-qualified hostname of the registry to use',
default: 'registry.npmjs.org'
})
.help('help')
.version(functio... | Load it once, not every time, Jeeves. | Load it once, not every time, Jeeves.
| JavaScript | isc | npm/wombat-cli |
986e1ea58b31ffd799830d7050622e5e35663d22 | lib/collections/posts.js | lib/collections/posts.js | Posts = new Mongo.Collection('posts');
Meteor.methods({
postInsert: function(postAttributes) {
check(Meteor.userId(), String);
check(postAttributes, {
title: String,
url: String
});
var postWithSameLink = Posts.findOne({ url: postAttributes.url });
if (postWithSameLink) {
retu... | Posts = new Mongo.Collection('posts');
Posts.allow({
update: function(userId, post) {
return ownsDocument(userId, post);
},
remove: function(userId, post) {
return ownsDocument(userId, post);
}
});
Posts.deny({
update: function(userId, post, fieldNames) {
return (_.without(fieldNames, 'url', 'ti... | Add allow/deny for post editing/deleting | Add allow/deny for post editing/deleting
| JavaScript | mit | Bennyz/microscope,Bennyz/microscope |
c69f0e83947099b5ffc4de86c512636e93b9118e | server/methods/activities.js | server/methods/activities.js | Meteor.methods({
'getResidentsLatestActivityByType': function (activityTypeId) {
// Get resident latest activity by type
var residentLastActivityByType = Activities.aggregate([
{$match:
{activityTypeId: 'ccuz85YWbfAx4Yg7B'}
},
{$sort:
{activityDate: -1}
},
{$unwin... | Meteor.methods({
'getResidentsLatestActivityByType': function (activityTypeId) {
// Get resident latest activity by type
var residentLatestActivityByType = Activities.aggregate([
{$match:
{activityTypeId: 'ccuz85YWbfAx4Yg7B'}
},
{$sort:
{activityDate: -1}
},
{$unw... | Return only resident latesst activity by type. | Return only resident latesst activity by type.
| JavaScript | agpl-3.0 | GeriLife/wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing,GeriLife/wellbeing |
3ac79f63c258c2d49943b0c4ad8c2a1ef0f3315f | snapshot.js | snapshot.js | var utils = require('./tools/utils')
var shellRunner = require('./tools/shellRunner').setCommand('wkhtmltoimage');
var imagesPath = 'public/snapshots/';
var take = function (url) {
var options = {
output: imagesPath + utils.getMd5(url) + '.jpg',
quality: 100
};
console.log('run', url, opti... | var fs = require('fs');
var utils = require('./tools/utils');
var shellRunner = require('./tools/shellRunner').setCommand('wkhtmltoimage');
var getFilePath = function (url, options) {
var imagesPath = 'public/snapshots/';
var format = '.jpg';
return imagesPath + utils.getMd5(url) + format;
};
var take = f... | Use fs to output file. | Use fs to output file.
| JavaScript | mit | zhangxin840/web-snapshot |
137f1e513694a914ead27a29d6b7584343c49a18 | lib/utils/media-utils.js | lib/utils/media-utils.js | // @flow
import type { MediaType } from '../types/media-types';
import fileType from 'file-type';
type FileInfo = {| name: string, mime: string, mediaType: MediaType |};
function fileInfoFromData(
data: Uint8Array | Buffer,
fileName: string,
): ?FileInfo {
const fileTypeResult = fileType(data);
if (!fileType... | // @flow
import type { MediaType } from '../types/media-types';
import fileType from 'file-type';
type FileInfo = {| name: string, mime: string, mediaType: MediaType |};
function fileInfoFromData(
data: Uint8Array | Buffer,
fileName: string,
): ?FileInfo {
const fileTypeResult = fileType(data);
if (!fileType... | Handle empty filename in fileInfoFromData | [lib] Handle empty filename in fileInfoFromData
| JavaScript | bsd-3-clause | Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal |
ce0f41d2b157470c085b20f60a27ef28a34400ae | src/getIn.js | src/getIn.js | // @flow
import hasKey from "./hasKey";
import type {Composite, Path} from "./types";
/**
* Returns value located at the given path or undefined otherwise.
*/
const getIn = (path: Path, composite: Composite) => {
const [key, ...rest] = path;
return hasKey(key, composite)
? getIn(rest, composite[(key: any)... | // @flow
import {isLastIndex} from "@jumpn/utils-array";
import get from "./get";
import hasKey from "./hasKey";
import type {Composite, Path} from "./types";
const getInRecur = (index, path, composite) => {
if (isLastIndex(path, index)) return get(path[index], composite);
return hasKey(path[index], composite)... | Add logic to handle empty path usecase | fix(src): Add logic to handle empty path usecase
| JavaScript | mit | jumpn/utils-composite,jumpn/utils-composite |
05f391d26de9fcd3fd2f141ac1f69e109fa0add4 | lib/selectors/current-project-id.js | lib/selectors/current-project-id.js | // @flow
import {createSelector} from 'reselect'
import selectCurrentScenario from './current-scenario'
export default createSelector(
(state) => state.project && state.project.currentProject,
selectCurrentScenario,
(_, props = {}) => props.params,
(currentProject = {}, currentScenario = {}, routeParams = {})... | // @flow
import {createSelector} from 'reselect'
import selectCurrentScenario from './current-scenario'
export default createSelector(
(state) => state.project && state.project.currentProject,
selectCurrentScenario,
(_, props = {}) => props.params,
(currentProject = {}, currentScenario = {}, routeParams = {})... | Select project id from route parameters first | fix(project): Select project id from route parameters first
Fixes a problem where project was set in wrong order.
closes #535
| JavaScript | mit | conveyal/scenario-editor,conveyal/scenario-editor,conveyal/analysis-ui,conveyal/analysis-ui,conveyal/analysis-ui |
f8a06501aee12fd0a57ee964579b529664704d51 | scripts/deploymentScript.js | scripts/deploymentScript.js | require('shelljs/global');
const platform = {
path: 'sashimi-platform',
buildPath: 'public'
};
const webapp = {
path: 'sashimi-webapp',
buildPath: 'dist'
};
let statusBuild = -1;
let statusStart = -1;
printTitle('Build web application')
cd(`./${webapp.path}`);
statusBuild = exec('yarn run build').code;
thro... | require('shelljs/global');
const platform = {
path: 'sashimi-platform',
buildPath: 'public'
};
const webapp = {
path: 'sashimi-webapp',
buildPath: 'dist'
};
let statusBuild = -1;
let statusStart = -1;
printTitle('Build web application');
cd(`./${webapp.path}`);
exec('yarn');
statusBuild = exec('yarn run bui... | Fix deployment script to include yarn" | Fix deployment script to include yarn"
| JavaScript | mit | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note |
143da98557544b5a1b5125de7c88db33946e9b41 | .eslintrc.js | .eslintrc.js | const path = require('path')
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
globals: {
ga: true,
gon: true,
},
parse... | const path = require('path')
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
globals: {
annConfig: true,
ga: true,
go... | Add `annConfig` to globals option | Add `annConfig` to globals option
| JavaScript | apache-2.0 | annict/annict,annict/annict,annict/annict,annict/annict |
404743f170808d467769c69ec8e89117b7644d79 | ghost/admin/loader.js | ghost/admin/loader.js | // Loader to create the Ember.js application
/*global require */
window.App = require('ghost/app')['default'].create();
| // Loader to create the Ember.js application
/*global require */
if (!window.disableBoot) {
window.App = require('ghost/app')['default'].create();
}
| Add initial client unit test. | Add initial client unit test.
| JavaScript | mit | TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost |
976297be81149e588c8620bfb7d3db043ce4d453 | src/gh-issues-view.js | src/gh-issues-view.js | /** @babel */
import React from 'react';
import ReactDOM from 'react-dom';
import IssuesList from './components/issues-list';
export default class GhIssuesView {
constructor(serializedState) {
// Create root element
this.element = document.createElement('div');
this.element.classList.add('quick-issues')... | /** @babel */
import React from 'react';
import ReactDOM from 'react-dom';
import IssuesList from './components/issues-list';
export default class GhIssuesView {
constructor(serializedState) {
// Create root element
this.element = document.createElement('div');
this.element.classList.add('quick-issues')... | Use Atom's new Dock feature | Use Atom's new Dock feature
| JavaScript | mit | r24y/github-issues |
18617ec4b7070e8944b425e4cf1eec58438e050b | src/main.js | src/main.js | import './assets/style/main.scss';
const resources = {
manifest: '/application.webmanifest',
fonts: 'https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700%7cRoboto+Slab:300,400',
icon: 'https://gravatar.com/avatar/39263d15a3b0838a938aaaa59dde5c06?s=256',
};
export default (Vue, {
head,
}) => {
hea... | import './assets/style/main.scss';
const resources = {
manifest: '/application.webmanifest',
fonts: 'https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700%7cRoboto+Slab:300,400&display=swap',
icon: 'https://gravatar.com/avatar/39263d15a3b0838a938aaaa59dde5c06?s=256',
};
export default (Vue, {
head,... | Configure web-fonts to swap after being loaded | Configure web-fonts to swap after being loaded
| JavaScript | cc0-1.0 | thasmo/website |
4297e850bfd02d4e72caaa98bb1d9cdbc72308cd | grunt/contrib-sass.js | grunt/contrib-sass.js | // Compile SCSS files to CSS
module.exports = function(grunt) {
grunt.config('sass', {
dev: {
options: {
sourcemap: true,
style: 'nested',
precision: 5
},
files: [{
expand: true,
cwd: 'scss',... | // Compile SCSS files to CSS
module.exports = function(grunt) {
grunt.config('sass', {
dev: {
options: {
sourcemap: true,
trace: false,
style: 'nested',
precision: 5
},
files: [{
expand: true... | Add trace option for Sass. | Add trace option for Sass.
| JavaScript | mit | yellowled/yl-bp,yellowled/yl-bp |
dde8d65e695daa255128615e0794d1d84e4e4f78 | src/index.js | src/index.js | export { default as ThemeProvider } from './ThemeProvider'
export { default as connectTheme } from './connectTheme'
| export * from './styles'
export { default as connectTheme } from './connectTheme'
export { default as ThemeProvider } from './ThemeProvider'
export { default as Button } from './Button'
export { default as Divider } from './Divider'
export { default as Error } from './Error'
export { default as Icon } from './Icon'
e... | Allow importing directly from carbon-ui | Allow importing directly from carbon-ui
| JavaScript | mit | tuckerconnelly/carbon-ui |
d0c03cc94e34a061e302ae081109d5a04cda35a9 | libraries/middleware.js | libraries/middleware.js | import { applyMiddleware, compose } from 'redux';
export default function createMiddleware(clientMiddleware) {
const middleware = applyMiddleware(clientMiddleware);
const composeEnhancers =
typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? window.__REDUX_DEVTOOLS_EXTENSION_COMPO... | import { applyMiddleware, compose } from 'redux';
export default function createMiddleware(clientMiddleware) {
const middleware = applyMiddleware(clientMiddleware);
const composeEnhancers =
typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? window.__REDUX_DEVTOOLS_EXTENSION_COMPO... | Fix after update prettier to 1.7 | Fix after update prettier to 1.7
| JavaScript | mit | Sly777/ran,Sly777/ran |
6ffd98b8fc6a3029d9a485051a6c59d6989bda4d | .eslintrc.js | .eslintrc.js | module.exports = {
'env': {
'browser': true,
'commonjs': true,
'es6': true
},
'extends': 'eslint:recommended',
'installedESLint': true,
'parserOptions': {
'ecmaFeatures': {
'experimentalObjectRestSpread': true,
'jsx': true
},
's... | module.exports = {
'env': {
'browser': true,
'commonjs': true,
'es6': true
},
'extends': ['eslint:recommended', 'plugin:react/recommended'],
'installedESLint': true,
'parserOptions': {
'ecmaFeatures': {
'experimentalObjectRestSpread': true,
'js... | Use defaults from eslint react plugin | Use defaults from eslint react plugin
| JavaScript | mit | Flonka/timeit-web-app,Flonka/timeit-web-app |
06a6fc66096fbc88e64e187323bf5f75adaff063 | src/forc.js | src/forc.js | export default function * forc (bindings, body) {
for (const [key, value] of pairs(bindings)) {
const iter = isFunction(value) ? value(/* bindings... */) : value
for (const item of iter) {
yield body({[key]: item})
}
}
}
function isFunction (value) {
return typeof value === 'function'
}
funct... | export default function * forc (bindings, body) {
for (const [key, value] of pairs(bindings)) {
const iter = isFunction(value) ? value(/* bindings... */) : value
for (const item of iter) {
yield body({[key]: item})
}
}
}
function * pairs (iter) {
let prev
for (const item of iter) {
if (... | Move type checkers to the bottom of the file | Move type checkers to the bottom of the file
| JavaScript | unlicense | Olical/forc |
de2767f8aa7d0aa772b62de4cb20b1341a015ba3 | src/init.js | src/init.js | // Entry point of the application
var parser = require('./parser');
var Renderer = require('./renderer');
var Interpreter = require('./interpreter');
var Predictor = require('./predictor');
var interpreter;
var renderer;
window.onload = function() {
var code = document.getElementById('source').innerHTML;
interpr... | // Entry point of the application
var parser = require('./parser');
var Renderer = require('./renderer');
var Interpreter = require('./interpreter');
var Predictor = require('./predictor');
var interpreter;
var renderer;
var predictor;
window.onload = function() {
var code = document.getElementById('source').inner... | Change to predict 'on demand' | Change to predict 'on demand'
| JavaScript | mit | yoo2001818/AheuiChem,tnRaro/AheuiChem,tnRaro/AheuiChem,yoo2001818/AheuiChem |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.