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 |
|---|---|---|---|---|---|---|---|---|---|
f95cf530a32f0637536e606d864139d0cde80372 | test/compressJavaScript-test.js | test/compressJavaScript-test.js | var vows = require('vows'),
assert = require('assert'),
AssetGraph = require('../lib/AssetGraph');
vows.describe('transforms.compressJavaScript').addBatch(function () {
var test = {};
[undefined, 'uglifyJs', 'yuicompressor', 'closurecompiler'].forEach(function (compressorName) {
test[String(com... | var vows = require('vows'),
assert = require('assert'),
AssetGraph = require('../lib/AssetGraph');
vows.describe('transforms.compressJavaScript').addBatch(function () {
var test = {};
// The YUICompressor and ClosureCompiler tests fail intermittently on Travis
[undefined, 'uglifyJs'/*, 'yuicompress... | Disable the YUICompressor and closure compiler tests | Disable the YUICompressor and closure compiler tests
They're annoying because the fail on Travis half of the time. | JavaScript | bsd-3-clause | jscinoz/assetgraph,jscinoz/assetgraph,papandreou/assetgraph,papandreou/assetgraph,assetgraph/assetgraph,jscinoz/assetgraph,papandreou/assetgraph |
801e990ae4b3433ab1800bbdfd6d8c9921fc2029 | controllers/api.js | controllers/api.js | 'use strict';
/**
* GET /api/challenges
* List of challenges.
*/
exports.getChallenges = function getChallenges(req, res) {
res.json({ challenges: [] });
};
/**
* POST /api/challenges
* Create new challenges.
*/
exports.postChallenges = function postChallenges(req, res) {
res.status(201).send("Created n... | 'use strict';
/**
* GET /api/challenges
* List of challenges.
*/
exports.getChallenges = function get(req, res) {
res.json({ challenges: [] });
};
/**
* POST /api/challenges/:challengeId
* Created a new challenge.
*/
exports.postChallenge = function post(req, res) {
res.status(201).send("Created new challenge... | Update API controller with team and challenge routes | Update API controller with team and challenge routes
| JavaScript | mit | lostatseajoshua/Challenger |
015f87577e6296419fcf3747629cf095681a2e8f | app/javascript/app/components/compare/compare-ndc-content-overview/compare-ndc-content-overview-selectors.js | app/javascript/app/components/compare/compare-ndc-content-overview/compare-ndc-content-overview-selectors.js | import { createSelector } from 'reselect';
import isEmpty from 'lodash/isEmpty';
import {
parseSelectedLocations,
getSelectedLocationsFilter,
addSelectedNameToLocations
} from 'selectors/compare';
// values from search
const getSelectedLocations = state => state.selectedLocations || null;
const getContentOvervie... | import { createSelector } from 'reselect';
import isEmpty from 'lodash/isEmpty';
import {
parseSelectedLocations,
getSelectedLocationsFilter,
addSelectedNameToLocations
} from 'selectors/compare';
// values from search
const getSelectedLocations = state => state.selectedLocations || null;
const getContentOvervie... | Fix crashing bug: Compare Libya | Fix crashing bug: Compare Libya
| JavaScript | mit | Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch |
c554a2b89f64b9f522a16d3080d8c81990b09d82 | app.js | app.js | /**
* App Dependencies.
*/
var loopback = require('loopback')
, app = module.exports = loopback()
, fs = require('fs')
, path = require('path')
, request = require('request')
, TaskEmitter = require('sl-task-emitter');
// expose a rest api
app.use(loopback.rest());
// Add static files
app.use(loopback.st... | /**
* App Dependencies.
*/
var loopback = require('loopback')
, app = module.exports = loopback()
, fs = require('fs')
, path = require('path')
, request = require('request')
, TaskEmitter = require('sl-task-emitter');
// expose a rest api
app.use(loopback.rest());
// Add static files
app.use(loopback.st... | Make it working directory independent | Make it working directory independent
| JavaScript | mit | strongloop-bluemix/loopback-example-app,svennam92/loopback-example-app,hacksparrow/loopback-example-app,sam-github/sls-sample-app,jewelsjacobs/loopback-example-app,jewelsjacobs/loopback-example-app,rvennam/loopback-example-app,svennam92/loopback-example-app,rvennam/loopback-example-app,Joddsson/loopback-example-app,rve... |
6a1d280e8a0f576b4129b7fe5ca71ba93a1095b6 | components/Fork.js | components/Fork.js | import React from 'react'
import { makeStyles } from '@material-ui/core/styles'
import Fab from '@material-ui/core/Fab'
import Badge from '@material-ui/core/Badge'
const useStyles = makeStyles(() => ({
fork: {
position: 'absolute',
right: 30,
top: 30
}
}))
const Fork = ({ stars }) => {
const classes = useSty... | import React from 'react'
import { makeStyles } from '@material-ui/core/styles'
import Fab from '@material-ui/core/Fab'
import Badge from '@material-ui/core/Badge'
const useStyles = makeStyles(() => ({
fork: {
position: 'absolute',
right: 30,
top: 30
}
}))
const Fork = ({ stars }) => {
const classes = useSty... | Add rel on fork link | Add rel on fork link
| JavaScript | mit | ooade/NextSimpleStarter |
2d94f56750717d4a6479b8eed940b103b53a0f61 | rollup.config.js | rollup.config.js | import sourcemaps from 'rollup-plugin-sourcemaps';
export const globals = {
// Apollo
'apollo-client': 'apollo.core',
'apollo-link': 'apolloLink.core',
'apollo-link-batch': 'apolloLink.batch',
'apollo-utilities': 'apollo.utilities',
'zen-observable-ts': 'apolloLink.zenObservable',
//GraphQL
'graphql/l... | import sourcemaps from 'rollup-plugin-sourcemaps';
export const globals = {
// Apollo
'apollo-client': 'apollo.core',
'apollo-link': 'apolloLink.core',
'apollo-link-batch': 'apolloLink.batch',
'apollo-utilities': 'apollo.utilities',
'apollo-link-http-common': 'apolloLink.utilities',
'zen-observable-ts': ... | Add missing global Rollup alias for apollo-link-http-common | Add missing global Rollup alias for apollo-link-http-common
This fixes #521, making it so that the apollo-link-http bundle resolves
apollo-link-http-common to global.apolloLink.utilities instead of
global.apolloLinkHttpCommon (which does not exist).
| JavaScript | mit | apollographql/apollo-link,apollographql/apollo-link |
b52476d5f5c59cc2f0d5df2270b4f35b86b166c0 | core/src/action.js | core/src/action.js | const elements = document.querySelectorAll('bracket-less');
function doAction(e) {
if (e.target.tagName !== 'BRACKET-LESS') return;
e.target.classList.toggle('bracket-less');
e.stopPropagation();
}
document.body.addEventListener('click', doAction);
function toggleCollapse(state) {
if (state.collapse) { // pl... | const elements = document.querySelectorAll('bracket-less');
function doAction(e) {
e.stopPropagation();
if (e.target.tagName !== 'BRACKET-LESS') return;
e.target.classList.toggle('bracket-less');
}
document.body.addEventListener('click', doAction);
function toggleCollapse(state) {
if (state.collapse) { // ... | Stop propogation in any case | Stop propogation in any case
| JavaScript | isc | mrv1k/bracketless,mrv1k/bracketless |
dd1fa20110373e12ac2b9a67ace0d6cf4dabea0c | pages/_document.js | pages/_document.js | import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import stylesheet from 'pages/styles.scss'
export default class MyDocument extends Document {
render () {
return (
<html>
<Head>
<meta charSet='utf-8' />
<meta name='viewport' content='wid... | import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import stylesheet from './styles.scss'
export default class MyDocument extends Document {
render () {
return (
<html>
<Head>
<meta charSet='utf-8' />
<meta name='viewport' content='width=d... | Move base style in the header | Move base style in the header
| JavaScript | mit | bmagic/acdh-client |
0b49d0bb7a4dc577c0664775f2c53d86c3c6f486 | greasemonkey-endomondo-design.user.js | greasemonkey-endomondo-design.user.js | // ==UserScript==
// @name Greasemonkey EndomondoDesign
// @namespace https://github.com/JanisE
// @include *www.endomondo.com/*
// @version 1
// @grant none
// ==/UserScript==
var css = document.createElement('style');
css.type = 'text/css';
css.innerHTML = ".feedItem-footer .eoAvatar-image {visibility: hidden} .eoFe... | // ==UserScript==
// @name Greasemonkey EndomondoDesign
// @namespace https://github.com/JanisE
// @description Project URL: https://github.com/JanisE/greasemonkey-endomondo-design
// @include *www.endomondo.com/*
// @version 1
// @grant none
// ==/UserScript==
var css = document.createElement('style');
css.type = 'te... | Add a back-reference to the repository. | Add a back-reference to the repository.
| JavaScript | mit | JanisE/greasemonkey-endomondo-design |
01526d30ab470b2872ac98f62d6a8712d78eddbc | tools/main-transpile-wrapper.js | tools/main-transpile-wrapper.js | // This file exists because it is the file in the tool that is not automatically
// transpiled by Babel
function babelRegister() {
require("meteor-babel/register")({
babelOptions: require("meteor-babel").getDefaultOptions(
require("./babel-features.js")
)
});
}
babelRegister(); // #RemoveInProd this... | // This file exists because it is the file in the tool that is not automatically
// transpiled by Babel
function babelRegister() {
require("meteor-babel/register")({
babelOptions: require("meteor-babel").getDefaultOptions(
require("./babel-features.js")
)
});
}
babelRegister(); // #RemoveInProd this... | Install ES2015 String polyfills in tool code, too. | Install ES2015 String polyfills in tool code, too.
| JavaScript | mit | cherbst/meteor,jeblister/meteor,kengchau/meteor,cherbst/meteor,deanius/meteor,karlito40/meteor,h200863057/meteor,Jonekee/meteor,guazipi/meteor,Puena/meteor,planet-training/meteor,deanius/meteor,namho102/meteor,chiefninew/meteor,TechplexEngineer/meteor,allanalexandre/meteor,baiyunping333/meteor,jeblister/meteor,katopz/m... |
76f211a93cba95050f5fcbcdada228f9e3c42936 | d3/test/spec/test_wgaPipeline.js | d3/test/spec/test_wgaPipeline.js | describe('The constructor is supposed a proper WgaPipeline object', function(){
it('Constructor wgaPipeline exists', function(){
expect(WgaPipeline).toBeDefined();
});
var svg = $('<svg></svg>');
var wga = new WgaPipeline(svg);
it('WgaPipelie object is not null', function(){
expect(wga).not.toBeNull();
});
i... | describe('The constructor is supposed a proper WgaPipeline object', function(){
it('Constructor wgaPipeline exists', function(){
expect(WgaPipeline).toBeDefined();
});
var svg = $('<svg></svg>');
var wga = new WgaPipeline(svg);
it('WgaPipelie object is not null', function(){
expect(wga).not.toBeNull();
});
i... | Test for functionality of setData method fails | Test for functionality of setData method fails
| JavaScript | mit | AliTVTeam/AliTV,BioInf-Wuerzburg/AliTV,AliTVTeam/AliTV,BioInf-Wuerzburg/AliTV,BioInf-Wuerzburg/AliTV,BioInf-Wuerzburg/AliTV,BioInf-Wuerzburg/AliTV,BioInf-Wuerzburg/AliTV |
4b956b5e7fb6206f17fdaf9f770afe6734827455 | packages/idyll-editor/src/renderer.js | packages/idyll-editor/src/renderer.js | const components = require('idyll-components');
const IdyllDocument = require('idyll-document');
const React = require('react');
class Renderer extends React.PureComponent {
render() {
const { idyllMarkup, ast, idyllHash } = this.props;
return (
<div className={"renderer"}>
<div className={"ren... | const components = require('idyll-components');
const IdyllDocument = require('../../idyll-document/src');
const React = require('react');
class Renderer extends React.PureComponent {
render() {
const { idyllMarkup, ast, idyllHash } = this.props;
return (
<div className={"renderer"}>
<div class... | Use relative path until published | Use relative path until published
| JavaScript | mit | idyll-lang/idyll,idyll-lang/idyll |
8b96e99cb55204088d239e2ec63e5af535068786 | server/routes.js | server/routes.js | var f = "MMM Do YYYY";
function calcWidth(name) {
return 250 + name.length * 6.305555555555555;
}
WebApp.connectHandlers.use("/package", function(request, response) {
if(request.url.split('/')[1] != ''){
var url = `https://atmospherejs.com/a/packages/findByNames\
?names=${request.url.split('/')[1]}`;
HTTP.get... | function calcWidth(name) {
return 250 + name.length * 6.305555555555555;
}
WebApp.connectHandlers.use("/package", function(request, response) {
if(request.url.split('/')[1] != ''){
var url = `https://atmospherejs.com/a/packages/findByNames\
?names=${request.url.split('/')[1]}`;
HTTP.get(url, {headers: {'Accept... | Fix undefined name and scope variables | Fix undefined name and scope variables
| JavaScript | mit | sungwoncho/meteor-icon,sungwoncho/meteor-icon |
fb3508a81f101d1c376deff610d7f93af5d426ba | ghpages/js/stationary-track.js | ghpages/js/stationary-track.js | var playlist = WaveformPlaylist.init({
samplesPerPixel: 3000,
mono: true,
waveHeight: 100,
container: document.getElementById("playlist"),
state: 'cursor',
waveOutlineColor: '#E0EFF1',
colors: {
waveOutlineColor: '#E0EFF1',
timeColor: 'grey',
fadeColor: 'black'
},
controls: {
sho... | var playlist = WaveformPlaylist.init({
samplesPerPixel: 3000,
zoomLevels: [500, 1000, 3000, 5000],
mono: true,
waveHeight: 100,
container: document.getElementById("playlist"),
state: 'cursor',
waveOutlineColor: '#E0EFF1',
colors: {
waveOutlineColor: '#E0EFF1',
timeColor: 'grey',
fadeCo... | Fix zoom levels for example. | Fix zoom levels for example.
| JavaScript | mit | naomiaro/waveform-playlist,naomiaro/waveform-playlist |
18b70b1dfc2e258215596e561cf37369fc467a9d | stories/Interactions.story.js | stories/Interactions.story.js | import React from 'react'
import {withInfo} from '@storybook/addon-info'
import {storiesOf} from '@storybook/react'
import Board from '../src'
const data = {
lanes: [
{
id: 'lane1',
title: 'Planned Tasks',
cards: [
{id: 'Card1', title: 'Card1', description: 'foo card', metadata: {id: '... | import React from 'react'
import {withInfo} from '@storybook/addon-info'
import {storiesOf} from '@storybook/react'
import Board from '../src'
const data = {
lanes: [
{
id: 'lane1',
title: 'Planned Tasks',
cards: [
{id: 'Card1', title: 'Card1', description: 'foo card', metadata: {id: '... | Allow laneId to be passed as param to onCardClick handler | fix: Allow laneId to be passed as param to onCardClick handler
https://github.com/rcdexta/react-trello/issues/34
| JavaScript | mit | rcdexta/react-trello,rcdexta/react-trello |
0605be68fa516a167f6519c238952a23e005bc4d | templates/app/routes/index.js | templates/app/routes/index.js | var path = require('path'),
fs = require('fs');
var routes = function (app) {
fs.readdirSync(__dirname).filter(function (file) {
return path.join(__dirname, file) != __filename;
}).forEach(function (file) {
require('./' + path.basename(file))(app);
});
}
module.exports = routes;
| var path = require('path'),
fs = require('fs');
var routes = function(app) {
fs.readdirSync(__dirname).filter(function(file) {
return path.join(__dirname, file) != __filename;
}).forEach(function(file) {
require('./' + path.basename(file))(app);
});
}
module.exports = routes;
| Indent by 4 spaces instead of 2 | Indent by 4 spaces instead of 2
| JavaScript | mit | saintedlama/bumm,saintedlama/bumm,the-diamond-dogs-group-oss/bumm |
bc1ab08e8f40fd8586cfb91e18e2c28868700a21 | src/configureRefreshFetch.js | src/configureRefreshFetch.js | // @flow
type Configuration = {
refreshToken: () => Promise<void>,
shouldRefreshToken: (error: any) => boolean,
fetch: (url: any, options: Object) => Promise<any>
}
function configureRefreshFetch (configuration: Configuration) {
const { refreshToken, shouldRefreshToken, fetch } = configuration
let refreshi... | // @flow
type Configuration = {
refreshToken: () => Promise<void>,
shouldRefreshToken: (error: any) => boolean,
fetch: (url: any, options: Object) => Promise<any>
}
function configureRefreshFetch (configuration: Configuration) {
const { refreshToken, shouldRefreshToken, fetch } = configuration
let refreshi... | Throw the right error from failing second request | Throw the right error from failing second request
Fixes #4. | JavaScript | mit | vlki/refresh-fetch |
871c29ed5273a08ca0f4a3413a62ac513c574974 | client/test/reducer.spec.js | client/test/reducer.spec.js | import React from 'react';
import { expect } from 'chai';
import { List as ImmutableList, Map } from 'immutable';
import reducer from '../src/reducer';
describe('reducer', () => {
it('should return the initial state', () => {
const actual = reducer(undefined, {});
const expected = ImmutableList.of();
ex... | import React from 'react';
import { expect } from 'chai';
import { List as ImmutableList, Map } from 'immutable';
import reducer from '../src/reducer';
describe('reducer', () => {
it('should return the initial state', () => {
const actual = reducer(undefined, {});
const expected = ImmutableList.of();
ex... | Add missing test for reducer action CLEAR_CUSTOMIZATION | Add missing test for reducer action CLEAR_CUSTOMIZATION
| JavaScript | mit | marlonbernardes/coding-stickers,marlonbernardes/coding-stickers |
1b5f10b9c975b8a055d830e8ac5e112dd059c7d5 | electron/index.js | electron/index.js | var menubar = require('menubar');
var ipc = require('ipc');
var shell = require('shell')
var mb = menubar({
dir: __dirname,
width: 280,
height: 87
});
mb.on('ready', function ready () {
require('../server');
})
ipc.on('browser', function browser (ev) {
shell.openExternal('http://localhost:3000')
})
i... | var menubar = require('menubar');
var ipc = require('ipc');
var shell = require('shell')
var mb = menubar({
dir: __dirname,
width: 280,
height: 87,
icon: __dirname + '/Icon.png'
});
mb.on('ready', function ready () {
require('../server');
})
ipc.on('browser', function browser (ev) {
shell.openExte... | Fix for updated default icon name | Fix for updated default icon name
| JavaScript | mit | origingod/lightning,karissa/lightning,lightning-viz/lightning,cournape/lightning,cournape/lightning,lightning-viz/lightning,origingod/lightning,karissa/lightning |
c8f91cf8b2d5b1d0c59e80b3c0fb9f25a49d935e | src/api/index.js | src/api/index.js | import moment from 'moment';
import { maxPages } from '../../data/config';
// Prevent webpack window problem
const isBrowser = () => typeof window !== 'undefined';
const isPage = () => (isBrowser() ? window.location.pathname.indexOf('page') === -1 : false);
const getCurrentPage = () => {
if (isBrowser() === true) ... | import moment from 'moment';
import { maxPages } from '../../data/config';
// Prevent webpack window problem
const isBrowser = () => typeof window !== 'undefined';
const isPage = () => (isBrowser() ? window.location.pathname.indexOf('page') === -1 : false);
const getCurrentPage = () => {
if (isBrowser() === true) ... | Fix date bug in moment.js | Fix date bug in moment.js
| JavaScript | mit | calpa/blog |
af9f12582e288bd2dc1a21a3075d706919b441b3 | examples/basic/components/App.js | examples/basic/components/App.js | const React = require('react');
const { Link } = require('react-router');
const { connect } = require('react-redux');
const { updatePath } = require('redux-simple-router');
function App({ updatePath, children }) {
return (
<div>
<header>
Links:
{' '}
<Link to="/">Home</Link>
... | const React = require('react');
const { Link } = require('react-router');
const { connect } = require('react-redux');
const { pushPath } = require('redux-simple-router');
function App({ pushPath, children }) {
return (
<div>
<header>
Links:
{' '}
<Link to="/">Home</Link>
{' ... | Migrate the basic example to the new API | Migrate the basic example to the new API
| JavaScript | mit | rackt/redux-simple-router,reactjs/react-router-redux |
8587e62d184bcc6f28988c6a25b4bbf227d85ed8 | src/diskdrive.js | src/diskdrive.js | var exec = require('child_process').exec;
var self = module.exports;
self.eject = function(id) {
// are we running on mac?
if (process.platform === 'darwin') {
// setup optional argument, on mac, will default to 1
id = (typeof id === 'undefined') ? 1 : id;
exec('drutil tray eject ' + id, function(err, stdout... | var exec = require('child_process').exec;
var self = module.exports;
/**
* Eject the specified disk drive.
* @param {int|string} id Locator for the disk drive.
* @param {Function} callback Optional callback for disk drive ejection completion / error.
*/
self.eject = function(id, callback) {
// are ... | Support for completion callback with error | Support for completion callback with error
| JavaScript | mit | brendanashworth/diskdrive |
cb2a18f55784f2b5ce0305d68dee0a4835430435 | tests/loaders/assets.spec.js | tests/loaders/assets.spec.js | /*!
* qwebs
* Copyright(c) 2016 Benoît Claveau
* MIT Licensed
*/
"use strict";
const Qwebs = require("../../lib/qwebs");
const AssetsLoader = require("../../lib/loaders/assets");
describe("assetsLoader", () => {
it("load", done => {
return Promise.resolve().then(() => {
let $qwebs = new Q... | /*!
* qwebs
* Copyright(c) 2016 Benoît Claveau
* MIT Licensed
*/
"use strict";
const Qwebs = require("../../lib/qwebs");
const AssetsLoader = require("../../lib/loaders/assets");
describe("assetsLoader", () => {
it("Load", done => {
return Promise.resolve().then(() => {
let $qwebs = new Q... | Test failed to read public folder | Test failed to read public folder | JavaScript | mit | BenoitClaveau/qwebs,beny78/qwebs,BenoitClaveau/qwebs,beny78/qwebs |
4cc9f1f6ede2f3d1b428e7422fd4767c50c5eab3 | src/githubApi.js | src/githubApi.js | define(["lib/reqwest", "lib/lodash", "lib/knockout", "githubEvent"],
function (reqwest, _, ko, GithubEvent) {
var githubApi = {};
var rootUrl = "https://api.github.com";
function getOrganisationMembers(orgName) {
return reqwest({
url: rootUrl + '/orgs/' + orgName + '/members',
... | define(["lib/reqwest", "lib/lodash", "lib/knockout", "githubEvent"],
function (reqwest, _, ko, GithubEvent) {
var githubApi = {};
var rootUrl = "https://api.github.com";
function getOrganisationMembers(orgName) {
return reqwest({
url: 'https://api.github.com/orgs/' + orgName + '/memb... | Move event source to Github site feeds, rather than full (rate-limited) API | Move event source to Github site feeds, rather than full (rate-limited) API
| JavaScript | mit | pimterry/github-org-feed-page,pimterry/github-org-feed-page |
fc5c76afa4402477d7cc70010d253a05e5688603 | learnyounode/json-api-server.js | learnyounode/json-api-server.js | var http = require('http')
var moment = require('moment')
var url = require('url')
function stringifyTime(now) {
var timeString = '{"hour":' + now.hour() +
',"minute":' + now.minute() +
',"second":' + now.second() + '}'
return timeString;
}
function unixifyTime(now) {
var tim... | var http = require('http')
var moment = require('moment')
var url = require('url')
function stringifyTime(time) {
return {
hour: time.hour(),
minute: time.minute(),
second: time.second()
}
}
function unixifyTime(time) {
return { unixtime: time.valueOf() }
}
var server = http.createServer(function(r... | Use JS Objects for generating JSON | Use JS Objects for generating JSON
Replace hand-coded JSON strings with JSON hashes (or Objects, I'm not
sure what they are defined as at this point.)
| JavaScript | mit | nmarley/node-playground,nmarley/node-playground |
3c3515ca7d264f4fa1d58047d60d4522a8eb21a2 | test/index-spec.js | test/index-spec.js | /* eslint-disable prefer-arrow-callback */
/* eslint-env node, mocha, browser */
const assert = require('assert');
const test = require('../src/index').test;
const item = require('./harness/component-data');
const path = require('path');
describe('Vue test utils', () => {
const pathToHarness = path.resolve(__dirnam... | /* eslint-disable prefer-arrow-callback */
/* eslint-env node, mocha, browser */
const assert = require('assert');
const test = require('../src/index').test;
const item = require('./harness/component-data');
const path = require('path');
describe('Vue test utils', () => {
const pathToHarness = path.resolve(__dirnam... | Add unit test for verifying window in then callback. | Add unit test for verifying window in then callback.
| JavaScript | mit | peripateticus/vue-test-utils |
8c23d570176a529519ac869508b1db59c5485a1e | src/lib/utils.js | src/lib/utils.js | module.exports = {
getViewPortInfo: function getViewPort () {
var e = document.documentElement
var g = document.getElementsByTagName('body')[0]
var x = window.innerWidth || e.clientWidth || g.clientWidth
var y = window.innerHeight || e.clientHeight || g.clientHeight
return {
width: x,
... | module.exports = {
getViewPortInfo: function getViewPort () {
var e = document.documentElement
var g = document.getElementsByTagName('body')[0]
var x = window.innerWidth || e.clientWidth || g.clientWidth
var y = window.innerHeight || e.clientHeight || g.clientHeight
return {
width: x,
... | Add promiseAny until function to get Promise.any support without extending prototype | Add promiseAny until function to get Promise.any support without extending prototype | JavaScript | mit | opbeat/opbeat-angular,jahtalab/opbeat-js,opbeat/opbeat-js-core,opbeat/opbeat-angular,opbeat/opbeat-react,opbeat/opbeat-react,jahtalab/opbeat-js,opbeat/opbeat-react,jahtalab/opbeat-js,opbeat/opbeat-angular,opbeat/opbeat-js-core |
6ece176a96ddcc80e681ae668f5bdbf865fec567 | src/webpack/presets/eslint.js | src/webpack/presets/eslint.js | import path from 'path'
export default {
name: 'eslint',
configure ({ projectPath }) {
return {
eslint: {
configFile: path.join(projectPath, '.eslintrc')
},
module: {
preLoaders: [
{
test: /\.jsx?$/,
loader: 'eslint',
exclude: /no... | import path from 'path'
export default {
name: 'eslint',
configure ({ projectPath, enableCoverage }) {
if (!enableCoverage) {
return {}
}
return {
eslint: {
configFile: path.join(projectPath, '.eslintrc')
},
module: {
preLoaders: [
{
test:... | Disable linting when generating coverage | feat(coverage): Disable linting when generating coverage
| JavaScript | mit | saguijs/sagui,saguijs/sagui |
c3e1fa56c7b2690a59a2c6790eb83dd068746da0 | tests/canvas.js | tests/canvas.js | $(document).ready(function() {
module("Canvas presentations");
test("Check Canvas Presentations", function() {
expect(1);
ok(MITHGrid.Presentation.RaphSVG !== undefined, "RaphSVG Presentation exists");
//ok(MITHGrid.Presentation.SVGRect !== undefined, "SVGRect Presentation exists");
});
test("Check C... | $(document).ready(function() {
module("Canvas presentations");
test("Check Canvas Presentations", function() {
expect(1);
ok(MITHGrid.Presentation.RaphSVG !== undefined, "RaphSVG Presentation exists");
});
test("Check Canvas availability", function() {
var presentation;
expect(3);
try {
pres... | Fix test missing the container element | Fix test missing the container element
| JavaScript | apache-2.0 | umd-mith/OACVideoAnnotator,umd-mith/OACVideoAnnotator,umd-mith/OACVideoAnnotator |
a8bec029798389b68fe5081ff6736605cdc613a7 | tests/extend.js | tests/extend.js | var $ = require('../')
, assert = require('assert')
$.import('Foundation')
$.NSAutoreleasePool('alloc')('init')
// Subclass 'NSObject', creating a new class named 'NRTest'
var NRTest = $.NSObject.extend('NRTest')
, counter = 0
// Add a new method to the NRTest class responding to the "description" selector
NRTes... | var $ = require('../')
, assert = require('assert')
$.import('Foundation')
$.NSAutoreleasePool('alloc')('init')
// Subclass 'NSObject', creating a new class named 'NRTest'
var NRTest = $.NSObject.extend('NRTest')
, counter = 0
// Add a new method to the NRTest class responding to the "description" selector
NRTes... | Remove this test case for now... still segfaulting for some crazy reason... | Remove this test case for now... still segfaulting for some crazy reason...
| JavaScript | mit | telerik/NodObjC,mralexgray/NodObjC,TooTallNate/NodObjC,TooTallNate/NodObjC,jerson/NodObjC,jerson/NodObjC,telerik/NodObjC,jerson/NodObjC,mralexgray/NodObjC |
1e2f798a9a67e57350180e4ac847eac504f11d57 | ember-cli-build.js | ember-cli-build.js | /*jshint node:true*/
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
// Add options here
});
/*
This build file specifies the options for the dummy test app of this
addon, located ... | /*jshint node:true*/
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
snippetSearchPaths: ['app', 'node_modules/ui-base-theme/addon']
});
/*
This build file specifies the options for th... | Fix code snippets in styleguide | Fix code snippets in styleguide
| JavaScript | mit | prototypal-io/ui-tomato-theme,prototypal-io/ui-tomato-theme |
bfa5e93efef1b135edb4cf1807391b5bfc3646fe | src/redux/store.js | src/redux/store.js | // @flow
/* eslint-disable arrow-body-style */
import { applyMiddleware, createStore } from 'redux'
import { createEpicMiddleware } from 'redux-observable'
import thunk from 'redux-thunk'
import promiseMiddleware from 'redux-promise-middleware'
import { routerMiddleware } from 'react-router-redux'
import { composeWithD... | // @flow
/* eslint-disable arrow-body-style */
import { applyMiddleware, createStore, compose } from 'redux'
import { createEpicMiddleware } from 'redux-observable'
import thunk from 'redux-thunk'
import promiseMiddleware from 'redux-promise-middleware'
import { routerMiddleware } from 'react-router-redux'
import { dev... | Use redux compose with devToolsEnhancer | Use redux compose with devToolsEnhancer
| JavaScript | apache-2.0 | tribou/react-template,tribou/react-template,tribou/react-template,tribou/react-template,tribou/react-template |
316152ea0fed4dca0b38276bdbf94884a2363b5a | packages/articles/server/routes/articles.js | packages/articles/server/routes/articles.js | 'use strict';
var articles = require('../controllers/articles');
// Article authorization helpers
var hasAuthorization = function(req, res, next) {
if (req.article.user.id !== req.user.id) {
return res.send(401, 'User is not authorized');
}
next();
};
module.exports = function(Articles, app, auth... | 'use strict';
var articles = require('../controllers/articles');
// Article authorization helpers
var hasAuthorization = function(req, res, next) {
if (res.adminEnabled() || (req.article.user && (req.article.user_id === req.user._id))) {
next();
}
else {
return res.send(401, 'User is not a... | Allow for Admin to Edit / Delete | Allow for Admin to Edit / Delete
Allow for Admin to Edit / Delete articles. Allow allow for edit / delete of articles if the user was deleted. | JavaScript | mit | rpalacios/preach-lander,paperdev7/web-project,suyesh/mean,Cneubauern/Test,Tukaiz/vmi,pavitlabs/mindappt,webapp-angularjs/football,MericGarcia/deployment-mean,reergymerej/counts,Edifice/OctoDo,dhivyaprp/Lets-Fix,szrobinli/mean,ngEdmundas/mean-user-management,cyberTrebuchet/this_is_forOM,Chien19861128/qa-app,kmdr/farmy,j... |
f0144914bb08c8ffd3cd99a35fc9c4d4137b933c | Docs/static/custom/tooltips.js | Docs/static/custom/tooltips.js | var currentTip = null;
var currentTipElement = null;
function hideTip(evt, name, unique)
{
var el = document.getElementById(name);
el.style.display = "none";
currentTip = null;
}
function findPos(obj)
{
// no idea why, but it behaves differently in webbrowser component
if (window.location.search == "?inapp"... | var currentTip = null;
var currentTipElement = null;
function hideTip(evt, name, unique)
{
var el = document.getElementById(name);
el.style.display = "none";
currentTip = null;
}
function findPos(obj)
{
var curleft = 0;
var curtop = obj.offsetHeight;
while (obj)
{
curleft += obj.offsetLeft;
curt... | Fix tooltip positions in tutorial pages | Fix tooltip positions in tutorial pages | JavaScript | apache-2.0 | NaseUkolyCZ/FunScript,NaseUkolyCZ/FunScript,mcgee/FunScript,ZachBray/FunScript,mcgee/FunScript,cloudRoutine/FunScript,tpetricek/FunScript,mcgee/FunScript,ovatsus/FunScript,nwolverson/FunScript,ZachBray/FunScript,ovatsus/FunScript,nwolverson/FunScript,ovatsus/FunScript,alfonsogarciacaro/FunScript,mcgee/FunScript,nwolver... |
3784330b114e5e5b03c7bf1ab854c6865c0079ef | addon/mixins/token-adapter.js | addon/mixins/token-adapter.js | import Mixin from '@ember/object/mixin';
import { inject } from '@ember/service';
import { get, computed } from '@ember/object';
import { isEmpty } from '@ember/utils';
import config from 'ember-get-config';
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
/**
Adapter Mixin that works with... | import Mixin from '@ember/object/mixin';
import { inject } from '@ember/service';
import { get, computed } from '@ember/object';
import { isEmpty } from '@ember/utils';
import config from 'ember-get-config';
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
/**
Adapter Mixin that works with... | Fix computed header property issue | Fix computed header property issue
| JavaScript | mit | jpadilla/ember-simple-auth-token,jpadilla/ember-cli-simple-auth-token,jpadilla/ember-simple-auth-token,jpadilla/ember-cli-simple-auth-token |
6d76e2009091d9997c0a692b4fc983112d889653 | src/util-lang.js | src/util-lang.js | /**
* util-lang.js - The minimal language enhancement
*/
function isType(type) {
return function(obj) {
return {}.toString.call(obj) == "[object " + type + "]"
}
}
var isObject = isType("Object")
var isString = isType("String")
var isArray = Array.isArray || isType("Array")
var isFunction = isType("Function... | /**
* util-lang.js - The minimal language enhancement
*/
var _object = {}
function isType(type) {
return function(obj) {
return _object.toString.call(obj) == "[object " + type + "]"
}
}
var isObject = isType("Object")
var isString = isType("String")
var isArray = Array.isArray || isType("Array")
var isFunc... | Update share one object for check type. | Update share one object for check type.
| JavaScript | mit | PUSEN/seajs,121595113/seajs,kuier/seajs,liupeng110112/seajs,evilemon/seajs,twoubt/seajs,treejames/seajs,seajs/seajs,mosoft521/seajs,Gatsbyy/seajs,lianggaolin/seajs,kaijiemo/seajs,coolyhx/seajs,imcys/seajs,sheldonzf/seajs,baiduoduo/seajs,liupeng110112/seajs,hbdrawn/seajs,judastree/seajs,yuhualingfeng/seajs,JeffLi1993/se... |
b8a59f454394bcc271966a5ffea5d086c4207ce7 | test/spec/controllers/formDropArea.js | test/spec/controllers/formDropArea.js | 'use strict';
describe('Controller: FormDropAreaCtrl', function () {
// load the controller's module
beforeEach(module('confRegistrationWebApp'));
var FormDropAreaCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$n... | 'use strict';
describe('Controller: FormDropAreaCtrl', function () {
// load the controller's module
beforeEach(module('confRegistrationWebApp'));
var FormDropAreaCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$n... | Test the move block fn | Test the move block fn
| JavaScript | mit | CruGlobal/conf-registration-web,CruGlobal/conf-registration-web,CruGlobal/conf-registration-web,CruGlobal/conf-registration-web |
bac969961ad951c10d0cdfa1d8b622c0d121d26f | app/components/select-date.js | app/components/select-date.js | import Ember from 'ember';
export default Ember.Component.extend({
userSettings: Ember.inject.service(),
init () {
this._super();
this.get('userSettings').timePeriods().then(response => {
// Sort by latest on top
this.set('timePeriods', response.sortBy('begins').reverse());
// Create ar... | import Ember from 'ember';
export default Ember.Component.extend({
btnActive: false,
didReceiveAttrs () {
this.set('timePeriodChanged', this.get('currentDate'));
},
init () {
this._super();
this.get('userSettings').timePeriods().then(response => {
// Sort by latest on top
this.set('tim... | Set variable for time period base on value passed to component | refactor: Set variable for time period base on value passed to component
| JavaScript | mit | pe1te3son/spendings-tracker,pe1te3son/spendings-tracker |
a2361ee313e42f3b3446fa4baf3c0bbd4e072c48 | app/routes/index.js | app/routes/index.js | import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
var person_id = this.controllerFor('application').get('attrs.person.id');
return this.apijax.GET('/identifier.json', { 'person_id': person_id });
},
setupController: function(controller, model) {
this._super(controller... | import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
var person = this.controllerFor('application').get('attrs.person'),
person_id = person.id,
model;
if (!Ember.isEmpty(person.full_name)) {
// we have full passed in details for the person, no need for loo... | Add ability to pass in full details for person | Add ability to pass in full details for person
* now no need for ajax call in this case
| JavaScript | mit | opengovernment/person-widget,opengovernment/person-widget |
3480438a6698868c7cdcd743489d5e597e318cbe | app/main.js | app/main.js | // Install the configuration interface and set default values
require('configuration.js');
// Use DIM styling overrides and our own custom styling
require('beautification.js');
// Stores weapons pulled from our custom database
require('weaponDatabase.js');
// Pulls down weapon data and broadcasts updates
require('we... | // Install the configuration interface and set default values
require('configuration.js');
// Use DIM styling overrides and our own custom styling
require('beautification.js');
// Stores weapons pulled from our custom database
require('weaponDatabase.js');
// Pulls down weapon data and broadcasts updates
require('we... | Swap over to using fateBus. | Swap over to using fateBus.
| JavaScript | mit | rslifka/fate_of_all_fools,rslifka/fate_of_all_fools |
829354e73febe532252c48c171537db3b38eb749 | public/angular/directives/twitter-button.js | public/angular/directives/twitter-button.js | 'use strict';
(function(app) {
app.directive('twitterBtn', [function() {
var link = function() {
!function(d,s,id){
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id;
... | 'use strict';
(function(app) {
app.directive('twitterBtn', [function() {
var link = function() {
!function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){
js = d.createElement(s);
js.id = id... | Add more spaces to twitter js code. | Add more spaces to twitter js code. | JavaScript | mit | clamstew/timer |
3c647e872aceea76b8bd4008032488909019a1f2 | .eslintrc.js | .eslintrc.js | module.exports = {
extends: [
'nextcloud'
],
/**
* Allow jest syntax in the src folder
*/
env: {
jest: true
},
/**
* Allow shallow import of @vue/test-utils in order to be able to use it in
* the src folder
*/
rules: {
"node/no-unpublished-import": ["error", {
"allowModules": ["@vue/test-util... | module.exports = {
extends: [
'nextcloud'
],
}
| Remove eslint rules added to the eslint-config module | Remove eslint rules added to the eslint-config module
Signed-off-by: Marco Ambrosini <3397c7e210a9d1588196cfebb12b2c6b133f6934@pm.me>
| JavaScript | agpl-3.0 | nextcloud/spreed,nextcloud/spreed,nextcloud/spreed |
0591ffecc36e9b5daebb284de7b74737749c3040 | app/components/sortable-items.js | app/components/sortable-items.js | import Ember from 'ember';
import SortableItems from 'sortable-items/components/sortable-items';
export default SortableItems;
| import Ember from 'ember';
import SortableItems from 'ember-cli-sortable/components/sortable-items';
export default SortableItems;
| Update import for the app with the correct ember-addon name | Update import for the app with the correct ember-addon name
| JavaScript | mit | Cryrivers/ember-cli-sortable,JennieJi/ember-cli-sortable,jqyu/ember-cli-sortable,JennieJi/ember-cli-sortable,laantorchaweb/ember-cli-sortable,laantorchaweb/ember-cli-sortable,MaazAli/ember-cli-sortable,Cryrivers/ember-cli-sortable,MaazAli/ember-cli-sortable,jqyu/ember-cli-sortable |
fad9ff7971146796207687d03df30c8f41d77290 | rakuten_mail_unchecker.user.js | rakuten_mail_unchecker.user.js | // ==UserScript==
// @name Rakuten Mail Magazine Unchecker
// @namespace https://github.com/takamario/gm_script
// @description Rakuten Mail Magazine Unchecker
// @include https://order.step.rakuten.co.jp/rms/mall/basket/vc*
// @include https://basket.step.rakuten.co.jp/rms/mall/bs/confi... | // ==UserScript==
// @name Rakuten Mail Magazine Unchecker
// @namespace https://github.com/takamario/gm_script
// @description Rakuten Mail Magazine Unchecker
// @include https://order.step.rakuten.co.jp/rms/mall/basket/vc*
// @include https://basket.step.rakuten.co.jp/rms/mall/bs/confi... | Add exclude books cart page | Add exclude books cart page
| JavaScript | mit | takamario/gm_script |
fb0857c7e26ec7d3f9e1e3dca474769d52fc5cef | addon/mixins/export-to-svg.js | addon/mixins/export-to-svg.js | import Ember from "ember";
var container = '<g transform="scale(%s)">%h</g>';
export default Ember.Mixin.create({
exportToSvg: function(){
var svg = this.$("svg").clone(),
width = +svg.find("desc.width")[0].innerHTML,
div = document.createElement("div"),
svgContent,
promise;
... | import Ember from "ember";
var container = '<g transform="scale(%s)">%h</g>';
export default Ember.Mixin.create({
exportToSvg: function(){
var svg = this.$("svg").clone(),
width = +svg.find("desc.width")[0].innerHTML,
div = document.createElement("div"),
svgContent,
promise;
... | Remove base svg from exported svg | Remove base svg from exported svg
| JavaScript | apache-2.0 | porkepic/squiggle,porkepic/squiggle |
3690a15fc48242d95456fabd1f923f121dc0a2db | app/components/add-expense.js | app/components/add-expense.js | import Ember from 'ember';
// import $ from 'jquery';
export default Ember.Component.extend({
expense: {
sum: '',
category: '',
name: ''
},
currency: '£',
expenseCategories: [
'Charity',
'Clothing',
'Education',
'Events',
'Food',
'Gifts',
'Healthcare',
'Household',
... | import Ember from 'ember';
// import $ from 'jquery';
export default Ember.Component.extend({
expense: {
sum: '',
category: '',
name: ''
},
currency: '£',
expenseCategories: [
'Charity',
'Clothing',
'Education',
'Events',
'Food',
'Gifts',
'Healthcare',
'Household',
... | Check if form is valid and then send save action to parent | refactor: Check if form is valid and then send save action to parent
| JavaScript | mit | pe1te3son/spendings-tracker,pe1te3son/spendings-tracker |
0bf04823deb5eb3c673ae8cd7663e5f8ff59de90 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function (grunt) {
require('time-grunt')(grunt);
grunt.initConfig({
eslint: {
all: {
src: [
'*.js',
'bin/grunth',
'lib/*.js',
],
},
},
jsc... | 'use strict';
module.exports = function (grunt) {
require('time-grunt')(grunt);
grunt.initConfig({
eslint: {
all: {
src: [
'*.js',
'bin/grunth',
'lib/*.js',
],
},
},
jsc... | Correct messages printed during tests | Correct messages printed during tests
| JavaScript | mit | EE/grunth-cli |
04df28e0092f11aec568d26fea8cca5118756bce | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-shell');
grunt.initConfig( {
gitclone: {
mastercointools: {
options: {
repository: 'https://github.com/curtislacy/mastercoin-tools.git',
branch: 'Specify-Directory',
dire... | module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-shell');
grunt.initConfig( {
gitclone: {
mastercointools: {
options: {
repository: 'https://github.com/curtislacy/mastercoin-tools.git',
branch: 'master',
directory: 'nod... | Switch to using the master branch of my mastercoin-tools fork. | Switch to using the master branch of my mastercoin-tools fork.
| JavaScript | agpl-3.0 | VukDukic/omniwallet,ripper234/omniwallet,arowser/omniwallet,Nevtep/omniwallet,FuzzyBearBTC/omniwallet,VukDukic/omniwallet,maran/omniwallet,arowser/omniwallet,achamely/omniwallet,OmniLayer/omniwallet,curtislacy/omniwallet,ripper234/omniwallet,habibmasuro/omniwallet,VukDukic/omniwallet,OmniLayer/omniwallet,habibmasuro/om... |
196a15dca3290f4fed10470516840a29b1af3588 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['./*.js', 'routes/*.js', 'models/*.js']
}
},
watch: {
gruntfile: {
... | 'use strict';
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['./*.js', 'routes/*.js', 'models/*.js']
}
},
watch: {
gruntfile: {
... | Include watching config.json for changes | Include watching config.json for changes
| JavaScript | mit | GuusK/disruptIT,GuusK/disruptIT,GuusK/disruptIT,GuusK/disruptIT |
33d989b7a73129a9198da4c0147995cb19500364 | js/cookies-init.js | js/cookies-init.js | $(function handleSimpleIntegration() {
cookieChoices.showCookieBar({
linkHref: '#',
cookieText: 'spine.io uses cookies to help operate the site and gather analytics data. You can read more about it in our',
linkText: 'Privacy Statement',
dismissText: 'I agree',
dis... | $(function handleSimpleIntegration() {
cookieChoices.showCookieBar({
linkHref: '#',
cookieText: 'spine.io uses cookies to help operate the site and gather analytics data.',
// Unlink this 2 lines to add link to Privacy Statements
// cookieText: 'spine.io uses cookies to help operate... | Hide link to the Privacy Statement in the cookie notification | Hide link to the Privacy Statement in the cookie notification
| JavaScript | apache-2.0 | SpineEventEngine/SpineEventEngine.github.io,SpineEventEngine/SpineEventEngine.github.io,SpineEventEngine/SpineEventEngine.github.io,SpineEventEngine/SpineEventEngine.github.io,SpineEventEngine/SpineEventEngine.github.io,SpineEventEngine/SpineEventEngine.github.io |
0b69c73dfa7f9873176aac684f8e5800ce48b308 | example-loop.js | example-loop.js | var TiVoRemote = require('./TiVoRemote');
var readline = require('readline');
var config = {
ip: '192.168.1.100',
port: 31339
}
var remote = new TiVoRemote(config);
var rl = readline.createInterface({ input: process.stdin, output: process.stdout });
rl.setPrompt('');
remote.on('channel', function(channel) { cons... | var TiVoRemote = require('./TiVoRemote');
var readline = require('readline');
if (process.argv.length < 3) {
console.log('Usage: <script> <ip>');
process.exit(1);
}
var config = {
ip: process.argv[2],
port: 31339
}
var remote = new TiVoRemote(config);
var rl = readline.createInterface({ input: process.stdin,... | Allow setting IP from command line argument | Allow setting IP from command line argument
| JavaScript | mit | mattjgalloway/homebridge-tivo |
4a67c4969fc66dd10d9fc6fb7c07be91c5ac2838 | src/welcome.js | src/welcome.js | import {ArrayExtensions} from './arrayextensions';
import {Letter} from './letter';
import {moveBefore, DIRECTION} from 'aurelia-dragula';
export class Welcome {
constructor() {
this.dragDirection = DIRECTION.HORIZONTAL;
this.reset();
}
get unjumbledName() {
return this.nameLetters.reduce((previous... | import {ArrayExtensions} from './arrayextensions';
import {Letter} from './letter';
import {moveBefore, DIRECTION} from 'aurelia-dragula';
export class Welcome {
constructor() {
this.dragDirection = DIRECTION.HORIZONTAL;
this.reset();
}
get unjumbledName() {
return this.nameLetters.reduce((previous... | Make the code slightly clearer | Make the code slightly clearer | JavaScript | apache-2.0 | michaelmalonenz/aurelia-dragula-example,michaelmalonenz/aurelia-dragula-example |
d7b23057f03f2af55e032999f8161b6458d8dd77 | spec/ui/control.js | spec/ui/control.js | define(['backbone', 'cilantro', 'text!/mock/fields.json'], function (Backbone, c, fieldsJSON) {
var fields = new Backbone.Collection(JSON.parse(fieldsJSON));
describe('FieldControl', function() {
var control;
describe('Base', function() {
beforeEach(function() {
con... | define(['backbone', 'cilantro', 'text!/mock/fields.json'], function (Backbone, c, fieldsJSON) {
var fields = new Backbone.Collection(JSON.parse(fieldsJSON));
describe('FieldControl', function() {
var control;
describe('Base', function() {
beforeEach(function() {
con... | Update spec to take in account null fields in context model | Update spec to take in account null fields in context model | JavaScript | bsd-2-clause | chop-dbhi/cilantro,chop-dbhi/cilantro,chop-dbhi/cilantro |
ccac850fcd3878adbb54e9ae8f92e08f29c81d6f | test/helper.js | test/helper.js | 'use strict';
//supress log messages
process.env.LOG_LEVEL = 'fatal';
var chai = require('chai'),
cap = require('chai-as-promised');
global.sinon = require('sinon');
global.fs = require('fs');
global.utils = require('radiodan-client').utils;
global.EventEmitter = require('events').EventE... | 'use strict';
//supress log messages
process.env.LOG_LEVEL = 'fatal';
var chai = require('chai'),
cap = require('chai-as-promised');
global.sinon = require('sinon');
global.fs = require('fs');
global.utils = require('radiodan-client').utils;
global.EventEmitter = require('events').EventE... | Add fake Radiodan client objects | Add fake Radiodan client objects
| JavaScript | apache-2.0 | radiodan/magic-button,radiodan/magic-button |
083c74399f6c260d1738272c60b282d83b2a0b44 | document/documentConversion.js | document/documentConversion.js | import DocumentConfigurator from './DocumentConfigurator'
import DocumentModel from './DocumentModel'
import DocumentJSONConverter from './DocumentJSONConverter'
import DocumentHTMLImporter from './DocumentHTMLImporter'
import DocumentHTMLExporter from './DocumentHTMLExporter'
function importJSON (content) {
let doc... | import DocumentConfigurator from './DocumentConfigurator'
import DocumentModel from './DocumentModel'
import DocumentJSONConverter from './DocumentJSONConverter'
import DocumentHTMLImporter from './DocumentHTMLImporter'
import DocumentHTMLExporter from './DocumentHTMLExporter'
function importJSON (content) {
let doc... | Remove the data-id attribute on HTML export | Remove the data-id attribute on HTML export
| JavaScript | apache-2.0 | stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila |
22b7b0759a48eadbb3268f30d34926e43ee7d2ca | src/database/DataTypes/InsuranceProvider.js | src/database/DataTypes/InsuranceProvider.js | import Realm from 'realm';
export class InsuranceProvider extends Realm.Object {}
InsuranceProvider.schema = {
name: 'InsuranceProvider',
primaryKey: 'id',
properties: {
id: 'string',
name: 'string',
comment: 'string?',
validityDays: 'int',
isActive: 'bool',
policies: {
type: 'link... | import Realm from 'realm';
export class InsuranceProvider extends Realm.Object {}
InsuranceProvider.schema = {
name: 'InsuranceProvider',
primaryKey: 'id',
properties: {
id: 'string',
name: { type: 'string', optional: true },
comment: { type: 'string', optional: true },
validityDays: { type: 'in... | Add update to provider properties | Add update to provider properties
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
92538b650ec1da071fe6be0697234c6236b118a1 | build-dev-bundle.js | build-dev-bundle.js | var path = require("path");
var stealTools = require("steal-tools");
var promise = stealTools.bundle({
config: path.join(__dirname, "package.json!npm")
}, {
filter: [ "**/*", "package.json" ],
minify: true
});
| var path = require("path");
var stealTools = require("steal-tools");
stealTools.bundle({
config: path.join(__dirname, "package.json!npm")
}, {
filter: [ "**/*", "package.json" ],
minify: true
}).catch(function(error) {
console.error(error);
process.exit(1);
});
| Exit with an error when the deps-bundle script fails | Exit with an error when the deps-bundle script fails
Previously, if you ran the deps-bundle script and steal-tools reported an error, the script would still exit successfully and the next script would run (e.g. when building the site/docs). This would leave you with an out-of-date (or non-existent) dev-bundle.
This f... | JavaScript | mit | bitovi/canjs,bitovi/canjs,bitovi/canjs,bitovi/canjs |
6552de30288ec17a669a949f1808bd6bb817a1ae | js/change_logos.js | js/change_logos.js | window.addEventListener("load", function() {
const EXTRA_IMAGES = document.getElementsByClassName("alt-logo-img");
EXTRA_IMAGES[0].classList.toggle("active");
EXTRA_IMAGES[EXTRA_IMAGES.length - 1].classList.toggle("active");
var just_switched = false;
Array.from(EXTRA_IMAGES).forEach(function(img, idx) {
var ne... | window.addEventListener("load", function() {
const EXTRA_IMAGES = document.getElementsByClassName("alt-logo-img");
EXTRA_IMAGES[0].classList.toggle("active");
EXTRA_IMAGES[EXTRA_IMAGES.length - 1].classList.toggle("active");
var just_switched = false;
Array.from(EXTRA_IMAGES).forEach(function(img, idx) {
var ne... | Reduce if to a modulo for changing logos | Reduce if to a modulo for changing logos
Thanks to @karolsw2 for pointing this out
Ref: #1
| JavaScript | mit | nabijaczleweli/nabijaczleweli.github.io,nabijaczleweli/nabijaczleweli.github.io |
299868764c1340bc5cec893ea1081b8947d14838 | scripts/createsearchindex.js | scripts/createsearchindex.js | console.log("=================================");
console.log("Creating search index...");
console.log("=================================");
// Scan through all content/ directories
// For each markdown file
// CreateIndex(title,content,path)
var lunr = require('lunr');
var idx = lunr(function () {
this.fiel... | console.log("=================================");
console.log("Creating search index...");
console.log("=================================");
// Scan through all content/ directories
// For each markdown file
// CreateIndex(title,content,path)
var lunr = require('lunr');
var idx = lunr(function () {
this.fiel... | Add super hero search data. Format the search output. | Add super hero search data. Format the search output.
| JavaScript | mit | govau/service-manual |
b2f9d7066c4bf6dff22a448e2d34e3a00f7e1431 | lib/catch-links.js | lib/catch-links.js |
module.exports = function (root, cb) {
root.addEventListener('click', (ev) => {
if (ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey || ev.defaultPrevented) {
return true
}
var anchor = null
for (var n = ev.target; n.parentNode; n = n.parentNode) {
if (n.nodeName === 'A') {
... |
module.exports = function (root, cb) {
root.addEventListener('click', (ev) => {
if (ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey || ev.defaultPrevented) {
return true
}
var anchor = null
for (var n = ev.target; n.parentNode; n = n.parentNode) {
if (n.nodeName === 'A') {
... | Refactor magnet URI link catch logic | Refactor magnet URI link catch logic
| JavaScript | agpl-3.0 | ssbc/patchwork,ssbc/patchwork |
8de8572bcb78739bc25f471dfbfec3ab7e75964c | lib/bot/queries.js | lib/bot/queries.js | var r = require('rethinkdb');
// Number of seconds after which Reddit will archive an article
// (180 days): https://github.com/reddit/reddit/commit/b7b24d2e9fa06ba37ea78e0275dce86d95158e64
var archiveLimit = 180 * 24 * 60 * 60;
exports.mostUrgentSubject = r.table('subjects')
.between(r.now().sub(archiveLimit),r.no... | var r = require('rethinkdb');
// Number of seconds after which Reddit will archive an article
// (180 days): https://github.com/reddit/reddit/commit/b7b24d2e9fa06ba37ea78e0275dce86d95158e64
var archiveLimit = 180 * 24 * 60 * 60;
exports.mostUrgentSubject = r.table('subjects')
.between(r.now().sub(archiveLimit),r.no... | Put sub-index immediately after limit on query | Put sub-index immediately after limit on query
| JavaScript | mit | stuartpb/QIKlaxonBot,stuartpb/QIKlaxonBot |
c4c365e613a68109aa33d7a14fc0041b3cf5c148 | lib/less/render.js | lib/less/render.js | var PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise;
module.exports = function(environment, ParseTree, ImportManager) {
var render = function (input, options, callback) {
var parse = require('./parse')(environment, ParseTree, ImportManager);
if (typeof(options) =... | var PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise;
module.exports = function(environment, ParseTree, ImportManager) {
var render = function (input, options, callback) {
if (typeof(options) === 'function') {
callback = options;
options = {};
... | Fix parse refactor - this passed to the plugin manager must be less | Fix parse refactor - this passed to the plugin manager must be less
| JavaScript | apache-2.0 | foresthz/less.js,chenxiaoxing1992/less.js,wjb12/less.js,NaSymbol/less.js,evocateur/less.js,less/less.js,seven-phases-max/less.js,MrChen2015/less.js,SkReD/less.js,deciament/less.js,christer155/less.js,yuhualingfeng/less.js,xiaoyanit/less.js,NirViaje/less.js,royriojas/less.js,royriojas/less.js,less/less.js,bendroid/less.... |
f7032ee4eb1b17cdab455259ea46e4bba055b5da | lib/parsers/sax.js | lib/parsers/sax.js | var util = require('util');
var sax = require('sax');
var TreeBuilder = require('./../treebuilder').TreeBuilder;
function XMLParser(target) {
var self = this;
this.parser = sax.parser(true);
this.target = (target) ? target : new TreeBuilder();
/* TODO: would be nice to move these out */
this.parser.onope... | var util = require('util');
var sax = require('sax');
var TreeBuilder = require('./../treebuilder').TreeBuilder;
function XMLParser(target) {
this.parser = sax.parser(true);
this.target = (target) ? target : new TreeBuilder();
this.parser.onopentag = this._handleOpenTag.bind(this);
this.parser.ontext = thi... | Move methods out of the constructor. | Move methods out of the constructor.
| JavaScript | apache-2.0 | racker/node-elementtree |
73d49ad830e028c64d5a68754757dcfc38d34792 | source/test/authenticate-flow-test.js | source/test/authenticate-flow-test.js | import { describe } from 'riteway';
import dsm from '../dsm';
const SIGNED_OUT = 'signed_out';
const AUTHENTICATING = 'authenticating';
const actionStates = [
['initialize', SIGNED_OUT,
['sign in', AUTHENTICATING
// ['report error', 'error',
// ['handle error', 'signed out']
// ],
// ... | import { describe } from 'riteway';
import dsm from '../dsm';
const SIGNED_OUT = 'signed_out';
const AUTHENTICATING = 'authenticating';
const actionStates = [
['initialize', SIGNED_OUT,
['sign in', AUTHENTICATING
// ['report error', 'error',
// ['handle error', 'signed out']
// ],
// ... | Fix test to use main unit test files standards | Fix test to use main unit test files standards
The main unit test file tested action creators against `reducer().status` instead of the full state. There seems to be inconsistencies in the payload for action creators which caused these tests to fail. I have updated the tests to only check the status instead of the ent... | JavaScript | mit | ericelliott/redux-dsm |
de51636cdf89ae16ab0f9070127acffad5c3b277 | js/ClientApp.js | js/ClientApp.js | var div = React.DOM.div;
var h1 = React.DOM.h1;
var MyTitle = React.createClass({
render: function() {
return (
div(null, h1(null, this.props.title))
)
}
})
var MyTitleFactory = React.createFactory(MyTitle)
var MyFirstComponent = React.createClass({
render: function() {
return (
... | var div = React.DOM.div;
var h1 = React.DOM.h1;
var MyTitle = React.createClass({
render: function() {
return (
div(null, h1({ style: {color: this.props.color} }, this.props.title))
)
}
})
var MyTitleFactory = React.createFactory(MyTitle)
var MyFirstComponent = React.createClass({
render: fu... | Add props to the components | Add props to the components
| JavaScript | mit | jbarbettini/intro-to-react-workshop,jbarbettini/intro-to-react-workshop |
8fc701cdda3fe6bb65d17b854787be36d5236d92 | models/analysis.js | models/analysis.js | var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var analysisSchema = new Schema({
user_id: {type: Schema.Types.ObjectId, ref: 'User', required: true},
analysis_name: {type: String, required: true},
analysis: {type: String, required: true},
corpora_ids: [{type: String, required: true}],... | var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var analysisSchema = new Schema({
user_id: {type: Schema.Types.ObjectId, ref: 'User', required: true},
analysis_name: {type: String, required: true},
eta: {type: Number, required: true},
time_created: {type: Date, required: true},
analysis... | Add eta and time created to db schema | Add eta and time created to db schema
| JavaScript | mit | rigatoni/linguine-node,rigatoni/linguine-node,Pastafarians/linguine-node,Pastafarians/linguine-node |
eb95bb8ff136c601257b3143f9f2c9ecee7b8fc1 | dom-text.js | dom-text.js | module.exports = DOMText
function DOMText(value, owner) {
if (!(this instanceof DOMText)) {
return new DOMText(value)
}
this.data = value || ""
this.length = this.data.length
this.ownerDocument = owner || null
}
DOMText.prototype.type = "DOMTextNode"
DOMText.prototype.nodeType = 3
DOMTex... | module.exports = DOMText
function DOMText(value, owner) {
if (!(this instanceof DOMText)) {
return new DOMText(value)
}
this.data = value || ""
this.length = this.data.length
this.ownerDocument = owner || null
}
DOMText.prototype.type = "DOMTextNode"
DOMText.prototype.nodeType = 3
DOMText... | Add nodeName property to text nodes | Add nodeName property to text nodes
| JavaScript | mit | Raynos/min-document,Raynos/min-document |
3a352b8f2d9795eebf2d106dada7cca026c42035 | bin/index.js | bin/index.js | #! /usr/bin/env node
'use strict';
var yarnOrNpm = require('../index');
// Execute the command
try {
const { status } = yarnOrNpm.spawn.sync(
process.argv.slice(2), { stdio: 'inherit' }
);
process.exit(status);
} catch (err) {
console.log(err);
process.exit(1);
}
| #! /usr/bin/env node
'use strict';
const yarnOrNpm = require('../index');
// Execute the command
try {
const status = yarnOrNpm.spawn.sync(
process.argv.slice(2),
{ stdio: 'inherit' }
).status
process.exit(status);
} catch (err) {
console.log(err);
process.exit(1);
}
| Replace destructuring with regular property access | Replace destructuring with regular property access
| JavaScript | mit | camacho/yarn-or-npm |
64bb2784ffa12a6ae67596dcc98c129bca81f1f6 | src/formatter.js | src/formatter.js | class JsonFormatter {
static stringify(object, options) {
options = {
space: options.prettify ? ' ' : null
}
return JSON.stringify(object, null, options.space)
}
static parse(string) {
return JSON.parse(string)
}
}
export default {
json: JsonFormatter
}
| class JsonFormatter {
static stringify(object, options) {
options = {
space: (options && options.prettify) ? ' ' : null
}
return JSON.stringify(object, null, options.space)
}
static parse(string) {
return JSON.parse(string)
}
}
export default {
json: JsonFormatter
}
| Make stringify's options parameter optional | Make stringify's options parameter optional
| JavaScript | mit | lujjjh/ea-utils |
11ad49c32359d07e95487e27651968cd9300e822 | src/models/Post.js | src/models/Post.js | import cuid from 'cuid';
import {database, auth} from '@/config/firebase';
export default function (post = {}) {
// Properties
this.id = post.id || cuid();
this.title = post.title || '';
this.created = post.created || Date.now();
this.lastEdited = post.lastEdited || null;
this.lastSaved = post.lastSaved |... | import cuid from 'cuid';
import {database, auth} from '@/config/firebase';
export default function (post = {}) {
// Properties
this.id = post.id || cuid();
this.created = post.created || Date.now();
this.lastEdited = post.lastEdited || null;
this.lastSaved = post.lastSaved || null;
this.lastPublished = po... | Refactor the title into a getter method | Refactor the title into a getter method
| JavaScript | mit | tuelsch/bolg,tuelsch/bolg |
996ed3e9977489df473230cadc3973ba24d0ea6d | tests/controllers/reverseControllerTests.js | tests/controllers/reverseControllerTests.js | describe("ReverseController", function () {
var fakeReverseFilter;
// See: https://docs.angularjs.org/api/ng/provider/$filterProvider
beforeEach(module("app.controllers", function ($filterProvider) {
console.log($filterProvider);
fakeReverseFilter = jasmine.createSpy("fakeReverseFilter");
... | describe("ReverseController", function () {
var fakeReverseFilter;
// See: https://docs.angularjs.org/api/ng/provider/$filterProvider
beforeEach(module("app.controllers", function ($filterProvider) {
fakeReverseFilter = jasmine.createSpy("fakeReverseFilter");
$filterProvider.register("reve... | Add example of faking a filter | Add example of faking a filter
| JavaScript | mit | mariojvargas/angularjs-stringcalc,mariojvargas/angularjs-stringcalc |
8e0a36fc602135fd1ec6318c8cc7ee0f7576499d | client/js/google_analytics.js | client/js/google_analytics.js | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;// noinspection CommaExpressionJS
i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();// noinspection CommaExpressionJS
a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefo... | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;// noinspection CommaExpressionJS
i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();// noinspection CommaExpressionJS
a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefo... | Add event to track host usage | Add event to track host usage | JavaScript | mit | samg2014/VirtualHand,samg2014/VirtualHand |
cb35b30799405a9b43f1736758efd463652a0206 | lib/provider.js | lib/provider.js | module.exports = {
selector: ['.source.python'],
id: 'aligner-python',
config: {
':-alignment': {
title: 'Padding for :',
description: 'Pad left or right of the character',
type: 'string',
"enum": ['left', 'right'],
"default": 'right'
},
':-leftSpace': {
title: 'Lef... | module.exports = {
selector: [
'.source.python',
'.source.embedded.python',
],
id: 'aligner-python',
config: {
':-alignment': {
title: 'Padding for :',
description: 'Pad left or right of the character',
type: 'string',
"enum": ['left', 'right'],
"default": 'right'
}... | Add support for embedded python | Add support for embedded python
| JavaScript | mit | adrianlee44/atom-aligner-python |
c8af2b414debcbafc0f87012da0ee3a23f44a107 | lib/rx-fetch.js | lib/rx-fetch.js | 'use strict';
const Rx = require('rx');
require('isomorphic-fetch');
const rxResponse = function (promiseResponse) {
this._promiseResponse = promiseResponse;
this.status = promiseResponse.status;
this.ok = promiseResponse.ok;
this.statusText = promiseResponse.statusText;
this.headers = promiseResponse.heade... | 'use strict';
const Rx = require('rx');
require('isomorphic-fetch');
//------------------------------------------------------------------------------
const rxResponse = function (promiseResponse) {
this._promiseResponse = promiseResponse;
this.status = promiseResponse.status;
this.ok = promiseResponse.ok;
th... | Add divider lines between functions. | Add divider lines between functions.
| JavaScript | mit | tangledfruit/rxjs-fetch,tangledfruit/rx-fetch |
7018847ded01cd7c338b23eafc72935d60938264 | connectors/byte.fm.js | connectors/byte.fm.js | 'use strict';
/* global Connector, Util */
Connector.playerSelector = '#player';
Connector.artistTrackSelector = '.player-current-title';
Connector.getArtistTrack = function() {
var text = $(Connector.artistTrackSelector).text();
var m = text.match(/ - /g);
if (m && (m.length === 2)) {
var arr = text.split(' -... | 'use strict';
/* global Connector, Util */
Connector.playerSelector = '#player';
Connector.artistTrackSelector = '.player-current-title';
Connector.getArtistTrack = function() {
var text = $(Connector.artistTrackSelector).text();
var m = text.match(/ - /g);
if (m && (m.length === 2)) {
var arr = text.split(' -... | Use 'Connector.onReady' function to emulate DOM update | Use 'Connector.onReady' function to emulate DOM update
| JavaScript | mit | usdivad/web-scrobbler,david-sabata/web-scrobbler,Paszt/web-scrobbler,galeksandrp/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,inverse/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,david-sabata/web-scrobbler,carpet-berlin/web-scrobbler,alexesprit/web-scrobbler,alexesprit/web-scrobbler,inverse/web-scrobbler,carpet-b... |
fe3639819bbc7bb2c6143c670157912b10ad9330 | test/count-test.js | test/count-test.js | var mongoose = require('mongoose'),
async = require('async'),
config = require('./config'),
Schema = mongoose.Schema,
mongoosastic = require('../lib/mongoosastic');
var CommentSchema = new Schema({
user: String,
post_date: {type:Date, es_type:'date'},
message: {type:String},
title: {type:String, es_boo... | var mongoose = require('mongoose'),
async = require('async'),
config = require('./config'),
Schema = mongoose.Schema,
mongoosastic = require('../lib/mongoosastic');
var CommentSchema = new Schema({
user: String,
post_date: {type:Date, es_type:'date'},
message: {type:String},
title: {type:String, es_boo... | Set manual timeout for count test | Set manual timeout for count test
| JavaScript | mit | francesconero/mongoosastic,guumaster/mongoosastic,mongoosastic/mongoosastic,hdngr/mongoosastic,teambition/mongoosastic,hdngr/mongoosastic,francesconero/mongoosastic,avastms/mongoosastic,guumaster/mongoosastic,ennosol/mongoosastic,mongoosastic/mongoosastic,mallzee/mongoosastic,mallzee/mongoosastic,mallzee/mongoosastic,m... |
4532ca7d069d433b2494945e4ed42cf1759541c5 | test/unit/users.js | test/unit/users.js | describe('Users', function() {
describe('Creation', function () {
context('When creating a new user', function() {
it('Should have an id', function() {
var some_guy = jsf(mocks.user);
// ADD SHOULD.JS
some_guy.should.have.property('id');
some_guy.id.should.be.ok();
... | describe('Users', function() {
describe('Creation', function () {
context('When creating a new user', function() {
var some_guy = jsf(mocks.user);
it('Should have an id', function() {
some_guy.should.have.property('userId');
some_guy.userId.should.be.ok();
some_guy.userId.sho... | Set user schema global to the test context | Set user schema global to the test context
| JavaScript | mit | facundovictor/mocha-testing |
5ed29e091ef3f24b2f5c9720da5b38ec67e5548c | src/detectors/threads/index.js | src/detectors/threads/index.js | /**
* Copyright 2019 Google 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 applicable law ... | /**
* Copyright 2019 Google 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 applicable law ... | Add link to Firefox’s I2P | Add link to Firefox’s I2P
| JavaScript | apache-2.0 | GoogleChromeLabs/wasm-feature-detect |
5d881c58a1c425d70d9e38bb8a07f3ebf17c2a2a | components/gh-upload-modal.js | components/gh-upload-modal.js | import ModalDialog from 'ghost/components/gh-modal-dialog';
import upload from 'ghost/assets/lib/uploader';
var UploadModal = ModalDialog.extend({
layoutName: 'components/gh-modal-dialog',
didInsertElement: function () {
this._super();
upload.call(this.$('.js-drop-zone'), {fileStorage: this.ge... | import ModalDialog from 'ghost/components/gh-modal-dialog';
import upload from 'ghost/assets/lib/uploader';
var UploadModal = ModalDialog.extend({
layoutName: 'components/gh-modal-dialog',
didInsertElement: function () {
this._super();
upload.call(this.$('.js-drop-zone'), {fileStorage: this.ge... | Fix button class on upload modal | Fix button class on upload modal
no issue
- this makes sure that the cancel button on the upload modal gets the
correct class
| JavaScript | mit | JohnONolan/Ghost-Admin,airycanon/Ghost-Admin,TryGhost/Ghost-Admin,acburdine/Ghost-Admin,JohnONolan/Ghost-Admin,kevinansfield/Ghost-Admin,dbalders/Ghost-Admin,kevinansfield/Ghost-Admin,acburdine/Ghost-Admin,airycanon/Ghost-Admin,dbalders/Ghost-Admin,TryGhost/Ghost-Admin |
e33da7f293c1dc45e2121b5dd881773c8716c76a | tests/dummy/app/routes/application.js | tests/dummy/app/routes/application.js | import Ember from 'ember';
export default Ember.Route.extend({
title: function(tokens) {
var base = 'My Blog';
var hasTokens = tokens && tokens.length;
return hasTokens ? tokens.reverse().join(' - ') + ' - ' + base : base;
}
});
| import Ember from 'ember';
export default Ember.Route.extend({
title: function(tokens) {
tokens = Ember.makeArray(tokens);
tokens.unshift('My Blog');
return tokens.reverse().join(' - ');
}
});
| Update test code to match README example | Update test code to match README example
| JavaScript | mit | ronco/ember-cli-document-title,kimroen/ember-cli-document-title,kimroen/ember-cli-document-title,ronco/ember-cli-document-title |
8d197c49b89665981b90fa7b43b73516ed6a67bc | app/modules/demo/demo.routes.js | app/modules/demo/demo.routes.js | 'use strict';
require('./demo.module.js')
.config(Routes);
/**
* @ngInject
*/
function Routes($stateProvider, $locationProvider, $urlRouterProvider) {
$locationProvider.html5Mode(true);
$stateProvider
.state('Home', {
url: '/',
controller: 'ExampleCtrl as home',
templateUrl... | 'use strict';
require('./demo.module.js')
.config(Routes);
/**
* @ngInject
*/
function Routes($stateProvider, $locationProvider, $urlRouterProvider) {
$stateProvider
.state('Home', {
url: '/',
controller: 'ExampleCtrl as home',
templateUrl: 'demo/home.html',
title: 'Home... | Remove html5 config option from demo module | Remove html5 config option from demo module
| JavaScript | mit | rogerhutchings/ng-davai,rogerhutchings/ng-davai |
e8d18d8b96361c0ba06f3e540fdf7717e8b1025c | src/google/fontapiurlbuilder.js | src/google/fontapiurlbuilder.js | /**
* @constructor
*/
webfont.FontApiUrlBuilder = function(apiUrl) {
if (apiUrl) {
this.apiUrl_ = apiUrl;
} else {
var protocol = 'https:' == window.location.protocol ? 'https:' : 'http:';
this.apiUrl_ = protocol + webfont.FontApiUrlBuilder.DEFAULT_API_URL;
}
this.fontFamilies_ = null;
};
webf... | /**
* @constructor
*/
webfont.FontApiUrlBuilder = function(apiUrl) {
if (apiUrl) {
this.apiUrl_ = apiUrl;
} else {
var protocol = 'https:' == window.location.protocol ? 'https:' : 'http:';
this.apiUrl_ = protocol + webfont.FontApiUrlBuilder.DEFAULT_API_URL;
}
this.fontFamilies_ = null;
};
webf... | Change the url builder to handle integrations. | Change the url builder to handle integrations.
| JavaScript | apache-2.0 | typekit/webfontloader,zeixcom/webfontloader,kevinrodbe/webfontloader,mettjus/webfontloader,sapics/webfontloader,Monotype/webfontloader,typekit/webfontloader,omo/webfontloader,sapics/webfontloader,digideskio/webfontloader,armandocanals/webfontloader,omo/webfontloader,ahmadruhaifi/webfontloader,JBusch/webfontloader,joelr... |
d1ccfc9a672c42c9fe3967f657ad1213d7288abd | gulpfile.js | gulpfile.js | const babel = require('gulp-babel');
const gulp = require('gulp');
const print = require('gulp-print');
gulp.task('js', () => {
return gulp.src('src/*.js')
.pipe(print())
.pipe( babel({ presets: ['es2015'] }))
.pipe(gulp.dest('dist'));
}); | const babel = require('gulp-babel');
const gulp = require('gulp');
const print = require('gulp-print');
gulp.task('build', () => {
return gulp.src('src/*.js')
.pipe(print())
.pipe( babel({ presets: ['es2015'] }))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', () => {
gulp.watch('src... | Change task name from 'js' to 'build' | Change task name from 'js' to 'build'
Add 'watch' task to gulp to build compiled JS files on ES6 file change
| JavaScript | mit | keenanamigos/es6-js-helper-functions |
f4ad01bf552e757b0afe515b4d5f0603403f7922 | app/assets/javascripts/comfortable_mexican_sofa/admin/modules/LinkManager.js | app/assets/javascripts/comfortable_mexican_sofa/admin/modules/LinkManager.js | define([
'jquery',
'DoughBaseComponent',
'InsertManager',
'eventsWithPromises'
], function (
$,
DoughBaseComponent,
InsertManager,
eventsWithPromises
) {
'use strict';
var LinkManagerProto,
defaultConfig = {
selectors: {
}
};
function LinkManager($el, config, customCo... | define([
'jquery',
'DoughBaseComponent',
'InsertManager',
'eventsWithPromises',
'filter-event'
], function (
$,
DoughBaseComponent,
InsertManager,
eventsWithPromises,
filterEvent
) {
'use strict';
var LinkManagerProto,
defaultConfig = {
selectors: {
}
};
function ... | Use filterEvent for filtering events | Use filterEvent for filtering events
| JavaScript | mit | moneyadviceservice/cms,moneyadviceservice/cms,moneyadviceservice/cms,moneyadviceservice/cms |
01b0c0c8a2d5c78d81cd0532fe837c14550fdf50 | hello.js | hello.js | // Hello page
//
exports.View =
{
title: "Hello World",
elements:
[
{ control: "stackpanel", orientation: "Horizontal", contents: [
{ control: "text", value: "First name:", fontsize: 12, width: 200, textAlignment: "Right", margin: { top: 10, right: 10 } },
{ control: "edit",... | // Hello page
//
exports.View =
{
title: "Hello World",
elements:
[
{ control: "text", value: "Enter your name:", font: { size: 12, bold: true } },
{ control: "stackpanel", orientation: "Horizontal", contents: [
{ control: "text", value: "First name:", fontsize: 12, width: 200,... | Update control alignment (was relying in platform-specific margins) | Update control alignment (was relying in platform-specific margins)
| JavaScript | mit | SynchroLabs/SynchroSamples |
c517504edce5d6767a353abc088e5084ad1a7e2a | spec/main-spec.js | spec/main-spec.js | 'use babel'
import {fork} from 'child_process'
import * as Communication from '../src/main'
const WORKER_PATH = __dirname + '/fixtures/worker.js'
describe('Process-Communication', function() {
describe('createFromProcess', function() {
it('works as expected', function() {
const child = fork(WORKER_PATH)... | 'use babel'
import {fork} from 'child_process'
import * as Communication from '../src/main'
const WORKER_PATH = __dirname + '/fixtures/worker.js'
describe('Process-Communication', function() {
describe('createFromProcess', function() {
it('works as expected', function() {
const child = fork(WORKER_PATH)... | Add specs for latest exit event | :new: Add specs for latest exit event
| JavaScript | mit | steelbrain/process-communication |
03e248c9803b16c6c1cd8bad5524b668f3ac987e | modules/help.js | modules/help.js | 'use strict';
const builder = require('botbuilder');
module.exports = exports = [(session) => {
const card = new builder.HeroCard(session)
.title('JIRA Journal Bot')
.text('Your bullet journal - whatever you want to log.')
.images([
builder.CardImage.create(session, 'http://do... | 'use strict';
const builder = require('botbuilder');
module.exports = exports = [(session) => {
const card = new builder.HeroCard(session)
.title('JIRA Journal Bot')
.text('Your bullet journal - whatever you want to log.')
.images([
builder.CardImage.create(session, 'https://b... | Include a temp logo for bot. | Include a temp logo for bot.
| JavaScript | mit | 99xt/jira-journal,99xt/jira-journal |
764df7490dd131106a62bea47469aa171f283cdb | client/templates/app/nav/nav.js | client/templates/app/nav/nav.js | Template.nav.onRendered(function() {
this.$('.button-collapse').sideNav({
closeOnClick: true
});
});
Template.nav.events({
'click .logout': function(e){
e.preventDefault();
Meteor.logout(function(){
sAlert.info('Logged out succesfully');
});
}
})
Template.userDropdown.onRendered(function... | Template.nav.onRendered(function() {
this.$('.button-collapse').sideNav({
closeOnClick: true
});
});
Template.nav.events({
'click .logout': function(e){
e.preventDefault();
Meteor.logout(function(){
sAlert.info('Logged out succesfully');
});
}
})
Template.userDropdown.onRendered(function... | Fix pesky modal duplication issue... | Fix pesky modal duplication issue...
| JavaScript | mit | mtr-cherish/cherish,mtr-cherish/cherish |
49af20920479ecd2772c929e301dbe48623f4a07 | src/Characters.js | src/Characters.js | "use strict"
const Characters = {
WIDE_BAR: "W",
NARROW_BAR: "N",
WIDE_SPACE: "w",
NARROW_SPACE: "n",
}
module.exports = Characters
| export const WIDE_BAR = "W"
export const NARROW_BAR = "N"
export const WIDE_SPACE = "w"
export const NARROW_SPACE = "n"
| Use es6 imports / exports | Use es6 imports / exports
| JavaScript | mit | mormahr/barcode.js,mormahr/barcode.js |
20c23bb1482b7bf2498baa46db2b97fba6ff701d | src/state/FormBuilderState.js | src/state/FormBuilderState.js | import DefaultContainer from './DefaultContainer'
import {getFieldType} from '../utils/getFieldType'
const noop = () => {}
export function createFieldValue(value, context) {
const {schema, field, resolveContainer} = context
if (!field) {
throw new Error(`Missing field for value ${value}`)
}
const fieldT... | import DefaultContainer from './DefaultContainer'
import {getFieldType} from '../utils/getFieldType'
const noop = () => {}
export function createFieldValue(value, context) {
const {schema, field, resolveContainer} = context
if (!field) {
throw new Error(`Missing field for value ${value}`)
}
const fieldT... | Improve error message if resolveContainer throws | Improve error message if resolveContainer throws
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
782f9a4018618fc0615b7857848a0f7d918a77bf | public/js/controllers/index.js | public/js/controllers/index.js | angular.module('mean.system').controller('IndexController', ['$scope', 'Global', 'socket', function ($scope, Global, socket) {
$scope.global = Global;
socket.on('test', function() {
console.log('test!');
});
}]); | angular.module('mean.system').controller('IndexController', ['$scope', 'Global', 'socket', function ($scope, Global, socket) {
$scope.global = Global;
socket.on('test', function() {
console.log('test!');
});
}]).controller('CardController', ['$scope', 'ApiService', function($scope, ApiService) {
Api... | Split up question/answer cards to be handled by different functions | Split up question/answer cards to be handled by different functions
| JavaScript | mit | andela/kissa-cfh-project,andela/kiba-cfh,andela/temari-cfh,andela/kissa-cfh-project,cardsforhumanity/cardsforhumanity,andela/kiba-cfh,cardsforhumanity/cardsforhumanity,andela/temari-cfh |
e11cdbfdf605225184acbc48a7af45a719d0a832 | app/resize/index.js | app/resize/index.js | import candela from './../../src/candela';
import indexContent from './index.jade';
import 'javascript-detect-element-resize/detect-element-resize';
import './index.styl';
function showPage () {
[...document.getElementsByClassName('page')].forEach(el => {
el.classList.add('hidden');
});
let pageId = 'main';
... | import candela from './../../src/candela';
import indexContent from './index.jade';
import 'javascript-detect-element-resize/detect-element-resize';
import './index.styl';
function showPage () {
[...document.getElementsByClassName('page')].forEach(el => {
el.classList.add('hidden');
});
let pageId = 'main';
... | Fix resize demo to work with updated Scatter plot | Fix resize demo to work with updated Scatter plot
| JavaScript | apache-2.0 | Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela |
29ec5b25a9a10568e98eee4bd6964e58090ac470 | gulp/tasks/clean.js | gulp/tasks/clean.js | import gulp from 'gulp';
import del from 'del';
const list = [
'src/web/**/*.css',
'src/web/**/*.css.map',
'src/web/**/*.js.map',
'dist/**/*',
// exclusion
'!src/web/vendor/**'
];
export default (options) => {
gulp.task('clean', (callback) => {
del(list).then(() => {
ca... | import gulp from 'gulp';
import del from 'del';
const list = [
'dist/cnc/app',
'dist/cnc/web',
'src/web/**/*.css',
'src/web/**/*.css.map',
'src/web/**/*.js.map',
// exclusion
'!src/web/vendor/**'
];
export default (options) => {
gulp.task('clean', (callback) => {
del(list).then... | Clean only app and web from dist/cnc | Clean only app and web from dist/cnc
| JavaScript | mit | cheton/cnc,cncjs/cncjs,cncjs/cncjs,cheton/piduino-grbl,cncjs/cncjs,cheton/piduino-grbl,cheton/cnc.js,cheton/cnc,cheton/cnc.js,cheton/piduino-grbl,cheton/cnc,cheton/cnc.js |
d73050a1e157f1786a0361cec00768f170fad647 | config-sample.js | config-sample.js | "use strict";
module.exports = {
twitter: {
consumer_key: "",
consumer_secret: "",
access_token: "",
access_token_secret: ""
},
timezone: "Asia/Tokyo",
themeCount: 4,
themes: [
"ココア",
"チノ",
"リゼ",
"千夜",
"シャロ",
"マヤ",
"メグ",
"青山ブルーマウンテン",
"モカ",
"ティッピー",... | "use strict";
module.exports = {
twitter: {
consumer_key: "",
consumer_secret: "",
access_token: "",
access_token_secret: ""
},
timezone: "Asia/Tokyo",
themeCount: 4,
themes: [
"ココア",
"チノ",
"リゼ",
"千夜",
"シャロ",
"マヤ",
"メグ",
"青山ブルーマウンテン",
"モカ",
"凛",
... | Add themes to default config | Add themes to default config
| JavaScript | mit | rot1024/gochiusa-onedraw-bot |
2fc2997ac3f47d4101a96d39e6850ff620e976d3 | assets/js/common.js | assets/js/common.js | function successMessage(message) {
new PNotify({
title: 'Success!!',
text: message,
type: 'success'
});
}
function errorMessage(message) {
new PNotify({
title: 'Failed!!',
text: message,
type: 'error'
});
} | function successMessage(message) {
new PNotify({
title: 'Success!!',
text: message,
type: 'success'
});
}
function errorMessage(message) {
new PNotify({
title: 'Failed!!',
text: message,
type: 'error'
});
}
// Preview image
function previewImage(input) {... | Add previewImage on Common js | Add previewImage on Common js
| JavaScript | mit | gctomakin/renTRMNL,gctomakin/renTRMNL,gctomakin/renTRMNL |
95a5b7ae3438ae47aff3102077dce77464a5430c | setup/setupBeta.js | setup/setupBeta.js | /**
* Validate if the application is in beta
* and the user has the access token to
* view the beta version.
*
* If not authorized session, then display coming soon
*/
const env = require('../env')
module.exports = (app) => {
// This is only valid for Heroku.
// Change this if you're using other
// hosting... | /**
* Validate if the application is in beta
* and the user has the access token to
* view the beta version.
*
* If not authorized session, then display coming soon
*/
const env = require('../env')
module.exports = (app) => {
// This is only valid for Heroku.
// Change this if you're using other
// hosting... | Check if beta flag is activated | Check if beta flag is activated
| JavaScript | mit | ferreiro/website,ferreiro/website |
486b73ea5f37f93c120e2b9b683be50641690fd9 | lib/exec.js | lib/exec.js | 'use strict';
const { execFile } = require('child_process');
const exec = (...args) => {
return new Promise((resolve, reject) => {
execFile(...args, (err, stdout) => {
if (err) {
reject(err);
return;
}
resolve(stdout);
});
});... | 'use strict';
const util = require('util');
const childProcess = require('child_process');
const execFile = util.promisify(childProcess.execFile);
const exec = async (...args) => {
const { stdout } = await execFile(...args);
return stdout;
};
module.exports = exec;
| Simplify with async and await | Simplify with async and await
| JavaScript | mpl-2.0 | sholladay/os-proxy |
d7ef13680371c6ca8176826a5f140cd1fe6eea13 | tests/routes/Home/index.spec.js | tests/routes/Home/index.spec.js | import HomeRoute from 'routes/Home'
describe('(Route) Home', () => {
let _component
beforeEach(() => {
_component = HomeRoute.component()
})
it('Should return a route configuration object', () => {
expect(typeof HomeRoute).to.equal('object')
})
it('Should define a route component', () => {
e... | import HomeRoute from 'routes/Home'
import { Content } from 'react-mdc-web'
describe('(Route) Home', () => {
let _component
beforeEach(() => {
_component = HomeRoute.component()
})
it('Should return a route configuration object', () => {
expect(typeof HomeRoute).to.equal('object')
})
it('Should ... | Fix text for new component | Fix text for new component
| JavaScript | mit | techcoop/techcoop.group,techcoop/techcoop.group |
5fe6d82e9acbdd8baed5bd8d8e3e0eb182c5fd19 | src/components/search_bar.js | src/components/search_bar.js | import React, { Component } from 'react'
//class-based component (ES6)
class SearchBar extends Component {
constructor(props) {
super(props);
this.state = { term: '' }
}
render() { //method definition in ES6
return <input onChange={event => console.log(event.target.value)} />;
}
}
export defaul... | import React, { Component } from 'react'
//class-based component (ES6)
class SearchBar extends Component {
constructor(props) {
super(props);
this.state = { searchInput: '' } //This is the only time we set state like this. We usually use setState
}
render() { //method definition in ES6
return (
... | Set the state of the component and output it to the screen | Set the state of the component and output it to the screen
| JavaScript | mit | phirefly/react-redux-starter,phirefly/react-redux-starter |
13dfef553e22433d89800c6a2d90dadc8a968fcd | src/engine/monitor-record.js | src/engine/monitor-record.js | const {Record} = require('immutable');
const MonitorRecord = Record({
id: null, // Block Id
/** Present only if the monitor is sprite-specific, such as x position */
spriteName: null,
/** Present only if the monitor is sprite-specific, such as x position */
targetId: null,
opcode: null,
val... | const {Record} = require('immutable');
const MonitorRecord = Record({
id: null, // Block Id
/** Present only if the monitor is sprite-specific, such as x position */
spriteName: null,
/** Present only if the monitor is sprite-specific, such as x position */
targetId: null,
opcode: null,
val... | Fix default value for monitor record | Fix default value for monitor record
| JavaScript | bsd-3-clause | LLK/scratch-vm,LLK/scratch-vm,LLK/scratch-vm |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.