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 |
|---|---|---|---|---|---|---|---|---|---|
c0398e1654be8d9ee2b29a8388f5228dd853d7d9 | assets/javascripts/bbcode_color_dialect.js | assets/javascripts/bbcode_color_dialect.js | (function() {
Discourse.Dialect.inlineBetween({
start: "[color=",
stop: "[/color]",
rawContents: true,
emitter: function(contents) {
var matches = contents.match(/(.+)](.*)/);
if (matches) {
return ['span', {style: "color: " + matches[1] + ";"}, matches[2]];
}
}
});
})... | (function() {
Discourse.Dialect.inlineBetween({
start: "[color=",
stop: "[/color]",
rawContents: true,
emitter: function(contents) {
var matches = contents.match(/(.+)](.*)/);
if (matches) {
return ['font', {color: matches[1]}, matches[2]];
}
}
});
Discourse.Markdown... | Use font tags, whitelist the used font tags | Use font tags, whitelist the used font tags
| JavaScript | mit | dandv/discourse-bbcode-color,dandv/discourse-bbcode-color,discourse/discourse-bbcode-color,discourse/discourse-bbcode-color |
b26f0e00a67c3242198232ec05e0cd50ddbea28f | client/main.js | client/main.js | /*
######################################
# Authentication Components #
######################################
*/
/*
Register component
*/
/*
Login component
*/
/*
######################################
# Graphing Components #
######################################
*/
/*
#####... | /*
######################################
# Authentication Components #
######################################
*/
/*
Register component
*/
var RegisterForm = React.createClass({
render: function () {
return (
<div className="registerForm">
<label for="username">Username</label>
<input type=... | Add basic html for registration component | Add basic html for registration component
| JavaScript | mit | Squarific/SmartHome,Squarific/SmartHome,Squarific/SmartHome |
9b807c4be024214bba8684ed9343eecc06c83010 | both/router/routes.js | both/router/routes.js | /*****************************************************************************/
/* Client and Server Routes */
/*****************************************************************************/
Router.configure({
layoutTemplate: 'MasterLayout',
loadingTemplate: 'Loading',
notFoundTemplate: 'NotFound'
});
Router.rou... | /*****************************************************************************/
/* Client and Server Routes */
/*****************************************************************************/
Router.configure({
layoutTemplate: 'MasterLayout',
loadingTemplate: 'Loading',
notFoundTemplate: 'NotFound'
});
Router.rou... | Add more private pages to access denied list | Add more private pages to access denied list
| JavaScript | mit | bojicas/letterhead,bojicas/letterhead |
f66b406ff0fc60794885d3a998394775f7f8f892 | template/electron/renderer/index.js | template/electron/renderer/index.js | require('babel-register')({ extensions: ['.jsx'] });
const app = require('hadron-app');
const React = require('react');
const ReactDOM = require('react-dom');
const AppRegistry = require('hadron-app-registry');
const DataService = require('mongodb-data-service');
const Connection = require('mongodb-connection-model')... | require('babel-register')({ extensions: ['.jsx'] });
const app = require('hadron-app');
const React = require('react');
const ReactDOM = require('react-dom');
const AppRegistry = require('hadron-app-registry');
const DataService = require('mongodb-data-service');
const Connection = require('mongodb-connection-model')... | Load plugin from entry point in electron | Load plugin from entry point in electron
| JavaScript | apache-2.0 | mongodb-js/compass-plugin,mongodb-js/compass-plugin |
9d772f89559eae69bd5c43266435565b0e770ce9 | app/settings/auth/route.js | app/settings/auth/route.js | import AuthenticatedRouteMixin from 'ui/mixins/authenticated-route';
import Ember from 'ember';
import C from 'ui/utils/constants';
export default Ember.Route.extend(AuthenticatedRouteMixin,{
model: function() {
var headers = {};
headers[C.HEADER.PROJECT] = undefined;
return this.get('store').find('git... | import AuthenticatedRouteMixin from 'ui/mixins/authenticated-route';
import Ember from 'ember';
import C from 'ui/utils/constants';
export default Ember.Route.extend(AuthenticatedRouteMixin,{
model: function() {
var headers = {};
headers[C.HEADER.PROJECT] = undefined;
return this.get('store').find('git... | Reset the access control details showing when coming back | Reset the access control details showing when coming back
| JavaScript | apache-2.0 | vincent99/ui,kaos/ui,jjperezaguinaga/ui,rancher/ui,lvuch/ui,westlywright/ui,rancherio/ui,ubiquityhosting/rancher_ui,nrvale0/ui,jjperezaguinaga/ui,westlywright/ui,kaos/ui,nrvale0/ui,rancher/ui,pengjiang80/ui,lvuch/ui,westlywright/ui,jjperezaguinaga/ui,rancher/ui,ubiquityhosting/rancher_ui,pengjiang80/ui,pengjiang80/ui,n... |
60671a4e9d366d81f67b2d13d75b7eef1e49317e | gulpfile.js | gulpfile.js | /*!
* gulpfile
*/
// Load plugins
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var rename = require('gulp-rename');
var jade = require('gulp-jade');
var inline = require('gulp-inline-css');
// Paths
var sourcePath = 'src';
var paths = {
emails: sourcePath + ... | /*!
* gulpfile
*/
// Load plugins
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var rename = require('gulp-rename');
var jade = require('gulp-jade');
var inline = require('gulp-inline-css');
// Paths
var sourcePath = 'src';
var paths = {
emails: sourcePath + ... | Fix Gulp watch for theme files | Fix Gulp watch for theme files
Rebuild when a theme file is modified
| JavaScript | mit | Guirec/HTML-Email-Generator,Guirec/HTML-Email-Generator |
9e7ce5bc9c67ac3fbb3bff58f203b6a02c22468c | scripts/src/main.js | scripts/src/main.js | require(["UserMedia", "VideoWrapper"], function(UserMedia, VideoWrapper) {
"use strict";
var startButton = document.getElementById("startButton");
startButton.onclick = startLocalVideo;
var videoWrapper = new VideoWrapper(document.getElementById('localVideo'));
var userMedia = new UserMedia(videoW... | require(["UserMedia", "VideoWrapper"], function(UserMedia, VideoWrapper) {
"use strict";
var startButton = document.getElementById("startButton");
startButton.onclick = startLocalVideo;
var videoWrapper = new VideoWrapper(document.getElementById('localVideo'));
var userMedia = new UserMedia(videoW... | Add stopLocalVideo if the user does not support getUserMedia | Add stopLocalVideo if the user does not support getUserMedia
| JavaScript | mit | tomas2387/webrtcApp |
fcf582951eb7d9fee2211fefc3506282e03d8e8f | src/store/api/assettypes.js | src/store/api/assettypes.js | import client from '@/store/api/client'
export default {
getAssetTypes (callback) {
client.get('/api/data/asset-types?relations=true', callback)
},
getAssetType (assetTypeId, callback) {
client.get(`/api/data/entity-types/${assetTypeId}`, callback)
},
newAssetType (assetType, callback) {
const ... | import client from '@/store/api/client'
export default {
getAssetTypes (callback) {
client.get('/api/data/asset-types', callback)
},
getAssetType (assetTypeId, callback) {
client.get(`/api/data/entity-types/${assetTypeId}`, callback)
},
newAssetType (assetType, callback) {
const data = {
... | Remove useless flag on get asset types call | [assets] Remove useless flag on get asset types call
| JavaScript | agpl-3.0 | cgwire/kitsu,cgwire/kitsu |
d2a9dc303a745d4fc2a23d700a1439794ed167d4 | products/static/products/app/js/services.js | products/static/products/app/js/services.js | 'use strict';
app.factory('Product', function($http) {
function getUrl(id = '') {
return 'http://127.0.0.1:8000/api/products/' + id + '?format=json';
}
return {
get: function(id, callback) {
return $http.get(getUrl(id)).success(callback);
},
query: function(page, page_size, callback) {
... | 'use strict';
app.factory('Product', function($http) {
function getUrl(id) {
id = typeof id !== 'undefined' ? id : '';
return 'http://127.0.0.1:8000/api/products/' + id + '?format=json';
}
return {
get: function(id, callback) {
return $http.get(getUrl(id)).success(callback);
},
query:... | Remove dependency on default parameters in JS | Remove dependency on default parameters in JS
Apparently it's only supported by Firefox, source:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/default_parameters
This issue was brought up in #3.
| JavaScript | mit | matachi/product-gallery,matachi/product-gallery,matachi/product-gallery |
aa3d6ad4d2d4ef7742df07d9f8c63c5f0a2ac440 | src/app/libs/Api.js | src/app/libs/Api.js | import queryString from "query-string";
class Api {
static get(url, data = {}) {
return this.request(url + (Object.keys(data).length > 0 ? ('?' + queryString.stringify(data)) : '' ), undefined, "GET");
}
static post(url, data = {}) {
return this.request(url, data, "POST");
}
stati... | import queryString from "query-string";
class Api {
static get(url, data = {}) {
return this.request(url + (Object.keys(data).length > 0 ? ('?' + queryString.stringify(data)) : '' ), undefined, "GET");
}
static post(url, data = {}) {
return this.request(url, data, "POST");
}
stati... | Use the error string if we have one for malformed json | Use the error string if we have one for malformed json
| JavaScript | mit | gilfillan9/spotify-jukebox-v2,gilfillan9/spotify-jukebox-v2 |
2f9bde3ad5a2e3dd104c812b6c81f4077fe0aa1e | vendor/nwmatcher/selector_engine.js | vendor/nwmatcher/selector_engine.js | Prototype._original_property = window.NW;
//= require "repository/src/nwmatcher"
Prototype.Selector = (function(engine) {
function select(selector, scope) {
return engine.select(selector, scope || document, Element.extend);
}
return {
engine: engine,
select: select,
match: engine.match
};
... | Prototype._original_property = window.NW;
//= require "repository/src/nwmatcher"
Prototype.Selector = (function(engine) {
var select = engine.select;
if (Element.extend !== Prototype.K) {
select = function select(selector, scope) {
return engine.select(selector, scope, Element.extend);
};
}
ret... | Simplify the NWMatcher adapter and optimize it for browsers that don't need to extend DOM elements. | prototype: Simplify the NWMatcher adapter and optimize it for browsers that don't need to extend DOM elements. [jddalton]
| JavaScript | mit | 292388900/prototype,erpframework/prototype,sdumitriu/prototype,lamsieuquay/prototype,ridixcr/prototype,lamsieuquay/prototype,erpframework/prototype,baiyanghese/prototype,lamsieuquay/prototype,Jiasm/prototype,Gargaj/prototype,erpframework/prototype,fashionsun/prototype,sstephenson/prototype,ridixcr/prototype,Gargaj/prot... |
fe71390baca97c018af1b47174d6459600971de4 | demo/webmodule.js | demo/webmodule.js | // a simple web app/module
importFromModule('helma.skin', 'render');
function main_action() {
var context = {
title: 'Module Demo',
href: href
};
render('skins/modules.html', context);
}
// module scopes automatically support JSAdapter syntax!
function __get__(name) {
if (name == 'href... | // a simple web app/module
importFromModule('helma.skin', 'render');
function main_action() {
var context = {
title: 'Module Demo',
href: req.path
};
render('skins/modules.html', context);
}
| Fix demo app: modules no longer act as JSAdapters | Fix demo app: modules no longer act as JSAdapters
git-svn-id: fac99be8204c57f0935f741ea919b5bf0077cdf6@9147 688a9155-6ab5-4160-a077-9df41f55a9e9
| JavaScript | apache-2.0 | ringo/ringojs,Transcordia/ringojs,ringo/ringojs,ringo/ringojs,oberhamsi/ringojs,ringo/ringojs,ashwinrayaprolu1984/ringojs,oberhamsi/ringojs,Transcordia/ringojs,ashwinrayaprolu1984/ringojs,oberhamsi/ringojs,Transcordia/ringojs,Transcordia/ringojs,ashwinrayaprolu1984/ringojs,ashwinrayaprolu1984/ringojs |
01ce1bde07bfe675ad2cfd1e32f5cbd76dd53922 | imports/api/messages.js | imports/api/messages.js | import { Mongo } from 'meteor/mongo';
import { ValidatedMethod } from 'meteor/mdg:validated-method';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
export const Messages = new Mongo.Collection('messages');
Messages.deny({
insert() {
return true;
},
update() {
return true;
},
remove() {
... | import { Mongo } from 'meteor/mongo';
import { ValidatedMethod } from 'meteor/mdg:validated-method';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
export const Messages = new Mongo.Collection('messages');
Messages.deny({
insert() {
return true;
},
update() {
return true;
},
remove() {
... | Save comment with username instead of user id | Save comment with username instead of user id
| JavaScript | mit | f-martinez11/ActiveU,f-martinez11/ActiveU |
3cfc6e9d2234ec8b60c748888a88f2fe675ec872 | tests/unit/components/dashboard-widget-test.js | tests/unit/components/dashboard-widget-test.js | import { test , moduleForComponent } from 'appkit/tests/helpers/module-for';
import DashboardWidgetComponent from 'appkit/components/dashboard-widget';
moduleForComponent('dashboard-widget', 'Unit - Dashboard widget component', {
subject: function() {
var bayeuxStub = { subscribe: Ember.K };
var subscribeStu... | import { test , moduleForComponent } from 'appkit/tests/helpers/module-for';
import DashboardWidgetComponent from 'appkit/components/dashboard-widget';
moduleForComponent('dashboard-widget', 'Unit - Dashboard widget component', {
subject: function() {
// Mock Faye/bayeux subscribe process; avoid network calls.
... | Improve Faye/Bayeux coverage in widget specs. | Improve Faye/Bayeux coverage in widget specs.
| JavaScript | mit | substantial/substantial-dash-client |
9acb51cda733751729fbe33c29c666c40cbdae35 | src/Header/index.js | src/Header/index.js | import React from 'react';
import NavMenu from './NavMenu';
export default class Header extends React.Component {
constructor(props) {
super(props);
}
render() {
let navMenu;
if (this.props.config.headerMenuLinks.length > 0) {
navMenu = <NavMenu links={this.props.config.headerMenuLinks} /... | import React from 'react';
import NavMenu from './NavMenu';
export default class Header extends React.Component {
constructor(props) {
super(props);
}
render() {
let navMenu;
if (this.props.config.headerMenuLinks.length > 0) {
navMenu = <NavMenu links={this.props.config.headerMenuLinks} /... | Add header background color based on config | Add header background color based on config
| JavaScript | apache-2.0 | naltaki/naltaki-front,naltaki/naltaki-front |
7441c6d4f8648391f556de91382a066bf6971da4 | src/MasterPlugin.js | src/MasterPlugin.js | import Plugin from "./Plugin";
export default class MasterPlugin extends Plugin {
static get plugin() {
return {
name: "MasterPlugin",
description: "",
help: "This plugin has access to PluginManager and will perform all the 'meta'/'super' actions.",
type: P... | import Plugin from "./Plugin";
export default class MasterPlugin extends Plugin {
static get plugin() {
return {
name: "MasterPlugin",
description: "",
help: "This plugin has access to PluginManager and will perform all the 'meta'/'super' actions.",
type: P... | Add null check on help generation | Add null check on help generation
| JavaScript | mit | crisbal/Telegram-Bot-Node,crisbal/Node-Telegram-Bot,crisbal/Node-Telegram-Bot,crisbal/Telegram-Bot-Node |
fecd31dd46b4f790f9c0cfe28eff3909fd0945b5 | lib/ee.js | lib/ee.js | var slice = [].slice;
module.exports = {
on: function on(ev, handler) {
var events = this._events,
eventsArray = events[ev];
if (!eventsArray) {
eventsArray = events[ev] = [];
}
eventsArray.push(handler);
},
removeListener: function removeListener(e... | var slice = [].slice;
module.exports = {
on: function on(ev, handler) {
var events = this._events,
eventsArray = events[ev];
if (!eventsArray) {
eventsArray = events[ev] = [];
}
eventsArray.push(handler);
},
removeListener: function removeListener(e... | Use `for` instead of `forEach` as it minifies better. | Use `for` instead of `forEach` as it minifies better. | JavaScript | mit | Raynos/eventemitter-light |
36335b37034025d76f8c758f9617292d9889fb73 | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
"use strict";
// Display the execution time of grunt tasks
require("time-grunt")(grunt);
// Load all grunt-tasks in 'Build/Grunt-Options'.
var gruntOptionsObj = require("load-grunt-configs")(grunt, {
"config" : {
src: "Build/Grunt-Options/*.js"
}
});
grunt.initConfig(g... | module.exports = function(grunt) {
"use strict";
// Display the execution time of grunt tasks
require("time-grunt")(grunt);
// Load all grunt-tasks in 'Build/Grunt-Options'.
var gruntOptionsObj = require("load-grunt-configs")(grunt, {
"config" : {
src: "Build/Grunt-Options/*.js"
}
});
grunt.initConfig(g... | Fix the jit-grunt mapping for the replace task | [BUGFIX] Fix the jit-grunt mapping for the replace task
| JavaScript | mit | t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template |
ce22c210ed48656ab3dae5b2cff8cd2e8fa662c5 | js/game.js | js/game.js | var Game = function(boardString){
var board = '';
this.board = '';
if (arguments.length === 1) {
this.board = this.toArray(boardString);
} else {
function random() {
return Math.floor(Math.random() * 10 + 6);
};
var firstTwo = random(), secondTwo = random();
for ( var i = 0; i < 16; i+... | var Game = function(boardString){
var board = '';
this.board = '';
if (arguments.length === 1) {
this.board = this.toArray(boardString);
} else {
function random() {
return Math.floor(Math.random() * 10 + 6);
};
var firstTwo = random(), secondTwo = random();
for ( var i = 0; i < 16; i+... | Modify toString method for board array format | Modify toString method for board array format
| JavaScript | mit | suprfrye/galaxy-256,suprfrye/galaxy-256 |
d6cff2ae3baf9de7f8156545fda5bb67361c36c2 | components/Header.js | components/Header.js | import Head from 'next/head';
export default () =>
<header>
<Head>
<style>{`
body {
font-family: "Helvetica Neue", Arial, sans-serif;
}
`}</style>
</Head>
</header>;
| import Head from 'next/head';
export default () =>
<header>
<Head>
<style global jsx>{`
body {
font-family: "Helvetica Neue", Arial, sans-serif;
}
`}</style>
</Head>
</header>;
| Fix flash of unstyled text | Fix flash of unstyled text | JavaScript | mit | pmdarrow/react-todo |
09c78c2316fdb2a1cb72b7bf5694404d4125927d | src/components/providers/cdg/Prefs/Prefs.js | src/components/providers/cdg/Prefs/Prefs.js | import React from 'react'
export default class Prefs extends React.Component {
static propTypes = {
prefs: React.PropTypes.object.isRequired,
setPrefs: React.PropTypes.func.isRequired,
providerRefresh: React.PropTypes.func.isRequired,
}
toggleEnabled = this.toggleEnabled.bind(this)
handleRefresh =... | import React from 'react'
export default class Prefs extends React.Component {
static propTypes = {
prefs: React.PropTypes.object.isRequired,
setPrefs: React.PropTypes.func.isRequired,
providerRefresh: React.PropTypes.func.isRequired,
}
toggleEnabled = this.toggleEnabled.bind(this)
handleRefresh =... | Fix rendering before prefs loaded | Fix rendering before prefs loaded
| JavaScript | isc | bhj/karaoke-forever,bhj/karaoke-forever |
e8c621a87d93590901e128ab8e2fb8b649b63270 | modules/blueprint.js | modules/blueprint.js | var BlueprintClient = require('xively-blueprint-client-js');
var client = new BlueprintClient({
authorization: process.env.BLUEPRINT_AUTHORIZATION
});
module.exports = client;
| var BlueprintClient = require('xively-blueprint-client-js');
var client = new BlueprintClient({
authorization: process.env.BLUEPRINT_AUTHORIZATION
});
console.log('Client initialized with authorization >', process.env.BLUEPRINT_AUTHORIZATION);
module.exports = client;
| Add logging with Blueprint authorization token | Add logging with Blueprint authorization token
| JavaScript | mit | Altoros/refill-them-api |
eaf2461432f490fee0e8812889c90bd88eb7a0fe | realtime/index.js | realtime/index.js | const io = require('socket.io'),
winston = require('winston');
winston.remove(winston.transports.Console);
winston.add(winston.transports.Console, {'timestamp': true});
const PORT = 3031;
winston.info('Rupture real-time service starting');
winston.info('Listening on port ' + PORT);
var socket = io.listen(PORT... | const io = require('socket.io'),
winston = require('winston');
winston.remove(winston.transports.Console);
winston.add(winston.transports.Console, {'timestamp': true});
const PORT = 3031;
winston.info('Rupture real-time service starting');
winston.info('Listening on port ' + PORT);
var socket = io.listen(PORT... | Add logging for server-side work completed event | Add logging for server-side work completed event
| JavaScript | mit | dimkarakostas/rupture,dimriou/rupture,dimriou/rupture,esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,esarafianou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,esarafianou/rupture,dionyziz/rupture,dionyziz/rupture,dimriou/rupture,dimriou/rupture,dimriou/rupture,dionyziz/rupture,dimkarakostas/rupture,dimk... |
e7bcd073726ab546c41883e68648aadbe7cdeed2 | assets/js/main.js | assets/js/main.js | (function(document){
function setStyle(style, param) {
var range, sel;
if (window.getSelection) {
sel = window.getSelection();
if (sel.getRangeAt) {
range = sel.getRangeAt(0);
}
document.designMode = "on";
if (range) {
sel.removeAllRanges();
sel.addRange... | (function(document){
function setStyle(style, param) {
var range, sel;
if (window.getSelection) {
sel = window.getSelection();
if (sel.getRangeAt) {
range = sel.getRangeAt(0);
}
document.designMode = "on";
if (range) {
sel.removeAllRanges();
sel.addRange... | Add image the right way | Add image the right way
| JavaScript | mit | guilhermecomum/minimal-editor |
b491985b4a59f368633a225905f582933fa47f0e | packages/babel-compiler/package.js | packages/babel-compiler/package.js | Package.describe({
name: "babel-compiler",
summary: "Parser/transpiler for ECMAScript 2015+ syntax",
// Tracks the npm version below. Use wrap numbers to increment
// without incrementing the npm version. Hmm-- Apparently this
// isn't possible because you can't publish a non-recommended
// release with p... | Package.describe({
name: "babel-compiler",
summary: "Parser/transpiler for ECMAScript 2015+ syntax",
// Tracks the npm version below. Use wrap numbers to increment
// without incrementing the npm version. Hmm-- Apparently this
// isn't possible because you can't publish a non-recommended
// release with p... | Make babel-runtime use ecmascript-runtime on server only. | Make babel-runtime use ecmascript-runtime on server only.
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor |
1b4be05beb4d717c13796e404e019ee6d4a543ce | app/javascript/sugar/posts/embeds.js | app/javascript/sugar/posts/embeds.js | import $ from "jquery";
import Sugar from "../../sugar";
/**
* Handlers for scripted embed (social) quirks
*/
$(Sugar).bind("ready", function(){
// Initialize twitter embeds when new posts load or previewed
$(Sugar).bind("postsloaded", function(event, posts) {
if (posts.length && window.twttr && window.twtt... | import $ from "jquery";
import Sugar from "../../sugar";
/**
* Handlers for scripted embed (social) quirks
*/
$(Sugar).bind("ready", function(){
const postsContainer = document.querySelector(".posts");
// Initialize twitter embeds when new posts load or previewed
$(Sugar).bind("postsloaded", function(event, p... | Check that posts exist before applying the resizeObserver | Check that posts exist before applying the resizeObserver
| JavaScript | mit | elektronaut/sugar,elektronaut/sugar,elektronaut/sugar,elektronaut/sugar |
f8d22f8ded7ea448a643f248c346d46e85a929ea | js/query-cache.js | js/query-cache.js | define([], function () {
var caches = {};
function Cache(method) {
this.method = method;
this._store = {};
}
/** xml -> Promise<Result> **/
Cache.prototype.submit = function submit (query) {
var xml = query.toXML();
var current = this._store[xml];
if (current) {
return current;
... | define([], function () {
var caches = {};
function Cache(method, service) {
this.method = method;
this._store = {};
this.service = service;
}
/** xml -> Promise<Result> **/
Cache.prototype.submit = function submit (query) {
var key, current;
if (this.method === 'findById') {
key =... | Allow cache methods that are run from the service. | Allow cache methods that are run from the service.
| JavaScript | apache-2.0 | yochannah/show-list-tool,alexkalderimis/show-list-tool,yochannah/show-list-tool,intermine-tools/show-list-tool,intermine-tools/show-list-tool,intermine-tools/show-list-tool,yochannah/show-list-tool |
7d8217e5404375885c14539d5a3cdd6799755154 | packages/youtube/package.js | packages/youtube/package.js | Package.describe({
name: 'pntbr:youtube',
version: '0.0.1',
summary: 'Manage Youtube\'s videos',
git: 'https://github.com/goacademie/fanhui',
documentation: 'README.md'
})
Package.onUse(function(api) {
api.versionsFrom('1.2.1')
api.use(['ecmascript', 'mongo'])
api.use(['iron:router', 'templating', 'ses... | Package.describe({
name: 'pntbr:youtube',
version: '0.0.1',
summary: 'Manage Youtube\'s videos',
git: 'https://github.com/goacademie/fanhui',
documentation: 'README.md'
})
Package.onUse(function(api) {
api.versionsFrom('1.2.1')
api.use(['ecmascript', 'mongo'])
api.use(['iron:router', 'templating', 'ses... | Disable Vdos collection on client | Disable Vdos collection on client
| JavaScript | mit | goacademie/fanhui,goacademie/fanhui |
9a97f6929af78c0bfffeca2f96a9c47f7fa1e943 | plugins/no-caching/index.js | plugins/no-caching/index.js | var robohydra = require('robohydra'),
RoboHydraHead = robohydra.heads.RoboHydraHead;
function getBodyParts(config) {
"use strict";
var noCachingPath = config.nocachingpath || '/.*';
return {heads: [new RoboHydraHead({
path: noCachingPath,
handler: function(req, res, ne... | var robohydra = require('robohydra'),
RoboHydraHead = robohydra.heads.RoboHydraHead;
function getBodyParts(config) {
"use strict";
var noCachingPath = config.nocachingpath || '/.*';
return {heads: [new RoboHydraHead({
path: noCachingPath,
handler: function(req, res, ne... | Delete the if-none-match header in the no-caching plugin | Delete the if-none-match header in the no-caching plugin
| JavaScript | apache-2.0 | mlev/robohydra,robohydra/robohydra,robohydra/robohydra,mlev/robohydra,mlev/robohydra |
deadb3b799e40640be486ec5c6f7f39f54eae162 | config/web.js | config/web.js | module.exports = {
public_host_name: 'http://watchmen.letsnode.com/', // required for OAuth dance
auth: {
GOOGLE_CLIENT_ID: process.env.WATCHMEN_GOOGLE_CLIENT_ID || '<Create credentials from Google Dev Console>',
GOOGLE_CLIENT_SECRET: process.env.WATCHMEN_GOOGLE_CLIENT_SECRET || '<Create crede... | module.exports = {
public_host_name: process.env.WATCHMEN_BASE_URL || 'http://watchmen.letsnode.com/', // required for OAuth dance
auth: {
GOOGLE_CLIENT_ID: process.env.WATCHMEN_GOOGLE_CLIENT_ID || '<Create credentials from Google Dev Console>',
GOOGLE_CLIENT_SECRET: process.env.WATCHMEN_GOOGL... | Add WATCHMEN_BASE_URL env var to configure base url | Add WATCHMEN_BASE_URL env var to configure base url
| JavaScript | mit | corinis/watchmen,labianchin/WatchMen,plyo/watchmen,corinis/watchmen,NotyIm/WatchMen,iloire/WatchMen,Cellington1/Status,NotyIm/WatchMen,labianchin/WatchMen,plyo/watchmen,labianchin/WatchMen,NotyIm/WatchMen,plyo/watchmen,ravi/watchmen,ravi/watchmen,Cellington1/Status,iloire/WatchMen,Cellington1/Status,corinis/watchmen,il... |
084fd3d7bc7c227c313d2f23bce1413af02f935a | lib/background.js | lib/background.js | var path = require('path');
var nightwatch = require('nightwatch');
var originalArgv = JSON.parse(process.argv[2]);
nightwatch.cli(function(argv) {
for (var key in originalArgv) {
if (key === 'env' && argv['parallel-mode'] === true) {
continue;
}
argv[key] = originalArgv[key];
}
if (argv.test)... | var path = require('path');
var nightwatch = require('nightwatch');
var originalArgv = JSON.parse(process.argv[2]);
nightwatch.cli(function(argv) {
for (var key in originalArgv) {
if (key === 'env' && originalArgv[key].indexOf(',') > -1 && argv['parallel-mode'] === true) {
continue;
}
argv[key] = o... | Fix correct check for env argument passed | Fix correct check for env argument passed
| JavaScript | mit | tatsuyafw/gulp-nightwatch,StoneCypher/gulp-nightwatch |
2fbe38df3bba8886de9295ef637b65ea8ac664af | lib/i18n/index.js | lib/i18n/index.js | /**
* i18n plugin
* register handlebars handler which looks up translations in a dictionary
*/
var path = require("path");
var fs = require("fs");
var handlebars = require("handlebars");
module.exports = function makePlugin() {
return function (opts) {
var data = {
"en": {}
... | /**
* i18n plugin
* register handlebars handler which looks up translations in a dictionary
*/
var path = require("path");
var fs = require("fs");
var handlebars = require("handlebars");
module.exports = function makePlugin() {
return function (opts) {
var data = {
"en": {}
... | Handle missing title localisation file. | Handle missing title localisation file.
| JavaScript | mit | playcanvas/developer.playcanvas.com,playcanvas/developer.playcanvas.com |
6721766466e5cf2231fcc81fa9cdee2972835a93 | lib/jsonReader.js | lib/jsonReader.js | var fs = require('fs');
var JSONStream = require('JSONStream');
var jsonReader = {};
jsonReader.read = function (fileName, callback) {
return fs.readFile(fileName, function(err, data) {
if (err) throw err;
return callback(data);
});
};
jsonReader.readStartStationStream = function (fileName, callback) {
... | var fs = require('fs')
var jsonReader = {}
jsonReader.read = function (fileName, callback) {
return fs.readFile(fileName, function (err, data) {
if (err) {
throw err
}
return callback(data)
})
}
jsonReader.readStream = function (fileName) {
return fs.createReadStream(fileName)
}
module.expor... | Clean up and make a separate method for return a readStream | Clean up and make a separate method for return a readStream
| JavaScript | mit | superhansa/bikesluts,superhansa/bikesluts |
5162a6d35a605c13d32dadf8a821e569248db98e | Gruntfile.js | Gruntfile.js | require('js-yaml');
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-karma');
grunt.initConfig({
paths: require('js_paths.yml'),
mochaTest: {
jsbox_apps: {
src: ['<%= paths.tests.jsbox_apps.spec... | require('js-yaml');
var path = require('path');
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-karma');
grunt.initConfig({
paths: require('js_paths.yml'),
mochaTest: {
jsbox_apps: {
src: ['<%=... | Make use of node path utils when processing the jst names for jst grunt task | Make use of node path utils when processing the jst names for jst grunt task
| JavaScript | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go |
1170229827ef0e2e4dc78bd65bf71ab6ce7875fc | lib/node-linux.js | lib/node-linux.js | /**
* @class nodelinux
* This is a standalone module, originally designed for internal use in [NGN](http://github.com/thinkfirst/NGN).
* However; it is capable of providing the same features for Node.JS scripts
* independently of NGN.
*
* ### Getting node-linux
*
* `npm install node-linux`
*
* ### Using node-... | /**
* @class nodelinux
* This is a standalone module, originally designed for internal use in [NGN](http://github.com/thinkfirst/NGN).
* However; it is capable of providing the same features for Node.JS scripts
* independently of NGN.
*
* ### Getting node-linux
*
* `npm install node-linux`
*
* ### Using node-... | Remove exception on requiring module | Remove exception on requiring module | JavaScript | mit | zonetti/node-linux,zonetti/node-linux |
f27626a82f7c2228182fca3b3d84171cf49b0ecb | Gruntfile.js | Gruntfile.js | require('js-yaml');
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-mocha-test');
grunt.initConfig({
paths: require('paths.yml'),
mochaTest: {
jsbox_apps: {
src: ['<%= paths.jsbox_apps.tests %>'],
}
}
});
grunt.registerTask('test', [
'mochaTest'
]);
grun... | require('js-yaml');
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-mocha-test');
grunt.initConfig({
paths: require('paths.yml'),
mochaTest: {
jsbox_apps: {
src: ['<%= paths.jsbox_apps.tests %>'],
}
}
});
grunt.registerTask('test:jsbox_apps', [
'mochaTest:jsb... | Add a grunt task for only the jsbox_app js tests | Add a grunt task for only the jsbox_app js tests
| JavaScript | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go |
20c080c8f356f257d9c57dc761dd904280fabd4e | js/application.js | js/application.js | // load social sharing scripts if the page includes a Twitter "share" button
var _jsLoader = _jsLoader || {};
// callback pattern
_jsLoader.initTwitter = (function() {
if (typeof (twttr) != 'undefined') {
twttr.widgets.load();
} else {
_jsLoader.getScript('http://platform.twitter.com/widgets.js');
... | // load social sharing scripts if the page includes a Twitter "share" button
var _jsLoader = _jsLoader || {};
// callback pattern
_jsLoader.initTwitter = (function() {
if (typeof (twttr) != 'undefined') {
twttr.widgets.load();
} else {
_jsLoader.getScript('http://platform.twitter.com/widgets.js', f... | Add timeouts to social app loading | Add timeouts to social app loading
| JavaScript | mit | bf4/bf4.github.com,bf4/bf4.github.com,bf4/bf4.github.com,bf4/bf4.github.com |
67fc5a6d4365cc87ef7a07766594cae9431f1086 | lib/app/js/directives/shadowDom.js | lib/app/js/directives/shadowDom.js | 'use strict';
angular.module('sgApp')
.directive('shadowDom', function(Styleguide, $templateCache) {
var USER_STYLES_TEMPLATE = 'userStyles.html';
return {
restrict: 'E',
transclude: true,
link: function(scope, element, attrs, controller, transclude) {
if (typeof element[0].create... | 'use strict';
angular.module('sgApp')
.directive('shadowDom', function(Styleguide, $templateCache) {
var USER_STYLES_TEMPLATE = 'userStyles.html';
return {
restrict: 'E',
transclude: true,
link: function(scope, element, attrs, controller, transclude) {
scope.$watch(function() {
... | Fix fullscreen mode when using disableEncapsulation option | Fix fullscreen mode when using disableEncapsulation option
| JavaScript | mit | hence-io/sc5-styleguide,junaidrsd/sc5-styleguide,kraftner/sc5-styleguide,patriziosotgiu/sc5-styleguide,lewiscowper/sc5-styleguide,varya/sc5-styleguide,kraftner/sc5-styleguide,hence-io/sc5-styleguide,jkarttunen/sc5-styleguide,lewiscowper/sc5-styleguide,ifeelgoods/sc5-styleguide,jkarttunen/sc5-styleguide,SC5/sc5-stylegui... |
8566a1dedb86a6941ef32822a424dbae327e646d | src/streams/hot-collection-to-collection.js | src/streams/hot-collection-to-collection.js | define(['streamhub-sdk/collection'], function (Collection) {
'use strict';
var HotCollectionToCollection = function () {};
/**
* Transform an Object from StreamHub's Hot Collection endpoint into a
* streamhub-sdk/collection model
* @param hotCollection {object}
*/
HotCollectionTo... | define(['streamhub-sdk/collection'], function (Collection) {
'use strict';
var HotCollectionToCollection = function () {};
/**
* Transform an Object from StreamHub's Hot Collection endpoint into a
* streamhub-sdk/collection model
* @param hotCollection {object}
*/
HotCollectionTo... | Include url attribute in created Collection | Include url attribute in created Collection
| JavaScript | mit | gobengo/streamhub-hot-collections |
3f8a720bce6ea792be37fbf7a52ba7ea62d89c9f | lib/connection.js | lib/connection.js | var mongo = require('mongoskin');
var job = require('./job');
var Queue = require('./queue');
var Worker = require('./worker');
module.exports = Connection;
function Connection(uri, options) {
this.db = mongo.db(uri, options);
}
Connection.prototype.worker = function (queues, options) {
var self = this;
... | var mongo = require('mongoskin');
var job = require('./job');
var Queue = require('./queue');
var Worker = require('./worker');
module.exports = Connection;
function Connection(uri, options) {
this.db = mongo.db(uri, options);
}
Connection.prototype.worker = function (queues, options) {
var self = this;
... | Create worker queue with options | Create worker queue with options | JavaScript | mit | dioscouri/nodejs-monq |
403e11554bdd11ec3e521d4de244f22bdae437d0 | src/components/Layout/HeaderNav.js | src/components/Layout/HeaderNav.js | import React from 'react'
import PropTypes from 'prop-types'
import { Menu, Icon, Popover } from 'antd'
import { Link } from 'dva/router'
import uri from 'utils/uri'
import { l } from 'utils/localization'
import styles from './Header.less'
import { classnames } from 'utils'
function createMenu(items, handleClick, mode... | import React from 'react'
import PropTypes from 'prop-types'
import { Menu, Icon, Popover } from 'antd'
import { Link } from 'dva/router'
import uri from 'utils/uri'
import { l } from 'utils/localization'
import styles from './Header.less'
import { classnames } from 'utils'
function createMenu(items, handleClick, mode... | Fix header nav selected key issue | Fix header nav selected key issue
| JavaScript | mit | steem/qwp-antd,steem/qwp-antd |
9b491e8b0792917404e6a8af09b1f6bd367274d1 | src/components/SubTabView/index.js | src/components/SubTabView/index.js | import React, {Component} from 'react'
import {StyleSheet, View} from 'react-native'
import TabButton from './TabButton'
export default class extends Component {
state = {activeTab: 0}
render = () => (
<View style={{flex: 1}}>
{this.props.tabs.length < 2 ? null :
<View style={Styles.tabWrapper}>
{
... | import React, {Component} from 'react'
import {StyleSheet, View} from 'react-native'
import TabButton from './TabButton'
export default class extends Component {
state = {activeTab: 0}
render = () => (
<View style={{flex: 1}}>
{this.props.tabs.length < 2 ? null :
<View style={Styles.tabWrapper}>
{
... | Implement sort ordering for SubTabView | Implement sort ordering for SubTabView
| JavaScript | mit | Digitova/reactova-framework |
7aeca984f56841396a3d26120decc7b1b161f92a | scripts/_build-base-html.js | scripts/_build-base-html.js | const fs = require(`fs`);
const glob = require(`glob`);
const path = require(`path`);
const buildHtml = require(`./_build-html.js`);
const pages = glob.sync(path.join(process.cwd(), `pages`, `**`, `*.hbs`));
module.exports = (data) => {
pages.forEach((page) => {
const baseTemplate = fs.readFileSync(page, `utf8... | const fs = require(`fs`);
const glob = require(`glob`);
const path = require(`path`);
const buildHtml = require(`./_build-html.js`);
const pages = glob.sync(path.join(process.cwd(), `pages`, `**`, `*.hbs`));
module.exports = (data) => {
pages.forEach((page) => {
const baseTemplate = fs.readFileSync(page, `utf8... | Add support for nested pages | Add support for nested pages
| JavaScript | mit | avalanchesass/avalanche-website,avalanchesass/avalanche-website |
78aa6e0fb40c58376105c801c1204b194bc926de | publishing/printview/main.js | publishing/printview/main.js | // convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab
define([
'base/js/namespace',
'jquery',
], function(IPython, $) {
"use strict";
if (IPython.version[0] < 3) {
console.log("This extension requires IPython 3.x")
return
}
... | // convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab
define([
'base/js/namespace',
'jquery',
], function(IPython, $) {
"use strict";
if (IPython.version[0] < 3) {
console.log("This extension requires at least IPython 3.x")
return
}
... | Make printview work with jupyter | Make printview work with jupyter
| JavaScript | bsd-3-clause | Konubinix/IPython-notebook-extensions,Konubinix/IPython-notebook-extensions,Konubinix/IPython-notebook-extensions |
bc7f78fa11cfd51a4bcf28a3d1bc5aa384772224 | api/index.js | api/index.js | const { Router } = require('express')
const authRoutes = require('./authentication')
const usersRoutes = require('./users')
const authMiddleware = require('./../middlewares/authentication')
const api = (app) => {
let api = Router()
api.use(authMiddleware)
api.get('/', (req, res) => {
res.status(... | const { Router } = require('express')
const authRoutes = require('./authentication')
const usersRoutes = require('./users')
const customerRoutes = require('./customers')
const authMiddleware = require('./../middlewares/authentication')
const api = (app) => {
let api = Router()
api.use(authMiddleware)
... | Remove current user data from response and user customer routes | Remove current user data from response and user customer routes
| JavaScript | mit | lucasrcdias/customer-mgmt |
04035fb612629d88a73b04cdca02efc20833e819 | cypress/integration/top-bar.spec.js | cypress/integration/top-bar.spec.js | context("Sage top bar UI", () => {
beforeEach(() => {
cy.visit("/")
})
context("new node icon", () => {
it("lets you drag a node onto canvas", () => {
cy.getSageIframe().find('.proto-node')
.trigger('mousedown', { which: 1 })
cy.getSageIframe().find('.ui-droppable')
.trigger(... | context("Sage top bar UI", () => {
beforeEach(() => {
cy.visit("/")
})
context("new node icon", () => {
it("lets you drag a node onto canvas", () => {
cy.getSageIframe().find('.proto-node')
.trigger('mousedown', { which: 1 })
cy.getSageIframe().find('.ui-droppable')
.trigger(... | Add Cypress test for About menu | Add Cypress test for About menu
| JavaScript | mit | concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models |
012db48868f1770b85925e52dce7628883f6867a | demo/src/index.js | demo/src/index.js | import 'normalize.css';
import React from 'react';
import { render } from 'react-dom';
import ButtonDemo from './components/ButtonDemo';
import './index.css';
render(
<main>
<ButtonDemo />
</main>,
document.getElementById('root')
);
| import 'normalize.css';
import React from 'react';
import { render } from 'react-dom';
import ButtonDemo from './ButtonDemo';
import './index.css';
render(
<main>
<ButtonDemo />
</main>,
document.getElementById('root')
);
| Fix access path of the button component | fix(demo): Fix access path of the button component
| JavaScript | mit | kripod/material-components-react,kripod/material-components-react |
d23efb0cd3380ea5a6b3384f4f2fa5ff72466f0b | playground/index.js | playground/index.js | 'use strict';
import React, { Component } from 'react';
import Pic from '../lib/index.js';
export default class Playground extends Component {
render() {
return (
<html>
<head>
<meta charSet='UTF-8' />
<title>react-pic</title>
</head>
<body>
<div id="r... | 'use strict';
import React, { Component } from 'react';
import Pic from '../lib/index.js';
export default class Playground extends Component {
constructor(props) {
super(props);
this.state = {
show: true
};
this.clickHandler = this.clickHandler.bind(this);
}
clickHandler() {
this.setS... | Add button that toggles `<Pic>` to make it easier to develop for unmount | Add button that toggles `<Pic>` to make it easier to develop for unmount
| JavaScript | mit | benox3/react-pic |
dd80f254f407429aeaf5ca5c4fb414363836c267 | src/karma.conf.js | src/karma.conf.js | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... | Add custom launcher for karma | Add custom launcher for karma
| JavaScript | mit | dzonatan/angular2-linky,dzonatan/angular2-linky |
f0b03d64e8e43781fe3fe97f6f6de4f4a1da1705 | jobs/search-items.js | jobs/search-items.js | const WMASGSpider = require('../wmasg-spider');
class SearchItems {
constructor(concurrency = 5) {
this.title = 'search items';
this.concurrency = concurrency;
}
process(job, done) {
const spider = new WMASGSpider();
spider.on('error', error => done(error));
spider.on('end', () => done());
... | const WMASGSpider = require('../wmasg-spider');
class SearchItems {
constructor(concurrency = 5) {
this.title = 'search items';
this.concurrency = concurrency;
}
match(item, expression) {
return item.title.toLowerCase().match(expression) || item.description.toLowerCase().match(expression);
}
pr... | Implement filtering items by keywords and price and passing result back | Implement filtering items by keywords and price and passing result back
| JavaScript | mit | adrianrutkowski/wmasg-crawler |
f24a110d489a35705477ec1332fb9a148a26b609 | api/models/user.js | api/models/user.js | 'use strict'
let mongoose = require('mongoose')
mongoose.Promise = global.Promise
let Schema = mongoose.Schema
let UserSchema = new Schema({
email: String,
password: String,
CMDRs: {
default: [],
type: [{
type: Schema.Types.ObjectId,
ref: 'Rat'
}]
},
nicknames: {
default: [],
... | 'use strict'
let mongoose = require('mongoose')
mongoose.Promise = global.Promise
let Schema = mongoose.Schema
let UserSchema = new Schema({
email: String,
password: String,
CMDRs: {
default: [],
type: [{
type: Schema.Types.ObjectId,
ref: 'Rat'
}]
},
nicknames: {
default: [],
... | Add permission group field to User object. | Add permission group field to User object.
#25
| JavaScript | bsd-3-clause | FuelRats/api.fuelrats.com,FuelRats/api.fuelrats.com,FuelRats/api.fuelrats.com |
30716f7acac0bf738d32b9c69aca84b59872a821 | src/components/posts_new.js | src/components/posts_new.js | import React from 'react';
import { Field, reduxForm } from 'redux-form';
class PostsNew extends React.Component {
renderField(field) {
return (
<div className='form-group'>
<label>{field.label}</label>
<input
className='form-control'
type='text'
{...field.inpu... | import React from 'react';
import { Field, reduxForm } from 'redux-form';
class PostsNew extends React.Component {
renderField(field) {
return (
<div className='form-group'>
<label>{field.label}</label>
<input
className='form-control'
type='text'
{...field.inpu... | Add initial validations (using redux forms) | Add initial validations (using redux forms)
| JavaScript | mit | monsteronfire/redux-learning-blog,monsteronfire/redux-learning-blog |
d52129c5d915e260d4d86914326606f305ad4ed0 | experiments/modern/src/maki-interpreter/interpreter.js | experiments/modern/src/maki-interpreter/interpreter.js | const parse = require("./parser");
const { getClass } = require("./objects");
const interpret = require("./virtualMachine");
function main({ runtime, data, system, log }) {
const program = parse(data);
// Set the System global
program.variables[0].setValue(system);
// Replace class hashes with actual JavaScr... | const parse = require("./parser");
const { getClass, getFormattedId } = require("./objects");
const interpret = require("./virtualMachine");
function main({ runtime, data, system, log }) {
const program = parse(data);
// Set the System global
program.variables[0].setValue(system);
// Replace class hashes wit... | Improve error message for missing classes | Improve error message for missing classes
| JavaScript | mit | captbaritone/winamp2-js,captbaritone/winamp2-js,captbaritone/winamp2-js |
20589a3fbfb61328a93a71eda4a90f07d6d0aa23 | mac/resources/open_ATXT.js | mac/resources/open_ATXT.js | define(['mac/roman'], function(macRoman) {
'use strict';
function open(item) {
return item.getBytes().then(function(bytes) {
item.setDataObject(new TextView(bytes.buffer, bytes.byteOffset, bytes.byteLength));
});
};
function TextView(buffer, byteOffset, byteLength) {
this.dataView = new... | define(['mac/roman'], function(macRoman) {
'use strict';
function open(item) {
return item.getBytes().then(function(bytes) {
item.setDataObject(new TextView(bytes.buffer, bytes.byteOffset, bytes.byteLength));
});
};
function TextView(buffer, byteOffset, byteLength) {
this.dataView = new... | Put in missing bytes field | Put in missing bytes field | JavaScript | mit | radishengine/drowsy,radishengine/drowsy |
6143f9ef9701b92ec38aa12f4be2b1c94e4394cd | app/models/user.js | app/models/user.js | var Bcrypt = require('bcryptjs')
var Mongoose = require('../../database').Mongoose
var ObjectId = Mongoose.Schema.Types.ObjectId;
var userSchema = new Mongoose.Schema({
username: {
type : String,
required: true
},
password: {
type : String,
required: true
},
email: {
type : String,
r... | var Bcrypt = require('bcryptjs')
var Mongoose = require('../../database').Mongoose
var ObjectId = Mongoose.Schema.Types.ObjectId;
var userSchema = new Mongoose.Schema({
username: {
type : String,
required: true
},
password: {
type : String,
required: true
},
email: {
type : String,
r... | Change mixed type to array json | Change mixed type to array json
| JavaScript | mit | fitraditya/Obrel |
f345e428c9d7766ee5945f1d1d2cbb6e64c24ce4 | assets/js/index.js | assets/js/index.js | new Vue({
el: '#app',
delimiters: ['[[', ']]'],
data: {
search: '',
activeNote: window.location.href.split('#')[1]
},
methods: {
seeNote: function (note) {
this.activeNote = note
}
},
updated: function () {
var ulElem
for (var refName in this.$refs) {
ulElem = this.$ref... | new Vue({
el: '#app',
delimiters: ['[[', ']]'],
data: {
search: '',
activeNote: window.location.href.split('#')[1]
},
methods: {
seeNote: function (note) {
this.activeNote = note
}
},
updated: function () {
var ulElem
for (var refName in this.$refs) {
ulElem = this.$ref... | Improve automatic focus to the search input | Improve automatic focus to the search input
| JavaScript | mit | Yutsuten/Yutsuten.github.io,Yutsuten/Yutsuten.github.io,Yutsuten/Yutsuten.github.io |
7249234061e8791ccbee5d0e3b8578d8595e43f8 | tests/unit/classes/ModuleLoader.js | tests/unit/classes/ModuleLoader.js | var utils = require('utils')
, env = utils.bootstrapEnv()
, moduleLdr = env.moduleLoader
, injector = require('injector')
, ncp = require('ncp')
, path = require('path')
, async = require('async');
describe('ModuleLoader', function() {
before(function(done) {
... | var utils = require('utils')
, env = utils.bootstrapEnv()
, moduleLdr = env.moduleLoader
, injector = require('injector')
, ncp = require('ncp')
, path = require('path')
, async = require('async');
describe('ModuleLoader', function() {
it('should load modules', fu... | Remove old code for copying test-module | chore(cleanup): Remove old code for copying test-module | JavaScript | mit | CleverStack/node-seed |
021c5e27be8e909bd7a56fc794e9a9d6c15cef9a | utilities/execution-environment.js | utilities/execution-environment.js | /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
const canUseDOM = !!(
typeof window !== 'undefined' &&
window.document &&
window.document.createElement
);
const ExecutionEnvironment = {
canUseDOM,
canUseWorkers:... | /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
const canUseDOM = !!(
typeof window !== 'undefined' &&
window.document &&
window.document.createElement
);
const canUseWorkers = typeof Worker !== 'undefined';
const ... | Change exports for Execution Environment | Change exports for Execution Environment
This reverts the export which is resulting in canUseDOM’s value equaling undefined.
| JavaScript | bsd-3-clause | salesforce/design-system-react,salesforce/design-system-react,salesforce/design-system-react |
2d3838b5391f65fd7abc4975eb0eb153f54386db | lib/sort_versions.js | lib/sort_versions.js | 'use strict';
var Semvish = require('semvish');
module.exports = function(arr) {
if(!arr) {
return;
}
return arr.slice().sort(Semvish.compare).reverse();
};
| 'use strict';
var Semvish = require('semvish');
module.exports = function(arr) {
if(!arr) {
return;
}
return arr.slice().sort(Semvish.rcompare);
};
| Use rcomp instead of .reverse() in sort | Use rcomp instead of .reverse() in sort
| JavaScript | mit | MartinKolarik/api-sync,jsdelivr/api-sync,MartinKolarik/api-sync,jsdelivr/api-sync |
de03d876a5ddd7e82627441219d446e9f0d64275 | server/controllers/students.js | server/controllers/students.js | //var Teachers = require('../models/teachers');
//var TeacherClasses = require('../models/Teacher_classes');
//var Classes = require('../models/classes');
//var ClassLessons = require('../models/class_lessons');
// var Lessons = require('../models/lessons');
//var RequestedResponses = require('../models/requested_respo... | //var Teachers = require('../models/teachers');
//var TeacherClasses = require('../models/Teacher_classes');
//var Classes = require('../models/classes');
//var ClassLessons = require('../models/class_lessons');
// var Lessons = require('../models/lessons');
//var RequestedResponses = require('../models/requested_respo... | Remove teacherConnect socket event for frontend handling | Remove teacherConnect socket event for frontend handling
| JavaScript | mit | shanemcgraw/thumbroll,Jakeyrob/thumbroll,absurdSquid/thumbroll,absurdSquid/thumbroll,Jakeyrob/thumbroll,Jakeyrob/thumbroll,shanemcgraw/thumbroll,shanemcgraw/thumbroll |
6d5ba4db94939c5f29451df363c9f6afd9740779 | src/assets/dosamigos-ckeditor.widget.js | src/assets/dosamigos-ckeditor.widget.js | /**
* @copyright Copyright (c) 2012-2015 2amigOS! Consulting Group LLC
* @link http://2amigos.us
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
if (typeof dosamigos == "undefined" || !dosamigos) {
var dosamigos = {};
}
dosamigos.ckEditorWidget = (function ($) {
var pub = ... | /**
* @copyright Copyright (c) 2012-2015 2amigOS! Consulting Group LLC
* @link http://2amigos.us
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
if (typeof dosamigos == "undefined" || !dosamigos) {
var dosamigos = {};
}
dosamigos.ckEditorWidget = (function ($) {
var pub = ... | Fix bug with csrf token | Fix bug with csrf token
| JavaScript | bsd-3-clause | yangtoude/yii2-ckeditor-widget,richardfan1126/yii2-ckeditor-widget,alexdin/yii2-ckeditor-widget,richardfan1126/yii2-ckeditor-widget,richardfan1126/yii2-ckeditor-widget,yangtoude/yii2-ckeditor-widget,alexdin/yii2-ckeditor-widget,yangtoude/yii2-ckeditor-widget |
28948b82be7d6da510d0afce5aa8d839df0ab1b0 | test/main_spec.js | test/main_spec.js | let chai = require('chai')
let chaiHttp = require('chai-http')
let server = require('../src/main.js')
import {expect} from 'chai'
chai.use(chaiHttp)
describe('server', () => {
before( () => {
server.listen();
})
after( () => {
server.close();
})
describe('/', () => {
it('should return 200', (do... | let chai = require('chai')
let chaiHttp = require('chai-http')
let server = require('../src/main.js')
import {expect} from 'chai'
chai.use(chaiHttp)
describe('server', () => {
before( () => {
server.listen();
})
after( () => {
server.close();
})
describe('/', () => {
it('should return 200', (do... | Remove logging from server test | Remove logging from server test
| JavaScript | mit | GLNRO/react-redux-threejs,GLNRO/react-redux-threejs |
68eceecffb4ea457fe92d623f5722fd25c09e718 | src/js/routers/app-router.js | src/js/routers/app-router.js | import * as Backbone from 'backbone';
import Items from '../collections/items';
import SearchBoxView from '../views/searchBox-view';
import SearchResultsView from '../views/searchResults-view';
import AppView from '../views/app-view';
import DocumentSet from '../helpers/search';
import dispatcher from '../helpers/dispa... | import * as Backbone from 'backbone';
import Items from '../collections/items';
import SearchBoxView from '../views/searchBox-view';
import SearchResultsView from '../views/searchResults-view';
import AppView from '../views/app-view';
import Events from '../helpers/backbone-events';
import DocumentSet from '../helpers/... | Use Events instead of custom dispatcher (more) | Use Events instead of custom dispatcher (more)
| JavaScript | mit | trevormunoz/katherine-anne,trevormunoz/katherine-anne,trevormunoz/katherine-anne |
b4b22938c6feba84188859e522f1b44c274243db | src/modules/workshop/workshop.routes.js | src/modules/workshop/workshop.routes.js | // Imports
import UserRoles from '../../core/auth/constants/userRoles';
import WorkshopController from './workshop.controller';
import WorkshopHeaderController from './workshop-header.controller';
import { workshop } from './workshop.resolve';
import { carBrands } from '../home/home.resolve';
/**
* @ngInject
* @para... | // Imports
import UserRoles from '../../core/auth/constants/userRoles';
import WorkshopController from './workshop.controller';
import WorkshopHeaderController from './workshop-header.controller';
import { workshop } from './workshop.resolve';
import { carBrands } from '../home/home.resolve';
/**
* @ngInject
* @para... | Set action to information when routing to workshop details | Set action to information when routing to workshop details
| JavaScript | mit | ProtaconSolutions/Poc24h-January2017-FrontEnd,ProtaconSolutions/Poc24h-January2017-FrontEnd |
f7dfb99616f47561d83f9609c8a32fd6275a053c | src/components/CategoryBody.js | src/components/CategoryBody.js | /**
* Created by farid on 8/16/2017.
*/
import React, {Component} from "react";
import Post from "./Post";
import PropTypes from 'prop-types';
class CategoryBody extends Component {
render() {
return (
<div className="card-body">
<div className="row">
{
... | /**
* Created by farid on 8/16/2017.
*/
import React, {Component} from "react";
import Post from "./Post";
import PropTypes from 'prop-types';
class CategoryBody extends Component {
render() {
return (
<div className="card-body">
<div className="row">
{
... | Enable delete and update post on home page | feat: Enable delete and update post on home page
| JavaScript | mit | faridsaud/udacity-readable-project,faridsaud/udacity-readable-project |
f49ab42589462d519c4304f9c3014a8d5f04e1b3 | native/components/safe-area-view.react.js | native/components/safe-area-view.react.js | // @flow
import * as React from 'react';
import { SafeAreaView } from 'react-navigation';
const forceInset = { top: 'always', bottom: 'never' };
type Props = {|
style?: $PropertyType<React.ElementConfig<typeof SafeAreaView>, 'style'>,
children?: React.Node,
|};
function InsetSafeAreaView(props: Props) {
const ... | // @flow
import type { ViewStyle } from '../types/styles';
import * as React from 'react';
import { View } from 'react-native';
import { useSafeArea } from 'react-native-safe-area-context';
type Props = {|
style?: ViewStyle,
children?: React.Node,
|};
function InsetSafeAreaView(props: Props) {
const insets = u... | Update SafeAreaView for React Nav 5 | [native] Update SafeAreaView for React Nav 5
Can't import directly from React Nav anymore, using `react-native-safe-area-context` now
| JavaScript | bsd-3-clause | Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal |
7afb5342fb92ed902b962a3324f731833a1cdb00 | client/userlist.js | client/userlist.js | var UserList = React.createClass({
componentDidMount: function() {
socket.on('join', this._join);
socket.on('part', this._part);
},
render: function() {
return (
<ul id='online-list'></ul>
);
},
_join: function(username) {
if (username != myUsernam... | var UserList = React.createClass({
componentDidMount: function() {
socket.on('join', this._join);
socket.on('part', this._part);
},
render: function() {
return (
<ul id='online-list'></ul>
);
},
_join: function(username) {
if (username != myUsernam... | Create prototype react component for user in list | Create prototype react component for user in list
| JavaScript | mit | mbalamat/ting,odyvarv/ting-1,gtklocker/ting,gtklocker/ting,mbalamat/ting,sirodoht/ting,dionyziz/ting,VitSalis/ting,gtklocker/ting,gtklocker/ting,odyvarv/ting-1,sirodoht/ting,sirodoht/ting,dionyziz/ting,dionyziz/ting,odyvarv/ting-1,mbalamat/ting,mbalamat/ting,dionyziz/ting,odyvarv/ting-1,VitSalis/ting,VitSalis/ting,VitS... |
0c2e8d75c01e8032adcde653a458528db0683c44 | karma.conf.js | karma.conf.js | module.exports = function(config){
config.set({
basePath : './',
files : [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-route/angular-route.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/components/**/*.js',
'app/view*/**/*.js'
... | module.exports = function(config){
config.set({
basePath : './',
files : [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-route/angular-route.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/components/**/*.js',
'app/view*/**/*.js'
... | Change karma to run both Firefox and Chrome. | Change karma to run both Firefox and Chrome.
I have both, I care about both, so run both!
| JavaScript | agpl-3.0 | CCJ16/registration,CCJ16/registration,CCJ16/registration |
a783fbcd8bcff07672e64ada1f75c7290c9a765a | src/chrome/index.js | src/chrome/index.js | /* eslint-disable no-console */
import { CONFIG } from '../constants';
import { Socket } from 'phoenix';
import { startPlugin } from '..';
import listenAuth from './listenAuth';
import handleNotifications from './handleNotifications';
import handleWork from './handleWork';
import renderIcon from './renderIcon';
export... | /* eslint-disable no-console */
import { CONFIG } from '../constants';
import { Socket } from 'phoenix';
import { startPlugin } from '..';
import listenAuth from './listenAuth';
import handleNotifications from './handleNotifications';
import handleWork from './handleWork';
import renderIcon from './renderIcon';
export... | Add plugin state to logging | Add plugin state to logging
| JavaScript | mit | rainforestapp/tester-chrome-extension,rainforestapp/tester-chrome-extension,rainforestapp/tester-chrome-extension |
b4cd7c829a7d17888902f5468d4ea0a0f1084c42 | src/common/Popup.js | src/common/Popup.js | /* @flow */
import React, { PureComponent } from 'react';
import type { ChildrenArray } from 'react';
import { View, Dimensions, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
popup: {
marginRight: 20,
marginLeft: 20,
marginBottom: 2,
bottom: 0,
borderRadius: 5,
shadowOp... | /* @flow */
import React, { PureComponent } from 'react';
import type { ChildrenArray } from 'react';
import { View, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
popup: {
marginRight: 20,
marginLeft: 20,
marginBottom: 2,
bottom: 0,
borderRadius: 5,
shadowOpacity: 0.25,... | Remove extraneous `maxHeight` prop on a `View`. | popup: Remove extraneous `maxHeight` prop on a `View`.
This is not a prop that the `View` component supports. It has never
had any effect, and the Flow 0.75 we'll pull in with RN 0.56 will
register it as an error.
This prop was added in commit ce0395cff when changing the component
used here to a `ScrollView`, and 62... | JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile |
752c2c39790cf1ffb1e97850991d2f13c25f92b8 | src/config/babel.js | src/config/babel.js | // External
const mem = require('mem');
// Ours
const { merge } = require('../utils/structures');
const { getProjectConfig } = require('./project');
const PROJECT_TYPES_CONFIG = {
preact: {
plugins: [
[
require.resolve('@babel/plugin-transform-react-jsx'),
{
pragma: 'h'
}... | // External
const mem = require('mem');
// Ours
const { merge } = require('../utils/structures');
const { getProjectConfig } = require('./project');
const PROJECT_TYPES_CONFIG = {
preact: {
plugins: [
[
require.resolve('@babel/plugin-transform-react-jsx'),
{
pragma: 'h'
}... | Update target browsers. IE 11 needs to be manually specified now becuase it's dropped below 1% in Australia, but is still supported by ABC. | Update target browsers. IE 11 needs to be manually specified now becuase it's dropped below 1% in Australia, but is still supported by ABC.
| JavaScript | mit | abcnews/aunty,abcnews/aunty,abcnews/aunty |
2525fe4097ff124239ed56956209d4d0ffefac27 | test/unit/util/walk-tree.js | test/unit/util/walk-tree.js | import walkTree from '../../../src/util/walk-tree';
describe('utils/walk-tree', function () {
it('should walk parents before walking descendants', function () {
var order = [];
var one = document.createElement('one');
one.innerHTML = '<two><three></three></two>';
walkTree(one, function (elem) {
... | import walkTree from '../../../src/util/walk-tree';
describe('utils/walk-tree', function () {
var one, order;
beforeEach(function () {
order = [];
one = document.createElement('one');
one.innerHTML = '<two><three></three></two>';
});
it('should walk parents before walking descendants', function (... | Write test for walkTre() filter. | Write test for walkTre() filter.
| JavaScript | mit | skatejs/skatejs,antitoxic/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs,chrisdarroch/skatejs |
1a07a7c7900cc14582fdaf41a96933d221a439e0 | tests/client/unit/s.Spec.js | tests/client/unit/s.Spec.js | describe('Satellite game', function () {
beforeEach(function () {
});
it('should exists', function () {
expect(s).to.be.an('object');
expect(s).to.have.property('config');
expect(s).to.have.property('init');
});
it('should contains ship properties', function () {
expect(s).to.have.dee... | describe('Satellite game', function () {
it('should exists', function () {
expect(s).to.be.an('object');
expect(s).to.have.property('config');
expect(s).to.have.property('init');
});
it('should contains ship properties', function () {
expect(s).to.have.deep.property('config.ship.hull');
... | Remove unused before each call | Remove unused before each call
| JavaScript | bsd-2-clause | satellite-game/Satellite,satellite-game/Satellite,satellite-game/Satellite |
3f934607b9404a5edca6b6a7f68c934d90c899ce | static/js/featured-projects.js | static/js/featured-projects.js | $('.project-toggle-featured').on('click', function() {
const projectId = $(this).data("project-id"),
featured = $(this).data("featured") === "True";
method = featured ? "DELETE" : "POST";
$.ajax({
type: method,
url: `/admin/featured/${projectId}`,
dataType:... | $('.project-toggle-featured').on('click', function() {
const projectId = $(this).data("project-id"),
featured = $(this).val() === "Remove";
method = featured ? "DELETE" : "POST";
$.ajax({
type: method,
url: `/admin/featured/${projectId}`,
dataType: 'json'
... | Update featured projects button text | Update featured projects button text
| JavaScript | bsd-3-clause | LibCrowds/libcrowds-bs4-pybossa-theme,LibCrowds/libcrowds-bs4-pybossa-theme |
06e880b204d4b19edb42116d7a7fad85e8889de9 | webpack.common.js | webpack.common.js | var webpack = require('webpack'),
path = require('path'),
CleanWebpackPlugin = require('clean-webpack-plugin');
var libraryName = 'webstompobs',
dist = '/dist';
module.exports = {
entry: __dirname + '/src/index.ts',
context: path.resolve("./src"),
output: {
path: path.join(__dirname, dist),
... | var webpack = require('webpack'),
path = require('path'),
CleanWebpackPlugin = require('clean-webpack-plugin');
var libraryName = 'webstompobs',
dist = '/dist';
module.exports = {
target: 'node',
entry: __dirname + '/src/index.ts',
context: path.resolve("./src"),
output: {
path: path.join(__di... | FIX : Version was not compatible with node | FIX : Version was not compatible with node
Reason : webpack was using window
| JavaScript | apache-2.0 | fpozzobon/webstomp-obs,fpozzobon/webstomp-obs,fpozzobon/webstomp-obs |
4c141ac898f6a7bad42db55445bb5fecf99639bd | src/user/user-interceptor.js | src/user/user-interceptor.js | export default function userInterceptor($localStorage){
function request(config){
if(config.headers.Authorization){
return config;
}
if($localStorage.token){
config.headers.Authorization = 'bearer ' + $localStorage.token;
}
return config;
}
return {request};
}
userInterceptor.$inje... | export default function userInterceptor(user){
function request(config){
if(config.headers.Authorization){
return config;
}
if(user.token){
config.headers.Authorization = 'bearer ' + user.token;
}
return config;
}
return {request};
}
userInterceptor.$inject = ['$localStorage'];
| Use user service in interceptor | Use user service in interceptor
| JavaScript | mit | tamaracha/wbt-framework,tamaracha/wbt-framework,tamaracha/wbt-framework |
5841cf3eb49b17d5c851d8e7e2f6b4573b8fe620 | src/components/nlp/template.js | src/components/nlp/template.js | /**
* Created by Tomasz Gabrysiak @ Infermedica on 08/02/2017.
*/
import html from '../../templates/helpers';
const template = (context) => {
return new Promise((resolve) => {
resolve(html`
<h5 class="card-title">Tell us how you feel.</h5>
<div class="card-text">
<form>
<div clas... | /**
* Created by Tomasz Gabrysiak @ Infermedica on 08/02/2017.
*/
import html from '../../templates/helpers';
const template = (context) => {
return new Promise((resolve) => {
resolve(html`
<h5 class="card-title">Tell us how you feel.</h5>
<div class="card-text">
<form>
<div clas... | Fix typos in text about NLP | Fix typos in text about NLP
| JavaScript | mit | infermedica/js-symptom-checker-example,infermedica/js-symptom-checker-example |
434fcc48ae69280d9295327ec6592c462ba55ab3 | webpack.config.js | webpack.config.js | // Used to run webpack dev server to test the demo in local
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = (env, options) => ({
mode: options.mode,
devtool: 'source-map',
entry: path.resolve(__dirname, 'demo/js/de... | // Used to run webpack dev server to test the demo in local
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = (env, options) => ({
mode: options.mode,
devtool: 'source-map',
entry: path.resolve(__dirname, 'demo/js/de... | Fix chunkhash not allowed in development | Fix chunkhash not allowed in development
| JavaScript | mit | springload/react-accessible-accordion,springload/react-accessible-accordion,springload/react-accessible-accordion |
458790663023230f78c75753bb2619bd437c1117 | webpack.config.js | webpack.config.js | const path = require('path');
module.exports = {
entry: {
'acrolinx-sidebar-integration': './src/acrolinx-sidebar-integration.ts',
'tests': './test/index.ts'
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: ... | const path = require('path');
module.exports = {
entry: {
'acrolinx-sidebar-integration': './src/acrolinx-sidebar-integration.ts',
'tests': './test/index.ts'
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
... | Use webpack just for transpileOnly of ts to js. | Use webpack just for transpileOnly of ts to js.
Type checking is done by IDE, npm run tscWatch or build anyway.
| JavaScript | apache-2.0 | acrolinx/acrolinx-sidebar-demo |
68b7afc956bf0dc2802f266183abb08e9930b3e9 | lib/errors.js | lib/errors.js | var inherits = require('inherits');
var self = module.exports = {
FieldValidationError: FieldValidationError,
ModelValidationError: ModelValidationError,
messages: {
"en-us": {
"generic": "Failed to validate field",
"required": "The field is required",
"wrong_type": "Field value is not o... | var inherits = require('inherits');
var self = module.exports = {
FieldValidationError: FieldValidationError,
ModelValidationError: ModelValidationError,
messages: {
"en-us": {
"generic": "Failed to validate field",
"required": "The field is required",
"wrong_type": "Field value is not o... | Improve formatting of ModelValidationError toString() | Improve formatting of ModelValidationError toString()
| JavaScript | mit | mariocasciaro/minimodel,D4H/minimodel |
b9129f100079a6bf96d086b95c8f65fa8f82d8d4 | lib/memdash/server/public/charts.js | lib/memdash/server/public/charts.js | $(document).ready(function(){
$.jqplot('gets-sets', [$("#gets-sets").data("gets"), $("#gets-sets").data("sets")], {
title: 'Gets & Sets',
grid: {
drawBorder: false,
shadow: false,
background: '#fefefe'
},
axesDefaults: {
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
},
... | $(document).ready(function(){
$.jqplot('gets-sets', [$("#gets-sets").data("gets"), $("#gets-sets").data("sets")], {
title: 'Gets & Sets',
grid: {
drawBorder: false,
shadow: false,
background: '#fefefe'
},
axesDefaults: {
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
},
... | Set legends and colors of series | Set legends and colors of series
| JavaScript | mit | bryckbost/memdash,bryckbost/memdash |
24c1af11a108aa8be55337f057b453cb1052cab6 | test/components/Button_test.js | test/components/Button_test.js | // import { test, getRenderedComponent } from '../spec_helper'
// import { default as subject } from '../../src/components/buttons/Button'
// test('#render', (assert) => {
// const button = getRenderedComponent(subject, {className: 'MyButton'}, 'Yo')
// assert.equal(button.type, 'button')
// assert.equal(button.... | import { expect, getRenderedComponent } from '../spec_helper'
import { default as subject } from '../../src/components/buttons/Button'
describe('Button#render', () => {
it('renders correctly', () => {
const button = getRenderedComponent(subject, {className: 'MyButton'}, 'Yo')
expect(button.type).to.equal('bu... | Add back in the button tests | Add back in the button tests | JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
0178ee1c94589270d78af013cf7ad493de04b637 | src/reducers/index.js | src/reducers/index.js | import { combineReducers } from 'redux'
import { RECEIVE_STOP_DATA } from '../actions'
const cardsReducer = () => {
return {cards: [{name: 'Fruängen', stopId: '9260', updating: false, error: false},{name: 'Slussen', stopId: '9192', updating: false, error: false}]}
}
const stopsReducer = (state, action) => {
switc... | import { combineReducers } from 'redux'
import { RECEIVE_STOP_DATA } from '../actions'
const cardsReducer = () => {
return {cards: [
{
name: 'Fruängen',
stopId: '9260',
updating: false,
error: false,
lines: [{
line: '14',
direction: 1
}]
},
{
name... | Add direction information to cards | Add direction information to cards
| JavaScript | apache-2.0 | Ozzee/sl-departures,Ozzee/sl-departures |
7b6ba59b367e90de2137c5300b264578d67e85e1 | src/sprites/Turret.js | src/sprites/Turret.js | import Obstacle from './Obstacle'
export default class extends Obstacle {
constructor (game, player, x, y, frame, bulletFrame) {
super(game, player, x, y, frame)
this.weapon = this.game.plugins.add(Phaser.Weapon)
this.weapon.trackSprite(this)
this.weapon.createBullets(50, 'chars_small', bulletFrame)... | import Obstacle from './Obstacle'
export default class extends Obstacle {
constructor (game, player, x, y, frame, bulletFrame) {
super(game, player, x, y, frame)
this.weapon = this.game.plugins.add(Phaser.Weapon)
this.weapon.trackSprite(this)
this.weapon.createBullets(50, 'chars_small', bulletFrame)... | Fix reaggroing when player gets hit while deaggrod. | Fix reaggroing when player gets hit while deaggrod.
| JavaScript | mit | mikkpr/LD38,mikkpr/LD38 |
c08b8593ffbd3762083af29ea452a09ba5180832 | .storybook/webpack.config.js | .storybook/webpack.config.js | const genDefaultConfig = require('@storybook/vue/dist/server/config/defaults/webpack.config.js')
const merge = require('webpack-merge')
module.exports = (baseConfig, env) => {
const storybookConfig = genDefaultConfig(baseConfig, env)
const quasarConfig = require('../build/webpack.dev.conf.js')
/* when building ... | const genDefaultConfig = require('@storybook/vue/dist/server/config/defaults/webpack.config.js')
const merge = require('webpack-merge')
module.exports = (baseConfig, env) => {
/* when building with storybook we do not want to extract css as we normally do in production */
process.env.DISABLE_EXTRACT_CSS = true
... | Set DISABLE_EXTRACT_CSS in correct place | Set DISABLE_EXTRACT_CSS in correct place
| JavaScript | mit | yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/karrot-frontend |
e30668139c173653ff962d393311f36cb64ab08f | test/components/Post.spec.js | test/components/Post.spec.js | import { expect } from 'chai';
import { mount } from 'enzyme';
import React from 'react';
import Post from '../../src/js/components/Post';
describe('<Post/>', () => {
const post = {
id: 0,
title: 'Test Post',
content: 'empty',
description: 'empty',
author: 'bot',
slug: 'test-post',
tags: ... | import { expect } from 'chai';
import { mount, shallow } from 'enzyme';
import React from 'react';
import Post from '../../src/js/components/Post';
describe('<Post/>', () => {
const post = {
id: 0,
title: 'Test Post',
content: 'empty',
description: 'empty',
author: 'bot',
slug: 'test-post',
... | Replace `mount` calls with `shallow` in <Post> tests | Replace `mount` calls with `shallow` in <Post> tests
| JavaScript | mit | slavapavlutin/pavlutin-node,slavapavlutin/pavlutin-node |
2b0dd27492594ee525eab38f6f4428d596d31207 | tests/tests.js | tests/tests.js | QUnit.test( "hello test", function( assert ) {
assert.ok( 1 == "1", "Passed!" );
}); | QUnit.test( "getOptions default", function( assert ) {
var options = $.fn.inputFileText.getOptions();
assert.equal(options.text,
'Choose File',
'Should return default text option when no text option is provided.');
assert.equal(options.remove,
false,
'Should return def... | Test that getOptions returns default options when none are provided | Test that getOptions returns default options when none are provided
| JavaScript | mit | datchung/jquery.inputFileText,datchung/jquery.inputFileText |
a8b64f852c6e223b21a4052fa9af885e79f6692e | app/server/shared/api-server/api-error.js | app/server/shared/api-server/api-error.js | /**
* Copyright © 2017 Highpine. All rights reserved.
*
* @author Max Gopey <gopeyx@gmail.com>
* @copyright 2017 Highpine
* @license https://opensource.org/licenses/MIT MIT License
*/
class ApiError {
constructor(message) {
this.message = message;
this.stack = Error().stack;
}
s... | /**
* Copyright © 2017 Highpine. All rights reserved.
*
* @author Max Gopey <gopeyx@gmail.com>
* @copyright 2017 Highpine
* @license https://opensource.org/licenses/MIT MIT License
*/
class ApiError extends Error {
constructor(message, id) {
super(message, id);
this.message = message;
... | Add inheritance from Error for ApiError | Add inheritance from Error for ApiError
| JavaScript | mit | highpine/highpine,highpine/highpine,highpine/highpine |
fbb7654967bb83d7c941e9eef6a87162fbff676b | src/actions/index.js | src/actions/index.js | // import axios from 'axios';
export const FETCH_SEARCH_RESULTS = 'fetch_search_results';
// const ROOT_URL = 'http://herokuapp.com/';
export function fetchSearchResults(term, location) {
// const request = axios.get(`${ROOT_URL}/${term}/${location}`);
const testJSON = {
data: [
{ name: 'Micha... | import axios from 'axios';
export const FETCH_SEARCH_RESULTS = 'fetch_search_results';
const ROOT_URL = 'https://earlybirdsearch.herokuapp.com/?';
export function fetchSearchResults(term, location) {
const request = axios.get(`${ROOT_URL}business=${term}&location=${location}`);
console.log(request);
// const... | Add heroku url to axios request | Add heroku url to axios request
| JavaScript | mit | EarlyRavens/ReactJSFrontEnd,EarlyRavens/ReactJSFrontEnd |
c6dc037de56ebc5b1beb853cc89478c1228f95b9 | lib/repositories/poets_repository.js | lib/repositories/poets_repository.js | var _ = require('underscore');
module.exports = function(dbConfig) {
var db = require('./poemlab_database')(dbConfig);
return {
create: function(user_data, callback) {
var params = _.values(_.pick(user_data, ["name", "email", "password"]));
db.query("insert into poets (name, email, password) values ($1, $... | var _ = require('underscore');
module.exports = function(dbConfig) {
var db = require('./poemlab_database')(dbConfig);
return {
create: function(user_data, callback) {
var params = _.values(_.pick(user_data, ["name", "email", "password"]));
db.query("insert into poets (name, email, password) values ($1, $... | Return all poet attributes except password from create method | Return all poet attributes except password from create method
| JavaScript | mit | jimguys/poemlab,jimguys/poemlab |
f620f2919897b40b9f960a3e147c54be0d0d6549 | src/cssrelpreload.js | src/cssrelpreload.js | /*! CSS rel=preload polyfill. Depends on loadCSS function. [c]2016 @scottjehl, Filament Group, Inc. Licensed MIT */
(function( w ){
// rel=preload support test
if( !w.loadCSS ){
return;
}
var rp = loadCSS.relpreload = {};
rp.support = function(){
try {
return w.document.createElement( "link" ).... | /*! CSS rel=preload polyfill. Depends on loadCSS function. [c]2016 @scottjehl, Filament Group, Inc. Licensed MIT */
(function( w ){
// rel=preload support test
if( !w.loadCSS ){
return;
}
var rp = loadCSS.relpreload = {};
rp.support = function(){
try {
return w.document.createElement( "link" ).... | Fix for bug where script might not be called | Fix for bug where script might not be called
Firefox and IE/Edge won't load links that appear after the polyfill.
What I think has been happening is the w.load event fires and clears the "run" interval before it has a chance to load styles that occur in between the last interval.
This addition calls the rp.poly func... | JavaScript | mit | filamentgroup/loadCSS,filamentgroup/loadCSS |
c3609cbe9d33222f2bd5c466b874f4943094143f | src/middleware/authenticate.js | src/middleware/authenticate.js | export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${tokenLength}})$`)
return (req, res, next) => {
var value = req.headers[header]
var e... | export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
var verifyHeader = ( !! config.header)
var header = (config.header || '').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${tokenLength}})$`)
return (req, res, next) => {
var err
r... | Make request header optional in authentication middleware. | Make request header optional in authentication middleware.
| JavaScript | mit | kukua/concava |
365e1016f05fab1b739b318d5bfacaa926bc8f96 | src/lib/getIssues.js | src/lib/getIssues.js | const Request = require('request');
module.exports = (user, cb) => {
Request.get({
url: `https://api.github.com/users/${user}/repos`,
headers: {
'User-Agent': 'GitPom'
}
}, cb);
};
| const Request = require('request');
module.exports = (options, cb) => {
Request.get({
url: `https://api.github.com/repos/${options.repoOwner}/${options.repoName}/issues`,
headers: {
'User-Agent': 'GitPom',
Accept: `application/vnd.github.v3+json`,
Authorization: `token ${options.access_toke... | Build module to fetch issues for a selected repo | Build module to fetch issues for a selected repo
| JavaScript | mit | The-Authenticators/gitpom,The-Authenticators/gitpom |
07b845fc27fdd3ef75f517e6554a1fef762233b7 | client/js/helpers/rosetexmanager.js | client/js/helpers/rosetexmanager.js | 'use strict';
function _RoseTextureManager() {
this.textures = {};
}
_RoseTextureManager.prototype.normalizePath = function(path) {
return path;
};
_RoseTextureManager.prototype._load = function(path, callback) {
var tex = DDS.load(path, function() {
if (callback) {
callback();
}
});
tex.minF... | 'use strict';
function _RoseTextureManager() {
this.textures = {};
}
_RoseTextureManager.prototype._load = function(path, callback) {
var tex = DDS.load(path, function() {
if (callback) {
callback();
}
});
tex.minFilter = tex.magFilter = THREE.LinearFilter;
return tex;
};
_RoseTextureManager.... | Make RoseTexManager use global normalizePath. | Make RoseTexManager use global normalizePath.
| JavaScript | agpl-3.0 | brett19/rosebrowser,brett19/rosebrowser,Jiwan/rosebrowser,exjam/rosebrowser,Jiwan/rosebrowser,exjam/rosebrowser |
fa40d7c3a2bdb01a72855103fa72095667fddb71 | js/application.js | js/application.js | // View
$(document).ready(function() {
console.log("Ready!");
// initialize the game and create a board
var game = new Game();
PopulateBoard(game.flattenBoard());
//Handles clicks on the checkers board
$(".board").on("click", function(e){
e.preventDefault();
game.test(game);
}) // .board on clic... | // View
$(document).ready(function() {
console.log("Ready!");
// initialize the game and create a board
var game = new Game();
PopulateBoard(game.flattenBoard());
//Handles clicks on the checkers board
$(".board").on("click", function(e){
e.preventDefault();
game.test(game);
}) // .board on clic... | Add else to into populate board to create a div elemento for the not used squares | Add else to into populate board to create a div elemento for the not used squares
| JavaScript | mit | RenanBa/checkers-v1,RenanBa/checkers-v1 |
87cf25bf581b4c96562f884d4b9c329c3c36a469 | lib/config.js | lib/config.js | 'use strict';
var _ = require('lodash')
, defaultConf, developmentConf, env, extraConf, productionConf, testConf;
env = process.env.NODE_ENV || 'development';
defaultConf = {
logger: 'dev',
port: process.env.PORT || 3000,
mongoUri: 'mongodb://localhost/SecureChat'
};
developmentConf = {};
productionConf = ... | 'use strict';
var _ = require('lodash')
, defaultConf, developmentConf, env, extraConf, productionConf, testConf;
env = process.env.NODE_ENV || 'development';
defaultConf = {
port: process.env.PORT || 3000,
};
developmentConf = {
logger: 'dev',
mongoUri: 'mongodb://localhost/SecureChat'
};
productionConf =... | Change loggers and move some options | Change loggers and move some options
| JavaScript | mit | Hilzu/SecureChat |
beb7349f523e7087979260698c9e799684ecc531 | scripts/components/button-group.js | scripts/components/button-group.js | 'use strict';
var VNode = require('virtual-dom').VNode;
var VText = require('virtual-dom').VText;
/**
* Button.
*
* @param {object} props
* @param {string} props.text
* @param {function} [props.onClick]
* @param {string} [props.style=primary]
* @param {string} [props.type=button]
* @returns {VNode}
*/
functi... | 'use strict';
var VNode = require('virtual-dom').VNode;
var VText = require('virtual-dom').VText;
/**
* Button.
* @private
*
* @param {object} props
* @param {string} props.text
* @param {function} [props.onClick]
* @param {string} [props.style=primary]
* @param {string} [props.type=button]
* @returns {VNode... | Make 'button' component more obviously private. | Make 'button' component more obviously private.
| JavaScript | mit | MRN-Code/coins-logon-widget,MRN-Code/coins-logon-widget |
b8864dc79530a57b5974bed932adb0e4c6ccf73c | server/api/nodes/nodeController.js | server/api/nodes/nodeController.js | var Node = require('./nodeModel.js'),
handleError = require('../../util.js').handleError,
handleQuery = require('../queryHandler.js');
module.exports = {
createNode : function (req, res, next) {
var newNode = req.body;
// Support /nodes and /roadmaps/roadmapID/nodes
newNode.parentRoadmap ... | var Node = require('./nodeModel.js'),
handleError = require('../../util.js').handleError,
handleQuery = require('../queryHandler.js');
module.exports = {
createNode : function (req, res, next) {
var newNode = req.body;
// Support /nodes and /roadmaps/roadmapID/nodes
newNode.parentRoadmap ... | Add route handler for DELETE /api/nodes/:nodeID | Add route handler for DELETE /api/nodes/:nodeID
| JavaScript | mit | sreimer15/RoadMapToAnything,GMeyr/RoadMapToAnything,delventhalz/RoadMapToAnything,cyhtan/RoadMapToAnything,sreimer15/RoadMapToAnything,cyhtan/RoadMapToAnything,RoadMapToAnything/RoadMapToAnything,GMeyr/RoadMapToAnything,RoadMapToAnything/RoadMapToAnything,delventhalz/RoadMapToAnything |
2cbe06fdf4fa59605cb41a5f6bfb9940530989b5 | src/schemas/index.js | src/schemas/index.js | import {header} from './header';
import {mime} from './mime';
import {security} from './security';
import {tags} from './tags';
import {paths} from './paths';
import {types} from './types';
export const fieldsToShow = {
'header': [
'info',
'contact',
'license',
'host',
'basePath'
],
'types': ... | import {header} from './header';
import {mime} from './mime';
import {security} from './security';
import {tags} from './tags';
import {paths} from './paths';
import {types} from './types';
export const fieldsToShow = {
'header': [
'info',
'contact',
'license',
'host',
'basePath',
'schemes'
... | Add Schemes to JSON preview | Add Schemes to JSON preview
| JavaScript | mit | apinf/open-api-designer,apinf/openapi-designer,apinf/openapi-designer,apinf/open-api-designer |
2f63b0d6c9f16e4820d969532e8f9ae00ab66bdd | eslint-rules/no-primitive-constructors.js | eslint-rules/no-primitive-constructors.js | /**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @emails react... | /**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @emails react... | Add error for number constructor, too | Add error for number constructor, too
| JavaScript | mit | aickin/react,jquense/react,billfeller/react,mhhegazy/react,nhunzaker/react,silvestrijonathan/react,brigand/react,trueadm/react,kaushik94/react,prometheansacrifice/react,cpojer/react,mosoft521/react,joecritch/react,yungsters/react,glenjamin/react,jdlehman/react,facebook/react,roth1002/react,edvinerikson/react,TheBlasfem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.