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 |
|---|---|---|---|---|---|---|---|---|---|
d40bead054b0883ff59ae6ddd311bf93c5da6de3 | public/js/scripts.js | public/js/scripts.js | $(document).ready(function(){
$('.datepicker').pickadate({
onSet: function (ele) {
if(ele.select){
this.close();
}
}
});
$('.timepicker').pickatime({
min: [7,30],
max: [19,0],
interval: 15,
onSet: function (ele) {
if(ele.select){
this.close();
... | $(document).ready(function(){
$('.datepicker').pickadate({
onSet: function (ele) {
if(ele.select){
this.close();
}
},
min: true
});
$('.timepicker').pickatime({
min: [7,30],
max: [19,0],
interval: 15,
onSet: function (ele) {
if(ele.select){
th... | Disable the selection of past dates | Disable the selection of past dates
| JavaScript | mit | warrenca/silid,warrenca/silid,warrenca/silid,warrenca/silid |
e5b67dcf51ee97b6890b06a5d17b890bbf616081 | bin/index.js | bin/index.js | #!/usr/bin/env node
const fs = require('fs')
const path = require('path')
const concise = require('../src/index')
const command = {
name: process.argv[2],
input: process.argv[3],
output: process.argv[4]
}
const build = (input, output) => {
concise.process(fs.readFileSync(input, 'utf8'), { from: input }).then... | #!/usr/bin/env node
const fs = require('fs')
const path = require('path')
const concise = require('../src/index')
const command = {
name: process.argv[2],
input: process.argv[3],
output: process.argv[4]
}
const build = (input, output) => {
concise.process(fs.readFileSync(input, 'utf8'), { from: input }).then... | Use the `css` property of `Result` | Use the `css` property of `Result`
| JavaScript | mit | ConciseCSS/concise.css |
a00a62f147489141cfb7d3fb2d10e08e8f161e01 | demo/js/components/workbench-new.js | demo/js/components/workbench-new.js | angular.module('yds').directive('ydsWorkbenchNew', ['$ocLazyLoad', '$timeout', '$window', 'Data', 'Basket', 'Workbench',
function ($ocLazyLoad, $timeout, $window, Data, Basket, Workbench) {
return {
restrict: 'E',
scope: {
lang: '@',
userId: '@'
... | angular.module('yds').directive('ydsWorkbenchNew', ['$ocLazyLoad', '$timeout', '$window', 'Data', 'Basket', 'Workbench',
function ($ocLazyLoad, $timeout, $window, Data, Basket, Workbench) {
return {
restrict: 'E',
scope: {
lang: '@',
userId: '@'
... | Disable steps that are not needed in Highcharts Editor | Disable steps that are not needed in Highcharts Editor
| JavaScript | apache-2.0 | YourDataStories/components-visualisation,YourDataStories/components-visualisation,YourDataStories/components-visualisation |
7b1ee57b1fc73b6bf75818561a2f5bba39b50344 | src/scripts/main.js | src/scripts/main.js | console.log('main.js');
// Load Css async w LoadCSS & +1 polyfill / https://www.npmjs.com/package/fg-loadcss?notice=MIvGLZ2qXNAEF8AM1kvyFWL8p-1MwaU7UpJd8jcG
var stylesheet = loadCSS( "styles/main.css" );
onloadCSS( stylesheet, function() {
console.log( "LoadCSS > Stylesheet has loaded. Yay !" );
$('.no-fouc')... | console.log('main.js');
// Load Css async w LoadCSS & +1 polyfill / https://www.npmjs.com/package/fg-loadcss?notice=MIvGLZ2qXNAEF8AM1kvyFWL8p-1MwaU7UpJd8jcG
var stylesheet = loadCSS( "styles/main.css" );
onloadCSS( stylesheet, function() {
console.log( "LoadCSS > Stylesheet has loaded. Yay !" );
// + No Fouc ... | Add / Fouc out (on link clic) | Add / Fouc out (on link clic)
| JavaScript | mit | youpiwaza/chaos-boilerplate,youpiwaza/chaos-boilerplate |
3908db4cabd5193aa3798a48277369b86b786f73 | tests/nock.js | tests/nock.js | /**
* Copyright (c) 2015 IBM Cloudant, Inc. All rights reserved.
*
* 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 ap... | /**
* Copyright (c) 2015 IBM Cloudant, Inc. All rights reserved.
*
* 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 ap... | Add the .query() method to the Nock noop | Add the .query() method to the Nock noop
| JavaScript | apache-2.0 | KimStebel/nodejs-cloudant,cloudant/nodejs-cloudant,cloudant/nodejs-cloudant |
ae166fa6cd8ef9c8a73ff1b9e7a1e64503e6061e | src/js/portfolio.js | src/js/portfolio.js | var observer = lozad(".lazy", {
rootMargin: "25%",
threshold: 0
});
observer.observe();
| import IntersectionObserver from 'intersection-observer';
import Lozad from 'lozad';
let observer = Lozad('.lazy', {
rootMargin: '25%',
threshold: 0
});
observer.observe();
| Use ES6 import for Portfolio JS dependencies | Use ES6 import for Portfolio JS dependencies
| JavaScript | mit | stevecochrane/stevecochrane.com,stevecochrane/stevecochrane.com |
a7a88cac0976c49e05fa9ea278320749f6ef1ba0 | rollup.config-dev.js | rollup.config-dev.js | "use strict";
const baseConfig = require("./rollup.config");
const plugin = require("./plugin");
const path = require("path");
module.exports = baseConfig.map((config, index) => {
config.plugins.push(plugin({
open: true,
filename: `stats.${index}.html`,
template: getTemplateType(config)
}));
return ... | "use strict";
const baseConfig = require("./rollup.config");
const plugin = require("./plugin");
const path = require("path");
module.exports = baseConfig.map(config => {
const templateType = getTemplateType(config);
config.plugins.push(
plugin({
open: true,
filename: `stats.${templateType}.html`,... | Use template name for statts file name | Use template name for statts file name
| JavaScript | mit | btd/rollup-plugin-visualizer,btd/rollup-plugin-visualizer |
0d58435c37ad66fa5bea391672cb490c13e455f7 | website/mcapp.projects/src/app/models/project.model.js | website/mcapp.projects/src/app/models/project.model.js | /*@ngInject*/
function ProjectModelService(projectsAPI) {
class Project {
constructor(id, name, owner) {
this.id = id;
this.name = name;
this.owner = owner;
this.samples_count = 0;
this.processes_count = 0;
this.experiments_count = 0;
... | /*@ngInject*/
function ProjectModelService(projectsAPI) {
class Project {
constructor(id, name, owner) {
this.id = id;
this.name = name;
this.owner = owner;
this.samples_count = 0;
this.processes_count = 0;
this.experiments_count = 0;
... | Add default value for owner_details. | Add default value for owner_details.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
0f9b5317e5a9ce68372d62c814dfbd260b748169 | JavaScriptUI-DOM-TeamWork-Kinetic/Scripts/GameEngine.js | JavaScriptUI-DOM-TeamWork-Kinetic/Scripts/GameEngine.js |
var GameEngine = ( function () {
function start(){
var x,
y,
color,
i,
j,
lengthBoard,
lengthField;
var players = [];
players.push( Object.create( GameObjects.Player ).init( 'First', 'white' ) );
players.push( Object.create( GameObjects.Player ).init( 'S... | var GameEngine = ( function () {
function start() {
var x,
y,
color,
i,
j,
lengthBoard,
lengthField;
var players = [];
players.push(Object.create(GameObjects.Player).init('First', 'white'));
players.push(Object... | Add pseudo code for game update according to game state. | Add pseudo code for game update according to game state.
| JavaScript | mit | Vesper-Team/JavaScriptUI-DOM-TeamWork,Vesper-Team/JavaScriptUI-DOM-TeamWork |
5390da989457ecff7dbfa94637c042e2d63f2841 | examples/Node.js/exportTadpoles.js | examples/Node.js/exportTadpoles.js | require('../../index.js');
var scope = require('./Tadpoles');
scope.view.exportFrames({
amount: 200,
directory: __dirname,
onComplete: function() {
console.log('Done exporting.');
},
onProgress: function(event) {
console.log(event.percentage + '% complete, frame took: ' + event.delta);
}
}); | require('../../node.js/');
var paper = require('./Tadpoles');
paper.view.exportFrames({
amount: 400,
directory: __dirname,
onComplete: function() {
console.log('Done exporting.');
},
onProgress: function(event) {
console.log(event.percentage + '% complete, frame took: ' + event.delta);
}
});
| Clean up Node.js tadpoles example. | Clean up Node.js tadpoles example.
| JavaScript | mit | 0/paper.js,0/paper.js |
8c1899b772a1083ce739e237990652b73b41a48d | src/apps/investment-projects/constants.js | src/apps/investment-projects/constants.js | const { concat } = require('lodash')
const currentYear = (new Date()).getFullYear()
const GLOBAL_NAV_ITEM = {
path: '/investment-projects',
label: 'Investment projects',
permissions: [
'investment.read_associated_investmentproject',
'investment.read_all_investmentproject',
],
order: 5,
}
const LOCA... | const { concat } = require('lodash')
const GLOBAL_NAV_ITEM = {
path: '/investment-projects',
label: 'Investment projects',
permissions: [
'investment.read_associated_investmentproject',
'investment.read_all_investmentproject',
],
order: 5,
}
const LOCAL_NAV = [
{
path: 'details',
label: 'P... | Remove preset date filters in investment collection | Remove preset date filters in investment collection
| JavaScript | mit | uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend |
ec0c70f94319a898453252d4c4a7d8020e40081b | take_screenshots.js | take_screenshots.js | var target = UIATarget.localTarget();
function captureLocalizedScreenshot(name) {
var target = UIATarget.localTarget();
var model = target.model();
var rect = target.rect();
if (model.match(/iPhone/)) {
if (rect.size.height > 480) model = "iphone5";
else model = "iphone";
} else {
model = "ipad"... | var target = UIATarget.localTarget();
function captureLocalizedScreenshot(name) {
var target = UIATarget.localTarget();
var model = target.model();
var rect = target.rect();
if (model.match(/iPhone/)) {
if (rect.size.height > 480) model = "iphone5";
else model = "iphone";
} else {
model = "ipad"... | Put the language first in the screen shot generation | Put the language first in the screen shot generation | JavaScript | mit | wordpress-mobile/ui-screen-shooter,myhanhtran1999/UIScreenShot,jonathanpenn/ui-screen-shooter,duk42111/ui-screen-shooter,myhanhtran1999/UIScreenShot,wordpress-mobile/ui-screen-shooter,jonathanpenn/ui-screen-shooter,duk42111/ui-screen-shooter,myhanhtran1999/UIScreenShot |
e771602c05add371bdb1d8d7082f87ae02715cae | app/commands.js | app/commands.js | var _ = require('underscore');
var util = require('util');
exports.setup = function() {
global.commands = {};
};
exports.handle = function(evt, msg) {
if(msg.slice(0, 1) != "!")
return;
var m = msg.match(/^!([A-Za-z0-9]+)(?: (.+))?$/);
if(!m)
return;
if(global.commands[m[1].lower()])
global.commands[m[1].l... | var _ = require('underscore');
var util = require('util');
exports.setup = function() {
global.commands = {};
};
exports.handle = function(evt, msg) {
if(msg.slice(0, 1) != "!")
return;
var m = msg.match(/^!([A-Za-z0-9]+)(?: (.+))?$/);
if(!m)
return;
if(global.commands[m[1].toLowerCase()])
global.commands[... | Fix error. Thought this was Python for a second xD | Fix error. Thought this was Python for a second xD
| JavaScript | mit | ircah/cah-js,ircah/cah-js |
e50a7eec7a8d1cb130da08cdae8c022b82af0e35 | app/controllers/sessionobjective.js | app/controllers/sessionobjective.js | import Ember from 'ember';
export default Ember.ObjectController.extend(Ember.I18n.TranslateableProperties, {
proxiedObjectives: [],
session: null,
course: null,
actions: {
addParent: function(parentProxy){
var newParent = parentProxy.get('content');
var self = this;
var sessionObjective ... | import Ember from 'ember';
export default Ember.ObjectController.extend(Ember.I18n.TranslateableProperties, {
proxiedObjectives: [],
session: null,
course: null,
actions: {
addParent: function(parentProxy){
var newParent = parentProxy.get('content');
var sessionObjective = this.get('model');
... | Fix issue with removing parent and speed up the process | Fix issue with removing parent and speed up the process
| JavaScript | mit | stopfstedt/frontend,stopfstedt/frontend,jrjohnson/frontend,thecoolestguy/frontend,gabycampagna/frontend,thecoolestguy/frontend,jrjohnson/frontend,ilios/frontend,djvoa12/frontend,gboushey/frontend,djvoa12/frontend,gboushey/frontend,ilios/frontend,dartajax/frontend,dartajax/frontend,gabycampagna/frontend |
6be5d442638239436104e48cd8977a7742c86c38 | bin/repl.js | bin/repl.js | #!/usr/bin/env node
var repl = require('repl');
var Chrome = require('../');
Chrome(function (chrome) {
var chromeRepl = repl.start({
'prompt': 'chrome> '
});
chromeRepl.on('exit', function () {
chrome.close();
});
for (var domain in chrome) {
chromeRepl.context[domain] =... | #!/usr/bin/env node
var repl = require('repl');
var protocol = require('../lib/Inspector.json');
var Chrome = require('../');
Chrome(function (chrome) {
var chromeRepl = repl.start({
'prompt': 'chrome> '
});
chromeRepl.on('exit', function () {
chrome.close();
});
for (var domainI... | Add protocol API only to the REPL context | Add protocol API only to the REPL context
| JavaScript | mit | valaxy/chrome-remote-interface,cyrus-and/chrome-remote-interface,washtubs/chrome-remote-interface,cyrus-and/chrome-remote-interface |
c4d7ea7e74d0f81b6b38a6623e47ccfee3a0fab1 | src/locale/index.js | src/locale/index.js | import React from 'react'
import * as ReactIntl from 'react-intl'
import languageResolver from './languageResolver'
import messagesFetcher from './messagesFetcher'
function wrappedReactIntlProvider(language, localizedMessages) {
return function SanityIntlProvider(props) {
return <ReactIntl.IntlProvider locale={... | import React from 'react'
import * as ReactIntl from 'react-intl'
import languageResolver from './languageResolver'
import messagesFetcher from './messagesFetcher'
function wrappedReactIntlProvider(language, localizedMessages) {
return function SanityIntlProvider(props) {
return <ReactIntl.IntlProvider locale={... | Add localeData for requested lanuage | Add localeData for requested lanuage
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
fd5937050f8f97301d909beadfa3e87ef9f4aa13 | src/components/forms/LinksControl.js | src/components/forms/LinksControl.js | import React, { Component, PropTypes } from 'react'
import FormControl from './FormControl'
/* eslint-disable react/prefer-stateless-function */
class LinksControl extends Component {
static propTypes = {
text: PropTypes.oneOfType([
PropTypes.string,
PropTypes.array,
]),
}
static defaultPro... | import React, { Component, PropTypes } from 'react'
import FormControl from './FormControl'
/* eslint-disable react/prefer-stateless-function */
class LinksControl extends Component {
static propTypes = {
text: PropTypes.oneOfType([
PropTypes.string,
PropTypes.array,
]),
}
static defaultPro... | Remove max-length on links control | Remove max-length on links control
The `max-length` attribute was inadvertently added.
[Finishes: #119027729](https://www.pivotaltracker.com/story/show/119027729)
[#119014219](https://www.pivotaltracker.com/story/show/119014219)
| JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
17bcd21bf30b3baabbacb1e45b59c7103b3cdbd3 | webpack/webpack.common.config.js | webpack/webpack.common.config.js | // Common webpack configuration used by webpack.hot.config and webpack.rails.config.
var path = require("path");
module.exports = {
context: __dirname, // the project dir
entry: [ "./assets/javascripts/example" ],
// In case you wanted to load jQuery from the CDN, this is how you would do it:
// externals: {
... | // Common webpack configuration used by webpack.hot.config and webpack.rails.config.
var path = require("path");
module.exports = {
context: __dirname, // the project dir
entry: [ "./assets/javascripts/example" ],
// In case you wanted to load jQuery from the CDN, this is how you would do it:
// externals: {
... | Remove exposing React as that was fixed in the React update | Remove exposing React as that was fixed in the React update
| JavaScript | mit | mscienski/stpauls,szyablitsky/react-webpack-rails-tutorial,RomanovRoman/react-webpack-rails-tutorial,crmaxx/react-webpack-rails-tutorial,roxolan/react-webpack-rails-tutorial,Rvor/react-webpack-rails-tutorial,phosphene/react-on-rails-cherrypick,jeffthemaximum/Teachers-Dont-Pay-Jeff,shakacode/react-webpack-rails-tutorial... |
255c7b47e7686650f5712fb2632d3b4c0e863d64 | src/lib/substituteVariantsAtRules.js | src/lib/substituteVariantsAtRules.js | import _ from 'lodash'
import postcss from 'postcss'
const variantGenerators = {
hover: (container, config) => {
const cloned = container.clone()
cloned.walkRules(rule => {
rule.selector = `.hover${config.options.separator}${rule.selector.slice(1)}:hover`
})
return cloned.nodes
},
focus: ... | import _ from 'lodash'
import postcss from 'postcss'
const variantGenerators = {
hover: (container, config) => {
const cloned = container.clone()
cloned.walkRules(rule => {
rule.selector = `.hover${config.options.separator}${rule.selector.slice(1)}:hover`
})
container.before(cloned.nodes)
}... | Move responsibility for appending nodes into variant generators themselves | Move responsibility for appending nodes into variant generators themselves
| JavaScript | mit | tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindcss/tailwindcss |
fcb2a9ecda9fe5dfb9484531ab697ef4c26ae608 | test/create-test.js | test/create-test.js | var tape = require("tape"),
jsdom = require("jsdom"),
d3 = Object.assign(require("../"), require("d3-selection"));
/*************************************
************ Components *************
*************************************/
// Leveraging create hook with selection as first argument.
var checkboxHTML ... | var tape = require("tape"),
jsdom = require("jsdom"),
d3 = Object.assign(require("../"), require("d3-selection"));
/*************************************
************ Components *************
*************************************/
// Leveraging create hook with selection as first argument.
var card = d3.com... | Change test to use card concept | Change test to use card concept
| JavaScript | bsd-3-clause | curran/d3-component |
3500fe09fd8aba9d9d789f1308d57955aaeacd5d | public/javascripts/page.js | public/javascripts/page.js | $(function() {
var socket = new WebSocket("ws://" + window.location.host + "/");
socket.onmessage = function(message){
console.log('got a message: ')
console.log(message)
}
});
| $(function() {
var socket = new WebSocket("ws://" + window.location.host + "/");
socket.addEventListener('message', function(message){
console.log('got a message: ')
console.log(message)
});
});
| Use addEventListener rather than onmessage | Use addEventListener rather than onmessage
| JavaScript | mit | portlandcodeschool-jsi/barebones-chat,portlandcodeschool-jsi/barebones-chat |
1a8ad6d06e5b465ee331cbc5c4957862edf31950 | test/fixtures/output_server.js | test/fixtures/output_server.js | /*
* grunt-external-daemon
* https://github.com/jlindsey/grunt-external-daemon
*
* Copyright (c) 2013 Joshua Lindsey
* Licensed under the MIT license.
*/
'use strict';
process.stdout.write("STDOUT Message");
process.stderr.write("STDERR Message");
| /*
* grunt-external-daemon
* https://github.com/jlindsey/grunt-external-daemon
*
* Copyright (c) 2013 Joshua Lindsey
* Licensed under the MIT license.
*/
'use strict';
process.stdout.setEncoding('utf-8');
process.stderr.setEncoding('utf-8');
process.stdout.write("STDOUT Message");
process.stderr.write("STDERR ... | Add encoding to output server streams | Add encoding to output server streams
| JavaScript | mit | jlindsey/grunt-external-daemon |
ea850baf397ae98a78222691e1f38571d66d029c | db/config.js | db/config.js | //For Heroku Deployment
var URI = require('urijs');
var config = URI.parse(process.env.DATABASE_URL);
config['ssl'] = true;
module.exports = config;
// module.exports = {
// database: 'sonder',
// user: 'postgres',
// //password: 'postgres',
// port: 32769,
// host: '192.168.99.100'
// };
| //For Heroku Deployment
var URI = require('urijs');
// var config = URI.parse(process.env.DATABASE_URL);
// config['ssl'] = true;
var config = process.env.DATABASE_URL;
module.exports = config;
// module.exports = {
// database: 'sonder',
// user: 'postgres',
// //password: 'postgres',
// port: 32769,
// hos... | Connect to PG via ENV string | Connect to PG via ENV string
| JavaScript | mit | aarontrank/SonderServer,MapReactor/SonderServer,MapReactor/SonderServer,aarontrank/SonderServer |
588a552ce9750a70f0c80ed574c139f563d5ffcc | optimize/index.js | optimize/index.js | var eng = require('./node/engine');
var index = module.exports = {
localMinimize: function(func, options, callback) {
eng.runPython('local', func, options, callback);
},
globalMinimize: function(func, options, callback) {
eng.runPython('global', func, options, callback);
},
nonNegLeastSquares: func... | var eng = require('./node/engine');
var index = module.exports = {
localMinimize: function(func, options, callback) {
eng.runPython('local', func, options, callback);
},
globalMinimize: function(func, options, callback) {
eng.runPython('global', func, options, callback);
},
minimizeEuclideanNorm: f... | Add API for derivative, vector root | Add API for derivative, vector root
| JavaScript | mit | acjones617/scipy-node,acjones617/scipy-node |
94396993d1a0552559cb5b822f797adee09ea2b1 | test/com/spinal/ioc/plugins/theme-test.js | test/com/spinal/ioc/plugins/theme-test.js | /**
* com.spinal.ioc.plugins.ThemePlugin Class Tests
* @author Patricio Ferreira <3dimentionar@gmail.com>
**/
define(['ioc/plugins/theme'], function(ThemePlugin) {
describe('com.spinal.ioc.plugins.ThemePlugin', function() {
before(function() {
});
after(function() {
});
describe('#new()', function() {
... | /**
* com.spinal.ioc.plugins.ThemePlugin Class Tests
* @author Patricio Ferreira <3dimentionar@gmail.com>
**/
define(['ioc/plugins/theme'], function(ThemePlugin) {
describe('com.spinal.ioc.plugins.ThemePlugin', function() {
before(function() {
this.plugin = null;
});
after(function() {
delete this.plugi... | Test cases for ThemePlugin Class added to the unit test file. | Test cases for ThemePlugin Class added to the unit test file.
| JavaScript | mit | nahuelio/boneyard,3dimention/spinal,3dimention/boneyard |
27b391f8bdf57b9c3215ef99a29351ba55db65f5 | public/main.js | public/main.js | $(function() {
var formatted_string = 'hoge';
// $('#text_output').text(formatted_string);
$('#text_input').bind('keyup', function(e) {
var text = $('#text_input').val();
console.log(text);
$.ajax({
url: 'http://localhost:9292/parse/',
method: 'POST',
crossDomain: true,
data: {... | $(function() {
var formatted_string = 'hoge';
// $('#text_output').text(formatted_string);
$('#text_input').bind('keyup', function(e) {
var text = $('#text_input').val();
console.log(text);
parse(text);
});
});
function update(formatted_string) {
$('#text_output').html(formatted_string);
}
funct... | Split out to parse function | Split out to parse function | JavaScript | mit | gouf/test_sinatra_markdown_preview,gouf/test_sinatra_markdown_preview |
512ebaf12ea76d3613c2742d4ea5b61a257e5e04 | test/templateLayout.wefTest.js | test/templateLayout.wefTest.js | /*!
* templateLayout tests
* Copyright (c) 2011 Pablo Escalada
* MIT Licensed
*/
TestCase("templateLayout", {
"test templateLayout registration":function () {
assertNotUndefined(wef.plugins.registered.templateLayout);
assertEquals("templateLayout", wef.plugins.registered["templateLayout"].name);... | /*!
* templateLayout tests
* Copyright (c) 2011 Pablo Escalada
* MIT Licensed
*/
TestCase("templateLayout", {
"test templateLayout registration":function () {
assertNotUndefined(wef.plugins.registered.templateLayout);
assertEquals("templateLayout", wef.plugins.registered.templateLayout.name);
... | Update code to pass tests | Update code to pass tests
| JavaScript | mit | diesire/cssTemplateLayout,diesire/cssTemplateLayout,diesire/cssTemplateLayout |
302c3434a44b3e51d84b70e801a72e9119f106f4 | src/scripts/main.js | src/scripts/main.js | // ES2015 polyfill
import 'babel-polyfill';
// Modernizr
import './modernizr';
// Components
import './components/example';
| // Polyfills
// Only use the polyfills you need e.g
// import 'core-js/object';
// import 'js-polyfills/html';
// Modernizr
import './modernizr';
// Components
import './components/example';
| Use core-js and js-polyfills instead of babel-polyfill | Use core-js and js-polyfills instead of babel-polyfill
| JavaScript | mit | strt/strt-boilerplate,strt/strt-boilerplate |
940f4f4da198335f51c2f8e76fc1c0caffb7736c | __tests__/index.js | __tests__/index.js | import config from "../"
import postcss from "postcss"
import stylelint from "stylelint"
import test from "tape"
test("basic properties of config", t => {
t.ok(isObject(config.rules), "rules is object")
t.end()
})
function isObject(obj) {
return typeof obj === "object" && obj !== null
}
const css = (
`a {
\tto... | import config from "../"
import stylelint from "stylelint"
import test from "tape"
test("basic properties of config", t => {
t.ok(isObject(config.rules), "rules is object")
t.end()
})
function isObject(obj) {
return typeof obj === "object" && obj !== null
}
const css = (
`a {
\ttop: .2em;
}
`)
stylelint.lint... | Use stylelint standalone API in test | Use stylelint standalone API in test
| JavaScript | mit | ntwb/stylelint-config-wordpress,WordPress-Coding-Standards/stylelint-config-wordpress,GaryJones/stylelint-config-wordpress,stylelint/stylelint-config-wordpress |
fd7dda54d0586906ccd07726352ba8566176ef71 | app/scripts/app.js | app/scripts/app.js | (function () {
'use strict';
/**
* ngInject
*/
function StateConfig($urlRouterProvider) {
$urlRouterProvider.otherwise('/');
}
// color ramp for sectors
var sectorColors = {
'School (K-12)': '#A6CEE3',
'Office': '#1F78B4',
'Warehouse': '#B2DF8A',
... | (function () {
'use strict';
/**
* ngInject
*/
function StateConfig($urlRouterProvider) {
$urlRouterProvider.otherwise('/');
}
// color ramp for sectors
var sectorColors = {
'School (K-12)': '#A6CEE3',
'Office': '#1F78B4',
'Medical Office': '#52A634',
... | Add remaining building types to MOSColors | Add remaining building types to MOSColors
| JavaScript | mit | azavea/mos-energy-benchmark,azavea/mos-energy-benchmark,azavea/mos-energy-benchmark |
202941769bd594e31719303882df16ee6ece95c9 | react/index.js | react/index.js | var deps = [
'/stdlib/tag.js',
'/stdlib/observable.js'
];
function increment(x) {
return String(parseInt(x, 10) + 1);
}
function onReady(tag, observable) {
var value = observable.observe("0");
function onChange(evt) {
value.set(evt.target.value);
}
var input = tag.tag({
na... | var deps = [
'/stdlib/tag.js',
'/stdlib/observable.js'
];
function increment(x) {
return String(parseInt(x, 10) + 1);
}
function onReady(tag, observable) {
var value = observable.observe("0");
var input = tag.tag({
name: 'input',
attributes: {type: 'number', value: value},
});... | Add 'change' event handler if tag attribute is an observable. | Add 'change' event handler if tag attribute is an observable.
| JavaScript | bsd-3-clause | garious/poochie-examples,garious/yoink-examples,garious/poochie-examples,garious/yoink-examples |
e37ab30622a50614f226dc746d7e7b68b2afd792 | lib/index.js | lib/index.js | var Keen = require('keen-tracking');
var extend = require('keen-tracking/lib/utils/extend');
// Accessor methods
function readKey(str){
if (!arguments.length) return this.config.readKey;
this.config.readKey = (str ? String(str) : null);
return this;
}
function queryPath(str){
if (!arguments.length) return th... | var Keen = require('keen-tracking');
var extend = require('keen-tracking/lib/utils/extend');
// Accessor methods
function readKey(str){
if (!arguments.length) return this.config.readKey;
this.config.readKey = str ? String(str) : null;
return this;
}
function queryPath(str){
if (!arguments.length) return this... | Clean up method names and internals | Clean up method names and internals
| JavaScript | mit | keen/keen-analysis.js,keen/keen-analysis.js |
ecb93921a112556a307505aec1d249b9fcc27f1d | lib/track.js | lib/track.js | var Util = require('./util.js');
module.exports = Track = function(vid, info) {
this.vid = vid;
this.title = info.title;
this.author = info.author;
this.viewCount = info.viewCount || info.view_count;
this.lengthSeconds = info.lengthSeconds || info.length_seconds;
};
Track.prototype.formatViewCount = functio... | var Util = require('./util.js');
module.exports = Track = function(vid, info) {
this.vid = vid;
this.title = info.title;
this.author = info.author;
this.viewCount = info.viewCount || info.view_count;
this.lengthSeconds = info.lengthSeconds || info.length_seconds;
};
Track.prototype.formatViewCount = functio... | Add getTime function to get remaining time | Add getTime function to get remaining time | JavaScript | mit | meew0/Lethe |
5e41bab44fe3cdd1d160198cbe9ec3aeebf1fdcc | jupyter-js-widgets/src/embed-webpack.js | jupyter-js-widgets/src/embed-webpack.js |
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// This file must be webpacked because it contains .css imports
// Load jquery and jquery-ui
var $ = require('jquery');
require('jquery-ui');
window.$ = window.jQuery = $;
require('jquery-ui');
// Load styling
req... |
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// This file must be webpacked because it contains .css imports
// Load jquery and jquery-ui
var $ = require('jquery');
require('jquery-ui');
window.$ = window.jQuery = $;
require('jquery-ui');
// Load styling
req... | Use addEventListener('load' instead of onload | Use addEventListener('load' instead of onload
| JavaScript | bsd-3-clause | cornhundred/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidg... |
18d33de0c54e64693274bc17afb1a08b9fec5ad8 | app/public/panel/controllers/DashCtrl.js | app/public/panel/controllers/DashCtrl.js | var angular = require('angular');
angular.module('DashCtrl', ['chart.js']).controller('DashController', ['$scope', $scope => {
const colorScheme = ['#2a9fd6'];
let weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
for(let i = 0; i < 6 - (new Date()).getDay(); i++) ... | var angular = require('angular');
angular.module('DashCtrl', ['chart.js']).controller('DashController', ['$scope', $scope => {
const colorScheme = ['#2a9fd6'];
// Calculate and format descending dates back one week
const currentDate = new Date();
const oneDay = 1000 * 60 * 60 * 24;
let dates = Arr... | Fix date and label calculation | Fix date and label calculation
| JavaScript | mit | Foltik/Shimapan,Foltik/Shimapan |
323b195642bab258001da6b0a85ca998e8697d3d | static/js/submit.js | static/js/submit.js | $(document).ready(function()
{
$("#invite-form").on('submit', function()
{
var inviteeEmail = $("#email").val();
console.log(inviteeEmail)
if (!inviteeEmail || !inviteeEmail.length) {
alert('Please enter an email');
return false;
}
$.ajax({... | $(document).ready(function()
{
$("#invite-form").on('submit', function()
{
var inviteeEmail = $("#email").val();
console.log(inviteeEmail)
if (!inviteeEmail || !inviteeEmail.length) {
alert('Please enter an email');
return false;
}
$.ajax({... | Use Materialize toasts to show the status | Use Materialize toasts to show the status
| JavaScript | mit | avinassh/slackipy,avinassh/slackipy,avinassh/slackipy |
63618d2180dfc52c922857eb6aabb2e195b637da | lib/helpers/redirect-to-organization.js | lib/helpers/redirect-to-organization.js | 'use strict';
var url = require('url');
var getHost = require('./get-host');
module.exports = function redirectToOrganization(req, res, organization) {
res.redirect(req.protocol + '://' + organization.nameKey + '.' + getHost(req) + url.parse(req.url).pathname);
};
| 'use strict';
var url = require('url');
var getHost = require('./get-host');
module.exports = function redirectToOrganization(req, res, organization) {
var uri = req.protocol
+ '://' + organization.nameKey
+ '.'
+ getHost(req)
+ url.parse(req.url).pathname;
var queryParams = Object.keys(req.quer... | Fix behaviour for redirect with query params | Fix behaviour for redirect with query params
| JavaScript | apache-2.0 | stormpath/express-stormpath,stormpath/express-stormpath,stormpath/express-stormpath |
1c42a6e807b644a246b62c43f1494a906c130447 | spec/server-pure/spec.render_png.js | spec/server-pure/spec.render_png.js | var renderPng = require('../../app/render_png');
describe('renderPng', function () {
describe('getScreenshotPath', function () {
it('creates the URL for the screenshot service call', function () {
renderPng.screenshotServiceUrl = 'http://screenshotservice';
renderPng.screenshotTargetUrl = 'http://spo... | var renderPng = require('../../app/render_png');
describe('renderPng', function () {
describe('getScreenshotPath', function () {
it('creates the URL for the screenshot service call', function () {
renderPng.screenshotServiceUrl = 'http://screenshotservice';
renderPng.screenshotTargetUrl = 'http://spo... | Fix qs params in screenshot url tests | Fix qs params in screenshot url tests
| JavaScript | mit | keithiopia/spotlight,alphagov/spotlight,alphagov/spotlight,keithiopia/spotlight,alphagov/spotlight,tijmenb/spotlight,keithiopia/spotlight,tijmenb/spotlight,tijmenb/spotlight |
8ffe7ba8783c85de062299f709a4a8d8a68eeef5 | packages/@sanity/base/src/preview/ReferencePreview.js | packages/@sanity/base/src/preview/ReferencePreview.js | import React, {PropTypes} from 'react'
import resolveRefType from './resolveRefType'
import {resolver as previewResolver} from 'part:@sanity/base/preview'
export default class SanityPreview extends React.PureComponent {
static propTypes = {
value: PropTypes.object,
type: PropTypes.object.isRequired
};
s... | import React, {PropTypes} from 'react'
import resolveRefType from './resolveRefType'
import {resolver as previewResolver} from 'part:@sanity/base/preview'
export default class SanityPreview extends React.PureComponent {
static propTypes = {
value: PropTypes.object,
type: PropTypes.object.isRequired
};
s... | Fix wrong resolving of referenced type | [previews] Fix wrong resolving of referenced type
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
abfd3076f555807bd43fc2733573056afda9d089 | settings/index.js | settings/index.js | import _ from 'lodash';
import React from 'react';
import Settings from '@folio/stripes-components/lib/Settings';
import PermissionSets from './permissions/PermissionSets';
import PatronGroupsSettings from './PatronGroupsSettings';
import AddressTypesSettings from './AddressTypesSettings';
const pages = [
{
rou... | import _ from 'lodash';
import React from 'react';
import Settings from '@folio/stripes-components/lib/Settings';
import PermissionSets from './permissions/PermissionSets';
import PatronGroupsSettings from './PatronGroupsSettings';
import AddressTypesSettings from './AddressTypesSettings';
const pages = [
{
rou... | Add commented-out permission guards. Part of UIU-197. | Add commented-out permission guards. Part of UIU-197.
| JavaScript | apache-2.0 | folio-org/ui-users,folio-org/ui-users |
6c3cd606ff1dd948a8a1b51eb5525da4881945d1 | www/Gruntfile.js | www/Gruntfile.js | module.exports = function (grunt) {
var allJSFilesInJSFolder = "js/**/*.js";
var distFolder = '../wikipedia/assets/';
grunt.loadNpmTasks( 'grunt-browserify' );
grunt.loadNpmTasks( 'gruntify-eslint' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-less' );
grunt.initConf... | module.exports = function (grunt) {
var allJSFilesInJSFolder = "js/**/*.js";
var distFolder = '../wikipedia/assets/';
grunt.loadNpmTasks( 'grunt-browserify' );
grunt.loadNpmTasks( 'gruntify-eslint' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-less' );
grunt.initConf... | Add eslint 'fix' flag to config. | Add eslint 'fix' flag to config.
Can be flipped to 'true' to auto-fix linting violations!
| JavaScript | mit | wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/w... |
5eb4b643651673dac89f53b5cc016b47ff852157 | src/generator-bin.js | src/generator-bin.js | #!/usr/bin/env node
const generate = require('./generator')
const program = require('commander')
program
.version('1.0.0')
.option('-w, --words [num]', 'number of words [2]', 2)
.option('-n, --numbers', 'use numbers')
.option('-a, --alliterative', 'use alliterative')
.option('-o --output [output]'... | #!/usr/bin/env node
const generate = require('./generator')
const program = require('commander')
program
.version('1.0.0')
.option('-w, --words [num]', 'number of words [2]', 2)
.option('-n, --numbers', 'use numbers')
.option('-a, --alliterative', 'use alliterative')
.option('-o, --output [output]... | Update README for CLI options. | Update README for CLI options.
| JavaScript | isc | aceakash/project-name-generator |
9e77430c1f309444c1990877d237cdf991d36d72 | src/dform.js | src/dform.js | function dform(formElement) {
var eventEmitter = {
on: function (name, handler) {
this[name] = this[name] || [];
this[name].push(handler);
return this;
},
trigger: function (name, event) {
if (this[name]) {
this[name].map(function (handler) {
handler(event);
... | function dform(formElement) {
var eventEmitter = {
on: function (name, handler) {
this[name] = this[name] || [];
this[name].push(handler);
return this;
},
trigger: function (name, event) {
if (this[name]) {
this[name].map(function (handler) {
handler(event);
... | Disable button should be the first thing to do | Disable button should be the first thing to do
| JavaScript | mit | dnode/dform,dnode/dform |
fc617bc90f25c5e7102c0e76c71d4790599ff23b | data-demo/person_udf.js | data-demo/person_udf.js | function transform(line) {
var values = line.split(',');
var obj = new Object();
obj.name = values[0];
obj.surname = values[1];
obj.timestamp = values[2];
var jsonString = JSON.stringify(obj);
return jsonString;
}
| /*
Copyright 2022 Google LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | Add a license header on code files | Add a license header on code files
Signed-off-by: Laurent Grangeau <919068a1571bc1b5deaaf9ac4d631597f8dd629f@gmail.com>
| JavaScript | apache-2.0 | GoogleCloudPlatform/deploystack-gcs-to-bq-with-least-privileges |
f7d9d0a57f691a4d9104ab00c75e1cca8cb2142f | src/history.js | src/history.js | const timetrack = require('./timetrack');
const calculateDuration = require('./calculateDuration');
module.exports = (pluginContext) => {
return (project, env = {}) => {
return new Promise((resolve, reject) => {
timetrack.loadData();
resolve(timetrack.getHistory().map(entry => {
... | const timetrack = require('./timetrack');
const Sugar = require('sugar-date');
const calculateDuration = require('./calculateDuration');
module.exports = (pluginContext) => {
return (project, env = {}) => {
return new Promise((resolve, reject) => {
timetrack.loadData();
resolve(time... | Use sugarjs for date parsing | Use sugarjs for date parsing
| JavaScript | mit | jnstr/zazu-timetracker |
a39453fdbfcc397839583d1b695e0476962f9879 | src/index.js | src/index.js | 'use strict';
import bunyan from 'bunyan';
import http from 'http';
import { createApp } from './app.js';
const logger = bunyan.createLogger({name: "Graphql-Swapi"});
logger.info('Server initialisation...');
createApp()
.then((app) => {
logger.info('Starting HTTP server');
const server = http.createServer(app);... | 'use strict';
import bunyan from 'bunyan';
import http from 'http';
import { createApp } from './app.js';
import eventsToAnyPromise from 'events-to-any-promise';
const logger = bunyan.createLogger({name: "Graphql-Swapi"});
function startServer(port, app) {
logger.info('Starting HTTP server');
const server = http.c... | Use my new lib events-to-any-promise | Use my new lib events-to-any-promise
| JavaScript | mit | franckLdx/GraphqlSwapi,franckLdx/GraphqlSwapi |
c6bb66a01539a85c6011eb1c6bd92fb4b7253ca4 | src/index.js | src/index.js | 'use strict';
const childProcess = require('child-process-promise');
const express = require('express');
const path = require('path');
const fs = require('fs');
const configPath = path.resolve(process.cwd(), process.argv.slice().pop());
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
const app = expre... | 'use strict';
const childProcess = require('child-process-promise');
const express = require('express');
const path = require('path');
const fs = require('fs');
const configPath = path.resolve(process.cwd(), process.argv.slice().pop());
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
const app = expre... | Use correct GitHub header name when checking requests | Use correct GitHub header name when checking requests
| JavaScript | mit | jwilsson/deployy-mcdeployface |
85b926b56baa0f29b71b5edea3e83479d1252f69 | saleor/static/js/components/categoryPage/ProductItem.js | saleor/static/js/components/categoryPage/ProductItem.js | import React, { Component, PropTypes } from 'react';
import Relay from 'react-relay';
import ProductPrice from './ProductPrice';
class ProductItem extends Component {
static propTypes = {
product: PropTypes.object
};
render() {
const { product } = this.props;
return (
<div className="col-6 c... | import React, { Component, PropTypes } from 'react';
import Relay from 'react-relay';
import ProductPrice from './ProductPrice';
class ProductItem extends Component {
static propTypes = {
product: PropTypes.object
};
render() {
const { product } = this.props;
return (
<div className="col-6 c... | Add missing field to query | Add missing field to query
| JavaScript | bsd-3-clause | jreigel/saleor,UITools/saleor,tfroehlich82/saleor,UITools/saleor,KenMutemi/saleor,UITools/saleor,tfroehlich82/saleor,HyperManTT/ECommerceSaleor,HyperManTT/ECommerceSaleor,jreigel/saleor,mociepka/saleor,KenMutemi/saleor,mociepka/saleor,maferelo/saleor,car3oon/saleor,maferelo/saleor,mociepka/saleor,maferelo/saleor,UITool... |
5927b98e608128152adafed5435fd2ec47a04237 | src/slide.js | src/slide.js | const DEFAULT_IN = 'fadeIn'
const DEFAULT_OUT = 'fadeOut'
class Slide extends BaseElement {
static get observedAttributes () {
return ['active', 'in', 'out']
}
get active () {
return this.hasAttribute('active')
}
set active (value) {
value ? this.setAttribute('active', '')
: this.remo... | const DEFAULT_IN = 'fadeIn'
const DEFAULT_OUT = 'fadeOut'
class Slide extends BaseElement {
static get observedAttributes () {
return ['active', 'in', 'out']
}
get active () {
return this.hasAttribute('active')
}
set active (value) {
value ? this.setAttribute('active', '')
: this.remo... | Simplify inline styles for inheritance | Simplify inline styles for inheritance
| JavaScript | mit | ricardocasares/using-custom-elements,ricardocasares/using-custom-elements |
b47017282e23be837d469378e5d1ac307f8d99c1 | client/app/scripts/directive/projectQuickView.js | client/app/scripts/directive/projectQuickView.js | angular
.module('app')
.directive('projectQuickView', function() {
return {
restrict: 'EA',
replace: false,
templateUrl: 'app/templates/partials/projectQuickView.html',
link: function(scope, element, attrs) {
scope.completed = attrs.completed;
scope.hasDate = function() ... | angular
.module('app')
.directive('projectQuickView', function() {
return {
restrict: 'EA',
replace: false,
templateUrl: 'app/templates/partials/projectQuickView.html',
link: function(scope, element, attrs) {
scope.completed = attrs.completed;
scope.hasDate = function() ... | Make a check if end_date exists on the project in the hasDate function | Make a check if end_date exists on the project in the hasDate function
| JavaScript | mit | brettshollenberger/rootstrikers,brettshollenberger/rootstrikers |
ae93a807f90a0b59101443d28a88cf934e536e4e | src/Calibrator.js | src/Calibrator.js | import {VM} from 'vm2'
import SensorData from './SensorData'
export default class Calibrator {
calibrate (data, cb) {
if ( ! (data instanceof SensorData)) return cb('Invalid SensorData given.')
var meta = data.getMetadata()
meta.getAttributes().forEach(function (attr) {
attr.getProperties().forEach(functio... | import {VM} from 'vm2'
import SensorData from './SensorData'
export default class Calibrator {
calibrate (data, cb) {
if ( ! (data instanceof SensorData)) return cb('Invalid SensorData given.')
var meta = data.getMetadata()
meta.getAttributes().forEach(function (attr) {
attr.getProperties().forEach(functio... | Add Math to calibrator VM and allow use of functions (not only function strings). | Add Math to calibrator VM and allow use of functions (not only function strings).
| JavaScript | mit | kukua/concava |
769ceb537eec6642fd039ea7ad0fa074029759b1 | share/spice/arxiv/arxiv.js | share/spice/arxiv/arxiv.js | (function (env) {
"use strict";
env.ddg_spice_arxiv = function(api_result){
if (!api_result) {
return Spice.failed('arxiv');
}
Spice.add({
id: "arxiv",
name: "Reference",
data: api_result,
meta: {
sourceName: ... | (function (env) {
"use strict";
env.ddg_spice_arxiv = function(api_result){
if (!api_result) {
return Spice.failed('arxiv');
}
Spice.add({
id: "arxiv",
name: "Reference",
data: api_result,
meta: {
sourceName: ... | Add published year to title | Add published year to title
| JavaScript | apache-2.0 | bigcurl/zeroclickinfo-spice,cylgom/zeroclickinfo-spice,iambibhas/zeroclickinfo-spice,whalenrp/zeroclickinfo-spice,iambibhas/zeroclickinfo-spice,dogomedia/zeroclickinfo-spice,dogomedia/zeroclickinfo-spice,kevintab95/zeroclickinfo-spice,levaly/zeroclickinfo-spice,bigcurl/zeroclickinfo-spice,bigcurl/zeroclickinfo-spice,xa... |
2897631e9330289d95ddbab0aa3b13f5d24d1d81 | web/js/calendar-template.js | web/js/calendar-template.js | function cookieValueHandler() {
Cookies.set(this.name, this.value, 365)
window.location.reload()
}
function registerSpecialInputs() {
$$("input").each(function(input) {
if (input.getAttribute("special") == "cookie") {
Event.observe(input, "click", cookieValueHandler)
if (inp... | function cookieValueHandler(event) {
var src = Event.element(event)
Cookies.set(src.name, src.value, 365)
window.location.reload()
}
function registerSpecialInputs() {
$$("input").each(function(input) {
if (input.getAttribute("special") == "cookie") {
Event.observe(input, "click", c... | Fix cookieValueHandler to work with IE | Fix cookieValueHandler to work with IE
git-svn-id: 4b387fe5ada7764508e2ca96c335714e4c1692c6@406 0d517254-b314-0410-acde-c619094fa49f
| JavaScript | bsd-3-clause | NUBIC/psc-mirror,NUBIC/psc-mirror,NUBIC/psc-mirror,NUBIC/psc-mirror |
3ee8995af1835156d7c94a3f6480d48396884f5c | dashboard/src/store/store.js | dashboard/src/store/store.js | import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
state: {},
mutations: {},
actions: {},
modules: {}
});
| import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
strict: process.env.NODE_ENV !== "production", //see https://vuex.vuejs.org/guide/strict.html
state: {},
mutations: {},
actions: {},
modules: {}
});
| Enable VueX strict mode in dev | Enable VueX strict mode in dev
| JavaScript | agpl-3.0 | napstr/wolfia,napstr/wolfia,napstr/wolfia |
1bc6d05e92432dbf503483e3f74d8a3fd456b4a6 | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var $ = require('gulp-load-plugins')({ lazy: false });
var source = require('vinyl-source-stream2');
var browserify = require('browserify');
var path = require('path');
var pkg = require('./package.json');
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v... | var gulp = require('gulp');
var $ = require('gulp-load-plugins')({ lazy: false });
var source = require('vinyl-source-stream2');
var browserify = require('browserify');
var path = require('path');
var pkg = require('./package.json');
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v... | Fix bundle arguments for latest browserify | Fix bundle arguments for latest browserify
| JavaScript | mit | ngot/should.js,Lucifier129/should.js,Qix-/should.js,shouldjs/should.js,shouldjs/should.js,hakatashi/wa.js,enicholson/should.js |
4156b07d63af7e23ac8138bc233747727310d407 | gulpfile.js | gulpfile.js | 'use strict';
var gulp = require('gulp');
var shell = require('gulp-shell')
var sass = require('gulp-sass');
var electron = require('electron-connect').server.create();
gulp.task('serve', function () {
// Compile the sass
gulp.start('sass');
// Start browser process
electron.start();
// Restart browser p... | 'use strict';
var gulp = require('gulp');
var shell = require('gulp-shell')
var sass = require('gulp-sass');
var electron = require('electron-connect').server.create();
var package_info = require('./package.json')
gulp.task('serve', function () {
// Compile the sass
gulp.start('sass');
// Start browser proces... | Make builds platform specific and add zipping | Make builds platform specific and add zipping
| JavaScript | apache-2.0 | opsdroid/opsdroid-desktop,opsdroid/opsdroid-desktop |
f7bd0b4865f0dadc77a33c1168c5239916b05614 | gulpfile.js | gulpfile.js | var gulp = require('gulp'),
coffee = require('gulp-coffee'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
del = require('del');
var paths = {
scripts: ['source/**/*.coffee']
};
gulp.task('clean', function (cb)... | var gulp = require('gulp'),
coffee = require('gulp-coffee'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
del = require('del'),
karma = require('karma').server;
var paths = {
scripts: ['source/**/*.cof... | Add tasks test and tdd | Add tasks test and tdd
| JavaScript | mit | mkawalec/latte-art |
b7d67f8a8581df15bf526f0e493b9ab626cab924 | Resources/public/js/select24entity.js | Resources/public/js/select24entity.js | $(document).ready(function () {
$.fn.select24entity = function (action) {
// Create the parameters array with basic values
var select24entityParam = {
ajax: {
data: function (params) {
return {
q: params.term
};
},
processResults: function (data) {... | $(document).ready(function () {
$.fn.select24entity = function (action) {
// Create the parameters array with basic values
var select24entityParam = {
ajax: {
data: function (params) {
return {
q: params.term
};
},
processResults: function (data) {... | Fix place of "tags" option in the default options | Fix place of "tags" option in the default options | JavaScript | mit | sharky98/select24entity-bundle,sharky98/select24entity-bundle,sharky98/select24entity-bundle |
b46ae05b9622867dfdbfe30402f2848b2770fee8 | test/DOM/main.js | test/DOM/main.js | // This is a simple test that is meant to demonstrate the ability
// interact with the 'document' instance from the global scope.
//
// Thus, the line: `exports.document = document;`
// or something similar should be done in your main module.
module.load('./DOM', function(DOM) {
// A wrapper for 'document.createEl... | // This is a simple test that is meant to demonstrate the ability
// interact with the 'document' instance from the global scope.
//
// Thus, the line: `exports.document = document;`
// or something similar should be done in your main module.
module.load('./DOM', function(DOM) {
// A wrapper for 'document.createEl... | Make the link work from a "file://" URI. | Make the link work from a "file://" URI.
| JavaScript | mit | TooTallNate/ModuleJS |
5f8631362875b2cafe042c7121cc293615cfffe0 | test/test-app.js | test/test-app.js | /*global describe, beforeEach, it*/
'use strict';
var path = require('path');
var assert = require('yeoman-generator').assert;
var helpers = require('yeoman-generator').test;
var os = require('os');
describe('hubot:app', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../app'))
.i... | /*global describe, beforeEach, it*/
'use strict';
var path = require('path');
var assert = require('yeoman-generator').assert;
var helpers = require('yeoman-generator').test;
var os = require('os');
describe('hubot:app', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../app'))
.i... | Fix assertion for not existing files | Fix assertion for not existing files
| JavaScript | mit | ArLEquiN64/generator-hubot-gulp,m-seldin/generator-hubot-enterprise,eedevops/generator-hubot-enterprise,eedevops/generator-hubot-enterprise,ArLEquiN64/generator-hubot-gulp,zarqin/generator-hubot,github/generator-hubot,mal/generator-hubot,zarqin/generator-hubot,mal/generator-hubot,m-seldin/generator-hubot-enterprise,Cla... |
66b15d29269455a5cf24164bd1982f7f01c323f3 | src/parse/expr.js | src/parse/expr.js | var expr = require('vega-expression'),
args = ['datum', 'event', 'signals'];
module.exports = expr.compiler(args, {
idWhiteList: args,
fieldVar: args[0],
globalVar: args[2],
functions: function(codegen) {
var fn = expr.functions(codegen);
fn.item = function() { return 'event.vg.item'; };
... | var expr = require('vega-expression'),
args = ['datum', 'event', 'signals'];
module.exports = expr.compiler(args, {
idWhiteList: args,
fieldVar: args[0],
globalVar: args[2],
functions: function(codegen) {
var fn = expr.functions(codegen);
fn.eventItem = function() { return 'event.vg.item'; }... | Update to revised event methods. | Update to revised event methods.
| JavaScript | bsd-3-clause | chiu/vega,smclements/vega,seyfert/vega,mathisonian/vega-browserify,carabina/vega,mcanthony/vega,shaunstanislaus/vega,Jerrythafast/vega,Jerrythafast/vega,cesine/vega,shaunstanislaus/vega,lgrammel/vega,Applied-Duality/vega,smclements/vega,smartpcr/vega,smartpcr/vega,mcanthony/vega,mathisonian/vega-browserify,pingjiang/ve... |
02475ac2b8ca9832733bbf01fbf49c80c8f5c66a | src/lang-proto.js | src/lang-proto.js | // Copyright (C) 2006 Google 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 law or agreed t... | // Copyright (C) 2006 Google 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 law or agreed t... | Fix proto lang handler to work minified and to use the type style for types like uint32. | Fix proto lang handler to work minified and to use the type style for types like uint32.
| JavaScript | apache-2.0 | ebidel/google-code-prettify,tcollard/google-code-prettify,tcollard/google-code-prettify,ebidel/google-code-prettify,tcollard/google-code-prettify |
e89d777b928d212b95ce639256de4e38c1788a77 | src/routes/api.js | src/routes/api.js | // Api Routes --
// RESTful API cheat sheet : http://ricostacruz.com/cheatsheets/rest-api.html
var express = require('express'),
router = express.Router(),
db = require('../modules/database');
/* GET users listing. */
router.get('/', function(req, res, next) {
res.json({
message: 'Hello world!'
});
})... | // Api Routes --
// RESTful API cheat sheet : http://ricostacruz.com/cheatsheets/rest-api.html
var express = require('express'),
router = express.Router(),
db = require('../modules/database');
/* GET users listing. */
router.get('/', function(req, res, next) {
res.json({
message: 'Hello world!'
});
})... | Add get one user in API | Add get one user in API
| JavaScript | mit | AnimalTracker/AnimalTracker,AnimalTracker/AnimalTracker |
53a27ad98440fb40c5d13f0415ee0ac348289ca1 | app/extension-scripts/main.js | app/extension-scripts/main.js | (function() {
chrome.browserAction.onClicked.addListener(function() {
var newURL = "chrome-extension://" + chrome.runtime.id + "/index.html";
chrome.tabs.create({ url: newURL });
});
})();
| (function() {
chrome.browserAction.onClicked.addListener(function() {
var appUrl = chrome.extension.getURL('index.html');
chrome.tabs.create({ url: appUrl });
});
})();
| Use builtin to build url | Use builtin to build url
| JavaScript | mit | chrisfried/DIM,bhollis/DIM,DestinyItemManager/DIM,48klocs/DIM,bhollis/DIM,delphiactual/DIM,chrisfried/DIM,bhollis/DIM,DestinyItemManager/DIM,LouisFettet/DIM,48klocs/DIM,delphiactual/DIM,bhollis/DIM,LouisFettet/DIM,DestinyItemManager/DIM,chrisfried/DIM,48klocs/DIM,delphiactual/DIM,chrisfried/DIM,delphiactual/DIM,Destiny... |
b7f05eeb90ceeb53ce14d2a23ee73300cce61f92 | lib/querystring.js | lib/querystring.js | // based on the qs module, but handles null objects as expected
// fixes by Tomas Pollak.
function stringify(obj, prefix) {
if (prefix && (obj === null || typeof obj == 'undefined')) {
return prefix + '=';
} else if (obj.constructor == Array) {
return stringifyArray(obj, prefix);
} else if (obj !== null ... | // based on the qs module, but handles null objects as expected
// fixes by Tomas Pollak.
var toString = Object.prototype.toString;
function stringify(obj, prefix) {
if (prefix && (obj === null || typeof obj == 'undefined')) {
return prefix + '=';
} else if (toString.call(obj) == '[object Array]') {
retur... | Add support for Dates to stringify, also improve stringify Object and Array | Add support for Dates to stringify, also improve stringify Object and Array
| JavaScript | mit | tomas/needle,tomas/needle |
7b6f45b5970766e1ce85c51c0e3d471b41f6a7d6 | app/helpers/takeScreenshot.js | app/helpers/takeScreenshot.js | import { remote } from 'electron'
export default async function takeScreenshot (html, deviceWidth) {
return new Promise(resolve => {
const win = new remote.BrowserWindow({
width: deviceWidth,
show: false,
})
win.loadURL(`data:text/html, ${html}`)
win.webContents.on('did-finish-load', ()... | import { remote } from 'electron'
import path from 'path'
import os from 'os'
import { fsWriteFile } from 'helpers/fs'
const TMP_DIR = os.tmpdir()
export default async function takeScreenshot (html, deviceWidth) {
return new Promise(async resolve => {
const win = new remote.BrowserWindow({
width: deviceW... | Use file to generate screenshot | Use file to generate screenshot
| JavaScript | mit | mjmlio/mjml-app,mjmlio/mjml-app,mjmlio/mjml-app |
2106cfa5b5905945ae2899441995c6c6451717ab | src/apps/interactions/macros/kind-form.js | src/apps/interactions/macros/kind-form.js | module.exports = function ({
returnLink,
errors = [],
}) {
return {
buttonText: 'Continue',
errors,
children: [
{
macroName: 'MultipleChoiceField',
type: 'radio',
label: 'What would you like to record?',
name: 'kind',
options: [{
value: 'interact... | module.exports = function ({
returnLink,
errors = [],
}) {
return {
buttonText: 'Continue',
errors,
children: [{
macroName: 'MultipleChoiceField',
type: 'radio',
label: 'What would you like to record?',
name: 'kind',
options: [{
value: 'interaction',
label... | Enable policy feedback in interaction creation selection | Enable policy feedback in interaction creation selection | JavaScript | mit | uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend |
0734e87bfa82d268366a46b29d3f54f14754d09d | js/swipe.js | js/swipe.js | $(document).ready(function(){
$('.swipeGal').each(function(i, obj){
});
});
| flickrParser = function(json){
var imageList = []
$(json.items).each(function(i, image){
imageList.push({
'title':image.title,
'artist':image.author,
'url':image.link,
'image':image.media.m});
})
return imageList;
}
$(document).ready(function(){
$('.swipeGal').each(function(i, obj){
var feedid = $... | Make request to flickr for group images and parse results into a standard json format. | Make request to flickr for group images and parse results into a standard json format.
| JavaScript | mit | neilvallon/Swipe-Gallery,neilvallon/Swipe-Gallery |
0ceb155aad0bad3d343194227b82fa8e074f7b07 | src/js/collections/pool.js | src/js/collections/pool.js | define(['backbone', '../models/dataset/connection'],
function(Backbone, Connection) {
'use strict';
var ConnectionPool = Backbone.Collection.extend({
model: Connection,
initialize: function(models, options) {
this.dataset = options['dataset'];
this.defaultCut =... | define(['backbone', '../models/dataset/connection'],
function(Backbone, Connection) {
'use strict';
var ConnectionPool = Backbone.Collection.extend({
model: Connection,
initialize: function(models, options) {
this.dataset = options['dataset'];
this.defaultCut =... | Use aggregation to namespace the connection id | Use aggregation to namespace the connection id
re #506
| JavaScript | agpl-3.0 | dataseed/dataseed-visualisation.js,dataseed/dataseed-visualisation.js |
a0501d86dcee4ef1ddad9e7e65db93b7e0b8b10b | src/events.js | src/events.js | var domElementValue = require('dom-element-value');
var EventManager = require('dom-event-manager');
var eventManager;
function eventHandler(name, e) {
var element = e.delegateTarget, eventName = 'on' + name;
if (!element.domLayerNode || !element.domLayerNode.events || !element.domLayerNode.events[eventName]) {
... | var domElementValue = require('dom-element-value');
var EventManager = require('dom-event-manager');
var eventManager;
function eventHandler(name, e) {
var element = e.delegateTarget;
if (!element.domLayerNode || !element.domLayerNode.events) {
return;
}
var events = []
var mouseClickEventName;
var b... | Change the event handler, the `click` handler is only called on left clicks, use the fake `mouseclick` event to catch any kind of click. | Change the event handler, the `click` handler is only called on left clicks, use the fake `mouseclick` event to catch any kind of click.
| JavaScript | mit | crysalead-js/dom-layer,crysalead-js/dom-layer |
b9e61516e633e79909371d6c185818e3579085d2 | languages.js | languages.js | module.exports = [
{name:'C++', mode:'c_cpp'},
{name:'CSS', mode:'css'},
{name:'HTML', mode:'html'},
{name:'JavaScript', mode:'javascript'},
{name:'Perl', mode:'perl'},
{name:'Python', mode:'python'},
{name:'Ruby', mode:'ruby'},
{name:'Shell', mode:'sh'},
{name... | module.exports = [
{name:'C++', mode:'c_cpp'},
{name:'CSS', mode:'css'},
{name:'HTML', mode:'html'},
{name:'JavaScript', mode:'javascript'},
{name:'JSON', mode:'json'},
{name:'Perl', mode:'perl'},
{name:'Python', mode:'python'},
{name:'Ruby', mode:'ruby'},
{na... | Add XML and JSON modes | Add XML and JSON modes
| JavaScript | unlicense | briangreenery/gist |
94a0a48971adbd1583707bd4ed9f874db0b82385 | test/dispose.js | test/dispose.js | describe('asking if a visible div scrolled', function() {
require('./fixtures/bootstrap.js');
beforeEach(h.clean);
afterEach(h.clean);
var visible = false;
var element;
var watcher;
beforeEach(function(done) {
element = h.createTest({
style: {
top: '10000px'
}
});
h.inser... | describe('using the watcher API to dispose and watch again', function() {
require('./fixtures/bootstrap.js');
beforeEach(h.clean);
afterEach(h.clean);
var visible = false;
var element;
var watcher;
beforeEach(function(done) {
element = h.createTest({
style: {
top: '10000px'
}
... | Rename the test on watcher API to have something more specific | Rename the test on watcher API to have something more specific
| JavaScript | mit | tzi/in-viewport,tzi/in-viewport,vvo/in-viewport,vvo/in-viewport,fasterize/in-viewport,fasterize/in-viewport,ipy/in-viewport,ipy/in-viewport |
5cb52c0c7d5149048fdc0f36c18e033a48f33fad | src/scripts/browser/components/auto-launcher/impl-win32.js | src/scripts/browser/components/auto-launcher/impl-win32.js | import manifest from '../../../../package.json';
import filePaths from '../../utils/file-paths';
import Winreg from 'winreg';
import BaseAutoLauncher from './base';
class Win32AutoLauncher extends BaseAutoLauncher {
static REG_KEY = new Winreg({
hive: Winreg.HKCU,
key: '\\Software\\Microsoft\\Windows\\Curr... | import manifest from '../../../../package.json';
import filePaths from '../../utils/file-paths';
import Winreg from 'winreg';
import BaseAutoLauncher from './base';
class Win32AutoLauncher extends BaseAutoLauncher {
static REG_KEY = new Winreg({
hive: Winreg.HKCU,
key: '\\Software\\Microsoft\\Windows\\Curr... | Handle not found error in win32 auto launcher | Handle not found error in win32 auto launcher
| JavaScript | mit | Hadisaeed/test-build,Aluxian/Messenger-for-Desktop,Aluxian/Facebook-Messenger-Desktop,Aluxian/Facebook-Messenger-Desktop,Aluxian/Messenger-for-Desktop,Aluxian/Facebook-Messenger-Desktop,Hadisaeed/test-build,Hadisaeed/test-build,rafael-neri/whatsapp-webapp,rafael-neri/whatsapp-webapp,rafael-neri/whatsapp-webapp,Aluxian/... |
3e89abf57c2242f8bef493eb0dc8fa053bec9e48 | lib/index.js | lib/index.js | /**
* Comma number formatter
* @param {Number} number Number to format
* @param {String} [separator=','] Value used to separate numbers
* @returns {String} Comma formatted number
*/
module.exports = function commaNumber (number, separator) {
separator = typeof separator === 'undefined' ? ',' : ('' + separator)
... | /**
* Comma number formatter
* @param {Number} number Number to format
* @param {String} [separator=','] Value used to separate numbers
* @returns {String} Comma formatted number
*/
module.exports = function commaNumber (number, separator) {
separator = typeof separator === 'undefined' ? ',' : ('' + separator)
... | Update code to follow standard style | Update code to follow standard style
| JavaScript | mit | cesarandreu/comma-number |
2a1121c856f387c164e5239e6a7dacf2d2f29330 | test/test-main.js | test/test-main.js | 'use strict';
if (!Function.prototype.bind) {
// PhantomJS doesn't support bind yet
Function.prototype.bind = Function.prototype.bind || function(thisp) {
var fn = this;
return function() {
return fn.apply(thisp, arguments);
};
};
}
var tests = Object.keys(window.__karma... | 'use strict';
if (!Function.prototype.bind) {
// PhantomJS doesn't support bind yet
Function.prototype.bind = Function.prototype.bind || function(thisp) {
var fn = this;
return function() {
return fn.apply(thisp, arguments);
};
};
}
var tests = Object.keys(window.__karma... | Remove jQuery dependency, not used | TEST: Remove jQuery dependency, not used
| JavaScript | mit | goliatone/gsocket |
7e71970b1cb76c8a916e365491ca07252a61a208 | src/server.js | src/server.js | import express from 'express';
import ReactDOMServer from 'react-dom/server'
import {Router} from 'react-router';
import MemoryHistory from 'react-router/lib/MemoryHistory';
import React from 'react';
import routes from './routing';
let app = express();
//app.engine('html', require('ejs').renderFile);
//app.set('vie... | import express from 'express';
import ReactDOMServer from 'react-dom/server'
import {Router} from 'react-router';
import MemoryHistory from 'react-router/lib/MemoryHistory';
import React from 'react';
import routes from './routing';
let app = express();
//app.engine('html', require('ejs').renderFile);
app.set('view... | Handle initial page laod via express | Handle initial page laod via express
| JavaScript | agpl-3.0 | voidxnull/libertysoil-site,Lokiedu/libertysoil-site,voidxnull/libertysoil-site,Lokiedu/libertysoil-site |
14e97545ba507765cd186b549981e0ebc55f1dff | javascript/NocaptchaField.js | javascript/NocaptchaField.js | var _noCaptchaFields=_noCaptchaFields || [];
function noCaptchaFieldRender() {
for(var i=0;i<_noCaptchaFields.length;i++) {
var field=document.getElementById('Nocaptcha-'+_noCaptchaFields[i]);
var options={
'sitekey': field.getAttribute('data-sitekey'),
'theme': field.getAtt... | var _noCaptchaFields=_noCaptchaFields || [];
function noCaptchaFieldRender() {
for(var i=0;i<_noCaptchaFields.length;i++) {
var field=document.getElementById('Nocaptcha-'+_noCaptchaFields[i]);
var options={
'sitekey': field.getAttribute('data-sitekey'),
'theme': field.getAtt... | Store widget_id on field element | Store widget_id on field element
This allows the captcha element to be targeted via the js api in situations where there is more than one nocaptcha widget on the page. See examples referencing `opt_widget_id` here https://developers.google.com/recaptcha/docs/display#js_api | JavaScript | bsd-3-clause | UndefinedOffset/silverstripe-nocaptcha,UndefinedOffset/silverstripe-nocaptcha |
2ebe898d9f2284ee0f25d8ac927bef4e7bb730de | lib/store.js | lib/store.js | var Store = module.exports = function () {
};
Store.prototype.hit = function (req, configuration, callback) {
var self = this;
var ip = req.ip;
var path;
if (configuration.pathLimiter) {
path = (req.baseUrl) ? req.baseUrl.replace(req.path, '') : '';
ip += configuration.path || path;
}
var now = Da... | var Store = module.exports = function () {
};
Store.prototype.hit = function (req, configuration, callback) {
var self = this;
var ip = req.ip;
var path;
if (configuration.pathLimiter) {
path = (req.baseUrl) ? req.baseUrl.replace(req.path, '') : '';
ip += configuration.path || path;
}
var now = Da... | Fix bug with inner reset time | Fix bug with inner reset time | JavaScript | mit | StevenThuriot/express-rate-limiter |
df1807f823332d076a0dff7e6ec0b49b8a42e8ad | config-SAMPLE.js | config-SAMPLE.js | /* Magic Mirror Config Sample
*
* By Michael Teeuw http://michaelteeuw.nl
* MIT Licensed.
*/
var config = {
port: 8080,
language: 'en',
timeFormat: 12,
units: 'imperial',
modules: [
{
module: 'clock',
position: 'top_left',
config: {
displaySeconds: false
}
},
... | /* Magic Mirror Config Sample
*
* By Michael Teeuw http://michaelteeuw.nl
* MIT Licensed.
*/
var config = {
port: 8080,
language: 'en',
timeFormat: 12,
units: 'imperial',
modules: [
{
module: 'clock',
position: 'top_left',
config: {
displaySeconds: false
}
},
... | Update sample config for new modules. | Update sample config for new modules.
| JavaScript | apache-2.0 | jhurstus/mirror,jhurstus/mirror |
761977b9c98bd5f92d6c90981fff16fec2df4893 | src/components/svg/SVGComponents.js | src/components/svg/SVGComponents.js | import React, { PropTypes } from 'react'
import classNames from 'classnames'
export const SVGComponent = ({ children, ...rest }) =>
<svg {...rest}>
{children}
</svg>
SVGComponent.propTypes = {
children: PropTypes.node.isRequired,
}
export const SVGIcon = ({ children, className, onClick }) =>
<SVGComponen... | import React, { PropTypes } from 'react'
import classNames from 'classnames'
export const SVGComponent = ({ children, ...rest }) =>
<svg {...rest}>
{children}
</svg>
SVGComponent.propTypes = {
children: PropTypes.node.isRequired,
}
export const SVGIcon = ({ children, className, onClick }) =>
<SVGComponen... | Set the default size to 40 on SVGBoxes | Set the default size to 40 on SVGBoxes
The null value was causing some weird rendering issues on a few icons
| JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
904ec5fd379bf47f66794af36ffcd5ecbf5d3ec5 | blueprints/ember-flexberry/index.js | blueprints/ember-flexberry/index.js | /* globals module */
module.exports = {
afterInstall: function () {
this.addBowerPackageToProject('git://github.com/BreadMaker/semantic-ui-daterangepicker.git#5d46ed2e6e5a0bf398bb6a5df82e06036dfc46be');
this.addBowerPackageToProject('datatables');
},
normalizeEntityName: function () {}
}; | /* globals module */
module.exports = {
afterInstall: function () {
return this.addBowerPackagesToProject([
{ name: 'semantic-ui-daterangepicker', target: '5d46ed2e6e5a0bf398bb6a5df82e06036dfc46be' },
{ name: 'datatables', target: '~1.10.8' }
]);
},
normalizeEntityName: function () {}
}; | Fix bower packages installation for addon | Fix bower packages installation for addon
| JavaScript | mit | Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry |
ae5d7724d279e3d1feb1c696d70f6a030407053e | test/patch.js | test/patch.js | var patch = require("../lib/patch")
, net = require("net")
, https = require("https")
, fs = require("fs");
// This is probably THE most ugliest code I've ever written
var responseRegExp = /^([0-9a-z-]{36}) (.*)$/i;
var host = net.createServer(function(socket) {
var i = 0;
socket.setEncoding("utf8");
socke... | var patch = require("../lib/patch")
, net = require("net")
, https = require("https")
, fs = require("fs");
// This is probably THE most ugliest code I've ever written
var responseRegExp = /^([0-9a-z-]{36}) (.*)$/i;
var host = net.createServer(function(socket) {
var i = 0;
socket.setEncoding("utf8");
socke... | Add error listener to test | Add error listener to test
| JavaScript | mit | buschtoens/distroy |
a7b3e2edaa8f1f2791f3cf8c88d210ca7f3b06c1 | webpack.config.js | webpack.config.js | 'use strict';
const path = require('path');
const webpack = require('webpack');
module.exports = {
cache: true,
devtool: '#source-map',
entry: [
path.resolve(__dirname, 'src', 'index.js')
],
module: {
rules: [
{
enforce: 'pre',
include: [
path.resolve(__dirname, 's... | 'use strict';
const path = require('path');
const webpack = require('webpack');
module.exports = {
cache: true,
devtool: '#source-map',
entry: [
path.resolve(__dirname, 'src', 'index.js')
],
module: {
rules: [
{
enforce: 'pre',
include: [
path.resolve(__dirname, 's... | Improve ESLint options for Webpack | Improve ESLint options for Webpack | JavaScript | mit | planttheidea/moize,planttheidea/moize |
349bad1afc06c0af44ff42ab7358e393f3ec4fd9 | lib/ipc-helpers/dump-node.js | lib/ipc-helpers/dump-node.js | #!/usr/bin/env node
process.on('exit', function sendCoverage() {
process.send({'coverage': global.__coverage__});
});
| #!/usr/bin/env node
process.on('beforeExit', function sendCovereageBeforeExit() {
process.send({'coverage': global.__coverage__});
});
| Use beforeExit event to send coverage | Use beforeExit event to send coverage
| JavaScript | mit | rtsao/unitest |
7d8145fce09a92004fbf302953d37863d2bc202b | lib/matrices.js | lib/matrices.js |
function Matrix(options) {
options = options || {};
var values;
if (options.values)
values = options.values;
if (options.rows && options.columns && !values) {
values = [];
for (var k = 0; k < options.rows; k++) {
var row = [];
... |
function Matrix(options) {
options = options || {};
var values;
if (options.values) {
values = options.values.slice();
for (var k = 0; k < values.length; k++)
values[k] = values[k].slice();
}
if (options.rows && options.columns && !values) {
... | Refactor matrix creation to use values slice | Refactor matrix creation to use values slice
| JavaScript | mit | ajlopez/MathelJS |
c29d3a670722b2f4d0a394e6a72ecb647687893a | .storybook/main.js | .storybook/main.js | module.exports = {
addons: ['@storybook/addon-backgrounds', '@storybook/addon-knobs'],
};
| module.exports = {
stories: ['../**/*.stories.js'],
addons: ['@storybook/addon-backgrounds', '@storybook/addon-knobs'],
};
| Define where to find the component stories | Define where to find the component stories
| JavaScript | mit | teamleadercrm/teamleader-ui |
ade0cebb2c7edcacb2f0e83a103e55529fa024cc | lib/user-data.js | lib/user-data.js | //
// This file talks to the main process by fetching the path to the user data.
// It also writes updates to the user-data file.
//
var ipc = require('electron').ipcRenderer
var fs = require('fs')
var getData = function () {
var data = {}
data.path = ipc.sendSync('getUserDataPath', null)
data.contents = JSON.p... | //
// This file talks to the main process by fetching the path to the user data.
// It also writes updates to the user-data file.
//
var ipc = require('electron').ipcRenderer
var fs = require('fs')
var getData = function () {
var data = {}
data.path = ipc.sendSync('getUserDataPath', null)
data.contents = JSON.p... | Fix having not set this up correctly | Fix having not set this up correctly
| JavaScript | bsd-2-clause | jlord/git-it-electron,jlord/git-it-electron,shiftkey/git-it-electron,vongola12324/git-it-electron,vongola12324/git-it-electron,shiftkey/git-it-electron,shiftkey/git-it-electron,vongola12324/git-it-electron,vongola12324/git-it-electron,vongola12324/git-it-electron,vongola12324/git-it-electron,shiftkey/git-it-electron,jl... |
b1da47403f4871313e0759a21091ace04151cb84 | src/renderer/actions/connections.js | src/renderer/actions/connections.js | import { sqlectron } from '../../browser/remote';
export const CONNECTION_REQUEST = 'CONNECTION_REQUEST';
export const CONNECTION_SUCCESS = 'CONNECTION_SUCCESS';
export const CONNECTION_FAILURE = 'CONNECTION_FAILURE';
export const dbSession = sqlectron.db.createSession();
export function connect (id, database) {
... | import { sqlectron } from '../../browser/remote';
export const CONNECTION_REQUEST = 'CONNECTION_REQUEST';
export const CONNECTION_SUCCESS = 'CONNECTION_SUCCESS';
export const CONNECTION_FAILURE = 'CONNECTION_FAILURE';
export const dbSession = sqlectron.db.createSession();
export function connect (id, database) {
... | Use promise all at the right place in the server connecting action | Use promise all at the right place in the server connecting action | JavaScript | mit | sqlectron/sqlectron-gui,sqlectron/sqlectron-gui,sqlectron/sqlectron-gui,sqlectron/sqlectron-gui |
0ebb23201bc8364368cb77c5b502a345d3144f0e | www/pg-plugin-fb-connect.js | www/pg-plugin-fb-connect.js | PG = ( typeof PG == 'undefined' ? {} : PG );
PG.FB = {
init: function(apiKey) {
PhoneGap.exec(function(e) {
console.log("init: " + e);
}, null, 'com.facebook.phonegap.Connect', 'init', [apiKey]);
},
login: function(a, b) {
try {
b = b || { perms: ''... | PG = ( typeof PG == 'undefined' ? {} : PG );
PG.FB = {
init: function(apiKey) {
PhoneGap.exec(null, null, 'com.facebook.phonegap.Connect', 'init', [apiKey]);
},
login: function(a, b) {
b = b || { perms: '' };
PhoneGap.exec(function(e) { // login
FB.Auth.setSession(e.sessi... | Update the JS to remove alerts etc and login now has to have its success method called | Update the JS to remove alerts etc and login now has to have its success method called
| JavaScript | mit | barfight/phonegap-plugin-facebook-connect,irnc/phonegap-plugin-facebook-connect,AntonDobrev/phonegap-plugin-facebook-connect,totoo74/phonegap-plugin-facebook-connect,AntonDobrev/phonegap-plugin-facebook-connect,irnc/phonegap-plugin-facebook-connect,totoo74/phonegap-plugin-facebook-connect,barfight/phonegap-plugin-faceb... |
a7dd9961d9350fc38ad2ad679c6e6b1d1e85e6e9 | packages/core/lib/commands/help.js | packages/core/lib/commands/help.js | var command = {
command: "help",
description:
"List all commands or provide information about a specific command",
help: {
usage: "truffle help [<command>]",
options: [
{
option: "<command>",
description: "Name of the command to display information for."
}
]
},
buil... | var command = {
command: "help",
description:
"List all commands or provide information about a specific command",
help: {
usage: "truffle help [<command>]",
options: [
{
option: "<command>",
description: "Name of the command to display information for."
}
]
},
buil... | Allow commands to define internal options | Allow commands to define internal options
So those options don't appear in the help output
| JavaScript | mit | ConsenSys/truffle |
d2eeb477b2925e6e83e63f75b497cc2b24d5e9d5 | webpack.config.js | webpack.config.js | const path = require('path')
module.exports = {
context: __dirname,
entry: './js/ClientApp.js',
devtool: 'source-map',
output: {
path: path.join(__dirname, '/public'),
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.json']
},
stats: {
colors: true,
reasons: true,
chunk... | const path = require('path')
module.exports = {
context: __dirname,
entry: './js/ClientApp.js',
devtool: 'source-map',
output: {
path: path.join(__dirname, '/public'),
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.json']
},
stats: {
colors: true,
reasons: true,
chunk... | Add style to Webpack rules. | Add style to Webpack rules.
| JavaScript | mit | sheamunion/fem_intro_react_code_along,sheamunion/fem_intro_react_code_along |
e1495b4a57c88e50ad1cb817372502f59c51b596 | lib/MultiSelection/OptionsListWrapper.js | lib/MultiSelection/OptionsListWrapper.js | import React from 'react';
import PropTypes from 'prop-types';
import Popper from '../Popper';
const OptionsListWrapper = React.forwardRef(({
useLegacy,
children,
controlRef,
isOpen,
renderToOverlay,
menuPropGetter,
modifiers,
...props
}, ref) => {
if (useLegacy) {
return <div {...menuPropGetter(... | import React from 'react';
import PropTypes from 'prop-types';
import Popper from '../Popper';
const OptionsListWrapper = React.forwardRef(({
useLegacy,
children,
controlRef,
isOpen,
renderToOverlay,
menuPropGetter,
modifiers,
...props
}, ref) => {
if (useLegacy) {
return <div {...menuPropGetter(... | Fix ref on downshift element | Fix ref on downshift element
| JavaScript | apache-2.0 | folio-org/stripes-components,folio-org/stripes-components |
3b4ee7102882f6e629828ac1e3e44d8f343d4012 | src/features/home/redux/initialState.js | src/features/home/redux/initialState.js | const initialState = {
count: 0,
redditReactjsList: [],
// navTreeData: null,
// projectData: null,
elementById: {},
fileContentById: {},
features: null,
projectDataNeedReload: false,
projectFileChanged: false,
fetchProjectDataPending: false,
fetchProjectDataError: null,
fetchFileContentPending:... | const initialState = {
count: 0,
redditReactjsList: [],
elementById: {},
fileContentById: {},
features: null,
projectDataNeedReload: false,
projectFileChanged: false,
fetchProjectDataPending: false,
fetchProjectDataError: null,
fetchFileContentPending: false,
fetchFileContentError: null,
demoAl... | Hide demo alert by default. | Hide demo alert by default.
| JavaScript | mit | supnate/rekit-portal,supnate/rekit-portal |
35c3457c31087a85103c9729279343775511c7e4 | packages/lesswrong/lib/reactRouterWrapper.js | packages/lesswrong/lib/reactRouterWrapper.js | /*import * as reactRouter3 from 'react-router';
export const Link = reactRouter3.Link;
export const withRouter = reactRouter3.withRouter;*/
import React from 'react';
import * as reactRouter from 'react-router';
import * as reactRouterDom from 'react-router-dom';
import { parseQuery } from './routeUtil'
import qs f... | /*import * as reactRouter3 from 'react-router';
export const Link = reactRouter3.Link;
export const withRouter = reactRouter3.withRouter;*/
import React from 'react';
import * as reactRouter from 'react-router';
import * as reactRouterDom from 'react-router-dom';
import { parseQuery } from './routeUtil'
import qs f... | Fix dumb bug in link-props handling | Fix dumb bug in link-props handling
| JavaScript | mit | Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2 |
0e1e23a2754c56869c9abf1ec058f69ac047905b | FrontEndCreator/questions.js | FrontEndCreator/questions.js | //must have a blank option one for question of type dropdown
standard('qTypes',["","Drop Down", "Multidrop-down", "Number Fillin", "Essay", "Code"]);
standard('qTypes2',["","dropdowns", "multidropdowns", "numfillins", "essays", "codes"]);
standard('correct',["Correct","Incorrect"]);
standard('incorrect',["Incorrect",... | var config = {
'.chosen-select' : {},
};
for (var selector in config) {
$(selector).chosen(config[selector]);
}
for(var k = 0; k < showHideList.length; k++){
// alert(showHide);
var showHide=showHideList[k];
for(var i = 0; i < showHide.length; i++){
// alert(showHide[i]);
if(showHide[i].leng... | Update methods to send object params | Update methods to send object params | JavaScript | mit | stephenjoro/QuizEngine |
fa48474a1860ab76a38cb0de737e48262dcd1bef | api/routes/auth.js | api/routes/auth.js | const url = require('url');
const express = require('express');
const router = express.Router();
module.exports = (app, auth) => {
router.post('/', auth.authenticate('saml', {
failureFlash: true,
failureRedirect: app.get('configureUrl'),
}), (req, res) => {
const arns = req.user['https://aws.amazon.co... | const url = require('url');
const express = require('express');
const router = express.Router();
module.exports = (app, auth) => {
router.post('/', auth.authenticate('saml', {
failureFlash: true,
failureRedirect: app.get('configureUrl'),
}), (req, res) => {
roles = req.user['https://aws.amazon.com/SA... | Add support for multiple role assertions | Add support for multiple role assertions
The `https://aws.amazon.com/SAML/Attributes/Role` attribute supports
single or multiple values. This fixes Awsaml to work when a
multiple-value attribute is passed.
Currently, the first role is always used. Support for selecting from
the roles may be added later.
GH-105
| JavaScript | mit | rapid7/awsaml,rapid7/awsaml,rapid7/awsaml |
37822557c035ca41a6e9243f77d03a69351fc65c | examples/simple.js | examples/simple.js | var jerk = require( '../lib/jerk' ), sys=require('sys');
var options =
{ server: 'localhost'
, port: 6667
, nick: 'Bot9121'
, channels: [ '#jerkbot' ]
};
jerk( function( j ) {
j.watch_for( 'soup', function( message ) {
message.say( message.user + ': soup is good food!' )
});
j.watch_for( /^(.+) ar... | var jerk = require( '../lib/jerk' ), util = require('util');
var options =
{ server: 'localhost'
, port: 6667
, nick: 'Bot9121'
, channels: [ '#jerkbot' ]
};
jerk( function( j ) {
j.watch_for( 'soup', function( message ) {
message.say( message.user + ': soup is good food!' )
});
j.watch_for( /^(.+... | Use util instead of sys in example. | Use util instead of sys in example.
Make sure the example Jerk script continues to work in future node.js
releases. The node.js `sys` library has been a pointer to `util` since
0.3 and has now been removed completely in the node.js development
branch.
| JavaScript | unlicense | gf3/Jerk |
c671f90b3877273d18ba22351e1e8b9a63a925c3 | shp/concat.js | shp/concat.js | export default function(a, b) {
var ab = new a.constructor(a.length + b.length);
ab.set(a, 0);
ab.set(b, a.length);
return ab;
}
| export default function(a, b) {
var ab = new Uint8Array(a.length + b.length);
ab.set(a, 0);
ab.set(b, a.length);
return ab;
}
| Fix for older versions of Node. | Fix for older versions of Node.
Older versions of Node had a conflicting implementation of buffer.set.
| JavaScript | bsd-3-clause | mbostock/shapefile |
1dfde5055467da45665db268a68e72866aef60e2 | lib/networking/ws/BaseSocket.js | lib/networking/ws/BaseSocket.js | "use strict";
const WebSocket = require("ws");
const Constants = require("../../Constants");
const heartbeat = new WeakMap();
class BaseSocket extends WebSocket {
constructor(url) {
super(url);
this.readyState = Constants.ReadyState.CONNECTING;
this.on("open", () => this.readyState = Constants.ReadySta... | "use strict";
const WebSocket = require("ws");
const Constants = require("../../Constants");
const heartbeat = new WeakMap();
class BaseSocket extends WebSocket {
constructor(url) {
super(url);
this.readyState = Constants.ReadyState.CONNECTING;
this.on("open", () => this.readyState = Constants.ReadySta... | Fix heartbeat sender timer handle cleanup | Fix heartbeat sender timer handle cleanup
| JavaScript | bsd-2-clause | qeled/discordie |
e1c49c2c2c1e8e8661a079b6e7acd598bd6123d3 | pliers-npm-security-check.js | pliers-npm-security-check.js | var fs = require('fs')
, request = require('request')
module.exports = function (pliers) {
pliers('npmSecurityCheck', function (done) {
fs.createReadStream('./npm-shrinkwrap.json').pipe(
request.post('https://nodesecurity.io/validate/shrinkwrap', function (error, res) {
if (error) done(new Error... | var fs = require('fs')
, request = require('request')
module.exports = function (pliers, name) {
pliers(name || 'npmSecurityCheck', function (done) {
fs.createReadStream('./npm-shrinkwrap.json').pipe(
request.post('https://nodesecurity.io/validate/shrinkwrap', function (error, res) {
if (error) ... | Add task name override functionality | Add task name override functionality
| JavaScript | bsd-3-clause | pliersjs/pliers-npm-security-check |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.