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 |
|---|---|---|---|---|---|---|---|---|---|
e4594662b73173fae86d3ad64351828421aae962 | src/palettes/nearest.js | src/palettes/nearest.js | // @flow
import { RANGE } from "constants/controlTypes";
import type { ColorRGBA } from "types";
const optionTypes = {
levels: { type: RANGE, range: [1, 256], default: 2 }
};
const defaults = {
levels: optionTypes.levels.default
};
// Gets nearest color
const getColor = (
color: ColorRGBA,
options: { level... | // @flow
import { RANGE } from "constants/controlTypes";
import type { ColorRGBA } from "types";
const optionTypes = {
levels: { type: RANGE, range: [1, 256], default: 2 }
};
const defaults = {
levels: optionTypes.levels.default
};
// Gets nearest color
const getColor = (
color: ColorRGBA,
options: { level... | Return early if full colour | Nearest: Return early if full colour
| JavaScript | mit | gyng/ditherer,gyng/ditherer,gyng/ditherer |
9fe2fb9aed4fb4c8833443a4df400591d18976da | dangerfile.js | dangerfile.js | import { danger, warn } from 'danger';
const packageChanged = danger.git.modified_files.includes('package.json');
const lockfileChanged = danger.git.modified_files.includes('package-lock.json');
if (packageChanged && !lockfileChanged) {
warn(`Changes were made to package.json, but not to package-lock.json.
Perhaps y... | import { danger, warn } from 'danger';
const packageChanged = danger.git.modified_files.includes('package.json');
const lockfileChanged = danger.git.modified_files.includes('package-lock.json');
if (packageChanged && !lockfileChanged) {
warn(`Changes were made to package.json, but not to package-lock.json.
Perhaps y... | Update message when package-lock.json should be updated | Chore: Update message when package-lock.json should be updated
No need to remove lock file anymore. | JavaScript | mit | styleguidist/react-styleguidist,sapegin/react-styleguidist,sapegin/react-styleguidist,styleguidist/react-styleguidist,bluetidepro/react-styleguidist,styleguidist/react-styleguidist |
fdedf38a1ccc570ca5ce30e4bf72a0927fa119b1 | scripts/tasks/download.js | scripts/tasks/download.js | 'use strict'
var github = require('octonode')
var client = github.client()
var evRepo = client.repo('nodejs/evangelism')
var https = require('https')
var path = require('path')
var fs = require('fs')
/* Currently proof-of-concept work. Outstanding:
* ================
* - [ ] gulpify
* - [ ] add to local boot proc... | 'use strict'
const github = require('octonode')
const https = require('https')
const path = require('path')
const fs = require('fs')
const basePath = path.join(__dirname, '..', '..', 'locale', 'en', 'blog', 'weekly-updates')
const repo = github.client().repo('nodejs/evangelism')
/* Currently proof-of-concept work. O... | Use `fs.access` instead of `fs.existsSync` | Use `fs.access` instead of `fs.existsSync`
| JavaScript | mit | strawbrary/nodejs.org,marocchino/new.nodejs.org,abdelrahmansaeedhassan/yuri,boneskull/new.nodejs.org,nodejs/new.nodejs.org,rnsloan/new.nodejs.org,yous/new.nodejs.org,matthewloring/new.nodejs.org,rnsloan/new.nodejs.org,boneskull/new.nodejs.org,yous/new.nodejs.org,nodejs/new.nodejs.org,strawbrary/nodejs.org,phillipj/new.... |
9df9040dfbb5004a3a3ff90287caed2d03c77c3f | simplayer.js | simplayer.js | #!/usr/bin/env node
'use strict';
var childProcess = require('child_process');
/**
* play
* To run the process to match the platform.
* @param {string} filepath
* @param {function} callback
* @return {Object} childProcess
*/
function play(filepath, callback) {
var mediaSoundPlayer = '(New-Object System.Media... | #!/usr/bin/env node
'use strict';
var childProcess = require('child_process');
/**
* play
* To run the process to match the platform.
* @param {string} filepath
* @param {function} callback
* @return {Object} childProcess
*/
function play(filepath, callback) {
var mediaSoundPlayer = '"(New-Object System.Medi... | Fix no exit to the powershell in windows | Fix no exit to the powershell in windows
| JavaScript | mit | MaxMEllon/simplayer |
3d94482d5e8a9be898cb707f4ceccf1c90b9c068 | lib/EventService.js | lib/EventService.js | const P = require('bluebird');
const preq = require('preq');
const uuid = require('cassandra-uuid').TimeUuid;
function getResourceChangeEvent(resourceUri, domain) {
return {
meta: {
topic: 'resource_change',
uri: resourceUri,
id: uuid.now().toString(),
dt: new Date().toISOString(),
... | const P = require('bluebird');
const preq = require('preq');
const uuid = require('cassandra-uuid').TimeUuid;
function getResourceChangeEvent(resourceUri, domain) {
return {
meta: {
topic: 'resource_change',
uri: resourceUri,
id: uuid.now().toString(),
dt: new Date().toISOString(),
... | Add protocol to resource_change event URIs | Add protocol to resource_change event URIs
| JavaScript | apache-2.0 | kartotherian/tilerator,kartotherian/tilerator,kartotherian/tilerator |
a62988bb0fd8f72faac3ed409eac105e06bf565f | demo/index.js | demo/index.js | require('./lib/seed')()
const { compose } = require('ramda')
const http = require('http')
const util = require('util')
const { logger, methods, mount, parseJson,
redirect, routes, static } = require('..')
const {
createCourse,
fetchCourse,
fetchCourses,
updateCourse
} = require('./api/courses')
const... | require('./lib/seed')()
const { compose } = require('ramda')
const http = require('http')
const util = require('util')
const { logger, methods, mount, parseJson,
redirect, routes, static } = require('..')
const {
createCourse,
fetchCourse,
fetchCourses,
updateCourse
} = require('./api/courses')
const... | Use PORT env var for heroku demo | Use PORT env var for heroku demo
| JavaScript | mit | articulate/paperplane |
b05972b6d8695469c655f89235773cea751e7410 | src/star_constructor.js | src/star_constructor.js | function chart(selection) {
// Merging the various user params
vars.user_vars = vistk.utils.merge(vars.user_vars, vars._user_vars);
// Merging with current charts parameters set by the user in the HTML file
vars = vistk.utils.merge(vars, vars.user_vars);
// Create the top level element conainin... | function chart(selection) {
// Merging the various user params
vars.user_vars = vistk.utils.merge(vars.user_vars, vars._user_vars);
// Merging with current charts parameters set by the user in the HTML file
vars = vistk.utils.merge(vars, vars.user_vars);
// Create the top level element conainin... | Allow elements within SVG to overflow | Allow elements within SVG to overflow
| JavaScript | mit | cid-harvard/vis-toolkit,cid-harvard/vis-toolkit |
e49c8ea16ed78ed1246905f4139aac9674122b83 | src/components/toolbar/models/SelectStateModel.js | src/components/toolbar/models/SelectStateModel.js | import SelectStateItemsCollection from '../collections/SelectStateItemsCollection';
import meta from '../meta';
export default Backbone.Model.extend({
initialize() {
const items = this.get('items');
const itemsCollection = new SelectStateItemsCollection(items);
this.listenTo(itemsCollection... | import SelectStateItemsCollection from '../collections/SelectStateItemsCollection';
import meta from '../meta';
export default Backbone.Model.extend({
initialize() {
const items = this.get('items');
const itemsCollection = new SelectStateItemsCollection(items);
this.listenTo(itemsCollection... | Add default selected state to toolbar selections. | Add default selected state to toolbar selections.
| JavaScript | mit | comindware/core-ui,comindware/core-ui,comindware/core-ui,comindware/core-ui |
11290de91c78b3e5c98c96723b8bd4935be2b2a4 | ghost/admin/app/session-stores/application.js | ghost/admin/app/session-stores/application.js | import AdaptiveStore from 'ember-simple-auth/session-stores/adaptive';
export default AdaptiveStore.extend({
localStorageKey: 'ghost:session',
cookieName: 'ghost:session'
});
| import AdaptiveStore from 'ember-simple-auth/session-stores/adaptive';
import ghostPaths from 'ghost/utils/ghost-paths';
const paths = ghostPaths();
const keyName = `ghost${(paths.subdir.indexOf('/') === 0 ? `-${paths.subdir.substr(1)}` : ``) }:session`;
export default AdaptiveStore.extend({
localStorageKey: keyN... | Set localStorage key based on subdir | Set localStorage key based on subdir
closes #6326
| JavaScript | mit | TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost |
83c643c19035a44d74b8aeccfe279dc2c7ce3367 | lib/config/index.js | lib/config/index.js | 'use strict';
const readConfig = require('restore-server-config');
// singleton
let config;
/**
* Loads the configuration and stores it in the config singleton.
* @param {string} baseDir Directory which contains the folder cfg with the config files.
* @param [Logger] logger
*/
function load(baseDir, logger) {
... | 'use strict';
const readConfig = require('restore-server-config');
// singleton
let config;
/**
* Loads the configuration and stores it in the config singleton.
* @param {string} baseDir Directory which contains the folder cfg with the config files.
* @param [Logger] logger
*/
function load(baseDir, logger) {
... | Replace config load callback wrapper | Replace config load callback wrapper
| JavaScript | mit | restorecommerce/chassis-srv,restorecommerce/chassis-srv |
bc85619117de88c6248f7652bb82a9396f35adc9 | app/assets/javascripts/web.js | app/assets/javascripts/web.js | //= require jquery
//= require leaflet
//= require leaflet-ajax
//= require leaflet-routing-machine
//= require osmtogeojson
//= require maps
$("#agua").change(function () {
if (this.checked) {
showWindsLayer();
} else {
hideWindsLayer();
}
})
$("#lluvia").change(function () {
if (thi... | //= require jquery
//= require leaflet
//= require leaflet-ajax
//= require leaflet-routing-machine
//= require osmtogeojson
//= require maps
$( document ).ready(function() {
$("#agua").change(function () {
if (this.checked) {
showWindsLayer();
} else {
hideWindsLayer();
... | Add checkbox event listeners after document load. | Add checkbox event listeners after document load.
| JavaScript | mit | ForestGuardian/ForestGuardianBackend,ForestGuardian/ForestGuardianBackend,ForestGuardian/ForestGuardianBackend,ForestGuardian/ForestGuardianBackend,ForestGuardian/ForestGuardianBackend |
685e7f437e4155c80814ca81f246a3571f85289f | spec/components/link.js | spec/components/link.js | import React, { PureComponent } from 'react';
import Link from '../../components/link';
class LinkTest extends PureComponent {
handleClick = () => {
console.log('Clicked on a link');
};
render () {
return (
<article>
<header>
<h1>Links</h1>
</header>
<div classNam... | import React, { PureComponent } from 'react';
import { Link, Heading1, Section } from '../../components/';
import { BrowserRouter as Router, Link as ReactRouterLink } from 'react-router-dom';
Link.use(ReactRouterLink);
class LinkTest extends PureComponent {
handleClick = () => {
console.log('Clicked on a link')... | Use the Link component from react-router in combination with our custom styled Link | Use the Link component from react-router in combination with our custom styled Link
| JavaScript | mit | teamleadercrm/teamleader-ui |
6bbed196b8b30180936e38e17bfddd3617752d31 | __tests__/components/Thumbnail-test.js | __tests__/components/Thumbnail-test.js | import React from 'react';
import shallowRender from '../utils/shallowRender';
import Thumbnail from '../../src/components/Thumbnail';
jest.unmock('../../src/components/Thumbnail');
describe('Thumbnail Component', () => {
it('should be a div HTML element', () => {
const output = shallowRender(<Thumbnail />);
... | import React from 'react';
import shallowRender from '../utils/shallowRender';
import Thumbnail from '../../src/components/Thumbnail';
jest.unmock('../../src/components/Thumbnail');
describe('Thumbnail Component', () => {
it('should be a div HTML element', () => {
const output = shallowRender(<Thumbnail />);
... | Update tests for Thumbnail component | Update tests for Thumbnail component
| JavaScript | mit | LittleFurryBastards/webpack-react-redux,LittleFurryBastards/webpack-babel-react,LittleFurryBastards/webpack-babel-react,LittleFurryBastards/webpack-react-redux |
d23a0c33a1db143c2b821dd307096d466db3c7af | src/frontend/lite/src/walletPath.js | src/frontend/lite/src/walletPath.js | import { app } from "electron";
const isDevelopment = process.env.NODE_ENV !== "production";
import os from "os";
import path from "path";
let walletPath = "";
if (process.type !== "renderer") {
if (os.platform() === "linux") {
walletPath = path.join(
app.getPath("home"),
isDevelopment ? ".gulden_d... | import { app } from "electron";
const isDevelopment = process.env.NODE_ENV !== "production";
import os from "os";
import path from "path";
let walletPath = "";
if (process.type !== "renderer") {
if (os.platform() === "linux") {
walletPath = path.join(
app.getPath("home"),
isDevelopment ? ".gulden_l... | Change wallet path for lite wallet | ELECTRON: Change wallet path for lite wallet
| JavaScript | mit | nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official |
2014d17c9c301508b0747327fc6a2a7b8dd538a3 | src/main/web/florence/js/functions/_reset.js | src/main/web/florence/js/functions/_reset.js | function resetPage() {
// Prevent default behaviour of all form submits throught Florence
$(document).on('submit', 'form', function(e) {
e.preventDefault();
console.log('Form submit stopped on: ', e);
});
// Fix for modal form submits not being detected
$(document).on('click', 'butt... | function resetPage() {
// Prevent default behaviour of all form submits throught Florence
$(document).on('submit', 'form', function(e) {
e.preventDefault();
});
// Fix for modal form submits not being detected
$(document).on('click', 'button', function() {
var $closestForm = $(this)... | Remove form submit prevention logging | Remove form submit prevention logging
| JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence |
dc14852989ce28312ea93b1e2210f70f9928ee79 | app/navigation/renderScene.js | app/navigation/renderScene.js | /* @flow */
import React from "react-native";
import routeMapper from "../routes/routeMapper";
import Colors from "../../Colors.json";
const {
NavigationCard,
StyleSheet,
View
} = React;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.lightGrey
},
normal: {
marginTop: 56... | /* @flow */
import React from "react-native";
import routeMapper from "../routes/routeMapper";
import Colors from "../../Colors.json";
const {
NavigationCard,
StyleSheet,
View
} = React;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.lightGrey
},
normal: {
marginTop: 56... | Use sceneRecord.get to get current route | Use sceneRecord.get to get current route
| JavaScript | unknown | scrollback/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods,wesley1001/io.scrollback.neighborhoods,wesley1001/io.scrollback.neighborhoods |
722184133a934315f1bd261bd4a16c54d5607be7 | app/themes/base/containers.js | app/themes/base/containers.js | export default ({ borders, colors, radii, space }) => {
const defaultStyles = {
mx: 'auto',
bg: colors.white,
width: ['100%', '85%'],
mb: `${space[6]}px`,
};
const large = {
...defaultStyles,
maxWidth: '1280px',
};
const medium = {
...defaultStyles,
maxWidth: '840px',
};
... | export default ({ borders, colors, radii, space }) => {
const defaultStyles = {
mx: 'auto',
bg: colors.white,
width: ['100%', '85%'],
mb: `${space[6]}px`,
position: 'relative',
};
const large = {
...defaultStyles,
maxWidth: '1280px',
};
const medium = {
...defaultStyles,
... | Add relative position to default container styles | [WEB-1338] Add relative position to default container styles
| JavaScript | bsd-2-clause | tidepool-org/blip,tidepool-org/blip,tidepool-org/blip |
940f3dce1f1aa7c885e66705c42df93810a308dd | lib/ticket-types.js | lib/ticket-types.js | 'use strict';
function ticketTypes (args, callback) {
var ticketTypes = [
{name: 'ninja', title: 'Ninja', tooltip: 'Select Ninja to create tickets for attendees under 13 or over 13.'},
{name: 'parent-guardian', title: 'Parent/Guardian', tooltip: 'Select Parent/Guardian to create tickets for parents/guardians... | 'use strict';
function ticketTypes (args, callback) {
/* ninja is defined as a key in many areas, keep it for backward compatibility */
var ticketTypes = [
{name: 'ninja', title: 'Youth', tooltip: 'Select Youth to create tickets for attendees under 18.'},
{name: 'parent-guardian', title: 'Parent/Guardian',... | Rename ninja to youth to reduce confusion | Rename ninja to youth to reduce confusion
| JavaScript | mit | CoderDojo/cp-events-service,CoderDojo/cp-events-service |
2984f42931b1030093f4329b51fc202063001eda | src/app/index.module.js | src/app/index.module.js | /* global malarkey:false, moment:false */
import { config } from './index.config';
import { routerConfig } from './index.route';
import { themeConfig } from './index.theme';
import { runBlock } from './index.run';
import { MainController } from './main/main.controller';
import { DetailsController } from './details/det... | /* global moment:false */
import { config } from './index.config';
import { routerConfig } from './index.route';
import { themeConfig } from './index.theme';
import { runBlock } from './index.run';
import { MainController } from './main/main.controller';
import { DetailsController } from './details/details.controller'... | FIX - Removed unused dependencies | FIX - Removed unused dependencies
| JavaScript | mit | lucasdesenna/generic-search-flow,lucasdesenna/generic-search-flow |
4ba2b6b0e60bbd7d101f61e228ec4191c608e288 | src/index.js | src/index.js | 'use strict';
/**
* Make a web element pannable.
*/
module.exports = {
init: (elem, containerElem) => {
var container = containerElem ?
containerElem : elem.parentElement;
elem.addEventListener('mousemove', (e) => {
e.preventDefault();
if (e && e.which === 1) {
if (e.movementX !== 0) {
con... | 'use strict';
/**
* Limit execution of onReady function
* to once over the given wait time.
*
* @function _throttle
* @private
*
* @param {function} onReady
* @param {function} onStandby
* @param {number} wait
*
* @returns {function}
*/
const _throttle = (onReady, onStandby, wait) => {
let time = Date.... | Implement throttling on event listener | Implement throttling on event listener
| JavaScript | mit | selcher/panner,selcher/panner |
7235b162e7080fe287f83edd84b13a91a4aa0ab2 | app/scripts/plugins/draw/draw.js | app/scripts/plugins/draw/draw.js | define(['backbone', 'backbone.marionette', 'communicator', 'leaflet', 'leaflet.draw'],
function(Backbone, Marionette, Communicator, L, LeafletDraw) {
return Marionette.Object.extend({
map: null,
mapController: null,
initialize: function(o) {
var self = this;
Communicator.medi... | define(['backbone', 'backbone.marionette', 'communicator', 'leaflet', 'leaflet.draw'],
function(Backbone, Marionette, Communicator, L, LeafletDraw) {
return Marionette.Object.extend({
map: null,
mapController: null,
initialize: function(o) {
var self = this;
Communicator.medi... | Remove circle and rectangle tools | Remove circle and rectangle tools
| JavaScript | mit | TotalActiveMedia/erfgeoviewer,TotalActiveMedia/erfgeoviewer,TotalActiveMedia/erfgeoviewer |
2b2aae763a3dc985a6bde7345a0798a7e0347423 | projects/immersive-and-narrative/plugins/MediaEvents/src/MediaEvents.js | projects/immersive-and-narrative/plugins/MediaEvents/src/MediaEvents.js | var ForgePlugins = ForgePlugins || {};
ForgePlugins.MediaEvents = function()
{
this._video = null;
};
ForgePlugins.MediaEvents.prototype =
{
boot: function()
{
this._setupVideo();
},
reset: function()
{
this._clearVideo();
this._setupVideo();
},
_setupVideo: f... | var ForgePlugins = ForgePlugins || {};
ForgePlugins.MediaEvents = function()
{
this._video = null;
};
ForgePlugins.MediaEvents.prototype =
{
boot: function()
{
this._setupVideo();
},
reset: function()
{
this._clearVideo();
this._setupVideo();
},
_setupVideo: f... | Fix MediaEvent plugin of immersive project for new scene media | Fix MediaEvent plugin of immersive project for new scene media
| JavaScript | apache-2.0 | gopro/forgejs-samples,gopro/forgejs-samples |
aa7245ba61b8a9f4c0c50d1516b59e618caf3050 | src/subtitulamos/resources/assets/js/rules.js | src/subtitulamos/resources/assets/js/rules.js | /**
* This file is covered by the AGPLv3 license, which can be found at the LICENSE file in the root of this project.
* @copyright 2020 subtitulamos.tv
*/
import "../css/rules.scss";
import { onDomReady } from "./utils";
onDomReady(() => {
for (const $spoilerWrapper of document.querySelectorAll(".spoiler-wrapper... | /**
* This file is covered by the AGPLv3 license, which can be found at the LICENSE file in the root of this project.
* @copyright 2020 subtitulamos.tv
*/
import "../css/rules.scss";
import { get_all, onDomReady } from "./utils";
onDomReady(() => {
for (const $spoilerName of get_all(".spoiler-name")) {
$spoi... | Fix collapsing of rule explanations | Fix collapsing of rule explanations
| JavaScript | agpl-3.0 | subtitulamos/subtitulamos,subtitulamos/subtitulamos,subtitulamos/subtitulamos,subtitulamos/subtitulamos,subtitulamos/subtitulamos |
675065d9085e8c4dc7ee8214a7eade47d5041f51 | src/utils.js | src/utils.js | const defaults = require('./defaults.js');
const parseBoolean = boolean => boolean === 'true';
const parseIntervals = (intervals) => {
if (Array.isArray(intervals)) {
return intervals
.filter(i => !isNaN(i))
.map(parseFloat)
.sort((a, b) => a - b);
}
const interval = parseFloat(intervals);... | const defaults = require('./defaults.js');
const parseBoolean = boolean => boolean === 'true';
const parseIntervals = (intervals) => {
if (Array.isArray(intervals)) {
return intervals
.filter(i => !isNaN(i))
.map(parseFloat)
.sort((a, b) => a - b);
}
const interval = parseFloat(intervals);... | Clone `defaults` object to avoid member assignment | Clone `defaults` object to avoid member assignment
Fixes urbica/galton#183
| JavaScript | mit | urbica/galton,urbica/galton |
57125a8c83882e44b2108e7ecac9240dfd90c8cf | src/js/pebble-js-app.js | src/js/pebble-js-app.js | var initialized = false;
Pebble.addEventListener("ready", function() {
console.log("ready called!");
initialized = true;
});
Pebble.addEventListener("showConfiguration", function() {
console.log("showing configuration");
var shakeToCheat = 1; // get current setting from pebble
Pebble.openURL('http://rawgith... | var initialized = false;
Pebble.addEventListener("ready", function() {
console.log("ready called!");
initialized = true;
});
Pebble.addEventListener("showConfiguration", function() {
console.log("showing configuration");
var shakeToCheat = localStorage.getItem("shake-to-cheat") || 1;
Pebble.openURL('http://... | Load and persist config on phone app | Load and persist config on phone app
| JavaScript | mit | chasecolburn/line-maze,chasecolburn/line-maze,chasecolburn/line-maze |
f74006ac42b9a1d75b2887130fd0046b7d05f268 | client/components/admin-lte/Sidebar.js | client/components/admin-lte/Sidebar.js | import React from 'react';
import SideLink from '../common/SideLink';
import { Link } from 'react-router';
const Sidebar = (props) => { // eslint-disable-line no-unused-vars
return (
<aside className="main-sidebar">
<section className="sidebar">
<div className="user-panel">
... | import React from 'react';
import SideLink from '../common/SideLink';
import { Link } from 'react-router';
const Sidebar = (props) => { // eslint-disable-line no-unused-vars
return (
<aside className="main-sidebar">
<section className="sidebar">
<div className="user-panel">
... | Add a link to the import-subscribers page in the sidebar | Add a link to the import-subscribers page in the sidebar
| JavaScript | bsd-3-clause | zhakkarn/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,karuppiah7890/Mail-for-Good,karuppiah7890/Mail-for-Good,zhakkarn/Mail-for-Good |
2ef6613becea4df29aaf9aeff58d308686743084 | app/js/app.js | app/js/app.js | var store = null;
$(function() {
$(document).on("dragstart", "img", false);
$("#page-back").click(function() {
utils.page(utils.page() - 1);
});
$("#page-next").click(function() {
utils.page(utils.page() + 1);
});
$.getJSON("data.json").done(function(data) {
if(data.length == 0) alert("No dat... | var store = null;
$(function() {
$(document).on("dragstart", "img", false);
$("#page-back").click(function() {
utils.page(utils.page() - 1);
});
$("#page-next").click(function() {
utils.page(utils.page() + 1);
});
$(window).keydown(function(event) {
if(event.keyCode == 39) {
event.preve... | Allow using keyboard to move between pages as well | Allow using keyboard to move between pages as well
| JavaScript | mit | bloopletech/mangos,bloopletech/videos,bloopletech/videos |
b81ff5ecc2ccb982c136305f9df3fb3c0d72827c | libs/Mailer.js | libs/Mailer.js | // let messanger = require('./mailer/transport')();
module.exports = function(_db, messanger){
if(!SlickSources[_db]) return {start: () => false};
let _req = {db:SlickSources[_db]},
Mails = Models.Mails(_req),
fetchMails = cb => {
Mails.find({limit:100,sent:'0'}, function(e, rec... | // let messanger = require('./mailer/transport')();
module.exports = function(_db, messanger){
if(!SlickSources[_db]) return {start: () => false};
let _req = {db:SlickSources[_db]},
Mails = Models.Mails(_req),
fetchMails = cb => {
Mails.find({limit:100}, function(e, recs){
... | Remove handling of failed send error | Remove handling of failed send error
| JavaScript | mit | steveesamson/slicks-bee,steveesamson/slicks-bee |
5c4c8f1b0b3557cde47b7ec4a2c553a3acca7a36 | src/error.js | src/error.js | //
// Error handling
//
export var onError
export function catchFunctionErrors(delegate) {
return onError ? function () {
try {
return delegate.apply(this, arguments);
} catch (e) {
onError && onError(e);
throw e;
}
} : delegate;
}
export function de... | //
// Error handling
// ---
//
// The default onError handler is to re-throw.
export var onError = function (e) { throw(e); };
export function catchFunctionErrors(delegate) {
return onError ? function () {
try {
return delegate.apply(this, arguments);
} catch (e) {
onError(e... | Change onError behaviour; export safeSetTimeout | Change onError behaviour; export safeSetTimeout
| JavaScript | mit | knockout/tko.utils |
0287791b0c12f2f952d2289fd6b99a9ab5cb6203 | dev/_/components/js/sourceCollectionView.js | dev/_/components/js/sourceCollectionView.js | AV.SourceCollectionView = Backbone.View.extend({
el: '#list_container',
initialize: function() {
this.listenTo(this.collection, 'all', this.render);
console.log("Initialize View");
},
events: {
"click #deleteButton": "delete",
//"click #uploadButton": "upload",
},
template: _.t... | AV.SourceCollectionView = Backbone.View.extend({
el: '#list_container',
initialize: function() {
this.listenTo(this.collection, 'all', this.render);
console.log("Initialize View");
},
events: {
"click #deleteButton": "delete",
//"click #uploadButton": "upload",
},
templ... | Remove upload view from sourcecollectionview | Remove upload view from sourcecollectionview
| JavaScript | bsd-3-clause | Swarthmore/juxtaphor,Swarthmore/juxtaphor |
7533d0283f658aaf5e93b017be5f96d021c1581e | src/index.js | src/index.js | var Laminate = {};
Laminate.Badge = require('./components/badge.js');
Laminate.Button = require('./components/button.js');
Laminate.Card = require('./components/card.js');
Laminate.Content = require('./components/content.js');
Laminate.Icon = require('./components/icon.js');
Laminate.Modal = require('./components/moda... | var Laminate = {};
Laminate.Badge = require('./components/badge');
Laminate.Button = require('./components/button');
Laminate.Card = require('./components/card');
Laminate.Content = require('./components/content');
Laminate.Icon = require('./components/icon');
Laminate.InputGroup = require('./components/input-group');... | Remove the .js from requires. | Remove the .js from requires.
| JavaScript | bsd-3-clause | joestump/laminate |
184c92f89191ebcbe9135ec6f04bce0cb97f55cf | js/getData.js | js/getData.js | window.onload = initializeData()
function initializeData() {
var div = document.getElementById("right_now");
var date = new Date();
div.textContent = date.getFullYear() + '-' + date.getMonth() + '-' + date.getDate();
var text = div.textContent;
}
| window.onload = initializeData()
function initializeData() {
var right_now = document.getElementById("right_now");
var date = new Date();
right_now.textContent = date.getFullYear() + '-' + date.getMonth() + '-' + date.getDate();
var text = right_now.textContent;
}
| Rename div variable to right_now | Rename div variable to right_now
| JavaScript | mit | mercysmart/cepatsembuh-iqbal,mercysmart/cepatsembuh-iqbal |
cf285d9197c1e6c65d0d99583d588b09b264110f | test-main.js | test-main.js | if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var ... | // PhantomJS doesn't support Function.prototype.bind
if (!Function.prototype.bind) {
var slice = Array.prototype.slice;
Function.prototype.bind = function(context) {
var func = this;
var args = slice.call(arguments, 1);
function bound() {
var calledAsConstructor = func.prototype && (this instance... | Fix Function.bind polyfill to work properly on PhantomJS. | Fix Function.bind polyfill to work properly on PhantomJS.
| JavaScript | mit | OneJSToolkit/onejs,OneJSToolkit/onejs |
ac903898478d239b507afa29a4bf10614cdc8976 | data/maps/caveCombat.js | data/maps/caveCombat.js | eburp.registerMap("caveCombat",{
name: "Cave Combat",
width: 9,
height: 9,
map: "\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
"
}); | eburp.registerMap("caveCombat",{
name: "Cave Combat",
width: 9,
height: 9,
map: "\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
"
}); | Fix cave combat to reflect new battle sizes. 9x9 | Fix cave combat to reflect new battle sizes. 9x9
| JavaScript | apache-2.0 | justindujardin/pow2,justindujardin/pow2,justindujardin/pow2 |
e0976a86e8ea6145337ac4962a861638ca6d0488 | models/Game.js | models/Game.js | /**
* Module dependencies.
*/
const Score = require('./score');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
// create a schema
const gameSchema = new Schema({
started_at: Date,
ended_at: Date,
teams: [Schema.Types.ObjectId],
score: [Score.schema]
});
// create a model using... | /**
* Module dependencies.
*/
const Score = require('./score');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
// create a schema
const gameSchema = new Schema({
started_at: Date,
ended_at: Date,
teams: [Schema.Types.ObjectId],
score: [Score.schema]
});
gameSchema.methods.star... | Replace pre function with start game function | Replace pre function with start game function
| JavaScript | mit | lostatseajoshua/Challenger |
c5fd2290ef4ab86998fcb2ee887043920aa52e31 | packages/github-oauth/package.js | packages/github-oauth/package.js | Package.describe({
summary: 'GitHub OAuth flow',
version: '1.2.0'
});
Package.onUse(function (api) {
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('underscore', 'server');
api.use('random', 'client');
api.use('service-configuration... | Package.describe({
summary: 'GitHub OAuth flow',
version: '1.2.1'
});
Package.onUse(function (api) {
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('underscore', ['client', 'server']);
api.use('random', 'client');
api.use('service-c... | Use underscore on client in github-oauth | Use underscore on client in github-oauth
`_` is being used in github_client.js, but not specified in the package
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor |
b7dd1f5adf6eeb229805dece644ac90f0625f4d7 | models/user.js | models/user.js | module.exports = function(sequelize, DataTypes) {
var User = sequelize.define('User', {
username: {type: DataTypes.STRING, unique: true},
password: DataTypes.STRING,
email: DataTypes.STRING
});
return User;
};
| module.exports = function(sequelize, DataTypes) {
var User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
password: {
type: DataTypes.STRING,
allowNull: false
},
em... | Add experience and non-null constraints to User model. | Add experience and non-null constraints to User model.
| JavaScript | mit | kevinwang/questkey |
a9d782a0953b13a18487883ae727b821813a98ef | assets/javascripts/color.js | assets/javascripts/color.js | (function(){
var app = angular.module('color', []);
app.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}]);
app.controller('ColorController', [ '$http', function($http) {
var color = thi... | (function(){
angular.module('color', [])
.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}])
.controller('ColorController', [ '$http', function($http) {
var color = this;
color.sta... | Remove the app variable for styling | Remove the app variable for styling
| JavaScript | mit | cbachich/color_divider-fe |
2750c4c4c08dc452e7dedea70f15e28e25e0f334 | app/components/Avatar/index.js | app/components/Avatar/index.js | // @flow
import React from 'react';
import { Image, View } from 'react-native';
import theme from '../../theme';
type Props = {
size?: number,
source: string,
style?: Object,
};
export default function Avatar({ size = 44, source, style, ...props }: Props) {
const styles = {
wrapper: {
backgroundCol... | // @flow
import React from 'react';
import { Image, Platform, View } from 'react-native';
import theme from '../../theme';
type Props = {
size?: number,
source: string,
style?: Object,
};
export default function Avatar({ size = 44, source, style, ...props }: Props) {
const styles = {
wrapper: {
bac... | Fix for double attempt at circle on iOS. | Fix for double attempt at circle on iOS.
| JavaScript | mit | Thinkmill/react-conf-app,Thinkmill/react-conf-app,brentvatne/react-conf-app,Thinkmill/react-conf-app |
ca3bfdc68e01285f1118496906799f4a4cef0eb1 | app/routes/events/components/RegisteredSummary.js | app/routes/events/components/RegisteredSummary.js | import React from 'react';
import { Link } from 'react-router';
import Tooltip from 'app/components/Tooltip';
import { FlexRow, FlexColumn, FlexItem } from 'app/components/FlexBox';
const Reg = ({ user }) => (
<Tooltip content={user.fullName}>
<Link to={`/users/${user.username}`} style={{ color: 'white' }}>
... | import React from 'react';
import { Link } from 'react-router';
import Tooltip from 'app/components/Tooltip';
import { FlexRow, FlexColumn, FlexItem } from 'app/components/FlexBox';
const Registration = ({ user }) => (
<Tooltip content={user.fullName}>
<Link to={`/users/${user.username}`} style={{ color: 'white'... | Fix naming and remove unnecessary | Fix naming and remove unnecessary []
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp |
096e398fbc89bf0dd3751ad012e6f944e4093949 | assets/js/components/adminbar/AdminBarZeroData.js | assets/js/components/adminbar/AdminBarZeroData.js | /**
* Admin Bar Clicks component.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.... | /**
* Admin Bar Clicks component.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.... | Update zero data column width on desktop. | Update zero data column width on desktop.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp |
abb3d6440881e4aac491eae0bb90817f469637b2 | controllers/artist-controller.js | controllers/artist-controller.js | var request = require('request');
var model = require('../models/index');
/* Sets a like in the Like table for a given artist and user (by Facebook ID number) */
exports.likeArtist = function(req, res) {
if (isNaN(req.params.id)) {
return res.status(400).send('Bad input: ' + req.params.id);
}
else {
if (... | var model = require('../models/index');
/* Sets a like in the Like table for a given artist and user (by Facebook ID number) */
exports.likeArtist = function(req, res) {
return res.status(200).send('Success');
}
/* Retrieves the artist recommendations for the user */
exports.getArtistRecommendations = function(req,... | Move code to the job queue implementation | Move code to the job queue implementation
| JavaScript | mit | kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender |
15c1b77326ce093c3b2e9be837fdc2d914a10aee | app/views/DiscussionDetails.js | app/views/DiscussionDetails.js | import React from "react-native";
import PeopleListContainer from "../containers/PeopleListContainer";
import Card from "./Card";
import CardTitle from "./CardTitle";
import DiscussionSummary from "./DiscussionSummary";
import CardAuthor from "./CardAuthor";
import ListHeader from "./ListHeader";
const {
ScrollView,
... | import React from "react-native";
import PeopleListContainer from "../containers/PeopleListContainer";
import Card from "./Card";
import CardTitle from "./CardTitle";
import DiscussionSummary from "./DiscussionSummary";
import CardAuthor from "./CardAuthor";
import ListHeader from "./ListHeader";
const {
ScrollView,
... | Remove vertical padding from details card | Remove vertical padding from details card
| JavaScript | unknown | wesley1001/io.scrollback.neighborhoods,wesley1001/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods |
cc1092a5c94b102448090429f0d7ee14ed26e19d | server/model/content_code/schema.js | server/model/content_code/schema.js | 'use strict';
const _ = require('lodash');
const Bluebird = require('bluebird');
const mongoose = require('mongoose');
const mongooseDelete = require('mongoose-delete');
const ShortId = require('mongoose-shortid-nodeps');
const Settings = require('../../settings');
const Content ... | 'use strict';
const _ = require('lodash');
const Bluebird = require('bluebird');
const mongoose = require('mongoose');
const mongooseDelete = require('mongoose-delete');
const ShortId = require('mongoose-shortid-nodeps');
const Settings = require('../../settings');
const Content ... | Sort content items by DEC _id | Sort content items by DEC _id
| JavaScript | mit | jedbangers/exclusive-content-web,jedbangers/exclusive-content-web |
dfcf1531726ad89afbec3054b666fc6b84a2093a | scripts/embedQA.js | scripts/embedQA.js | /* global $ */
$(() => {
"use strict";
var $qanda = $(".js-q-and-a");
var url = "http://localhost:8000/5614e8bded37eded3f16a9e6";
fetch(url).then((response) => {
response.json().then((resp) => {
if (!resp._embedded || !resp._embedded["hack:questions"] || !resp._embedded["hack:questions"].length) {
... | /* global $ */
$(() => {
"use strict";
var $qanda = $(".js-q-and-a");
var url = "http://localhost:8000/5614e8bded37eded3f16a9e6";
fetch(url).then((response) => {
response.json().then((resp) => {
if (!resp._embedded || !resp._embedded["hack:questions"] || !resp._embedded["hack:questions"].length) {
... | Add styling classes to the embedded product page script | Add styling classes to the embedded product page script
| JavaScript | mit | roelbaka/hyperquaid,eturan/hyperquaid,epallerols/hyperquaid,peej/hyperquaid |
b79362a07eaa527f27f2e28b8e6f4f5ebf37af30 | app/src/index.js | app/src/index.js | import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import './index.css';
import App from './App';
import Immutable from 'immutable'
import rootReducer from './rootReducer'
import registerServiceWorker from './registerServiceWorker';
im... | import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import './index.css';
import App from './components/App';
import Immutable from 'immutable'
import rootReducer from './rootReducer'
import registerServiceWorker from './registerService... | Fix App import pointing to old place | Fix App import pointing to old place
| JavaScript | mit | kheldysh/discursor,kheldysh/discursor |
04ca961a6b19d7bfc2d2962a6f9c6e9f876b333d | client/app/config/config.js | client/app/config/config.js | module.exports = {
notice: {
'logFile': './logs/ark-desktop.log',
'level': 1,
'defaultHideDelay': 5000
}
}; | module.exports = {
notice: {
'logFile': null,
'level': 1,
'defaultHideDelay': 5000
}
}; | Disable logging to file by default | Disable logging to file by default
| JavaScript | mit | krau612/ark-desktop,krau612/ark-desktop,krau612/ark-desktop |
e66ec1691a3ba9bf445a166ac3ebdb84efe37df9 | src/DeepNgRoot/Frontend/js/app/module/ng-config.js | src/DeepNgRoot/Frontend/js/app/module/ng-config.js | 'use strict';
'format es6';
export class Config {
/**
*
* @param {Boolean} isLocalhost
* @param {String} ngRewrite
* @param {Object} $locationProvider
*/
constructor(isLocalhost, ngRewrite, $locationProvider) {
if (!isLocalhost && ngRewrite === '/') {
$locationProvider.html5Mode(true);
... | 'use strict';
'format es6';
export class Config {
/**
*
* @param {Boolean} isLocalhost
* @param {String} ngRewrite
* @param {Object} $locationProvider
*/
constructor(isLocalhost, ngRewrite, $locationProvider) {
let isAwsWebsite = /\.amazonaws\.com$/i.test(window.location.hostname);
if (!isAw... | Disable html5Mode if hostname is s3-website | Disable html5Mode if hostname is s3-website
| JavaScript | mit | MitocGroup/deep-microservices-root-angularjs,MitocGroup/deep-microservices-root-angularjs,MitocGroup/deep-microservices-root-angularjs |
9f946527929d65607c0d42d33733d370fee27f83 | spec/api-system-preferences-spec.js | spec/api-system-preferences-spec.js | const assert = require('assert')
const {remote} = require('electron')
const {systemPreferences} = remote
describe('systemPreferences module', function () {
if (process.platform !== 'darwin') {
return
}
describe('systemPreferences.getUserDefault(key, type)', function () {
it('returns values for known use... | const assert = require('assert')
const {remote} = require('electron')
const {systemPreferences} = remote
describe('systemPreferences module', function () {
describe('systemPreferences.getAccentColor', function () {
if (process.platform !== 'win32') {
return
}
it('should return a non-empty string',... | Add basic spec for getAccentColor | Add basic spec for getAccentColor
| JavaScript | mit | shiftkey/electron,renaesop/electron,brenca/electron,wan-qy/electron,electron/electron,miniak/electron,seanchas116/electron,seanchas116/electron,aliib/electron,aliib/electron,the-ress/electron,gabriel/electron,the-ress/electron,electron/electron,dongjoon-hyun/electron,biblerule/UMCTelnetHub,tonyganch/electron,dongjoon-h... |
0798ad99e384fb91233ff0ba9c7ab8f439d1cb85 | public/js/report.js | public/js/report.js | /* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
var id = name + '-' + mode
var e = document.getElementById(id)
var ej = $(e)
e.style.display = e.style.display == 'table-row' ? 'none' : 'table-row'
$('#' + id + '-btn').tog... | /* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
var id = name.replace(/\./g, '\\.') + '-' + mode
, e = $('#' + id)
if (e.css('display') === 'none') var activating = 1
else var activating = 0
... | Fix dot escaping for jQuery and use $()[0] | Fix dot escaping for jQuery and use $()[0]
| JavaScript | mit | TimothyGu/fateserver-node,TimothyGu/fateserver-node |
013aea55f73a9cdf4063be8efb6689ae6fd6f985 | services/ui/src/components/LogViewer/index.js | services/ui/src/components/LogViewer/index.js | import React from 'react';
import { bp } from 'lib/variables';
const LogViewer = ({ logs }) => (
<React.Fragment>
<div className="logs">
<div className="log-viewer">{logs || 'Logs are not available.'}</div>
</div>
<style jsx>{`
.logs {
padding: 0 calc(100vw / 16) 48px;
width: ... | import React from 'react';
import { bp } from 'lib/variables';
const LogViewer = ({ logs }) => (
<React.Fragment>
<div className="logs">
<div className="log-viewer">{logs || 'Logs are not available.'}</div>
</div>
<style jsx>{`
.logs {
padding: 0 calc(100vw / 16) 48px;
width: ... | Allow log container to be full height | Allow log container to be full height
When viewing deployment logs in the dashboard, the logs are typically very long, but the log window is limited to 600px heigh. Given there is nothing else on the deployment page other than the logs, would be good if the height wasn't limited.
There's a few benefits to this:
... | JavaScript | apache-2.0 | amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon |
3ea4eebf2ed5dc409460b86a148b8fb0cdb2f9d7 | components/counter/Counter.js | components/counter/Counter.js | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import omit from 'lodash.omit';
import theme from './theme.css';
class Counter extends PureComponent {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
color: PropType... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import omit from 'lodash.omit';
import { Monospaced } from '../typography';
import theme from './theme.css';
class Counter extends PureComponent {
static propTypes = {
children: PropTypes.node,
clas... | Use our own Monospaced component instead of applying monospace class from ui-typography | Use our own Monospaced component instead of applying monospace class from ui-typography
| JavaScript | mit | teamleadercrm/teamleader-ui |
6c0ed962b38457d9b95e9318a711ffbf0cf838c3 | backend/models/users.js | backend/models/users.js | (function () {
var User = require('../database/mongodb').Users,
jwt = require('jwt-simple'),
async = require('async'),
crypto = require('crypto');
function _getUserInfo(userId, callback) {
User.findById(userId, function (err, resp) {
callback(err, resp);
})
... | (function () {
var User = require('../database/mongodb').Users,
jwt = require('jwt-simple'),
async = require('async'),
crypto = require('crypto');
function _getUserInfo(userId, callback) {
User.findById(userId, function (err, resp) {
callback(err, resp);
})
... | Update function help interact with User | Update function help interact with User
| JavaScript | mit | thinhit/Buzz |
65a6f25c4523a2844ef7c0bc8dc1dbb2b0edc347 | app/components/code-snippet.js | app/components/code-snippet.js | import Ember from "ember";
import Snippets from "../snippets";
/* global require */
var Highlight = require('highlight.js');
export default Ember.Component.extend({
tagName: 'pre',
classNameBindings: ['language'],
unindent: true,
_unindent: function(src) {
if (!this.get('unindent')) {
return src;
... | import Ember from "ember";
import Snippets from "../snippets";
/* global require */
var Highlight = require('highlight.js');
export default Ember.Component.extend({
tagName: 'pre',
classNameBindings: ['language'],
unindent: true,
_unindent: function(src) {
if (!this.get('unindent')) {
return src;
... | Remove reliance on function prototype extension. | Remove reliance on function prototype extension.
| JavaScript | mit | greyhwndz/ember-code-snippet,mike-north/ember-code-snippet,ef4/ember-code-snippet,ef4/ember-code-snippet |
4279d160bdd741ff40b6f1d0b87eccea9b16bf18 | lib/commands/help.js | lib/commands/help.js | 'use strict';
var Command = require('../models/command');
var lookupCommand = require('../cli/lookup-command');
var string = require('../utilities/string');
module.exports = Command.extend({
name: 'help',
works: 'everywhere',
description: 'Outputs the usage instructions for all commands or the provided command'... | 'use strict';
var Command = require('../models/command');
var lookupCommand = require('../cli/lookup-command');
var string = require('../utilities/string');
module.exports = Command.extend({
name: 'help',
works: 'everywhere',
description: 'Outputs the usage instructions for all commands or the provided command'... | Remove var command declaration (failing jshint test) | Remove var command declaration (failing jshint test)
| JavaScript | mit | eliotsykes/ember-cli,szines/ember-cli,beatle/ember-cli,xiujunma/ember-cli,code0100fun/ember-cli,ServiceTo/ember-cli,typeoneerror/ember-cli,taras/ember-cli,mixonic/ember-cli,williamsbdev/ember-cli,romulomachado/ember-cli,ef4/ember-cli,quaertym/ember-cli,coderly/ember-cli,nruth/ember-cli,kriswill/ember-cli,seawatts/ember... |
913c4f65c986da00961221356cc74c17ac270553 | js/app.js | js/app.js | App = Ember.Application.create({});
App.IndexRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', ['red', 'yellow', 'blue']);
}
}); | App = Ember.Application.create();
App.Router.map(function() {
// put your routes here
});
App.IndexRoute = Ember.Route.extend({
model: function() {
return ['red', 'yellow', 'blue'];
}
});
| Add router stub and clean up IndexRoute | Add router stub and clean up IndexRoute | JavaScript | mit | miguelcoba/ember-intro-code,miguelcoba/ember-intro-code |
1ffc1f60cb159cf47152c5d778505bd04ec71f0e | js/rts.js | js/rts.js | // Runtime
////////////////////////////////////////////////////////////////////////////////
// Thunks
// A thunk object
function $(value)
{
this.forced = false;
this.value = value;
}
// Force the thunk object
$.prototype.force = function(nocache)
{
return nocache ?
this.value() :
(this.forced ?
th... | // Runtime
////////////////////////////////////////////////////////////////////////////////
// Thunks
// A thunk object
function $(value)
{
this.forced = false;
this.value = value;
}
// Force the thunk object
$.prototype.force = function()
{
return this.forced ?
this.value :
(this.value = this.value(),... | Speed up by having separate thunk forcings | Speed up by having separate thunk forcings
| JavaScript | bsd-3-clause | chrisdone/fore |
d80b1ea4db12bc7f09f57b1ce9986a0eab9aa327 | src/html.js | src/html.js | import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { ServerStyleSheet } from 'styled-components';
const HTML = props => {
const head = Helmet.rewind();
const sheet = new ServerStyleSheet();
const main = sheet.collectStyles(<div id="___gatsby" dangerouslySet... | import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { ServerStyleSheet } from 'styled-components';
const HTML = props => {
const head = Helmet.rewind();
const sheet = new ServerStyleSheet();
const main = sheet.collectStyles(<div id="___gatsby" dangerouslySet... | Fix PropTypes for local dev server | Fix PropTypes for local dev server
| JavaScript | mit | iiroj/iiro.fi,iiroj/iiro.fi,iiroj/iiro.fi |
c4158a6e6b11915fc09336bc58376089f4fcd7d1 | src/main.js | src/main.js | import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
Vue.use(VueRouter);
const Main = Vue.extend({});
const router = new VueRouter();
router.map({
'/': { component: App },
});
router.start(Main, 'body');
| import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
Vue.use(VueRouter);
const Main = Vue.extend({});
const router = new VueRouter({ history: true });
router.map({
'/': { component: App },
});
router.start(Main, 'body');
| Use history option for vue-router | Use history option for vue-router
| JavaScript | mit | noraesae/soramaru,noraesae/soramaru |
98889b08d5dc039c5a58c522e5b2c9def1081a2d | src/util.js | src/util.js | const moment = require("moment");
let ctx;
try {
const chalk = require("chalk");
ctx = new chalk.constructor({enabled:true});
} catch (err) {
// silent
}
function getTime() {
const curHour = new Date().getHours() % 12 || 12;
return (curHour < 10 ? " " : "") + moment().format("LTS");
}
module.e... | const moment = require("moment");
let ctx;
try {
const chalk = require("chalk");
ctx = new chalk.constructor({enabled:true});
} catch (err) {
// silent
}
function getTime() {
return (" " + moment().format("LTS")).slice(-11);
}
module.exports = {
log(...args) {
if (ctx) console.log(getTi... | Improve time generation for logging | Improve time generation for logging
| JavaScript | mit | EPICZEUS/simple-discord.js |
c7812c809faab6ff14d7125edcce9b0bb2e58abc | react-pure-function/app/index.js | react-pure-function/app/index.js | var React = require('react');
var ReactDOM = require('react-dom');
var ProfilePic = React.createClass({
render: function() {
return (
<img src={'https://photo.fb.com/' + this.props.username}></img>
);
}
});
var ProfileLink = React.createClass({
render: function() {
retu... | var React = require('react');
var ReactDOM = require('react-dom');
var ProfilePic = function(props) {
return <img src={'https://twitter.com/' + this.props.username + '/profile_image?size=original'}></img>
}
// var ProfilePic = React.createClass({
// render: function() {
// return (
// <img... | Create component using statelless component | Create component using statelless component
| JavaScript | mit | kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidch... |
1cf5a0fe163a7769a83abc3cf5b14b91089a5f28 | lib/s3.js | lib/s3.js | var assert = require('assert')
var AWS = require('aws-sdk')
/**
* Create s3 client
* @param {Object} config AWS configuration
* @returns {Object} s3 client and helpers
*/
module.exports = function s3Loader (config) {
assert(config, 's3Loader requires config')
var client = new AWS.S3(config)
client.endpoint ... | const assert = require('assert')
const AWS = require('aws-sdk')
/**
* Create s3 client
* @param {Object} config AWS configuration
* @returns {Object} s3 client and helpers
*/
module.exports = function s3Loader (config) {
assert(config, 's3Loader requires config')
const client = new AWS.S3(config)
return {
... | Use const and remove useless lines | Use const and remove useless lines
| JavaScript | apache-2.0 | cesarandreu/bshed,cesarandreu/bshed |
94564b672b27eeb8229e03aa324f73d8f0339bc2 | js/outputs.js | js/outputs.js | 'use strict';
var OutputManager = (function () {
var outputs = [];
var active = [];
var display = undefined;
var addOutput = function(o) {
outputs.push(o);
};
var activateOutput = function(o) {
active.push(o);
};
var deactivateOutput = function(o) {
var i = active.indexOf(o);
active... | 'use strict';
var OutputManager = (function() {
var outputs = [];
var active = [];
var display = undefined;
var addOutput = function(o) {
outputs.push(o);
};
var activateOutput = function(o) {
active.push(o);
};
var deactivateOutput = function(o) {
var i = active.indexOf(o);
active.... | Fix up gjshint errors in output manager | Fix up gjshint errors in output manager
| JavaScript | bsd-3-clause | qdot/giftic,qdot/giftic,qdot/giftic |
7cf0ff5e0bcf845638d5c4bdbae06811bfc5614b | app/assets/javascripts/teikei.js | app/assets/javascripts/teikei.js | // Overwriting Backbone.Marionette.Renderer to use JST
Backbone.Marionette.Renderer.render = function(template, data) {
if (!JST[template]) throw "Template '" + template + "' not found!";
return JST[template](data);
};
// Extend and configure backbone-forms editors
var editors = Backbone.Form.editors;
editors.Ye... | // Overwriting Backbone.Marionette.Renderer to use JST
Backbone.Marionette.Renderer.render = function(template, data) {
if (!JST[template]) throw "Template '" + template + "' not found!";
return JST[template](data);
};
// Extend and configure backbone-forms editors
var editors = Backbone.Form.editors;
editors.Ye... | Set German month names for date editor. | Set German month names for date editor.
| JavaScript | agpl-3.0 | sjockers/teikei,teikei/teikei,sjockers/teikei,sjockers/teikei,teikei/teikei,teikei/teikei |
458ab503f8d0f6a7cc05ec735efac7cf15f46e67 | app/assets/scripts/views/home.js | app/assets/scripts/views/home.js | 'use strict';
import React from 'react';
import { Link } from 'react-router';
var Home = React.createClass({
displayName: 'Home',
render: function () {
return (
<section>
<header className='page__header--landing'>
<div className='page__headline--landing'>
<h1 className='pag... | 'use strict';
import React from 'react';
import { Link } from 'react-router';
var Home = React.createClass({
displayName: 'Home',
render: function () {
return (
<section>
<header className='page__header--landing'>
<div className='page__headline--landing'>
<h1 className='pag... | Replace Lorem Ipsum with intro text | Replace Lorem Ipsum with intro text
| JavaScript | bsd-2-clause | orma/openroads-vn-analytics,orma/openroads-vn-analytics,orma/openroads-vn-analytics |
61212b63fb10e5a75ac5f87685823cd1f24dab2a | app/models/coordinator.js | app/models/coordinator.js | import EmberObject from '@ember/object';
import Evented from '@ember/object/evented';
import { computed } from '@ember/object';
import ObjHash from './obj-hash';
import { unwrapper } from 'ember-drag-drop/utils/proxy-unproxy-objects';
export default EmberObject.extend(Evented, {
objectMap: computed(function() {
... | import EmberObject from '@ember/object';
import Evented from '@ember/object/evented';
import { computed } from '@ember/object';
import ObjHash from './obj-hash';
import { unwrapper } from 'ember-drag-drop/utils/proxy-unproxy-objects';
export default EmberObject.extend(Evented, {
objectMap: computed(function() {
... | Use send instead of sendAction | Use send instead of sendAction
| JavaScript | mit | mharris717/ember-drag-drop,mharris717/ember-drag-drop |
23e751b09f927e2826a6a4083868f7f864fbc94c | helpers.js | helpers.js | console.log("Loading helpers.js");
window.snip$ = (function() {
var path = require("path");
function currEd() { return lt.objs.editor.pool.last_active.call(null); }
function currPath() { return lt.objs.tabs.__GT_path(currEd()); }
function hasSelection() { return lt.objs.editor.selection_QMARK_.call(null, c... | console.log("Loading helpers.js");
window.snip$ = (function() {
var path = require("path");
function currEd() { return lt.objs.editor.pool.last_active.call(null); }
function currPath() { return lt.objs.tabs.__GT_path(currEd()); }
function currFileName() {
var p = currPath();
return p ? path.basena... | Allow wrapping around current line even though not selected | Allow wrapping around current line even though not selected
| JavaScript | mit | rundis/lt-snippets,weaver-viii/lt-snippets |
a1e304bb328a6b4ea8b136414e496929df2085a1 | contrib/rethinkdb-co/index.js | contrib/rethinkdb-co/index.js | var _ = require('lodash');
var RethinkDB = require(__dirname + '/../rethinkdb');
var connex = require(__dirname + '/../../lib');
var RethinkDBCo = module.exports = function(options) {
if(!(this instanceof RethinkDBCo)) {
return new RethinkDBCo(options);
}
return RethinkDB.apply(this, arguments);
};
requir... | var _ = require('lodash');
var RethinkDB = require(__dirname + '/../rethinkdb');
var connex = require(__dirname + '/../../lib');
var RethinkDBCo = module.exports = function(options) {
if(!(this instanceof RethinkDBCo)) {
return new RethinkDBCo(options);
}
return RethinkDB.apply(this, arguments);
};
requir... | Add possibility to pass options to rethinkdb-co run | Add possibility to pass options to rethinkdb-co run
| JavaScript | mit | tedeh/connex |
1039beba35e4eb474cb35ce300aa8f0b437a7ea0 | lib/config.js | lib/config.js | 'use strict';
var cc = require('config-chain');
var autoconfig = function(overrides) {
var config = cc(overrides).add({
IP: process.env.OPENSHIFT_NODEJS_IP || '0.0.0.0',
PORT: process.env.FH_PORT || process.env.OPENSHIFT_NODEJS_PORT || 8001,
dataTopicPrefix: ':cloud:data',
persistentStore: process.e... | 'use strict';
var cc = require('config-chain');
/**
* The sync frequency to be passed to fh-wfm-sync.
* Sync frequency is set individually for the client and the server.
* * On the client the setting is named `sync_frequency`.
* * On the server the setting is named `syncFrequency`.
* It is recommended that these... | Update server `syncFrequency` value to match client `sync_frequency` | Update server `syncFrequency` value to match client `sync_frequency`
Currently the server-side dataset sync frequencies are set to 10 seconds
whereas the client-side dataset sync frequencies are set to 5 seconds.
Having differing sync frequencies can cause unnecessary load on the
server, causing a full sync to be per... | JavaScript | mit | feedhenry-raincatcher/raincatcher-demo-cloud |
51cf6e6bc5fab543b18c23a7698eccaf006a9ca9 | generators/app/templates/_gulpfile.js | generators/app/templates/_gulpfile.js | var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
gulp.task('tslint', 'Lints all TypeScript source files', function(){
return gulp.src('src/**/*.ts')
.pipe(tslint())
.p... | var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
var tsFilesGlob = (function(c) {
return c.filesGlob || c.files || '**/*.ts';
})(require('./tsconfig.json'));
gulp.task('t... | Use filesGlob from tsconfig in gulp file | Use filesGlob from tsconfig in gulp file
| JavaScript | mit | ospatil/generator-node-typescript,ospatil/generator-node-typescript |
5a5565b39d96ce64767089bab8911ed891f44374 | isaac_math.js | isaac_math.js | // Math Library for ISAAC Physics.
// addVector function.
// Takes in two vectors, returns a new vector made by adding
// the inputs together. If the two input vectors don't have the same
// length, the first input vector will be returned.
function addVector (vectorA, vectorB) {
if(vectorA.length === vectorB.length) ... | // Math Library for ISAAC Physics.
// addVector function.
// Takes in two vectors, returns a new vector made by adding
// the inputs together. If the two input vectors don't have the same
// length, the first input vector will be returned.
function addVector (vectorA, vectorB) {
if(vectorA.length === vectorB.length) ... | Add dot product function to math module. | Add dot product function to math module.
| JavaScript | mit | isaacjs/ISAAC |
77e033f68bc06a8b522ab1d13c43473cc22e6911 | build/build.js | build/build.js | const rollup = require('rollup').rollup;
const babel = require('rollup-plugin-babel');
rollup({
entry: './src/index.js',
external: [
'babel-runtime/core-js/json/stringify',
'babel-runtime/core-js/object/assign',
'babel-runtime/helpers/asyncToGenerator',
'babel-runtime/regenerato... | const rollup = require('rollup').rollup;
const babel = require('rollup-plugin-babel');
rollup({
entry: './src/index.js',
external: [
'babel-runtime/core-js/json/stringify',
'babel-runtime/core-js/object/assign',
'babel-runtime/helpers/asyncToGenerator',
'babel-runtime/regenerato... | Remove arrow func compatible with old version node | Remove arrow func compatible with old version node
| JavaScript | mit | differui/rollup-plugin-sass,differui/rollup-plugin-sass |
bc629f18472ae90a87e4966a73e0cce6f0b250bf | lib/current.js | lib/current.js | // Date object that always reflects current time (with one second resolution)
'use strict';
var curry = require('es5-ext/lib/Function/prototype/curry')
, update;
update = function () {
this.setTime(Date.now());
};
module.exports = function () {
var date = new Date();
date.clear = curry.call(clearInterval, set... | // Date object that always reflects current time (with one second resolution)
'use strict';
var partial = require('es5-ext/lib/Function/prototype/partial')
, update;
update = function () {
this.setTime(Date.now());
};
module.exports = function () {
var date = new Date();
date.clear = partial.call(clearInterva... | Update up to changes in es5-ext | Update up to changes in es5-ext
| JavaScript | mit | medikoo/clock |
32828677d21b5de37859289632f91485ec20a2a1 | lib/router.js | lib/router.js | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound'
});
Router.route('/', {
name: 'home',
waitOn: function() {
return subscriptions.subscribe('allOwnedMangas', Meteor.userId());
},
fastRender: true
});
Router.route('/mi... | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound'
});
Router.route('/', {
name: 'home',
waitOn: function() {
return subscriptions.subscribe('allOwnedMangas', Meteor.userId());
},
fastRender: ... | Add a new subcription for the tomeDetails route | Add a new subcription for the tomeDetails route
| JavaScript | mit | dexterneo/mangas,dexterneo/mangas,dexterneo/mangatek,dexterneo/mangatek |
6e185f1b5f34fe3416ee95a00aeeb5c5d0273fc9 | lib/config.js | lib/config.js | 'use strict';
var fs = require('fs');
var path = require('path');
exports.getApiConfig = function() {
return Object.freeze({
port: process.env.SERVER_PORT || 4002,
heartbeat: process.env.HEARTBEAT === 'true',
logLevel: process.env.LOG_LEVEL || 'info',
api: Object.freeze({
apiURL: process.env.A... | 'use strict';
var fs = require('fs');
var path = require('path');
exports.getApiConfig = function() {
return Object.freeze({
port: process.env.SERVER_PORT || 4002,
heartbeat: process.env.HEARTBEAT === 'true',
logLevel: process.env.LOG_LEVEL || 'info',
api: Object.freeze({
apiURL: process.env.A... | Change apiURL default from docker to localhost | Change apiURL default from docker to localhost
As this is a public repository, we can't assume everybody will be using docker
and have the same container name.
MOM-554
| JavaScript | mpl-2.0 | jembi/openhim-mediator-file-queue,jembi/openhim-mediator-file-queue |
1d158c46020f6b9d42d5043a6f84c551032003fc | lib/config.js | lib/config.js | /*****************************************************************************
* utils.js
* Includes various utility functions
*/
var path = require('path');
var fs = require('fs');
var nconf = require('nconf');
var internals = {};
internals.configInited = false;
internals.Config = {}
internals.Config.load = f... | /*****************************************************************************
* utils.js
* Includes various utility functions
*/
var path = require('path');
var fs = require('fs');
var nconf = require('nconf');
var internals = {};
internals.configInited = false;
internals.Config = {}
/**
* Loads the config f... | Return default value on undefined only | Return default value on undefined only
| JavaScript | mit | altenia/ecofyjs-config |
9adb2f964716f4766765a566428ea101773fb878 | helper/DiskDataStore.js | helper/DiskDataStore.js | var fs = require('fs');
var Settings = require('./Settings');
var DiskDataStore = {};
DiskDataStore.init = function (){
this._CACHE_PATH = Settings.get('cache_path');
fs.mkdirSync(this._CACHE_PATH);
};
DiskDataStore.deleteEntry = function (key){
var fileName = this._CACHE_PATH + '/' + key;
fs.unlink(fileName... | var fs = require('fs');
var Settings = require('./Settings');
var DiskDataStore = {};
var fs = require('fs');
var deleteFolderRecursive = function(path) {
if( fs.existsSync(path) ) {
fs.readdirSync(path).forEach(function(file,index){
var curPath = path + '/' + file;
if(fs.lstatSync(curPath).isDirect... | Remove the cache folder before initializing data cache. | Remove the cache folder before initializing data cache.
| JavaScript | apache-2.0 | weilonge/unidisk,weilonge/unidisk,weilonge/unidisk |
92d2afce8ed638f0b8673c52ce14af955423a25c | lib/router.js | lib/router.js | Router.configure({
layoutTemplate: 'layout',
waitOn: function() {
return Meteor.subscribe('projects');
}
});
Router.route('/', {
});
| Router.configure({
layoutTemplate: 'layout'
});
Router.route('/', {
name: 'projectsList'
});
| Add routes for layout and projects list | Add routes for layout and projects list
| JavaScript | mit | PUMATeam/puma,PUMATeam/puma |
1135366b62530ffa4ecb8e2c9505f73d79e94d7a | gulp-config.js | gulp-config.js | module.exports = {
folder: {
tasks: 'tasks',
src: 'src',
build: 'assets',
prod: 'production'
},
task: {
htmlHint: 'html-hint',
jsHint: 'js-hint',
buildCustomJs: 'build-custom-js',
buildJsVendors: 'build-js-vendors',
buildSass: 'build-sass',
buildSassProd: 'build-sass-produc... | module.exports = {
folder: {
tasks: 'tasks',
src: 'src',
build: 'assets',
prod: 'production'
},
task: {
htmlHint: 'html-hint',
jsHint: 'js-hint',
buildCustomJs: 'build-custom-js',
buildJsVendors: 'build-js-vendors',
buildSass: 'build-sass',
buildSassProd: 'build-sass-produc... | Add more files to ignore for production task | Add more files to ignore for production task
| JavaScript | mit | KirillPd/web-starter-kit,KirillPd/web-starter-kit,justcoded/web-starter-kit,vodnycheck/justcoded,justcoded/web-starter-kit,vodnycheck/justcoded |
3c85a294c6173604793faa68ed829a10122efc7d | examples/babel/webpack.config.js | examples/babel/webpack.config.js | // Note: this example requires babel-loader
// npm install babel-loader
var path = require('path');
module.exports = {
context: __dirname,
entry: './file-to-annotate',
output: {
path: __dirname + '/dist',
filename: 'build.js'
},
resolveLoader: {
fallback: path.resolve(__dirname, '.... | // Note: this example babel and equires babel-loader
// npm install babel babel-loader
var path = require('path');
module.exports = {
context: __dirname,
entry: './file-to-annotate',
output: {
path: __dirname + '/dist',
filename: 'build.js'
},
resolveLoader: {
fallback: path.resolv... | Update babel example to take peer dependency to babel into account. | Update babel example to take peer dependency to babel into account.
Since npm 3 peer dependencies will not be installed automatically
(which was the default in npm 2.x). For this reason, running
npm install babel-loader
in examples/babel will throw an error when running with npm 3.
This change simply updates the com... | JavaScript | mit | huston007/ng-annotate-loader,huston007/ng-annotate-loader |
2f4d3ee03667fffb105fa2080abbcefe73a10e94 | src/file_seacher.js | src/file_seacher.js | /* @flow */
import _ from 'lodash'
import type { OrderedMap } from 'immutable';
import type MediaFile from './media_file';
export default class FileSeacher {
files: OrderedMap<number, MediaFile>;
constructor(files: OrderedMap<number, MediaFile>) {
this.files = files;
}
search(searchKeyword: string): Ord... | /* @flow */
import _ from 'lodash'
import type { OrderedMap } from 'immutable';
import type MediaFile from './media_file';
export default class FileSeacher {
files: OrderedMap<number, MediaFile>;
constructor(files: OrderedMap<number, MediaFile>) {
this.files = files;
}
search(searchKeyword: string): Ord... | Implement smartcase matching with search keyword | Implement smartcase matching with search keyword
| JavaScript | mit | joker1007/blackalbum,joker1007/blackalbum |
3c77d4e89dc8f097810ce84608b74ba158a8deb7 | src/util/compose.js | src/util/compose.js | const compose = (...functions) => {
return (...initial) => {
let count = functions.length;
return (function accum(arg) {
return count ? (count--, accum(functions[count].call(functions[count], arg))) : arg;
}).apply(functions[count - 1], initial);
};
};
export default compose;
| const compose = (...functions) => {
return (...initial) => {
let count = functions.length;
return (function accumulator(arg) {
return count ? (count--, accumulator(functions[count].call(functions[count], arg))) : arg;
}).apply(functions[count - 1], initial);
};
};
export default compose;
| Refactor to use a consistent name across functions | Refactor to use a consistent name across functions
| JavaScript | mit | restrung/restrung-js |
3625063c9b71d3d45bede0bd83af2152d83cd5ee | imports/ui/components/header/drawer-navigation.js | imports/ui/components/header/drawer-navigation.js | import React from 'react';
import Drawer from 'material-ui/Drawer';
import DrawerMenuItems from '../../containers/drawer-menu-items';
import * as ImagesHelper from '../../../util/images';
export default class DrawerNavigation extends React.Component {
componentDidMount() {
// iubenda Privacy Policy
(functio... | import React from 'react';
import Drawer from 'material-ui/Drawer';
import DrawerMenuItems from '../../containers/drawer-menu-items';
import * as ImagesHelper from '../../../util/images';
export default class DrawerNavigation extends React.Component {
componentDidMount() {
// iubenda Privacy Policy
(functio... | Set overflow:hidden to hide default windows scrollbars on drawer | Set overflow:hidden to hide default windows scrollbars on drawer
| JavaScript | mit | irvinlim/free4all,irvinlim/free4all |
184ffcd99116c9053e7956a3db5f5acc152fc971 | js/src/forum/components/DiscussionsUserPage.js | js/src/forum/components/DiscussionsUserPage.js | import UserPage from './UserPage';
import DiscussionList from './DiscussionList';
/**
* The `DiscussionsUserPage` component shows a discussion list inside of a user
* page.
*/
export default class DiscussionsUserPage extends UserPage {
init() {
super.init();
this.loadUser(m.route.param('username'));
}
... | import UserPage from './UserPage';
import DiscussionList from './DiscussionList';
/**
* The `DiscussionsUserPage` component shows a discussion list inside of a user
* page.
*/
export default class DiscussionsUserPage extends UserPage {
init() {
super.init();
this.loadUser(m.route.param('username'));
}
... | Sort user discussion list properly | Sort user discussion list properly
| JavaScript | mit | datitisev/core,datitisev/core,flarum/core,malayladu/core,datitisev/core,flarum/core,datitisev/core,malayladu/core,malayladu/core,flarum/core,malayladu/core |
dc6833e9115f7cb61de753b928781c30b2937958 | source/assets/javascripts/all.js | source/assets/javascripts/all.js | document.addEventListener("DOMContentLoaded", function(){
var select = document.querySelector('.locales select');
select.addEventListener('change', function(event){
origin = window.location.origin;
languageCode = event.currentTarget.selectedOptions[0].value
window.location.replace(origin + "/" + languag... | document.addEventListener("DOMContentLoaded", function(){
var select = document.querySelector('.locales select');
select.addEventListener('change', function(event){
origin = window.location.origin;
languageCode = event.currentTarget.selectedOptions[0].value
window.location.replace(origin + "/" + languag... | Fix JS bug in FAQ | Fix JS bug in FAQ
| JavaScript | mit | olivierlacan/keep-a-changelog,olivierlacan/keep-a-changelog |
316855e8230f114bdf409b59809c86bed2dd27bc | build/wrapper.template.js | build/wrapper.template.js | (function(){var g={};
(function(window){%output%}.bind(g,this))();
if (typeof(module)!="undefined"&&module.exports)module.exports=g.shaka;
else if (typeof(define)!="undefined")define(function(){return g.shaka});
else this.shaka=g.shaka;
})();
| (function(){var g={};
(function(window){%output%}.bind(g,this))();
if (typeof(module)!="undefined"&&module.exports)module.exports=g.shaka;
else if (typeof(define)!="undefined" && define.amd)define(function(){return g.shaka});
else this.shaka=g.shaka;
})();
| Check for define.amd along with typeof(define) | Check for define.amd along with typeof(define)
To prevent crashing with other module loaders that support `define`, but are not full AMD module loaders, check for `define.amd` as well before defining the AMD module. | JavaScript | apache-2.0 | brightcove/shaka-player,priyajeet/shaka-player,priyajeet/shaka-player,baconz/shaka-player,cmgrecu/shaka-player,sanbornhnewyyz/shaka-player,Afrostream/shaka-player,treejames/shaka-player,baconz/shaka-player,vimond/shaka-player,treejames/shaka-player,tvoli/shaka-player,ustudio/shaka-player,TheModMaker/shaka-player,samdut... |
cea824e63e4db6953c05ac67a1c9923f1f48abfc | test/129026_cog_sog_rapid_update.js | test/129026_cog_sog_rapid_update.js | var chai = require("chai");
chai.Should();
chai.use(require('chai-things'));
describe('129026 COG & SOG, Rapid Update', function () {
it('complete sentence converts', function () {
var tree = require("../n2kMapper.js").toNested(
JSON.parse('{"timestamp":"2014-08-15-18:00:10.005","prio":"2","src":"160","ds... | var chai = require("chai");
chai.Should();
chai.use(require('chai-things'));
chai.use(require('signalk-schema').chaiModule);
describe('129026 COG & SOG, Rapid Update', function () {
it('complete sentence converts', function () {
var tree = require("../n2kMapper.js").toNested(
JSON.parse('{"timestamp":"20... | Fix 129026 COG & SOG | Fix 129026 COG & SOG
| JavaScript | apache-2.0 | SignalK/n2k-signalk |
7624bbab290982806204b03df05d23e8932a11a7 | test/feature/Scope/BlockBinding6.js | test/feature/Scope/BlockBinding6.js | function testBlock() {
// Test function expressions.
{
var x = function g() { return 'g'; } || function h() { return 'h'; };
return x;
}
}
// ----------------------------------------------------------------------------
var result = testBlock();
assertEquals('g', result());
assertEquals('g', result.name)... | function testBlock() {
// Test function expressions.
{
var x = function g() { return 'g'; } || function h() { return 'h'; };
return x;
}
}
// ----------------------------------------------------------------------------
var result = testBlock();
assertEquals('g', result());
| Remove test that tests function instance name since that is non standard | Remove test that tests function instance name since that is non standard
| JavaScript | apache-2.0 | ide/traceur,ide/traceur,ide/traceur |
49253300460d315b475feca48a0727ad50d6dd13 | test/monkeyPatchSinonStackFrames.js | test/monkeyPatchSinonStackFrames.js | // Monkey-patch sinon.create to patch all created spyCall instances
// so that the top stack frame is a predictable string.
// Prevents every test from failing when the test suite is updated.
module.exports = function (sinon) {
// Copied from test/monkeyPatchSinonStackFrames.js
function patchCall(call) {
... | // Monkey-patch sinon.create to patch all created spyCall instances
// so that the top stack frame is a predictable string.
// Prevents every test from failing when the test suite is updated.
module.exports = function (sinon) {
function isSpy(value) {
return value && typeof value.id === 'string' &&
... | Test suite: Fix overeager monkey-patching of the sinon.stub return value that made sinon.createStubInstance() return an object with getCall and getCalls methods. | Test suite: Fix overeager monkey-patching of the sinon.stub return value that made sinon.createStubInstance() return an object with getCall and getCalls methods.
| JavaScript | mit | unexpectedjs/unexpected-sinon,unexpectedjs/unexpected-sinon |
84945daecb84911f27dbe4c6911f4cba4c994e78 | test/specs/simulation.drone.spec.js | test/specs/simulation.drone.spec.js | const { generateRandom } = require('../../server/simulation/drone');
describe('generateRandom()', () => {
const sampleArguments = {coords: {lat: 1, long: 1}, distance: 1000 };
test('returns an object', () => {
expect(
typeof generateRandom(sampleArguments)
).toBe('object');
});
test('returns a... | const { generateRandom } = require('../../server/simulation/drone');
describe('generateRandom()', () => {
const sampleArguments = {coords: {lat: 1, long: 1}, distance: 1000 };
test('returns an object', () => {
expect(
typeof generateRandom(sampleArguments)
).toBe('object');
});
test('returns a... | Add tests to check missions_completed attribute in random drone generator | Add tests to check missions_completed attribute in random drone generator
| JavaScript | mit | DAVFoundation/missioncontrol,DAVFoundation/missioncontrol,DAVFoundation/missioncontrol |
7c2213c67cbc670a7a4aecd5dbdab47013dca4ed | test/testServer.js | test/testServer.js | /**
* Created by Omnius on 18/07/2016.
*/
'use strict';
const Hapi = require('hapi');
const HapiAuthBasic = require('hapi-auth-basic');
const HapiAuthHawk = require('hapi-auth-hawk');
const Inert = require('inert');
module.exports = function () {
const server = new Hapi.Server();
server.connection({
... | /**
* Created by Omnius on 18/07/2016.
*/
'use strict';
const Hapi = require('hapi');
const HapiAuthBasic = require('hapi-auth-basic');
const HapiAuthHawk = require('hapi-auth-hawk');
const Inert = require('inert');
const Handlebars = require('handlebars');
const Vision = require('vision');
const Visionary = require... | Add view manager on test server | Add view manager on test server
| JavaScript | mit | identityclash/hapi-login-test,identityclash/hapi-login-test |
a11e9cbf5006c81826fdc1d8a79680c3b5097f2e | tests/view.spec.js | tests/view.spec.js |
// http://mochajs.org/
// @see http://chaijs.com/api/bdd/
describe('View', function() {
var App;
var View;
var testView;
beforeEach(function() {
App = window.App;
View = App.View;
});
afterEach(function() {
testView = undefined;
App = null;
View = null;
});
it('should set templa... |
// http://mochajs.org/
// @see http://chaijs.com/api/bdd/
describe('View', function() {
var App;
var View;
var testView;
beforeEach(function() {
App = window.App;
View = App.View;
});
afterEach(function() {
testView = undefined;
App = null;
View = null;
});
it('should set templa... | Add render template with js instructions | Add render template with js instructions
| JavaScript | mit | easy-deep-learning/mvc-pure-js,easy-deep-learning/mvc-pure-js |
0e5134d71da887d125b228ee773a47935b528c8a | config/adapters.js | config/adapters.js | /**
* Global adapter config
*
* The `adapters` configuration object lets you create different global "saved settings"
* that you can mix and match in your models. The `default` option indicates which
* "saved setting" should be used if a model doesn't have an adapter specified.
*
* Keep in mind that options y... | /**
* Global adapter config
*
* The `adapters` configuration object lets you create different global "saved settings"
* that you can mix and match in your models. The `default` option indicates which
* "saved setting" should be used if a model doesn't have an adapter specified.
*
* Keep in mind that options y... | Change db config to use postgres. Use secret config file to load connection settings. | Change db config to use postgres. Use secret config file to load connection settings.
| JavaScript | mit | thomaslangston/sailsnode |
62e63833c58b5ac8068199bb34897569654448e2 | reviewboard/static/rb/js/utils/consoleUtils.js | reviewboard/static/rb/js/utils/consoleUtils.js | var _origAssert = console.assert;
if (typeof window.console === 'undefined') {
window.console = {};
}
if (typeof console.log === 'undefined') {
console.log = function() {}
}
/*
* console.assert may not behave as we'd hope on all implementations.
* On Chrome, for instance, it doesn't raise an exception. So... | var _origAssert;
if (typeof window.console === 'undefined') {
window.console = {};
}
_origAssert = console.assert;
if (typeof console.log === 'undefined') {
console.log = function() {}
}
/*
* console.assert may not behave as we'd hope on all implementations.
* On Chrome, for instance, it doesn't raise an ... | Fix the console fallbacks to not break older browsers. | Fix the console fallbacks to not break older browsers.
The console fallbacks were designed to work if no console API was
defined, but it still ended up accessing stuff inside of console. It
also had some unused code at the end. This has been fixed and should
restore compatibility with Firefox 3.x and IE.
Fixes bug #2... | JavaScript | mit | custode/reviewboard,chipx86/reviewboard,sgallagher/reviewboard,davidt/reviewboard,custode/reviewboard,davidt/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,1tush/reviewboard,beol/reviewboard,1tush/reviewboard,brennie/reviewboard,beol/reviewboard,custode/reviewboard,beol/reviewboard,custode/reviewboard,chip... |
f3c665de8dc05b474e8b7ec993b1354cf028505c | src/filters.js | src/filters.js | (function() {
'use strict';
var app = angular.module('bonito-filters', []);
/**
* Print large number using prefixes (k, M, G, etc.) to
* keep their size short and to be friendlier to the poor non-robots.
* Adapted from: https://gist.github.com/thomseddon/3511330
*/
app.filter('humanNumber', functi... | (function() {
'use strict';
var app = angular.module('bonito-filters', []);
/**
* Print large number using prefixes (k, M, G, etc.) to
* keep their size short and to be friendlier to the poor non-robots.
* Adapted from: https://gist.github.com/thomseddon/3511330
*/
app.filter('humanNumber', functi... | Fix NaN when input is 0 | Fix NaN when input is 0
| JavaScript | apache-2.0 | tsg/bonito,tsg/bonito |
59040c2d68bae66da58e4abe8c54ab0ec9142823 | website/addons/googledrive/static/node-cfg.js | website/addons/googledrive/static/node-cfg.js | 'use strict';
var ko = require('knockout');
var AddonNodeConfig = require('js/addonNodeConfig').AddonNodeConfig;
var url = window.contextVars.node.urls.api + 'googledrive/config/';
new AddonNodeConfig('Google Drive', '#googledriveScope', url, '#googledriveGrid',
{
decodeFolder: (function(folder_name) {
... | 'use strict';
var AddonNodeConfig = require('js/addonNodeConfig').AddonNodeConfig;
var url = window.contextVars.node.urls.api + 'googledrive/config/';
new AddonNodeConfig('Google Drive', '#googledriveScope', url, '#googledriveGrid',
{
decodeFolder: (function(folder_name) {
return decodeURIComp... | Remove knockout requirement, as it is not used by the custom functions | Remove knockout requirement, as it is not used by the custom functions
| JavaScript | apache-2.0 | dplorimer/osf,laurenrevere/osf.io,njantrania/osf.io,hmoco/osf.io,Johnetordoff/osf.io,icereval/osf.io,barbour-em/osf.io,jolene-esposito/osf.io,caneruguz/osf.io,mattclark/osf.io,binoculars/osf.io,fabianvf/osf.io,KAsante95/osf.io,caneruguz/osf.io,HalcyonChimera/osf.io,caneruguz/osf.io,asanfilippo7/osf.io,CenterForOpenScie... |
89755b9c7da113508ccc5715d7d62a8ee44a809a | config/dependency-lint.js | config/dependency-lint.js | /* eslint-env node */
'use strict';
module.exports = {
allowedVersions: {
'ember-getowner-polyfill': '^1.0.0 || ^2.0.0',
'ember-inflector': '^1.0.0 || ^2.0.0',
'ember-runtime-enumerable-includes-polyfill': '^1.0.0 || ^2.0.0',
'ember-require-module': '^0.1',
}
};
| /* eslint-env node */
'use strict';
module.exports = {
allowedVersions: {
'ember-cli-string-helpers': '^1.4.0', //temporary workaround for conflict with ember-light-table
'ember-getowner-polyfill': '^1.0.0 || ^2.0.0',
'ember-inflector': '^1.0.0 || ^2.0.0',
'ember-runtime-enumerable-includes-polyfill'... | Allow multiple versions of ember-cli-string-helpers | Allow multiple versions of ember-cli-string-helpers
This is a temporary workaround for a conflict with ember-light-table
| JavaScript | mit | thecoolestguy/frontend,thecoolestguy/frontend,ilios/frontend,djvoa12/frontend,dartajax/frontend,ilios/frontend,jrjohnson/frontend,dartajax/frontend,jrjohnson/frontend,djvoa12/frontend |
676117cba78bb0269ce1b8d46d760fe779e2b09e | migrations/20170329060832-rename_allowence_to_allowance.js | migrations/20170329060832-rename_allowence_to_allowance.js | 'use strict';
module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.renameColumn('Departments', 'allowence', 'allowance');
},
down: function (queryInterface, Sequelize) {
return queryInterface.renameColumn('Departments', 'allowance', 'allowence');
}
};
| 'use strict';
var models = require('../lib/model/db');
module.exports = {
up: function (queryInterface, Sequelize) {
if ('sqlite' === queryInterface.sequelize.getDialect()) {
console.log('Going into SQLIite case');
return queryInterface
// Create Temp Departments based on current model de... | Add SQLite specific logic for recent migration. | Add SQLite specific logic for recent migration.
It appeared that out of box renameColumn looses some meta inforamtion
for subject column.
| JavaScript | mit | YulioTech/timeoff,YulioTech/timeoff,timeoff-management/application,timeoff-management/application |
45d0b315423946df17853708bf0d48005b92544b | webroot/js/responsive/app.module.js | webroot/js/responsive/app.module.js | (function() {
'use strict';
angular
.module('app', ['ngMaterial', 'ngMessages', 'ngCookies', 'ngSanitize'])
.config(['$mdThemingProvider', '$mdIconProvider', '$httpProvider', function($mdThemingProvider, $mdIconProvider, $httpProvider) {
$mdThemingProvider.theme('default')
... | (function() {
'use strict';
angular
.module('app', ['ngMaterial', 'ngMessages', 'ngCookies', 'ngSanitize'])
.config(['$mdThemingProvider', '$mdIconProvider', '$httpProvider', '$cookiesProvider', function(
$mdThemingProvider, $mdIconProvider, $httpProvider, $cookiesProvider
)... | Set global path and +1 month expiration date in angular cookies | Set global path and +1 month expiration date in angular cookies
| JavaScript | agpl-3.0 | Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2 |
08c8816c5a5267257cbd72b1ab292adcd219373e | backend/server/db/model/files.js | backend/server/db/model/files.js | /**
* @fileOverview
* @name files.js
* @author V. Glenn Tarcea <glenn.tarcea@gmail.com>
* @license
*/
module.exports = function(r) {
'use strict';
return {
countInProject: countInProject
};
function *countInProject(ids, projectID) {
let rql = r.table('datafiles').getAll.apply(this... | /**
* @fileOverview
* @name files.js
* @author V. Glenn Tarcea <glenn.tarcea@gmail.com>
* @license
*/
module.exports = function(r) {
'use strict';
return {
countInProject: countInProject
};
function *countInProject(ids, projectID) {
let rql = r.table('datafiles').getAll(r.args(ids... | Update how we call getAll to properly parse out an array of keys using r.args() rather than doing getAll.apply(this, items) (which doesn't work). | Update how we call getAll to properly parse out an array of keys using
r.args() rather than doing getAll.apply(this, items) (which doesn't work).
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.