commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 624 | message stringlengths 15 4.7k | lang stringclasses 3
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
5e0df55f9306d7e6eecd71881c59788a35925aec | parse-comments/lib/utils.js | parse-comments/lib/utils.js | /*!
* parse-comments <https://github.com/jonschlinkert/parse-comments>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
var utils = module.exports = {};
utils.trimRight = function(str) {
return str.replace(/\s+$/, '');
};
utils.stripStars = function (line) {
v... | let utils = module.exports = {};
utils.trimRight = function(str) {
return str.replace(/\s+$/, '');
};
utils.stripStars = function (line) {
let re = /^(?:\s*[\*]{1,2}\s)/;
return utils.trimRight(line.replace(re, ''));
};
| Clean up parse-comments utilis file | Clean up parse-comments utilis file
| JavaScript | apache-2.0 | weepower/wee-core |
bd2ee45b9fad33587764f03dbeb6f39c86299ea6 | js/main.js | js/main.js | var questions = [
Q1 = {
question: "What do HTML means?",
answer: "HyperText Markup Language"
},
Q2 = {
question: "What do CSS means?",
answer: "Cascading Style Sheet"
}
];
var question = document.getElementById('question');
var questionNum = 0;
function createNum() {
questionNum = Math.flo... | var questions = [
Q1 = {
question: "What does HTML means?",
answer: "HyperText Markup Language"
},
Q2 = {
question: "What does CSS means?",
answer: "Cascading Style Sheet"
},
Q3 = {
question: "Why the \"C\" in CSS, is called Cascading?",
answer: "When CSS rules are duplicated, the rule... | Modify and add another question | Modify and add another question
| JavaScript | mit | vinescarlan/FlashCards,vinescarlan/FlashCards |
265769d571df9e80462bb339c0476d8b1f4e3516 | initialize.js | initialize.js | var i = (function() {
'use strict';
return {
c: function(obj, args) {
if (arguments.length > 0) {
var newObj = Object.create(arguments[0]);
if ('init' in newObj) {
if (arguments.length > 1) {
var args = [];
for (var i = 1; i < arguments.length; i++) {
... | var i = (function() {
'use strict';
return {
c: function(obj, args) {
if (arguments.length > 0) {
var newObj = Object.create(arguments[0]);
if ('init' in newObj && typeof newObj.init === 'function') {
if (arguments.length > 1) {
var args = [];
for (var i =... | Check that init is a function | Check that init is a function
| JavaScript | mit | delta-nry/Initialize.js,delta-nry/Initialize.js |
a8bc763ab377f872355bef930bf5ad1735c25e19 | app/models/UserDevice.js | app/models/UserDevice.js |
module.exports = function(sequelize, DataTypes) {
var UserDevice = sequelize.define('UserDevice', {
type: {
type: DataTypes.ENUM('IOS', 'ANDROID'),
defaultValue: 'IOS'
},
token: {
type: DataTypes.STRING,
allowNull: false
}
},
{
classMethods: {
addDevice: function(deviceInfo) {... |
module.exports = function(sequelize, DataTypes) {
var UserDevice = sequelize.define('UserDevice', {
type: {
type: DataTypes.ENUM('IOS', 'ANDROID'),
defaultValue: 'IOS'
},
token: {
type: DataTypes.STRING,
allowNull: false
}
},
{
classMethods: {
addDevice: function(deviceInfo) {... | Remove duplicated device token for multiple users | Remove duplicated device token for multiple users
| JavaScript | mit | barak-shirali/PDS,barak-shirali/PDS,barak-shirali/PDS,barak-shirali/PDS |
dffde72e5e73cd23d2531198a0f61435ca30efb0 | lib/ArgVerifier.js | lib/ArgVerifier.js | var ArgumentError = require('./ArgumentError');
var topiarist = require('topiarist');
function verifierMethod(verifier, methodName) {
return function() {
if(!this.skipVerification) {
if(this.argValue === undefined) throw new ArgumentError(this.argName + ' argument must be provided.');
verifier[metho... | var ArgumentError = require('./ArgumentError');
var topiarist = require('topiarist');
function verifierMethod(verifierMethod) {
return function(arg) {
if(!this.skipVerification) {
if(this.argValue === undefined) throw new ArgumentError(this.argName + ' argument must be provided.');
verifierMethod.ca... | Use call() rather than apply() to improve performance. | Use call() rather than apply() to improve performance.
| JavaScript | apache-2.0 | dchambers/typester |
c532fbe1246fcf2032b09a417b27a932f0bce774 | server/services/ads.spec.js | server/services/ads.spec.js | /* global describe, beforeEach, afterEach, it */
const knex_config = require('../../knexfile');
const knex = require('knex')(knex_config['test']);
const chai = require('chai');
const should = chai.should();
describe('Handle ads', function() {
beforeEach(function(done) {
knex.migrate.rollback()
.then(func... | /* global describe, beforeEach, afterEach, it */
const chai = require('chai');
const should = chai.should();
const knex_config = require('../../knexfile');
const knex = require('knex')(knex_config['test']);
const util = require('../util')({ knex });
const service = require('./ads')({ knex, util });
describe('Handle... | Test that ads appear in date order latest first | Test that ads appear in date order latest first
| JavaScript | agpl-3.0 | Tradenomiliitto/tradenomiitti,Tradenomiliitto/tradenomiitti,Tradenomiliitto/tradenomiitti |
9e246962370dcd7f96732b56eaa2c09d1c757626 | util/transitionToParams.js | util/transitionToParams.js | import queryString from 'query-string';
function transitionToParams(params) {
const location = this.props.location;
let query = location.query;
if (query === undefined)
query = queryString.parse(location.search);
const allParams = Object.assign({}, query, params);
const keys = Object.keys(allParams);
... | import queryString from 'query-string';
function transitionToParams(params) {
const location = this.props.location;
let query = location.query;
if (query === undefined)
query = queryString.parse(location.search);
const allParams = Object.assign({}, query, params);
const keys = Object.keys(allParams);
... | Use queryString.stringify instead of by-hand gluing | Use queryString.stringify instead of by-hand gluing
Fixes STCOM-112
| JavaScript | apache-2.0 | folio-org/stripes-components,folio-org/stripes-components |
4c3c91c9b38ab6bde4a748c33e177f1f53036d6c | js/scripts.js | js/scripts.js | var pingPong = function(userNumber) {
if ((userNumber % 3 === 0) || (userNumber % 5 === 0)) {
return true;
} else {
return false;
}
}
| var pingPong = function(userNumber) {
if ((userNumber % 3 === 0) || (userNumber % 5 === 0)) {
return true;
} else {
return false;
}
};
| Remove superfluous and redundant code | Remove superfluous and redundant code
| JavaScript | mit | kcmdouglas/pingpong,kcmdouglas/pingpong |
09605e33cb1693d1a1cc88ee38b08d275bc9119c | views/components/addApp.js | views/components/addApp.js | import { h, Component } from 'preact'
import { bind } from './util'
export default class extends Component {
constructor() {
super()
this.state.show = false
}
linkState(key) {
return e => this.setState({
[key]: e.target.value
})
}
@bind
toggleShow() {
this.setState({
show: !... | import { h, Component } from 'preact'
import { bind } from './util'
export default class extends Component {
constructor() {
super()
this.state.show = false
}
linkState(key) {
return e => this.setState({
[key]: e.target.value
})
}
@bind
toggleShow() {
this.setState({
show: !... | Use destructuring to remove noise | Use destructuring to remove noise
| JavaScript | mit | zeusdeux/password-manager,zeusdeux/password-manager |
1dc06e37aa07f60780d1f3e74d2f58fa896d913e | src/Loading.js | src/Loading.js | import React, { Component } from 'react';
import './Loading.css';
class Loading extends Component {
render() {
return <p>Loading timetable data.</p>;
}
}
export default Loading;
| import React, { Component } from 'react';
import './Loading.css';
class Loading extends Component {
render() {
return (
<div className='loading'>
<h1>Loading</h1>
<h2>{this.props.name}</h2>
<p>{this.props.message}</p>
</div>
);
}
}
Loading.defaultProps = {
name: 'Loading name',
message: 'Loa... | Add error style message and name. | Add error style message and name.
| JavaScript | mit | kangasta/timetablescreen,kangasta/timetablescreen |
90ad2381efbe614ebec6516ffaa7a2df628ac259 | src/Weather.js | src/Weather.js | import React from 'react';
import Temperature from './Temperature.js';
class Weather extends React.Component {
render = () => {
// FIXME: After rendering, send stats to Google Analytics
// FIXME: Add the actual temperatures
return (
<Temperature degreesCelsius={25} hour={12}><... | import React from 'react';
import Temperature from './Temperature.js';
class Weather extends React.Component {
renderTemperatures = (renderUs) => {
// FIXME: Add the actual temperatures
console.log(renderUs);
return (
<Temperature degreesCelsius={25} hour={1} />
);
... | Add logic for choosing which forecasts to show | Add logic for choosing which forecasts to show
| JavaScript | mit | walles/weatherclock,walles/weatherclock,walles/weatherclock,walles/weatherclock |
3cb2c725d0571d44d43c1265966e0de8df47b725 | lib/common.js | lib/common.js | /**
* Find indices of all occurance of elem in arr. Uses 'indexOf'.
* @param {array} arr - Array-like element (works with strings too!).
* @param {array_element} elem - Element to search for in arr.
* @return {array} indices - Array of indices where elem occurs in arr.
*/
var findAllIndices = function(arr, elem) {... | /**
* Find indices of all occurance of elem in arr. Uses 'indexOf'.
* @param {array} arr - Array-like element (works with strings too!).
* @param {array_element} elem - Element to search for in arr.
* @return {array} indices - Array of indices where elem occurs in arr.
*/
var findAllIndices = function(arr, elem) {... | Add new fxn to null out chars in str range | Add new fxn to null out chars in str range
| JavaScript | mit | nhatbui/libhrc,nhatbui/libhrc |
5fd4d39b04efac1d58fc2106f8184a1bc43a220b | lib/common.js | lib/common.js | 'use strict';
var extendPrototypeWithThese = function (prototype, extendThese) {
/*
Helper method to implement a simple inheritance model for object prototypes.
*/
var outp = prototype;
if (extendThese) {
for (var i = extendThese.length - 1; i >= 0; i--) {
// ... | 'use strict';
var extendPrototypeWithThese = function (prototype, extendThese) {
/*
Helper method to implement a simple inheritance model for object prototypes.
*/
var outp = prototype;
if (extendThese) {
for (var i = extendThese.length - 1; i >= 0; i--) {
// ... | Copy prototype memebers on extend | Copy prototype memebers on extend
| JavaScript | mit | jhsware/component-registry,jhsware/SimpleJSRegistry |
09fddd7a0bf9a3c53e46f371f04701ef56a42811 | test/algorithms/sorting/testInsertionSort.js | test/algorithms/sorting/testInsertionSort.js | /* eslint-env mocha */
const InsertionSort = require('../../../src').Algorithms.Sorting.InsertionSort;
const assert = require('assert');
describe('Insertion Sort', () => {
it('should have no data when empty initialization', () => {
const inst = new InsertionSort();
assert.equal(inst.size, 0);
assert.deep... | /* eslint-env mocha */
const InsertionSort = require('../../../src').Algorithms.Sorting.InsertionSort;
const assert = require('assert');
describe('Insertion Sort', () => {
it('should have no data when empty initialization', () => {
const inst = new InsertionSort();
assert.equal(inst.size, 0);
assert.deep... | Test Insertion Sort: Test for sorting the array | Test Insertion Sort: Test for sorting the array
| JavaScript | mit | ManrajGrover/algorithms-js |
28838615005e5da47a15e78596f9e0f2513b9df7 | addon/mixins/lazy-route.js | addon/mixins/lazy-route.js | /**
* ES6 not supported here
*/
import Ember from "ember";
import config from 'ember-get-config';
export default Ember.Mixin.create({
bundleLoader: Ember.inject.service("bundle-loader"),
findBundleNameByRoute: function(routeName){
//Find bundle for route
var foundBundleName = Object.keys(c... | /**
* ES6 not supported here
*/
import Ember from "ember";
import config from 'ember-get-config';
export default Ember.Mixin.create({
bundleLoader: Ember.inject.service("bundle-loader"),
findBundleNameByRoute: function(routeName){
//Find bundle for route
var bundleName = null;
var bu... | Fix tests by switching to es5 syntax in finding bundles | Fix tests by switching to es5 syntax in finding bundles
| JavaScript | mit | duizendnegen/ember-cli-lazy-load,duizendnegen/ember-cli-lazy-load |
be9b946dfe51b075c002c1d2e2abb7cb0fad7559 | src/zoomingExits/zoomOutUp.js | src/zoomingExits/zoomOutUp.js | /*! Animate.js | The MIT License (MIT) | Copyright (c) 2017 GibboK */
; (function (animate) {
'use strict';
animate.zoomOutUp = function (selector, options) {
var keyframeset = [
{
opacity: 1,
transform: 'none',
transformOrigin: 'left center',
... | /*! Animate.js | The MIT License (MIT) | Copyright (c) 2017 GibboK */
; (function (animate) {
'use strict';
animate.zoomOutUp = function (selector, options) {
var keyframeset = [
{
opacity: 1,
transform: 'none',
transformOrigin: 'center bottom'... | Add fix bug in animation | Add fix bug in animation
| JavaScript | mit | gibbok/animate.js,gibbok/animate.js,gibbok/animatelo,gibbok/animatelo |
007c630953c76a27b74b46b48b20dcb8b3d79cae | js/respec-w3c-extensions.js | js/respec-w3c-extensions.js | // extend the bibliographic entries
var localBibliography = {
"HYDRA-CORE": {
authors: [ "Markus Lanthaler" ],
href: "http://www.hydra-cg.com/spec/latest/core/",
title: "Hydra Core Vocabulary",
status: "unofficial",
publisher: "W3C"
},
"PAV": "Paolo Ciccarese, Stian Soiland-Reyes, Khalid Bel... | // extend the bibliographic entries
var localBibliography = {
"HYDRA-CORE": {
authors: [ "Markus Lanthaler" ],
href: "http://www.hydra-cg.com/spec/latest/core/",
title: "Hydra Core Vocabulary",
status: "Unofficial Draft",
publisher: "W3C"
},
"PAV": {
authors: [
"Paolo Ciccarese",
... | Set up localBiblio according to ReSpec's documentation: | Set up localBiblio according to ReSpec's documentation:
http://www.w3.org/respec/ref.html#localbiblio
| JavaScript | mit | pentandra/spec,pentandra/spec |
f617ae5418d6c1223887a6685cd9714526fc95d2 | src/components/LoginForm.js | src/components/LoginForm.js | import React, {Component} from 'react';
import {Button, Card, CardSection, Input} from './common';
class LoginForm extends Component {
constructor(props) {
super(props);
this.state = {email: "", password: ''};
}
render() {
return <Card>
<CardSection>
<Input label="Email"
... | import React, {Component} from 'react';
import {Button, Card, CardSection, Input} from './common';
import firebase from 'firebase';
import {Text} from 'react-native';
class LoginForm extends Component {
constructor(props) {
super(props);
this.state = {email: '', password: '', error: ''};
}
async onBut... | Use firebase to authenticate users | Use firebase to authenticate users
| JavaScript | apache-2.0 | ChenLi0830/RN-Auth,ChenLi0830/RN-Auth,ChenLi0830/RN-Auth |
a9bcc1388143c86f8ac6d5afcfe0b8cb376b8de7 | src/main/webapp/resources/dev/js/singleUser.js | src/main/webapp/resources/dev/js/singleUser.js | /**
* Author: Josh Adam <josh.adam@phac-aspc.gc.ca>
* Date: 2013-04-17
* Time: 9:41 AM
*/
var username = $('#username').text();
function Project (data) {
"use strict";
this.name = data.name;
}
function UserViewModel () {
"use strict";
self.projects = ko.observableArray([]);
function getUserProjec... | /**
* Author: Josh Adam <josh.adam@phac-aspc.gc.ca>
* Date: 2013-04-17
* Time: 9:41 AM
*/
var username = $('#username').text();
function Project (data) {
"use strict";
this.name = data.name;
}
function UserViewModel () {
"use strict";
self.projects = ko.observableArray([]);
function getUserProjec... | Change the expected JSON format for user projects. | Change the expected JSON format for user projects.
| JavaScript | apache-2.0 | phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida |
c68b6772d435d76bfe290e40e0ae0539c1ba5d76 | src/js/model/Contacts.js | src/js/model/Contacts.js | var ContactView = require('../view/Contact');
/**
* Creates a new Contact
* @constructor
* @arg {Object} options - Object hash used to populate instance
* @arg {string} options.firstName - First name of the contact
* @arg {string} options.firstName - Last name of the contact
* @arg {string} options.tel - name o... | var ContactView = require('../view/Contact');
/**
* Creates a new Contact.
* @constructor
* @arg {Object} options - Object hash used to populate instance.
* @arg {string} options.firstName - First name of the contact.
* @arg {string} options.firstName - Last name of the contact.
* @arg {string} options.tel - Tel... | Use periods on senteces in docs | Use periods on senteces in docs
| JavaScript | isc | bitfyre/contacts |
061563eb253e72812e45aa454455288d194f3cc5 | app/scripts/components/player-reaction.js | app/scripts/components/player-reaction.js | import m from 'mithril';
import classNames from '../classnames.js';
class PlayerReactionComponent {
oninit({ attrs: { session, player } }) {
this.player = player;
session.on('send-reaction', ({ reactingPlayer, reaction }) => {
if (reactingPlayer.color === this.player.color) {
// Immediately up... | import m from 'mithril';
import classNames from '../classnames.js';
class PlayerReactionComponent {
oninit({ attrs: { session, player } }) {
this.player = player;
session.on('send-reaction', ({ reactingPlayer, reaction }) => {
if (reactingPlayer.color === this.player.color) {
// Immediately up... | Fix race condition when setTimeout callback is run | Fix race condition when setTimeout callback is run
The player object may change by the time the callback is run, and
therefore this.player.reactions may not exist at that point.
| JavaScript | mit | caleb531/connect-four |
547cb0360680e20025e086895f1926ea93c3a205 | lib/generators/loaders/ESNextReactLoader.js | lib/generators/loaders/ESNextReactLoader.js | module.exports = {
test: /\.es6\.js$|\.js$|\.jsx$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: [
'es2015-native-modules',
'stage-2',
'react',
],
plugins: [
'transform-class-properties',
'transform-react-constant-elements',
'transform-react-inline-... | module.exports = {
test: /\.es6\.js$|\.js$|\.jsx$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: [
'es2015-native-modules',
'stage-2',
'react',
].map(function(p) { return require.resolve('babel-preset-' + p) }),
plugins: [
'transform-class-properties',
't... | Revert "Revert "Fix module resolution for npm-link'd packages"" | Revert "Revert "Fix module resolution for npm-link'd packages""
This reverts commit 8dc3d9b82be05fe3077e2cc82963a229858930b5.
| JavaScript | mit | reddit/node-build |
2bf558768d4fc3bf4d1505c5a948c9962ca89b9e | lib/bumper.js | lib/bumper.js | function Bumper(coords, context, color) {
this.minX = coords.minX;
this.maxX = coords.maxX;
this.minY = coords.minY;
this.maxY = coords.maxY;
this.context = context;
this.type = coords.type;
this.color = coords.color || "white"
};
Bumper.prototype.draw = function() {
if (this.type == "bumper") {
th... | function Bumper(coords, context, color) {
this.minX = coords.minX;
this.maxX = coords.maxX;
this.minY = coords.minY;
this.maxY = coords.maxY;
this.context = context;
this.type = coords.type;
this.color = coords.color || "white"
};
Bumper.prototype.draw = function() {
if (this.type == "bumper") {
th... | Change relative path for sand image | Change relative path for sand image
| JavaScript | mit | brennanholtzclaw/game_time,brennanholtzclaw/game_time |
816f68b9722ebdeaaf2fc9df1915e6d647b8ba79 | test/e2e/dataExportSpec.js | test/e2e/dataExportSpec.js | const config = require('config')
describe('/#/privacy-security/data-export', () => {
describe('challenge "dataExportChallenge"', () => {
beforeEach(() => {
browser.get('/#/register')
element(by.id('emailControl')).sendKeys('admun@' + config.get('application.domain'))
element(by.id('passwordCont... | const config = require('config')
describe('/#/privacy-security/data-export', () => {
xdescribe('challenge "dataExportChallenge"', () => {
beforeEach(() => {
browser.get('/#/register')
element(by.id('emailControl')).sendKeys('admun@' + config.get('application.domain'))
element(by.id('passwordCon... | Disable flaky dataExport e2e test | Disable flaky dataExport e2e test
| JavaScript | mit | bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop |
17b597513cb8c7aab777cd1ea5fe7228cd15c166 | pogo-protos.js | pogo-protos.js | const fs = require('fs'),
protobuf = require('protobufjs');
const builder = protobuf.newBuilder(),
protoDir = __dirname + '/proto';
fs.readdirSync(protoDir)
.filter(filename => filename.match(/\.proto$/))
.forEach(filename => protobuf.loadProtoFile(protoDir + '/' + filename, builder));
module.exports... | const fs = require('fs'),
protobuf = require('protobufjs');
const builder = protobuf.newBuilder(),
protoDir = __dirname + '/proto';
fs.readdirSync(protoDir)
.filter(filename => filename.match(/\.proto$/))
.forEach(filename => protobuf.loadProtoFile(protoDir + '/' + filename, builder));
// Recursively... | Set packed=true for all repeated packable types | Set packed=true for all repeated packable types
Workaround for https://github.com/dcodeIO/protobuf.js/issues/432
| JavaScript | mit | cyraxx/node-pogo-protos,cyraxx/node-pogo-protos |
f677fef8a3474eacd62a22ddedc25a3c91ec9c3f | src/js/components/interests/CardContentList.js | src/js/components/interests/CardContentList.js | import React, { PropTypes, Component } from 'react';
import CardContent from '../ui/CardContent';
export default class CardContentList extends Component {
static propTypes = {
contents : PropTypes.array.isRequired,
userId : PropTypes.number.isRequired,
otherUserId : PropTypes.... | import React, { PropTypes, Component } from 'react';
import CardContent from '../ui/CardContent';
export default class CardContentList extends Component {
static propTypes = {
contents : PropTypes.array.isRequired,
userId : PropTypes.number.isRequired,
otherUserId : PropTypes.... | Make report optional in CardContent | QS-1341: Make report optional in CardContent
| JavaScript | agpl-3.0 | nekuno/client,nekuno/client |
65a3be9065227ba11ab0680f85c109d99b860bb4 | tools/cli/default-npm-deps.js | tools/cli/default-npm-deps.js | import buildmessage from "../utils/buildmessage.js";
import {
pathJoin,
statOrNull,
writeFile,
unlink,
} from "../fs/files";
const INSTALL_JOB_MESSAGE = "installing npm dependencies";
export function install(appDir, options) {
const packageJsonPath = pathJoin(appDir, "package.json");
const needTempPackage... | import buildmessage from "../utils/buildmessage.js";
import {
pathJoin,
statOrNull,
writeFile,
unlink,
} from "../fs/files";
const INSTALL_JOB_MESSAGE = "installing npm dependencies";
export function install(appDir, options) {
const packageJsonPath = pathJoin(appDir, "package.json");
const needTempPackage... | Fix test-packages in browser testing | Fix test-packages in browser testing
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor |
57617e3f76abbb7e0c4c421c0a6fbb1872a9ac87 | app/templates/Gruntfile.js | app/templates/Gruntfile.js | 'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scss: {
files: ['app/styles/**/*.scss'],
tasks: ['scss']
}
},
sass: {
dist: {
files: [{
expand: true,
cwd: 'app/style... | 'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scss: {
files: ['app/styles/**/*.scss'],
tasks: ['sass']
}
},
sass: {
dist: {
files: [{
expand: true,
cwd: 'app/style... | Fix watch was referring to subtask with typo | Fix watch was referring to subtask with typo
| JavaScript | bsd-3-clause | doberman/generator-doberman,doberman/generator-doberman |
4313cae1c10e687123c18625126537004ceb5131 | lib/util/request-browser.js | lib/util/request-browser.js | /*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
/** Browser replacement for the request module using jQuery. */
var EventEmitter = require('events').EventEmitter,
SingleIterator = require('../../lib/iterators/Iterator').SingleIterator;
require('setimmediate');
// Requests the gi... | /*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
/** Browser replacement for the request module using jQuery. */
var EventEmitter = require('events').EventEmitter,
SingleIterator = require('../../lib/iterators/Iterator').SingleIterator;
require('setimmediate');
// Requests the gi... | Add error handling to browser requests. | Add error handling to browser requests. | JavaScript | mit | infitude/Client.js |
c848a715cb5423085cb76c3bd958a1141ec2defd | public/app.js | public/app.js | $(document).ready(function() {
var options = {
chart: {
renderTo: 'chart',
type: 'spline',
},
title: {
text: 'Recent Water Values'
},
xAxis: {
type: 'datetime',
title: {
text: 'Date'
}
},
yAxis: {
labels: {
... | $(document).ready(function() {
var options = {
chart: {
renderTo: 'chart',
type: 'spline',
},
title: {
text: 'Recent Water Values'
},
xAxis: {
type: 'datetime',
title: {
text: 'Date'
}
},
yAxis: {
labels: {
... | Remove cacheing of the json | Remove cacheing of the json
| JavaScript | mit | amcolash/WaterPi,amcolash/WaterPi,amcolash/WaterPi,amcolash/WaterIoT,amcolash/WaterIoT,amcolash/WaterPi,amcolash/WaterIoT,amcolash/WaterIoT |
ba68dfed99a9616724512b11c9a7189552e71161 | node-tests/unit/utils/rasterize-list-test.js | node-tests/unit/utils/rasterize-list-test.js | 'use strict';
const expect = require('../../helpers/expect');
const fs = require('fs');
const sizeOf = require('image-size');
const RasterizeList = require('../../../src/utils/rasterize-list');
describe('RasterizeList', function() {
// Hitting the file system is slow
this.timeout(0);
... | 'use strict';
const expect = require('../../helpers/expect');
const fs = require('fs');
const sizeOf = require('image-size');
const RasterizeList = require('../../../src/utils/rasterize-list');
describe('RasterizeList', function() {
// Hitting the file system is slow
this.timeout(0);
... | Update test to improve speed by only writing and unlinking files once | refactor(rasterize-list): Update test to improve speed by only writing and unlinking files once
| JavaScript | mit | isleofcode/splicon |
b5994cb13469f3d48f589a2a7910149ef46b0516 | build/npm/stop-server.js | build/npm/stop-server.js | /*
* Copyright (C) 2017 Steven Soloff
*
* This software is licensed under the terms of the GNU Affero General Public
* License version 3 or later (https://www.gnu.org/licenses/).
*/
import config from './config'
import del from 'del'
import fs from 'fs'
import kill from 'tree-kill'
const serverPid = fs.readFileS... | /*
* Copyright (C) 2017 Steven Soloff
*
* This software is licensed under the terms of the GNU Affero General Public
* License version 3 or later (https://www.gnu.org/licenses/).
*/
import config from './config'
import fs from 'fs'
import kill from 'tree-kill'
const serverPid = fs.readFileSync(config.paths.serve... | Use fs.unlinkSync() to delete files | Use fs.unlinkSync() to delete files
| JavaScript | agpl-3.0 | ssoloff/hazelslack-server-core |
91fabd5f82b18a1b1e2acae87160be3488efc044 | tests/helpers/start-app.js | tests/helpers/start-app.js | import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
// use defaults, but you can override
let attributes = Ember.assign({}, config.APP, attrs);
Ember.run(() => {
application = Application... | import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let assign = Ember.assign || Ember.merge
// use defaults, but you can override
let attributes = assign({}, config.APP, attrs);
Ember.run(... | Fix tests for ember v2.4.x | Fix tests for ember v2.4.x
| JavaScript | mit | josemarluedke/ember-cli-numeral,jayphelps/ember-cli-numeral,josemarluedke/ember-cli-numeral |
8963d5f14cf34b4771a5dbcdad7181680aef7881 | example/src/screens/types/Drawer.js | example/src/screens/types/Drawer.js | import React from 'react';
import {StyleSheet, View, Text} from 'react-native';
class MyClass extends React.Component {
render() {
return (
<View style={styles.container}>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
width: 300,
alignItems: 'center',
... | import React from 'react';
import {StyleSheet, View, Button} from 'react-native';
class MyClass extends React.Component {
onShowModal = () => {
this.props.navigator.toggleDrawer({
side: 'left'
});
this.props.navigator.showModal({
screen: 'example.Types.Modal',
title: `Modal`
});
... | Add show modal button to SideMenu | Add show modal button to SideMenu
| JavaScript | mit | junedomingo/react-native-navigation,junedomingo/react-native-navigation,junedomingo/react-native-navigation,junedomingo/react-native-navigation |
c120257c591597d8bf291396180e18f40bb3b1fa | common/components/utils/ghostApi.js | common/components/utils/ghostApi.js | // @flow
import GhostContentAPI from "@tryghost/content-api";
const ghostContentAPI =
window.GHOST_URL &&
window.GHOST_CONTENT_API_KEY &&
new GhostContentAPI({
url: window.GHOST_URL,
key: window.GHOST_CONTENT_API_KEY,
version: "v3",
});
export type GhostPost = {|
title: string,
url: string,
... | // @flow
import GhostContentAPI from "@tryghost/content-api";
const ghostContentAPI =
window.GHOST_URL &&
window.GHOST_CONTENT_API_KEY &&
new GhostContentAPI({
url: window.GHOST_URL,
key: window.GHOST_CONTENT_API_KEY,
version: "v3",
});
export type GhostPost = {|
title: string,
url: string,
... | Include slugs in ghost response | Include slugs in ghost response
| JavaScript | mit | DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange |
d5bd4d7464121bba9c3464cd0194beedee273cbc | client/lib/js/constants/application_constants.js | client/lib/js/constants/application_constants.js | export const FLASK_BASE_URL = process.env.FLASK_BASE_URL;
export const API_PATH = `${FLASK_BASE_PATH}/api/`;
export default {
API_PATH,
FLASK_BASE_URL
};
| export const FLASK_BASE_URL = process.env.FLASK_BASE_URL;
export const API_PATH = `${FLASK_BASE_URL}/api/`;
export default {
API_PATH,
FLASK_BASE_URL
};
| Fix variable typo for FLASK_BASE_URL in app constants | Fix variable typo for FLASK_BASE_URL in app constants
| JavaScript | apache-2.0 | bigchaindb/bigchaindb-examples,bigchaindb/bigchaindb-examples,bigchaindb/bigchaindb-examples |
8b65390d14ef9e8da29a46092650866d24609042 | browser-test-config/browserstack-karma.js | browser-test-config/browserstack-karma.js | var baseKarma = require('./base-karma')
module.exports = function(config) {
var baseConfig = baseKarma(config);
config.set(Object.assign(baseConfig, {
browsers: [
'bs_firefox_android',
'bs_chrome_mac',
'bs_ie_11',
'bs_edge',
],
reporters: [
'mocha', 'BrowserStack',
]... | var baseKarma = require('./base-karma')
module.exports = function(config) {
var baseConfig = baseKarma(config);
config.set(Object.assign(baseConfig, {
browsers: [
'bs_firefox_android',
'bs_chrome_mac',
'bs_ie_11',
'bs_edge',
],
reporters: [
'mocha', 'BrowserStack',
]... | Test Edge 17 instead of 16 | Test Edge 17 instead of 16
| JavaScript | apache-2.0 | josdejong/mathjs,josdejong/mathjs,josdejong/mathjs,FSMaxB/mathjs,FSMaxB/mathjs,josdejong/mathjs,FSMaxB/mathjs,FSMaxB/mathjs,josdejong/mathjs,FSMaxB/mathjs |
3c2b0a9140c8dd101bf6e277550e156af3fc8acc | test/fluce-component.spec.js | test/fluce-component.spec.js | /* @flow */
import React from 'react'
import {addons} from 'react/addons'
var {TestUtils} = addons
var {createRenderer} = TestUtils
import Fluce from '../src/fluce-component'
import createFluce from '../src/create-fluce'
describe('<Fluce />', () => {
it('Should throw when rendered with many children', () => {
... | /* @flow */
import React from 'react'
import {addons} from 'react/addons'
var {TestUtils} = addons
var {createRenderer} = TestUtils
import Fluce from '../src/fluce-component'
import createFluce from '../src/create-fluce'
describe('<Fluce />', () => {
it('Should throw when rendered with many children', () => {
... | Revert "check if travis works" | Revert "check if travis works"
This reverts commit fbd645ae10b6b8c41befe416765ea7b6bc3343d9.
| JavaScript | mit | rpominov/fluce,rpominov/fluce |
08e299491da581b1d64d8fda499a0fd94d8427a1 | client/ember/tests/unit/models/config-test.js | client/ember/tests/unit/models/config-test.js | import {
moduleForModel,
test
} from 'ember-qunit';
moduleForModel('config');
test('it exists', function(assert) {
var model = this.subject();
// var store = this.store();
assert.ok(!!model);
});
| import {
moduleForModel,
test
}
from 'ember-qunit';
import Ember from 'ember';
var configMock = {
id: 1,
images: {
base_url: "http://image.tmdb.org/t/p/",
secure_base_url: "https://image.tmdb.org/t/p/",
backdrop_sizes: [
"w300",
"w780",
"w1280",
"original"
],
logo_si... | Add test for config model | Add test for config model
| JavaScript | mit | ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix |
4e771acd0015b67506747ff16ce0c971884fea8e | compiler/ast/FunctionDeclaration.js | compiler/ast/FunctionDeclaration.js | 'use strict';
var Node = require('./Node');
var ok = require('assert').ok;
class FunctionDeclaration extends Node {
constructor(def) {
super('FunctionDeclaration');
this.name = def.name;
this.params = def.params;
this.body = this.makeContainer(def.body);
}
generateCode(cod... | 'use strict';
var Node = require('./Node');
var ok = require('assert').ok;
class FunctionDeclaration extends Node {
constructor(def) {
super('FunctionDeclaration');
this.name = def.name;
this.params = def.params;
this.body = this.makeContainer(def.body);
}
generateCode(cod... | Allow function declaration name to be an Identifier node | Allow function declaration name to be an Identifier node
| JavaScript | mit | marko-js/marko,marko-js/marko |
f6f4b6fc44b0e5e09ea38cfe92be0c0ff28a4cf1 | src/stores/topicStore.js | src/stores/topicStore.js | import TopicReducer from "reducers/topicReducer";
import thunkMiddleware from "redux-thunk";
import {createStore, combineReducers, applyMiddleware} from 'redux';
import createLogger from 'redux-logger';
const loggerMiddleware = createLogger();
/**
* Creates the topic store.
*
* This is designed to be used isomorph... | import TopicReducer from "reducers/topicReducer";
import thunkMiddleware from "redux-thunk";
import {createStore, combineReducers, applyMiddleware} from 'redux';
import createLogger from 'redux-logger';
const loggerMiddleware = createLogger();
const createTopicStore = function createTopicStore(middlewares, reducers) ... | Make store creation more flexible. | Make store creation more flexible.
This will help us to create stores with no logging middleware later if we want (amongst other things).
| JavaScript | bsd-3-clause | Seinzu/word-cloud |
638fea7b838166e3fe75a482835c06db7c12bdb1 | client/webpack.config.js | client/webpack.config.js | const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'public'),
},
module: {
rules: [
{
use: {
loader: 'babel-lo... | const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'public'),
},
module: {
rules: [
{
use: {
loader: 'babel-lo... | Set `@babel/plugin-proposal-class-properties` as option in webpack | Set `@babel/plugin-proposal-class-properties` as option in webpack
Fixes webpack build error due to class properties
https://stackoverflow.com/a/52693007/452233
| JavaScript | mit | ultranaut/react-chat,ultranaut/react-chat |
b110e315ecd6339108848f6cea23b7d336dabbf1 | src/Resend.js | src/Resend.js | var MatrixClientPeg = require('./MatrixClientPeg');
var dis = require('./dispatcher');
module.exports = {
resend: function(event) {
MatrixClientPeg.get().resendEvent(
event, MatrixClientPeg.get().getRoom(event.getRoomId())
).done(function() {
dis.dispatch({
a... | var MatrixClientPeg = require('./MatrixClientPeg');
var dis = require('./dispatcher');
module.exports = {
resend: function(event) {
MatrixClientPeg.get().resendEvent(
event, MatrixClientPeg.get().getRoom(event.getRoomId())
).done(function() {
dis.dispatch({
a... | Add removeFromQueue function to cancel sending a queued event | Add removeFromQueue function to cancel sending a queued event
| JavaScript | apache-2.0 | matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk |
c0142bb488e5fa5edb0cefd205be96a806389ac6 | server/models/essentials.js | server/models/essentials.js | const mongoose = require('mongoose');
const logger = require('../logging');
// connecting to db
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost');
const db = mongoose.connection;
db.on('error', (err) => {
logger.error('Could not connect to database.', { err });
});
| const mongoose = require('mongoose');
const logger = require('../logging');
const DB_URL = process.env.SDF_DATABASE_URL;
const DB_NAME = process.env.SDF_DATABASE_NAME || 'sdf';
const DB_CONN_STR = DB_URL || `mongodb://localhost/${DB_NAME}`;
// connecting to db
console.log(`Connecting to mongodb using '${DB_CONN_STR... | Make connecting to mongodb a bit more pluggy | Make connecting to mongodb a bit more pluggy
| JavaScript | mit | dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta |
cd4023e5f54afd97cf9d6cfa2f2d9e092cde8cee | snippets/sheets/is_range_a_cell/code.js | snippets/sheets/is_range_a_cell/code.js | /* eslint-disable camelcase */
/**
* Checks if a range is a cell
* @param {GoogleAppsScript.Spreadsheet.Range} range
* @return {boolean}
*/
function isRangeACell_(range) {
return !/:/.test(range.getA1Notation());
}
/**
* Run the snippet
*/
function run_test() {
const cell = SpreadsheetApp.getActive().getRan... | /* eslint-disable camelcase */
/**
* Checks if a range is a cell
* @param {GoogleAppsScript.Spreadsheet.Range} range
* @return {boolean}
*/
function isRangeACell_(range) {
return !~range.getA1Notation().indexOf(':');
}
/**
* Run the snippet
*/
function run_test() {
const cell = SpreadsheetApp.getActive().ge... | Update is ceaal a reange | Update is ceaal a reange
Signed-off-by: Alex Ivanov <141a92417f71895e56c4a5da05f3e98fc78e2220@contributor.pw>
| JavaScript | unlicense | oshliaer/google-apps-script-snippets,oshliaer/google-apps-script-snippets,oshliaer/google-apps-script-snippets |
f001dbd00ba3741613f6d26f4d5a54db61444465 | test/unit-test/ping-spec.js | test/unit-test/ping-spec.js | /*
* Ping test suite
*/
var
vows = require('vows'),
assert = require('assert');
var
quero = {},
urls = [
'http://google.com',
'http://facebook.com',
'http://odesk.com',
'http://elance.com',
'http://parse.com',
'http://github.com',
'http://nodejs.org',
'http://npmjs.org'
];
function checkQue... | /*
* Ping test suite
*/
var
vows = require('vows'),
assert = require('assert');
var
quero = {},
urls = [
'http://google.com',
'http://facebook.com',
'http://odesk.com',
'http://elance.com',
'http://parse.com',
'http://github.com',
'http://nodejs.org',
'http://npmjs.org'
];
function checkQue... | Make sure the returned results will contained LinkedIn count | Make sure the returned results will contained LinkedIn count
| JavaScript | mit | muhammadghazali/quero |
71776730dcd36f9d3e606b8f109434056d47beb7 | lib/web/scripts/capabilities/home/HomeCapabilityView.js | lib/web/scripts/capabilities/home/HomeCapabilityView.js | const Marionette = require('backbone.marionette');
const HomeCardsView = require('./HomeCardsView.js');
module.exports = class HomeCapabilityView extends Marionette.View {
template = Templates['capabilities/home/home'];
className() {
return 'home-capability';
}
regions() {
return {cards: '.cards-cont... | const Marionette = require('backbone.marionette');
const HomeCardsView = require('./HomeCardsView.js');
module.exports = class HomeCapabilityView extends Marionette.View {
template = Templates['capabilities/home/home'];
className() {
return 'home-capability';
}
regions() {
return {cards: '.cards-cont... | Update the home screen greeting sometimes | Update the home screen greeting sometimes
| JavaScript | mit | monitron/jarvis-ha,monitron/jarvis-ha |
568abc38f0d1ef58ede0af5fcdcc31d0e99d595d | src/game/vue-game-plugin.js | src/game/vue-game-plugin.js | import GameStateManager from "./GameStates/GameStateManager";
// import CommandParser from "./Commands/CommandParser";
import GenerateName from "./Generators/NameGenerator";
export default {
install: (Vue) => {
Vue.prototype.$game = {
startGame() {
return GameStateManager.StartGame();
},
... | import GameStateManager from "./GameStates/GameStateManager";
// import CommandParser from "./Commands/CommandParser";
import GenerateName from "./Generators/NameGenerator";
export default {
install: (Vue) => {
Vue.prototype.$game = {
start() {
GameStateManager.StartGame();
},
receiveIn... | Add new game methods for state/input management | Add new game methods for state/input management
| JavaScript | mit | Trymunx/Dragon-Slayer,Trymunx/Dragon-Slayer |
1b55bfd142856c2d2fcda4a21a23df323e4ad5b1 | addon/pods/components/frost-tabs/component.js | addon/pods/components/frost-tabs/component.js | import Ember from 'ember'
import layout from './template'
import PropTypesMixin, { PropTypes } from 'ember-prop-types'
import uuid from 'ember-simple-uuid'
export default Ember.Component.extend(PropTypesMixin, {
// == Component properties ==================================================
layout: layout,
classN... | import Ember from 'ember'
import layout from './template'
import PropTypesMixin, { PropTypes } from 'ember-prop-types'
import uuid from 'ember-simple-uuid'
export default Ember.Component.extend(PropTypesMixin, {
// == Component properties ==================================================
layout: layout,
classN... | Put some property as required. | Put some property as required.
| JavaScript | mit | ciena-frost/ember-frost-tabs,ciena-frost/ember-frost-tabs,ciena-frost/ember-frost-tabs |
254d2831fcab758f55302a01032fe73c3fe49e10 | www/modules/core/components/session.service.js | www/modules/core/components/session.service.js | (function() {
'use strict';
angular.module('Core')
.service('sessionService', sessionService);
sessionService.$inject = ['commonService'];
function sessionService(commonService) {
var service = this;
service.isUserLoggedIn = isUserLoggedIn;
/* ===============... | (function() {
'use strict';
angular.module('Core')
.service('sessionService', sessionService);
sessionService.$inject = [];
function sessionService() {
var service = this;
service.isUserLoggedIn = isUserLoggedIn;
/* ======================================== Va... | Remove commonSvc dependency to prevent circular dependency | Remove commonSvc dependency to prevent circular dependency
| JavaScript | mit | tlkiong/cxa_test,tlkiong/cxa_test |
5d464fd7642aa91501d09738ba345e2e252aaff9 | index.js | index.js | var rules = require('./helpers/rules.js');
module.exports = function (options) {
options = options || {};
if (options.rules) {
Object.keys(options.rules).forEach(function (key) {
rules[key] = options.rules[key];
});
}
return function (module, controller) {
module.alias('cerebral-module-fo... | var rules = require('./helpers/rules.js');
module.exports = function (options) {
options = options || {};
if (options.rules) {
Object.keys(options.rules).forEach(function (key) {
rules[key] = options.rules[key];
});
}
return function (module, controller) {
module.alias('cerebral-module-fo... | Update to latest Cerebral, React. Removed deprecated warnings | Update to latest Cerebral, React. Removed deprecated warnings
| JavaScript | mit | cerebral/cerebral-module-forms,cerebral/cerebral-module-forms |
e7bef4ca97a6c73ce6a0f547387f2864d2c61d6e | module.js | module.js | var fs = require("fs");
var cur_pid = parseInt(fs.readFileSync(".muon").toString());
if (!isNaN(cur_pid)){
console.log("Server already running: process id "+cur_pid);
process.kill();
}
fs.writeFileSync(".muon",process.pid);
process.on('SIGINT', function() {
fs.writeFileSync(".muon","");
process.kill();... | var fs = require("fs");
var cur_pid = parseInt(fs.readFileSync(".muon").toString());
if (cur_pid != process.pid && !isNaN(cur_pid)){
console.log("Server already running: process id "+cur_pid);
process.kill();
}
fs.writeFileSync(".muon",process.pid);
process.on('SIGINT', function() {
fs.writeFileSync(".muon... | Check process id when reloading | Check process id when reloading
| JavaScript | mit | Kreees/muon,Kreees/muon |
1b62d12de0c1f9c9b3a08290a1bb9cee14d3039d | index.js | index.js | #!/usr/bin/env node
"use strict";
const moment = require("moment");
const sugar = require("sugar");
const chalk = require("chalk");
const exec = require("child_process").exec;
process.argv.splice(0, 2);
if (process.argv.length > 0) {
// Attempt to parse the date
let date = process.argv.join(" ");
let parsedDa... | #!/usr/bin/env node
"use strict";
const moment = require("moment");
const sugar = require("sugar");
const chalk = require("chalk");
const exec = require("child_process").exec;
process.argv.splice(0, 2);
if (process.argv.length > 0) {
// Attempt to parse the date
let date = process.argv.join(" ");
let parsedDa... | Change tabular to 4 spaces | Change tabular to 4 spaces
| JavaScript | mit | sam3d/git-date |
55dd1989d910d34fffdef9788192e7d0f7a7e48e | index.js | index.js | var git = require('edge-git');
var repo = new git.repository('./.git/');
console.log(repo.BranchesSync());
| var git = require('edge-git');
var repo = new git.repository('./.git/');
console.log(repo.BranchesSync()[0].CommitsSync());
| Add a more interesting example | Add a more interesting example
| JavaScript | mit | itsananderson/edge-git-example |
a0a28e3ce6be7fd369b67159478d7ebbd619ce79 | index.js | index.js | /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-cli-sentry',
contentFor: function(type, config){
if (type === 'body' && !config.sentry.skipCdn) {
return '<script src="' + config.sentry.cdn + '/' + config.sentry.version + '/ember,jquery,native/raven.min.js"></script>';
}
}
}... | /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-cli-sentry',
contentFor: function(type, config){
if (type === 'body-footer' && !config.sentry.skipCdn) {
return '<script src="' + config.sentry.cdn + '/' + config.sentry.version + '/ember,jquery,native/raven.min.js"></script>';
}... | Use 'body-footer' to ensure Raven is loaded after Ember. | Use 'body-footer' to ensure Raven is loaded after Ember.
`{{content-for 'body'}}` is typically before the `vendor.js` file's
script tag, so this switches to using `body-footer` to ensure `Raven` is
loaded after Ember itself.
| JavaScript | mit | pifantastic/ember-cli-sentry,dschmidt/ember-cli-sentry,damiencaselli/ember-cli-sentry,dschmidt/ember-cli-sentry,pifantastic/ember-cli-sentry,damiencaselli/ember-cli-sentry |
81f103f34e711a5283762deee89704350aba20d6 | index.js | index.js | #!/usr/bin/env node
'use strict';
const child_process = require('child_process');
const commander = require('commander');
const version = require('./package').version;
commander
.version(version)
.usage('[options] <cmd...>');
commander.parse(process.argv);
const args = process.argv.slice(2);
if (args.length... | #!/usr/bin/env node
'use strict';
const child_process = require('child_process');
const commander = require('commander');
const version = require('./package').version;
commander
.version(version)
.usage('[options] <cmd...>');
commander.parse(process.argv);
let args = process.argv.slice(2);
if (!args.length)... | Allow commands with no arguments | Allow commands with no arguments
| JavaScript | mit | pjdietz/hodo |
8f5c1e3234dd32588143f3ca51c01281b577ea17 | index.js | index.js | 'use strict';
module.exports = function (str, opts) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
opts = opts || {};
return str + ' & ' + (opts.postfix || 'rainbows');
};
| 'use strict';
module.exports = function (str, opts) {
var request = require('sync-request');
var options_obj = {
'headers': {
'user-agent': 'http://github.com/icyflame/gh-gist-owner'
}
};
var res = request('GET', 'https://api.github.com/gists/' + str, options_obj);
var body = JSON.parse(res.getBody());
... | Complete the request and return username | Complete the request and return username
Signed-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com> | JavaScript | mit | icyflame/gh-gist-owner |
e794cbfa89778eab9aae959a1ad90223afeea1e6 | index.js | index.js | require( 'dotenv' ).config();
var dropboxModule = require( './modules/dropbox.js' );
var googleDocsModule = require( './modules/googleDocs.js' );
var paypalModule = require( './modules/paypal.js' );
var express = require( 'express' );
var app = express();
app.set( 'port', ( process.env.Port || 30000 ) );
app.use( expr... | require( 'dotenv' ).config();
var dropboxModule = require( './modules/dropbox.js' );
var googleDocsModule = require( './modules/googleDocs.js' );
var paypalModule = require( './modules/paypal.js' );
var express = require( 'express' );
var app = express();
app.set( 'port', ( process.env.PORT ) );
app.use( express.stati... | Fix a port related issue that persists. | Fix a port related issue that persists.
| JavaScript | mit | kmgalanakis/node-js-paypal-rate |
22bbbd2febb2d9d7227fbd330ea8ce1b2101c95d | index.js | index.js | /* jshint node: true */
'use strict';
var BasePlugin = require('ember-cli-deploy-plugin');
module.exports = {
name: 'ember-cli-deploy-cloudfront',
createDeployPlugin: function(options) {
var DeployPlugin = BasePlugin.extend({
name: options.name,
defaultConfig: {
objectPaths: '/index.html'... | /* jshint node: true */
'use strict';
var BasePlugin = require('ember-cli-deploy-plugin');
module.exports = {
name: 'ember-cli-deploy-cloudfront',
createDeployPlugin: function(options) {
var DeployPlugin = BasePlugin.extend({
name: options.name,
defaultConfig: {
objectPaths: '/index.html'... | Add backticks to preparing log message | Add backticks to preparing log message
| JavaScript | mit | kpfefferle/ember-cli-deploy-cloudfront |
f71c6785131adcc85b91789da0d0a0b9f1a9713f | index.js | index.js | var path = require('path');
module.exports = function (source) {
if (this.cacheable) {
this.cacheable();
}
var matches = 0,
processedSource;
processedSource = source.replace(/React\.createClass/g, function (match) {
matches++;
return '__hotUpdateAPI.createClass';
});
if (!matches) {
... | var path = require('path');
module.exports = function (source) {
if (this.cacheable) {
this.cacheable();
}
var matches = 0,
processedSource;
processedSource = source.replace(/React\.createClass\s*\(\s*\{/g, function (match) {
matches++;
return '__hotUpdateAPI.createClass({';
});
if (!m... | Use more precise React.createClass call regex to avoid matching own code | Use more precise React.createClass call regex to avoid matching own code
| JavaScript | mit | gaearon/react-hot-loader,gaearon/react-hot-loader |
562375c8256c65be9223fb8622fc7ad4fde90b31 | index.js | index.js | var buildContents = require('./lib/buildContents');
var buildImports = require('./lib/buildImports');
var buildSection = require('./lib/buildSection');
var extend = require('util')._extend;
var fs = require('fs');
var path = require('path');
var processSassDoc = require('./lib/process... | var buildContents = require('./lib/buildContents');
var buildImports = require('./lib/buildImports');
var buildSection = require('./lib/buildSection');
var extend = require('util')._extend;
var fs = require('fs');
var path = require('path');
var processSassDoc = require('./lib/process... | Allow glob search pattern to be passed as a string | Allow glob search pattern to be passed as a string
| JavaScript | mit | zurb/octophant,zurb/foundation-settings-parser |
0be5cfbe8579f116666d2cd444f8c5c6de330d64 | index.js | index.js | var Promise = require('bluebird');
var mapValues = require('lodash.mapvalues');
var assign = require('lodash.assign');
var curry = require('lodash.curry');
function FileWebpackPlugin(files) {
this.files = files || {};
}
FileWebpackPlugin.prototype.apply = function(compiler) {
var self = this;
compiler.plugin('e... | var Promise = require('bluebird');
var mapValues = require('lodash.mapvalues');
var assign = require('lodash.assign');
var curry = require('lodash.curry');
function FileWebpackPlugin(files) {
this.files = files || {};
}
FileWebpackPlugin.prototype.apply = function(compiler) {
var self = this;
compiler.plugin('e... | Sort functions in order of usage | Sort functions in order of usage | JavaScript | mit | markdalgleish/file-webpack-plugin |
ab4c9d88e6afa89fac479dc417e485036cb62deb | index.js | index.js | 'use strict';
var jade = require('jade');
var fs = require('fs');
exports.name = 'jade';
exports.outputFormat = 'xml';
exports.compile = function (source, options) {
var fn = jade.compile(source, options);
return {fn: fn, dependencies: fn.dependencies}
};
exports.compileClient = function (source, options) {
r... | 'use strict';
var jade = require('jade');
var fs = require('fs');
exports.name = 'jade';
exports.outputFormat = 'html';
exports.compile = function (source, options) {
var fn = jade.compile(source, options);
return {fn: fn, dependencies: fn.dependencies}
};
exports.compileClient = function (source, options) {
... | Use `'html'` as output format | Use `'html'` as output format
Per jstransformers/jstransformer#3.
| JavaScript | mit | jstransformers/jstransformer-pug,jstransformers/jstransformer-jade,jstransformers/jstransformer-jade,jstransformers/jstransformer-pug |
c303f40444becc57113d04560705be4f88832b5b | routes/poem.js | routes/poem.js | var _ = require('underscore');
var PoemsRepository = require('../lib/repositories/poems_repository.js');
var poemsRepo = new PoemsRepository();
exports.list = function(req, res) {
poemsRepo.all(function(err, poems) {
res.render('poem/list', { poems: poems });
});
};
exports.edit = function(req, res) {
... | var _ = require('underscore'),
fs = require('fs'),
path = require('path'),
PoemsRepository = require('../lib/repositories/poems_repository.js');
var dbConfig;
if(fs.existsSync(path.join(__dirname, "../db/config.json"))) {
dbConfig = require("../db/config.json");
} else {
console.log("The database config file was ... | Read database config from file. Exit process if file not found. | Read database config from file. Exit process if file not found.
| JavaScript | mit | jimguys/poemlab,jimguys/poemlab |
0d54232f21a916b040b87b3c96c0687568d0e9cc | src/js/app.js | src/js/app.js | var fullscreen = require('./fullscreen')(document.getElementById('fs'));
var slides = require('./slides')(document.getElementById('fs')).then(function() {
var carousel = require('./carousel');
var slideRotationInterval = window.setInterval(carousel, (2 * 1000));
});
var analytics = require('./analytics');
document... | var fullscreen = require('./fullscreen')(document.getElementById('fs'));
var slides = require('./slides')(document.getElementById('fs')).then(function() {
var carousel = require('./carousel');
var slideRotationInterval = window.setInterval(carousel, (5 * 1000));
});
var analytics = require('./analytics');
document... | Increase slide display interval to 10s | Increase slide display interval to 10s
| JavaScript | mit | alphagov/performanceplatform-big-screen-view,alphagov/performanceplatform-big-screen-view,alphagov/performanceplatform-big-screen-view |
02fc6dab5673a5581620994cebd53115de756be8 | src/layout.js | src/layout.js | import * as dagre from "dagre"
export default function() {
let width = 1,
height = 1;
function layout(dag) {
const g = new dagre.graphlib.Graph(),
info = {};
g.setGraph(info);
dag.nodes().forEach(n => g.setNode(n.id, n));
dag.links().forEach(l => g.setEdge(l.source.id, l.target.id, l));
... | import * as dagre from "dagre"
export default function() {
let width = 1,
height = 1;
function layout(dag) {
const g = new dagre.graphlib.Graph(),
info = {};
g.setGraph(info);
dag.nodes().forEach(n => g.setNode(n.id, n));
dag.links().forEach(l => g.setEdge(l.source.id, l.target.id, l));
... | Fix another bug in dagre | Fix another bug in dagre
| JavaScript | mit | erikbrinkman/d3-dag,erikbrinkman/d3-dag |
9a78202e64fc4230885b4dba43061e7ea9106ab4 | test/lint-verify-fail.js | test/lint-verify-fail.js | "use strict";
const test = require("ava");
const childProcess = require("child_process");
const fs = require("fs");
const path = require("path");
const ruleFiles = fs
.readdirSync(".")
.filter(name => !name.startsWith(".") && name.endsWith(".js"));
test("test-lint/ causes errors without eslint-config-prettier", ... | "use strict";
const test = require("ava");
const childProcess = require("child_process");
const fs = require("fs");
const path = require("path");
const ruleFiles = fs
.readdirSync(".")
.filter(name => !name.startsWith(".") && name.endsWith(".js"));
test("test-lint/ causes errors without eslint-config-prettier", ... | Make failing test-lint/ tests easier to understand | Make failing test-lint/ tests easier to understand
| JavaScript | mit | lydell/eslint-config-prettier |
ab63aa700a31af82e47c8d4958fa5ab6b3bc4474 | src/NonASCIIStringSnapshotSerializer.js | src/NonASCIIStringSnapshotSerializer.js | /**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @emails oncall+ads_integration_management
* @flow strict-local
* @format
*/
'use strict';
const MAX_ASCII_CHARACTER = 127;
/**
* Serializes strings with non-ASCII characters to their Unicode escape
* sequences (eg. \u2022), to avoid hitting this... | /**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @emails oncall+ads_integration_management
* @flow strict-local
* @format
*/
'use strict';
const MAX_ASCII_CHARACTER = 127;
/**
* Serializes strings with non-ASCII characters to their Unicode escape
* sequences (eg. \u2022), to avoid hitting this... | Format JavaScript files with Prettier: scripts/draft-js/__github__/src | Format JavaScript files with Prettier: scripts/draft-js/__github__/src
Differential Revision: D32201648
fbshipit-source-id: f94342845cbe6454bb7ae4f02814e788fb25de9f
| JavaScript | mit | facebook/draft-js |
259a882114def098b30101aefdcc67366b067aab | src/config.js | src/config.js | module.exports = function(data) {
/**
* Read in config file and tidy up data
* Prefer application to require minimum config as possible
*/
var config = require('../config.' + environment + '.js');
if (!config.server) config.server = {
port: 3000
}
if (!config.app) config.app = {}
if (!config.cook... | module.exports = function(data) {
/**
* Read in config file and tidy up data
* Prefer application to require minimum config as possible
*/
var config = require('../config.' + environment + '.js');
if (!config.server) config.server = {
port: 3000
}
if (!config.app) config.app = {}
if (!config.cook... | Set default cookie secret value | Set default cookie secret value
| JavaScript | apache-2.0 | pinittome/pinitto.me,pinittome/pinitto.me,pinittome/pinitto.me |
26ba50793f316564c6ce0f00e131ccc8b668989a | src/router.js | src/router.js | var controllers = require('./controllers');
var mid = require('./middleware');
var router = function(app) {
app.get('/login', mid.requiresSecure, mid.requiresLogout, controllers.Account.loginPage);
app.get('/signup', mid.requiresSecure, mid.requiresLogout, controllers.Account.signupPage);
app.get('/logout', mid.... | var controllers = require('./controllers');
var mid = require('./middleware');
var router = function(app) {
app.get('/login', mid.requiresSecure, mid.requiresLogout, controllers.Account.loginPage);
app.get('/signup', mid.requiresSecure, mid.requiresLogout, controllers.Account.signupPage);
app.get('/logout', mid.... | Add secure requirement to root page. | Add secure requirement to root page.
| JavaScript | apache-2.0 | cognettings/nefarious-octo-prune,cognettings/nefarious-octo-prune |
e729d8327a402d403130f005dbb1d54b07a93434 | frontend/detail_pane/DetailPaneSection.js | frontend/detail_pane/DetailPaneSection.js | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/... | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/... | Remove extra blank line for consistency | Remove extra blank line for consistency
| JavaScript | bsd-3-clause | jhen0409/react-devtools,woowe/react-dev-tools,aolesky/react-devtools,aadsm/react-devtools,hedgerwang/react-devtools,jhen0409/react-devtools,aadsm/react-devtools,keyanzhang/react-devtools,hedgerwang/react-devtools,keyanzhang/react-devtools,woowe/react-dev-tools,aadsm/react-devtools,hedgerwang/react-devtools,aolesky/reac... |
d0e488c8c8da1ed827c5c51382c99c2b25f6819a | addon/utils/init-measure-label.js | addon/utils/init-measure-label.js | import MapLabel from './map-label';
import featureCenter from './feature-center';
import getMeasurement from './get-measurement';
export default function initMeasureLabel(result, map) {
if (!result) {
return;
}
if (result.mode === 'measure') {
let center = featureCenter(result.feature);
let measurem... | import MapLabel from './map-label';
import featureCenter from './feature-center';
import getMeasurement from './get-measurement';
export default function initMeasureLabel(result, map) {
if (!result) {
return;
}
if (result.mode === 'measure') {
let center = featureCenter(result.feature);
let measurem... | Fix measurement label not showing on first load | Fix measurement label not showing on first load
After importing the label didn't show up because `defaultLabel` option was removed
| JavaScript | mit | knownasilya/google-maps-markup,knownasilya/google-maps-markup |
b88680fdb87dfd4975dbd568a7ac253315354935 | express-res-links.js | express-res-links.js | import {stringify as stringifyLinks} from 'http-header-link'
export default function (req, res, next) {
res.links = function links (linkObj, lang = false) {
let val = this.get('Link') || ''
lang = lang || this.get('Content-Language') || linkObj.defaultLang
const newLinks = stringifyLinks(linkObj, lang)
... | import {stringify as stringifyLinks} from 'http-header-link'
export default function (req, res, next) {
res.links = function links (linkObj, lang = false) {
if (typeof linkObj !== 'object') {
throw new Error('res.links expects linkObj to be an object')
}
let val = this.get('Link') || ''
lang =... | Enforce arg0 being an object | Enforce arg0 being an object
| JavaScript | mit | ileri/express-res-links |
05e26d001bc0c577472c7284dccafd0d3526408a | ui.apps/src/main/webpack/bundles/components.js | ui.apps/src/main/webpack/bundles/components.js | // https://webpack.js.org/guides/dependency-management/#require-context
const cache = {};
function importAll(r) {
r.keys().forEach((key) => {
return cache[key] = r(key);
});
}
// Include all files named "index.js" in a "webpack.modules/" folder.
importAll(require.context('./../../content/jcr_root/', t... | /**
* Uncomment the following line to include Babel's polyfill.
* Note that this increases the size of the bundled JavaScript file.
* So be smart about when and where to include the polyfill.
*/
// import 'babel-polyfill';
// https://webpack.js.org/guides/dependency-management/#require-context
const cache = {};
f... | Add note about Babel Polyfill | Add note about Babel Polyfill
| JavaScript | mit | infielddigital/aem-webpack-example,infielddigital/aem-webpack-example |
3f8e0dd1bb6261f7991790d78f3c20b9df9a2ace | tasks/jscs.js | tasks/jscs.js | "use strict";
var Vow = require( "vow" );
module.exports = function( grunt ) {
var filter = Array.prototype.filter,
JSCS = require( "./lib/jscs" ).init( grunt );
grunt.registerMultiTask( "jscs", "JavaScript Code Style checker", function() {
var done = this.async(),
options = this... | "use strict";
var Vow = require( "vow" );
module.exports = function( grunt ) {
var filter = Array.prototype.filter,
JSCS = require( "./lib/jscs" ).init( grunt );
grunt.registerMultiTask( "jscs", "JavaScript Code Style checker", function() {
var done = this.async(),
options = this... | Add comment for null as default value | Add comment for null as default value
| JavaScript | mit | jscs-dev/grunt-jscs,BridgeAR/grunt-jscs |
552ba28555855f44ad37c274db40986c8ee41e45 | redux/src/main/renderer/components/Editor.js | redux/src/main/renderer/components/Editor.js | import React, {Component} from 'react'
import {keyStringDetector} from '../registories/registory'
export default class Editor extends Component {
constructor(props) {
super(props);
this.state = {text: ''};
}
getRestTextLength() {
return 140 - this.state.text.length;
}
onT... | import React, {Component} from 'react'
import {keyStringDetector} from '../registories/registory'
export default class Editor extends Component {
constructor(props) {
super(props);
this.state = this.initialState();
}
initialState() {
return {text: ''};
}
getRestTextLength... | Clear textarea after posting tweet | Clear textarea after posting tweet
| JavaScript | mit | wozaki/twitter-js-apps,wozaki/twitter-js-apps |
d2eb3ebfb3e82d1fc86b867fed795b97a692c5cd | app/assets/javascripts/application/specialist_guide_pagination.js | app/assets/javascripts/application/specialist_guide_pagination.js | $(function() {
var container = $(".specialistguide .govspeak");
var navigation = $(".specialistguide #document_sections");
container.splitIntoPages("h2");
pages = container.find(".page");
pages.hide();
var showDefaultPage = function() {
pages.first().show();
}
var showPage = function(hash) {
... | $(function() {
var container = $(".specialistguide .govspeak");
var navigation = $(".specialistguide #document_sections");
container.splitIntoPages("h2");
pages = container.find(".page");
pages.hide();
var showPage = function() {
var heading = $(location.hash);
if (heading.length == 0) {
pa... | Simplify and strengthen specialist guide hide/display page ccode. | Simplify and strengthen specialist guide hide/display page ccode.
If the page for the hash can't be found, the first page is shown,
preventing js errors if people hack in different hashes (or click on
old links)
| JavaScript | mit | hotvulcan/whitehall,ggoral/whitehall,ggoral/whitehall,robinwhittleton/whitehall,alphagov/whitehall,hotvulcan/whitehall,alphagov/whitehall,ggoral/whitehall,YOTOV-LIMITED/whitehall,askl56/whitehall,YOTOV-LIMITED/whitehall,robinwhittleton/whitehall,askl56/whitehall,robinwhittleton/whitehall,askl56/whitehall,hotvulcan/whit... |
813fede79c31161c54edea2fd706de79ba9c9769 | src/api/properties/array.js | src/api/properties/array.js | const { parse, stringify } = window.JSON;
export default {
coerce (val) {
return Array.isArray(val) ? val : [val];
},
default () {
return [];
},
deserialize (val) {
return parse(val);
},
serialize (val) {
return stringify(val);
}
};
| export default {
coerce: val => Array.isArray(val) ? val : [val],
default: () => [],
deserialize: JSON.parse,
serialize: JSON.stringify
};
| Make code a bit more concise. | Make code a bit more concise.
| JavaScript | mit | skatejs/skatejs,chrisdarroch/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs |
8bf0cb0069d886b8afe6dc52a31b806496568253 | public/theme/portalshit/script.js | public/theme/portalshit/script.js | (function() {
var target = $('.archives li').slice(7);
target.each(function() {
$(this).css("display", "none");
})
$('#show_more_archive_list').click(function() {
target.each(function() {
$(this).slideDown();
})
$(this).hide();
$('#show_less_archive_list').show();
})
$('#show_le... | (function() {
var target = $('.archives li').slice(7);
target.each(function() {
$(this).css("display", "none");
})
$('#show_more_archive_list').click(function() {
target.each(function() {
$(this).slideDown();
})
$(this).hide();
$('#show_less_archive_list').show();
})
$('#show_le... | Revert "Resize only when UA matches iPad" | Revert "Resize only when UA matches iPad"
This reverts commit d5260394049c993a4f4ddcea3cbe694212c36f38.
| JavaScript | mit | morygonzalez/portalshit.net,morygonzalez/portalshit.net,morygonzalez/portalshit.net,morygonzalez/portalshit.net |
d8dac75e6bbbdecfb3ca6f37326dfc35de28da8c | lib/insert.js | lib/insert.js | 'use strict'
module.exports = function insertInit (showErrors, showStdout) {
var callback
if (showErrors && showStdout) {
callback = function (e, result) {
if (e) {
console.error(e)
return
}
console.log(JSON.stringify(result.ops[0]))
}
} else if (showErrors && !showStdo... | 'use strict'
module.exports = function insertInit (showErrors, showStdout) {
var callback
if (showErrors && showStdout) {
callback = function (e, result) {
if (e) {
console.error(e)
return
}
process.stdout.write(JSON.stringify(result.ops[0]) + '\n')
}
} else if (showErr... | Replace console.log to process.stdout to write without formatting | Replace console.log to process.stdout to write without formatting
| JavaScript | mit | ViktorKonsta/pino-mongodb |
a2c6b35869dd5b9b9bd918f076756bad55d9901c | app/js/arethusa.relation/directives/nested_menu.js | app/js/arethusa.relation/directives/nested_menu.js | "use strict";
angular.module('arethusa.relation').directive('nestedMenu', [
'$compile',
'relation',
function($compile, relation) {
return {
restrict: 'A',
scope: {
relObj: '=',
labelObj: '=',
label: '=',
property: '=',
ancestors: '='
},
link: fu... | "use strict";
angular.module('arethusa.relation').directive('nestedMenu', [
'$compile',
'relation',
function($compile, relation) {
return {
restrict: 'A',
scope: {
relObj: '=',
labelObj: '=',
label: '=',
property: '=',
ancestors: '='
},
link: fu... | Add a nested class for nested menus | Add a nested class for nested menus
| JavaScript | mit | Masoumeh/arethusa,PonteIneptique/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,latin-language-toolkit/arethusa,Masoumeh/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,alpheios-project/arethusa |
645cd395a670abc82b4ca2312899ded66e80d2eb | app/mixins/handles-validation-errors-for-inputs.js | app/mixins/handles-validation-errors-for-inputs.js | import Ember from 'ember';
export default Ember.Mixin.create({
errors: [],
showError: false,
syncErrors: function () {
if (this.get('isDestroyed')) return;
this.set('errors', this.get('parentModel.errors.' + this.get('name')));
},
observeErrors: function () {
if (!this.get('parentModel')) retu... | import Ember from 'ember';
export default Ember.Mixin.create({
errors: [],
showError: false,
syncErrors: function () {
if (this.get('isDestroyed')) return;
this.set('errors', this.get('parentModel.errors.' + this.get('name')));
},
observeErrors: function () {
if (!this.get('parentModel')) retu... | Return created PaymentMethod when user's 401's in /your-account/billing | Return created PaymentMethod when user's 401's in /your-account/billing
| JavaScript | mit | dollarshaveclub/ember-uni-form,dollarshaveclub/ember-uni-form |
2c7ae72aba286d62526643326e71a942965cee60 | app/js/filters/dotToDash.js | app/js/filters/dotToDash.js | 'use strict';
angular.module('gisto.filter.dotToDash', []).filter('dotToDash', function () {
return function (input) {
return input.replace('.','-');
};
}); | 'use strict';
angular.module('gisto.filter.dotToDash', []).filter('dotToDash', function () {
return function (input) {
var output = input;
if(input.charAt(0) === '.') {
output = input.substr(1);
}
return output.replace('.','-');
};
}); | FIX (dotfiles in gist): fix links of dotfiles | FIX (dotfiles in gist): fix links of dotfiles
- fix links of dotfiles not handled correctly by "dotToDash" custom filter
| JavaScript | mit | Gisto/Gisto,Gisto/Gisto,Gisto/Gisto,shmool/Gisto,shmool/Gisto,shmool/Gisto,Gisto/Gisto |
40db9627f80e15aadc231fc3c4ad73fd4afff028 | scripts/command-line-utilities.js | scripts/command-line-utilities.js | /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
/* eslint-disable no-console, global-require */
import path from 'path';
const exec = ({
command,
isExecuted = true,
message,
dir = '.',
rootPath,
verbose = true... | /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
/* eslint-disable no-console, global-require */
import path from 'path';
const exec = ({
command,
message,
dir = '.',
rootPath,
verbose = true
}, callback) => {
... | Remove isExecuted from CLI utils | Remove isExecuted from CLI utils
| JavaScript | bsd-3-clause | salesforce/design-system-react,salesforce/design-system-react,salesforce/design-system-react |
431c9354ae176f0ab2020776145e85bef2dfcd58 | app/assets/javascripts/refresh.js | app/assets/javascripts/refresh.js | function refresh () {
$(".refresh-link").on("click", function(event) {
event.preventDefault();
var $target = $(event.target);
var url = $target.attr("href");
var id = url.match(/(\d+)(?!.*\d)/)[0].toString();
var dateTimeIn24Hours = new Date();
var $dateSpan = $(".data" + id);
var $timeRem... | function refresh () {
$(".refresh-link").on("click", function(event) {
event.preventDefault();
var $target = $(event.target);
var url = $target.attr("href");
var id = url.match(/(\d+)(?!.*\d)/)[0].toString();
var dateTimeIn24Hours = new Date();
var $dateSpan = $(".data" + id);
var $timeRem... | Add conditional to check if chain is currently broken or active | Add conditional to check if chain is currently broken or active
| JavaScript | mit | costolo/chain,costolo/chain,costolo/chain |
f711b8d6d6154d8bec444c7ba4d0a2f1ac6387ed | cronjobs.js | cronjobs.js | #!/bin/env node
module.exports = function()
{
var scope = this;
this.CronJob = require('cron').CronJob;
this.NewReleases = require(__dirname + '/newreleases');
this.User = require(__dirname + '/db/user');
this.jobs = [];
this.init = function()
{
// TODO: select distinct crontime and timezone from database u... | #!/bin/env node
module.exports = function()
{
var scope = this;
this.CronJob = require('cron').CronJob;
this.NewReleases = require(__dirname + '/newreleases');
this.User = require(__dirname + '/db/user');
this.jobs = [];
this.init = function()
{
// TODO: select distinct crontime and timezone from database u... | Set default to once a day for now | Set default to once a day for now
| JavaScript | mit | HalleyInteractive/new-release-notifier,HalleyInteractive/new-release-notifier |
1c9dd302192c8842ffd760e8e1689b602b4350c4 | examples/simple/webpack.config.js | examples/simple/webpack.config.js | var path = require( 'path' );
var webpack = require( 'webpack' );
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./index.jsx'
],
output: {
path: path.join( __dirname, 'dist' ),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webp... | var path = require( 'path' );
var webpack = require( 'webpack' );
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./index.jsx'
],
output: {
path: path.join( __dirname, 'dist' ),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webp... | Add .jsx to resolver for webpack. | Add .jsx to resolver for webpack.
| JavaScript | mit | coderkevin/redux-trigger |
cd9c75960c99ece71cadd691eb0297850e623a47 | spec/javascripts/behaviors/autosize_spec.js | spec/javascripts/behaviors/autosize_spec.js | /* eslint-disable space-before-function-paren, no-var, comma-dangle, no-return-assign, max-len */
import '~/behaviors/autosize';
(function() {
describe('Autosize behavior', function() {
var load;
beforeEach(function() {
return setFixtures('<textarea class="js-autosize" style="resize: vertical"></texta... | import '~/behaviors/autosize';
function load() {
$(document).trigger('load');
}
describe('Autosize behavior', () => {
beforeEach(() => {
setFixtures('<textarea class="js-autosize" style="resize: vertical"></textarea>');
});
it('does not overwrite the resize property', () => {
load();
expect($('te... | Remove iife and eslint disable | Remove iife and eslint disable
| JavaScript | mit | mmkassem/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,iiet/iiet-git,dreampet/gitlab,axilleas/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,axilleas/gitlabhq,dreampet/gi... |
d468959a91e3f4bd83ac8ca73b8ee698483bb03b | lib/logMiddleware.js | lib/logMiddleware.js | 'use strict'
const morgan = require('morgan')
// This adds a very simple log message for each request. Morgan is a package
// from express to do this, and we use tiny so we don't record any user
// information to logs in production.
//
// TODO: Add a different log format for dev & staging that provides more
// inform... | 'use strict'
const morgan = require('morgan')
// This adds a very simple log message for each request. Morgan is a package
// from express to do this, and we use tiny so we don't record any user
// information to logs in production.
//
// TODO: Add a different log format for dev & staging that provides more
// inform... | Add datetime to log format | Add datetime to log format
| JavaScript | mit | firstlookmedia/react-scripts,firstlookmedia/react-scripts |
b78b249b6650c7381d234cb0a737dab408979e59 | src/main/webapp/components/utils/getFields.js | src/main/webapp/components/utils/getFields.js | import {getField} from "./getField";
/**
* Creates a new object whose fields are either equal to obj[field] or defaultValue.
* Useful for extracting a subset of fields from an object.
*
* @param obj the object to query the fields for.
* @param fields an array of the target fields, in string form.
* @param... | import {getField} from "./getField";
/**
* Creates a new object whose fields are either equal to obj[field] or defaultValue.
* Useful for extracting a subset of fields from an object.
*
* @param obj the object to query the fields for.
* @param fields an array of the target fields, in string form.
* @param... | Delete Space from empty Object | Delete Space from empty Object | JavaScript | apache-2.0 | googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020 |
990f5face2b6eab527e91e98e6d20227c1673479 | app/js/models/user/User.Module.js | app/js/models/user/User.Module.js | var _ = require('underscore');
var Mosaic = require('mosaic-commons');
var App = require('mosaic-core').App;
var Api = App.Api;
var Teleport = require('mosaic-teleport');
/** This module manages resource statistics. */
module.exports = Api.extend({
/**
* Initializes internal fields.
*/
_initFields :... | var _ = require('underscore');
var Mosaic = require('mosaic-commons');
var App = require('mosaic-core').App;
var Api = App.Api;
var Teleport = require('mosaic-teleport');
/** This module manages resource statistics. */
module.exports = Api.extend({
/**
* Initializes internal fields.
*/
_initFields :... | Add notifications for changes in the user module | Add notifications for changes in the user module | JavaScript | mit | ubimix/techonmap-v2,ubimix/techonmap-v2,ubimix/techonmap-v2 |
a90e96f14501c734d425dbed86ddb0e1b80b75f1 | client/app/components/organization/organization.js | client/app/components/organization/organization.js | import angular from 'angular';
import uiRouter from 'angular-ui-router';
import organizationComponent from './organization.component';
import organizationDetail from './organizationDetail/organizationDetail';
require('angular-ui-grid/ui-grid.css');
//require('angular-datatables/dist/plugins/columnfilter/angular-data... | import angular from 'angular';
import uiRouter from 'angular-ui-router';
import organizationComponent from './organization.component';
import organizationDetail from './organizationDetail/organizationDetail';
require('angular-ui-grid/ui-grid.css');
//require('angular-datatables/dist/plugins/columnfilter/angular-data... | Make org a dev function for now | Make org a dev function for now
| JavaScript | agpl-3.0 | neteoc/neteoc-ui,neteoc/neteoc-ui,neteoc/neteoc-ui |
20d9f937eec0d0e751a6d52098c3cb90d63e6cd1 | test/index.js | test/index.js | import glob from 'glob';
import cssHook from 'css-modules-require-hook';
cssHook({generateScopedName: '[name]__[local]'});
glob.sync('**/*-test.js', {realpath: true, cwd: __dirname}).forEach(require);
| require('css-modules-require-hook')({
generateScopedName: '[name]__[local]'
});
require('glob')
.sync('**/*-test.js', {
realpath: true,
cwd: require('path').resolve(process.cwd(), 'test')
})
.forEach(require);
| Use ES5 for test endpoint so there is no need for babel transform | Use ES5 for test endpoint so there is no need for babel transform
| JavaScript | mit | nkbt/react-component-template |
756c25f989fd2e0cbbe4f1ead2d8c34557fc15be | app/scripts/services/plan-customers-service.js | app/scripts/services/plan-customers-service.js | 'use strict';
(function() {
angular.module('ncsaas')
.service('planCustomersService', ['baseServiceClass', planCustomersService]);
function planCustomersService(baseServiceClass) {
/*jshint validthis: true */
var ServiceClass = baseServiceClass.extend({
init:function() {
this._super();
... | 'use strict';
(function() {
angular.module('ncsaas')
.service('planCustomersService', ['baseServiceClass', planCustomersService]);
function planCustomersService(baseServiceClass) {
/*jshint validthis: true */
var ServiceClass = baseServiceClass.extend({
init:function() {
this._super();
... | Add new line to end of file (saas-265) | Add new line to end of file (saas-265)
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport |
bee278faa8706fe7ebdf36a6cc48801cf0ea86b9 | test/index.js | test/index.js | 'use strict';
module.exports = function (t, a, d) {
var invoked;
a(t(function () {
a(arguments.length, 0, "Arguments");
invoked = true;
}), undefined, "Return");
a(invoked, undefined, "Is not run immediately");
setTimeout(function () {
a(invoked, true, "Run in next tick");
d();
}, 10);
};
| 'use strict';
module.exports = function (t, a, d) {
var invoked;
a(t(function () {
a(arguments.length, 0, "Arguments");
invoked = true;
}), undefined, "Return");
a(invoked, undefined, "Is not run immediately");
setTimeout(function () {
a(invoked, true, "Run in next tick");
invoked = [];
t(function () {... | Add tests for serial calls | Add tests for serial calls
| JavaScript | isc | medikoo/next-tick |
29f392e54a4de685118228b21c6d1312e58b9d66 | test/index.js | test/index.js | var caps = require('../');
var test = require('tape');
test('works', function(t) {
var TEST_ARRAY = [
['kitten', 0.0],
['Kitten', 1 / 6.0],
['KItten', 1 / 3.0],
['KITten', 0.5],
['KITTen', 2 / 3.0],
['KITTEn', 5 / 6.0],
['KITTEN', 1.0],
['kittens ARE COOL', 7 / 16.0]
];
t.plan(TE... | var caps = require('../');
var test = require('tape');
test('works', function(t) {
var TEST_ARRAY = [
['kitten', 0.0],
['Kitten', 1 / 6.0],
['KItten', 1 / 3.0],
['KITten', 0.5],
['KITTen', 2 / 3.0],
['KITTEn', 5 / 6.0],
['KITTEN', 1.0],
['kittens ARE COOL', 7 / 16.0],
['kitteñ', 0... | Add tests for accented characters | Add tests for accented characters
| JavaScript | mit | nwitch/caps-rate |
5ce9c69881ea46aa6b2aa98d6d61e14fe4949f95 | script.js | script.js | var html = document.getElementById("html");
var render = document.getElementById("render");
var toggle = document.getElementById("toggle");
var error = document.getElementById("error");
var code = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: "javascript"
});
function update() {
try {
var e... | var html = document.getElementById("html");
var render = document.getElementById("render");
var toggle = document.getElementById("toggle");
var error = document.getElementById("error");
var code = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: "javascript"
});
function update() {
try {
var e... | Use textContent instead of innerText | Use textContent instead of innerText
| JavaScript | mit | nucular/xmgen,nucular/xmgen |
760268958b0cf37feb87e09876ee8da0333dc00a | lib/runner.js | lib/runner.js | /*global phantom*/
'use strict';
var system = require('system');
var webpage = require('webpage');
var page = webpage.create();
var errd = false;
var timeout = null;
var signal = '[E_PHANTOMIC] ';
var url = 'http://localhost:' + system.env.PHANTOMIC_PORT;
var debug = system.env.PHANTOMIC_DEBUG;
var last... | /*global phantom*/
'use strict';
var system = require('system');
var webpage = require('webpage');
var page = webpage.create();
var errd = false;
var timeout = null;
var signal = '[E_PHANTOMIC] ';
var url = 'http://localhost:' + system.env.PHANTOMIC_PORT;
var debug = system.env.PHANTOMIC_DEBUG;
var last... | Use phantom.debugExit(code) to exit in debug mode | Use phantom.debugExit(code) to exit in debug mode
| JavaScript | mit | mantoni/phantomic,mantoni/phantomic,mantoni/phantomic |
7098ecba8c91c0851fbd070a1798bd2562c4f264 | test/index.js | test/index.js | import test from 'ava';
import removeTrailingSeparator from '..';
test('strip trailing separator:', t => {
t.is(removeTrailingSeparator('foo/'), 'foo');
t.is(removeTrailingSeparator('foo\\'), 'foo');
});
test('don\'t strip when it\'s the only char in the string', async t => {
t.is(removeTrailingSeparator('/'), '/'... | import test from 'ava';
import removeTrailingSeparator from '..';
test('strip trailing separator:', t => {
t.is(removeTrailingSeparator('foo/'), 'foo');
t.is(removeTrailingSeparator('foo\\'), 'foo');
});
test('don\'t strip when it\'s the only char in the string', t => {
t.is(removeTrailingSeparator('/'), '/');
t.... | Use normal function for normal test | Use normal function for normal test
| JavaScript | isc | darsain/remove-trailing-separator |
c6ab3077925eb574062b1b9815bed6c954ab3cb6 | lib/server.js | lib/server.js | const express = require('express')
const fs = require('fs')
const http = require('http')
const https = require('https')
const path = require('path')
function startHttpServer(app, port) {
const httpServer = http.Server(app)
httpServer.listen(port, () => console.log(`Listening on HTTP port *:${port}`))
}
function s... | const express = require('express')
const fs = require('fs')
const http = require('http')
const https = require('https')
const path = require('path')
function startHttpServer(app, port) {
const httpServer = http.Server(app)
httpServer.listen(port, () => console.log(`Listening on HTTP port *:${port}`))
}
function s... | Send 404 errors as JSON to keep NPM happy | Send 404 errors as JSON to keep NPM happy | JavaScript | mit | heikkipora/registry-sync,heikkipora/registry-sync,heikkipora/registry-sync |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.