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 |
|---|---|---|---|---|---|---|---|---|---|
2aacce141e11e2e30f566cad900c9fa1f4234d2b | tests/dummy/app/routes/nodes/detail/draft-registrations.js | tests/dummy/app/routes/nodes/detail/draft-registrations.js | import Ember from 'ember';
export default Ember.Route.extend({
model() {
let node = this.modelFor('nodes.detail');
return node.get('draftRegistrations');
}
});
| import Ember from 'ember';
export default Ember.Route.extend({
model() {
let node = this.modelFor('nodes.detail');
let drafts = node.get('draftRegistrations');
return Ember.RSVP.hash({
node: node,
drafts: drafts
});
},
});
| Make both node and draft model available in draft template. | Make both node and draft model available in draft template.
| JavaScript | apache-2.0 | crcresearch/ember-osf,CenterForOpenScience/ember-osf,pattisdr/ember-osf,hmoco/ember-osf,baylee-d/ember-osf,hmoco/ember-osf,jamescdavis/ember-osf,CenterForOpenScience/ember-osf,pattisdr/ember-osf,chrisseto/ember-osf,binoculars/ember-osf,binoculars/ember-osf,cwilli34/ember-osf,jamescdavis/ember-osf,crcresearch/ember-osf,... |
0ef49d43df60f47ba98979c19c1c10d9808d1443 | web/static/js/query.js | web/static/js/query.js | App.QueryController = Ember.Controller.extend({
needs: ['insight'],
columnsBinding: "controllers.insight.columns",
limitBinding: "controllers.insight.limit",
_schema: Em.ArrayProxy.create({content:[]}),
_records: Em.ArrayProxy.create({content:[]}),
schema: function(){
this.execute();
return this.... | App.QueryController = Ember.Controller.extend({
needs: ['insight'],
orderBy: null,
where: null,
columnsBinding: "controllers.insight.columns",
limitBinding: "controllers.insight.limit",
whereBinding: "controllers.insight.where",
_schema: Em.ArrayProxy.create({content:[]}),
_records: Em.ArrayProxy.creat... | Allow editing of filters, ordering and limits. | Allow editing of filters, ordering and limits. | JavaScript | mpl-2.0 | mozilla/caravela,mozilla/caravela,mozilla/caravela,mozilla/caravela |
1e28a1f64256b02c70d1534561760657c6076179 | ui/app/common/authentication/directives/pncRequiresAuth.js | ui/app/common/authentication/directives/pncRequiresAuth.js | /*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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 Licen... | /*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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 Licen... | Add title when action buttons is disabled - FF fix | Add title when action buttons is disabled - FF fix
| JavaScript | apache-2.0 | jdcasey/pnc,jbartece/pnc,jsenko/pnc,alexcreasy/pnc,ruhan1/pnc,thauser/pnc,alexcreasy/pnc,jsenko/pnc,jbartece/pnc,dans123456/pnc,thescouser89/pnc,matejonnet/pnc,matedo1/pnc,jdcasey/pnc,ruhan1/pnc,rnc/pnc,jbartece/pnc,matedo1/pnc,matedo1/pnc,pkocandr/pnc,thauser/pnc,alexcreasy/pnc,project-ncl/pnc,jsenko/pnc,dans123456/pn... |
c530d6bee2bc659945b711c215b9f0368f0a8981 | background.js | background.js | chrome.contextMenus.create(
{
"title": "Define \"%s\"",
"contexts":["selection"],
"onclick": function(info, tab){
chrome.tabs.create(
{url: "http://www.google.com/search?q=define" + encodeURIComponent(" " + info.selectionText)
});
}
});
| chrome.contextMenus.create(
{
"title": "Define \"%s\"",
"contexts":["selection"],
"onclick": function(info, tab){
chrome.tabs.create(
{url: "http://www.google.com/search?q=define" + encodeURIComponent(" " + info.selectionText).replace(/%20/g, "+")
});
... | Improve the looks of the tab's URL by using "+" instead of "%20" | Improve the looks of the tab's URL by using "+" instead of "%20"
| JavaScript | mit | nwjlyons/google-dictionary-lookup |
e5e82e6af9505c9f5a04a8acbe8170349faf80b7 | modules/openlmis-web/src/main/webapp/public/js/shared/directives/angular-flot.js | modules/openlmis-web/src/main/webapp/public/js/shared/directives/angular-flot.js | /**
* Created with IntelliJ IDEA.
* User: issa
* Date: 2/10/14
* Time: 1:18 AM
*/
app.directive('aFloat', function() {
function link(scope, element, attrs){
scope.$watch('afData', function(){
init(scope.afData,scope.afOption);
});
scope.$watch('afOption', function(){
... | /**
* Created with IntelliJ IDEA.
* User: issa
* Date: 2/10/14
* Time: 1:18 AM
*/
app.directive('aFloat', function() {
function link(scope, element, attrs){
scope.$watch('afData', function(){
init(scope.afData,scope.afOption);
});
scope.$watch('afOption', function(){
... | Fix angular jqflot integration error | Fix angular jqflot integration error
| JavaScript | agpl-3.0 | OpenLMIS/open-lmis,jasolangi/jasolangi.github.io,jasolangi/jasolangi.github.io,USAID-DELIVER-PROJECT/elmis,OpenLMIS/open-lmis,vimsvarcode/elmis,vimsvarcode/elmis,vimsvarcode/elmis,kelvinmbwilo/vims,vimsvarcode/elmis,jasolangi/jasolangi.github.io,USAID-DELIVER-PROJECT/elmis,kelvinmbwilo/vims,vimsvarcode/elmis,kelvinmbwi... |
596710cc1308f0da187aca5f3cbe4f0b39a478a6 | frontend/Components/Dashboard.style.js | frontend/Components/Dashboard.style.js | const u = require('../styles/utils');
module.exports = {
'.dashboard': {
'padding': u.inRem(20),
},
'.dashboard’s-title': {
'font-size': u.inRem(40),
'line-height': u.inRem(40),
},
'.dashboard’s-subtitle': {
'font-size': u.inRem(12),
'text-transform': 'uppercase',
'letter-spacing': ... | const u = require('../styles/utils');
const dashboardPadding = 20;
const categoryBorderWidth = 1;
const categoryBorder =
`${categoryBorderWidth}px solid rgba(255, 255, 255, .2)`;
module.exports = {
'.dashboard': {
'padding': u.inRem(dashboardPadding),
},
'.dashboard’s-title': {
'font-size': u.inRem(... | Make categories a bit prettier | Make categories a bit prettier
| JavaScript | mit | magnificat/magnificat.surge.sh,magnificat/magnificat.surge.sh,magnificat/magnificat.surge.sh |
96507503d52fef205e9462de3bdcd7d38f18c453 | lib/routes.js | lib/routes.js | Router.configure({
layoutTemplate: '_layout'
});
//From what I can tell this has been depreciated
//https://github.com/iron-meteor/iron-router/blob/739bcc1445db3ad6bf90bda4e0cab3203a0ae526/lib/router.js#L88
Router.map(function() {
// initiative routes
this.route('initiatives', {
path: '/',
template: 'in... | Router.configure({
layoutTemplate: '_layout'
});
//From what I can tell this has been depreciated
//https://github.com/iron-meteor/iron-router/blob/739bcc1445db3ad6bf90bda4e0cab3203a0ae526/lib/router.js#L88
Router.map(function() {
// initiative routes
this.route('initiatives', {
path: '/',
template: 'in... | Fix initiativeShow to subscribe to userData | Fix initiativeShow to subscribe to userData
| JavaScript | mit | mtr-cherish/cherish,mtr-cherish/cherish |
4fead2fa52d33a187879371f2cb5b9af2ad2aa14 | api/routes/houseRoutes.js | api/routes/houseRoutes.js | 'use strict'
var passport = require('passport')
module.exports = function(app) {
var house = require('../controllers/houseController')
app.route('/houses')
.get(house.list_all_houses)
.post(passport.authenticate('jwt', {
session: false
}),
function(req, res) {
var token = getT... | 'use strict'
var passport = require('passport')
module.exports = function(app) {
var house = require('../controllers/houseController')
var versioning = require('../config/versioning')
app.route(versioning.url + '/houses')
.get(house.list_all_houses)
.post(passport.authenticate('jwt', {
session:... | Add API versioning for House endpoints. | Add API versioning for House endpoints.
| JavaScript | apache-2.0 | sotirelisc/housebot-api |
c1941e8deb1011fcda896467dea65f2a1a067bcd | app/libs/details/index.js | app/libs/details/index.js | 'use strict';
module.exports = {
get: function(task) {
return new Promise((resolve, reject) => {
// Check type
if ( task.type === undefined || ! ['show', 'move'].includes(task.type) ) {
return reject('Invalid job type "' + task.type + '" specified');
}
// Get metadata, auth wit... | 'use strict';
// Load requirements
const fs = require('fs'),
path = require('path');
// Define the config directory
let configDir = path.resolve('./config');
// Create config directory if we don't have one
if ( ! fs.existsSync(configDir) ) {
fs.mkdirSync(configDir);
}
module.exports = {
get: function(tas... | Create config directory if not present | WIP: Create config directory if not present
| JavaScript | apache-2.0 | transmutejs/core |
1208ee980cf3e5b3c2c847c2a8d27b4ec7207f0f | client/src/js/samples/components/Analyses/Create.js | client/src/js/samples/components/Analyses/Create.js | import React, { PropTypes } from "react";
import { Modal } from "react-bootstrap";
import { AlgorithmSelect, Button } from "virtool/js/components/Base";
const getInitialState = () => ({
algorithm: "pathoscope_bowtie"
});
export default class CreateAnalysis extends React.Component {
constructor (props) {
... | import React, { PropTypes } from "react";
import { Modal } from "react-bootstrap";
import { AlgorithmSelect, Button } from "virtool/js/components/Base";
const getInitialState = () => ({
algorithm: "pathoscope_bowtie"
});
export default class CreateAnalysis extends React.Component {
constructor (props) {
... | Hide create analysis modal on success | Hide create analysis modal on success
| JavaScript | mit | igboyes/virtool,igboyes/virtool,virtool/virtool,virtool/virtool |
3d81d8597aec5d77525edf6b479e02317b75ca36 | app/dashboard/routes/importer/helper/determine_path.js | app/dashboard/routes/importer/helper/determine_path.js | var slugify = require('./slugify');
var join = require('path').join;
var moment = require('moment');
module.exports = function (title, page, draft, dateStamp) {
var relative_path_without_extension;
var slug = slugify(title);
var name = name || slug;
name = name.split('/').join('-');
if (page) {
relat... | var slugify = require("./slugify");
var join = require("path").join;
var moment = require("moment");
module.exports = function(title, page, draft, dateStamp, slug) {
var relative_path_without_extension;
var name;
slug = slugify(title || slug);
name = name || slug;
name = name.split("/").join("-");
if (p... | Allow optional slug in function which determines an imported entry's path | Allow optional slug in function which determines an imported entry's path
| JavaScript | cc0-1.0 | davidmerfield/Blot,davidmerfield/Blot,davidmerfield/Blot,davidmerfield/Blot |
62ddd0bc9c88d199090089d5506d4894dc5d8737 | Resources/ui/handheld/android/ResponsesNewWindow.js | Resources/ui/handheld/android/ResponsesNewWindow.js | function ResponsesNewWindow(surveyID) {
try {
var ResponsesIndexView = require('ui/common/responses/ResponsesIndexView');
var ResponsesNewView = require('ui/common/responses/ResponsesNewView');
var ConfirmDialog = require('ui/common/components/ConfirmDialog');
var self = Ti.UI.createWindow({
navBarHidden... | function ResponsesNewWindow(surveyID) {
try {
var ResponsesIndexView = require('ui/common/responses/ResponsesIndexView');
var ResponsesNewView = require('ui/common/responses/ResponsesNewView');
var ConfirmDialog = require('ui/common/components/ConfirmDialog');
var self = Ti.UI.createWindow({
navBarHidden... | Add a guard clause to ResponseNewWindow | Add a guard clause to ResponseNewWindow
| JavaScript | mit | nilenso/ashoka-survey-mobile,nilenso/ashoka-survey-mobile |
fc112a5d2fe9418150c15740b297e2c74af72ab2 | lib/VideoCapture.js | lib/VideoCapture.js | // This module is responsible for capturing videos
'use strict';
const config = require('config');
const PiCamera = require('pi-camera');
const myCamera = new PiCamera({
mode: 'video',
output: process.argv[2],
width: config.get('camera.videoWidth'),
height: config.get('camera.videoHeight'),
timeout: config.... | // This module is responsible for capturing videos
'use strict';
const config = require('config');
const PiCamera = require('pi-camera');
const myCamera = new PiCamera({
mode: 'video',
output: process.argv[2],
width: config.get('camera.videoWidth'),
height: config.get('camera.videoHeight'),
timeout: config.... | Add minor delay to video capture. Hopefully this helps the camera moduel keep up. | Add minor delay to video capture. Hopefully this helps the camera moduel keep up.
| JavaScript | mit | stetsmando/pi-motion-detection |
e6516d3ef113bb35bcee5fd199ab06d14ca3f036 | src/main/webapp/styles.js | src/main/webapp/styles.js | const propertiesReader = require("properties-reader");
const defaults = {
"primary-color": "#1890ff",
"info-color": "#1890ff",
"link-color": "#1890ff",
"font-size-base": "14px",
"border-radius-base": "2px",
};
function formatAntStyles() {
const custom = {};
const re = /styles.ant.([\w+-]*)/;
try {
... | const propertiesReader = require("properties-reader");
const fs = require("fs");
const defaults = {
"primary-color": "#1890ff",
"info-color": "#1890ff",
"link-color": "#1890ff",
"font-size-base": "14px",
"border-radius-base": "2px",
};
const iridaConfig = "/etc/irida/irida.conf";
const propertiesConfig = "..... | Check to see what values are in which file. | Check to see what values are in which file.
| JavaScript | apache-2.0 | phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida |
f998f5fe7aedb8e33a81727c8371b690a698c73b | src/browser.js | src/browser.js | /*
*
* This is used to build the bundle with browserify.
*
* The bundle is used by people who doesn't use browserify.
* Those who use browserify will install with npm and require the module,
* the package.json file points to index.js.
*/
import Auth0Lock from './classic';
import Auth0LockPasswordless from './pa... | /*
*
* This is used to build the bundle with browserify.
*
* The bundle is used by people who doesn't use browserify.
* Those who use browserify will install with npm and require the module,
* the package.json file points to index.js.
*/
import Auth0Lock from './classic';
// import Auth0LockPasswordless from '.... | Exclude passwordless stuff from build | Exclude passwordless stuff from build
| JavaScript | mit | mike-casas/lock,mike-casas/lock,mike-casas/lock |
2ddf6d6222e6c0fa6f6b29665b90a2ba6fbd5d0f | src/app/libparsio/technical/services/update.service.js | src/app/libparsio/technical/services/update.service.js | /*
* Author: Alexandre Havrileck (Oxyno-zeta)
* Date: 25/06/16
* Licence: See Readme
*/
(function () {
'use strict';
angular
.module('libparsio.technical.services')
.factory('updateService', updateService);
/** @ngInject */
function updateService($q, updateDaoService, updateWrapperService, updateCacheSer... | /*
* Author: Alexandre Havrileck (Oxyno-zeta)
* Date: 25/06/16
* Licence: See Readme
*/
(function () {
'use strict';
angular
.module('libparsio.technical.services')
.factory('updateService', updateService);
/** @ngInject */
function updateService($q, updateDaoService, updateWrapperService, updateCacheSer... | Remove mock version in code | [App] Remove mock version in code
| JavaScript | mit | oxyno-zeta/LibParsio,oxyno-zeta/LibParsio |
74b84e2aa981ed9d8972afa97b998c8110a6dc6e | packages/net/__imports__.js | packages/net/__imports__.js | exports.map = {
'node': ['net.env.node.stdio'],
'browser': ['net.env.browser.csp'],
'mobile': []
}
exports.resolve = function(env, opts) {
return exports.map[env] || [];
};
| exports.map = {
'node': [
'net.env.node.stdio'
],
'browser': [
'net.env.browser.csp',
'net.env.browser.postmessage'
],
'mobile': []
}
exports.resolve = function(env, opts) {
return exports.map[env] || [];
};
| Fix for missing dynamic import | Fix for missing dynamic import
| JavaScript | mit | hashcube/js.io,hashcube/js.io,gameclosure/js.io,gameclosure/js.io |
f390c9257874452e2a7e2aa918502a713d7ea4e2 | app/assets/javascripts/discourse/views/topic_footer_buttons_view.js | app/assets/javascripts/discourse/views/topic_footer_buttons_view.js | /**
This view is used for rendering the buttons at the footer of the topic
@class TopicFooterButtonsView
@extends Discourse.ContainerView
@namespace Discourse
@module Discourse
**/
Discourse.TopicFooterButtonsView = Discourse.ContainerView.extend({
elementId: 'topic-footer-buttons',
topicBinding: 'contro... | /**
This view is used for rendering the buttons at the footer of the topic
@class TopicFooterButtonsView
@extends Discourse.ContainerView
@namespace Discourse
@module Discourse
**/
Discourse.TopicFooterButtonsView = Discourse.ContainerView.extend({
elementId: 'topic-footer-buttons',
topicBinding: 'contro... | Hide the Invite button in topics in secured categories | Hide the Invite button in topics in secured categories
| JavaScript | mit | natefinch/discourse,natefinch/discourse |
ab4b56ad493205c736dea190cd776e2c89a42e5b | servers.js | servers.js | var fork = require('child_process').fork;
var amountConcurrentServers = process.argv[2] || 2;
var port = initialPortServer();
var servers = [];
var path = __dirname;
var disableAutomaticGarbageOption = '--expose-gc';
for(var i = 0; i < amountConcurrentServers; i++) {
var portForServer = port + i;
var serverIde... | var fork = require('child_process').fork;
var amountConcurrentServers = process.argv[2] || 2;
var port = initialPortServer();
var servers = [];
var path = __dirname;
var disableAutomaticGarbageOption = '--expose-gc';
for(var i = 0; i < amountConcurrentServers; i++) {
var portForServer = port + i;
var serverIde... | Add log for child process | Add log for child process
| JavaScript | mit | eltortuganegra/server-websocket-benchmark,eltortuganegra/server-websocket-benchmark |
0c8ac4b02930dc5ea3dbec668ac5077f0d834237 | lib/requiredKeys.js | lib/requiredKeys.js |
module.exports = [
{
type: 'bitcoin',
purpose: 'payment'
},
{
type: 'bitcoin',
purpose: 'messaging'
},
{
type: 'ec',
purpose: 'sign'
},
{
type: 'ec',
purpose: 'update'
}
]
|
module.exports = [
{
type: 'bitcoin',
purpose: 'payment'
},
{
type: 'bitcoin',
purpose: 'messaging'
},
{
type: 'ec',
purpose: 'sign'
},
{
type: 'ec',
purpose: 'update'
},
{
type: 'dsa',
purpose: 'sign'
}
]
| Revert "don't require dsa key" | Revert "don't require dsa key"
This reverts commit ce8f474a2832374f109129d9847cdce526ae318c.
| JavaScript | mit | tradle/identity |
9ed345347d76ee4cf46658d583e9cb4713d14077 | js/energy-systems/view/EFACBaseNode.js | js/energy-systems/view/EFACBaseNode.js | // Copyright 2014-2015, University of Colorado Boulder
/**
* Base module for model elements whose position and opacity can change.
*
* @author John Blanco
* @author Andrew Adare
*/
define( function( require ) {
'use strict';
var inherit = require( 'PHET_CORE/inherit' );
var Node = require( 'SCENERY/nodes/N... | // Copyright 2014-2015, University of Colorado Boulder
/**
* Base module for model elements whose position and opacity can change.
*
* @author John Blanco
* @author Andrew Adare
*/
define( function( require ) {
'use strict';
var inherit = require( 'PHET_CORE/inherit' );
var Node = require( 'SCENERY/nodes/N... | Fix typo and use thisNode | Fix typo and use thisNode
| JavaScript | mit | phetsims/energy-forms-and-changes,phetsims/energy-forms-and-changes,phetsims/energy-forms-and-changes |
c61ebc077aaad3a53f7a3289aa6f0df2a025749b | backend/app.js | backend/app.js | var app = require('http').createServer();
var request = require('request');
var io = require('socket.io')(app);
var fs = require('fs');
app.listen(13374);
io.on('connection', function (socket) {
setInterval(function() {
request('http://status.hasi.it', function (error, response, body) {
if (!error && r... | var app = require('http').createServer();
var request = require('request');
var io = require('socket.io')(app);
var fs = require('fs');
app.listen(13374);
function pullData(socket) {
request('http://status.hasi.it', function (error, response, body) {
if (!error && response.statusCode == 200) {
socket.emit... | Add initial load and larger update interval | Add initial load and larger update interval
| JavaScript | mit | EddyShure/wazzup,EddyShure/wazzup |
75299752fcbdf5a4f7c99c13ae1c6827fe9a3d8a | app/assets/javascripts/map/services/GeostoreService.js | app/assets/javascripts/map/services/GeostoreService.js | define([
'Class', 'uri', 'bluebird',
'map/services/DataService'
], function(Class, UriTemplate, Promise, ds) {
'use strict';
var GET_REQUEST_ID = 'GeostoreService:get',
SAVE_REQUEST_ID = 'GeostoreService:save';
var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}';
var GeostoreService = Clas... | define([
'Class', 'uri', 'bluebird',
'map/services/DataService'
], function(Class, UriTemplate, Promise, ds) {
'use strict';
var GET_REQUEST_ID = 'GeostoreService:get',
SAVE_REQUEST_ID = 'GeostoreService:save';
var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}';
var GeostoreService = Clas... | Update to work with new Geostore API | Update to work with new Geostore API
| JavaScript | mit | Vizzuality/gfw,Vizzuality/gfw |
7d6689f17d296a6d1b914e39d1d04e7f5cb7dd7e | blueprints/assertion/index.js | blueprints/assertion/index.js | var stringUtil = require('ember-cli/lib/utilities/string');
module.exports = {
description: 'Generates a new custom assertion into tests/assertions/',
locals: function(options) {
var entity = options.entity;
var rawName = entity.name;
var name = stringUtil.dasherize(rawName);
var camelNa... | var stringUtil = require('ember-cli-string-utils');
module.exports = {
description: 'Generates a new custom assertion into tests/assertions/',
locals: function(options) {
var entity = options.entity;
var rawName = entity.name;
var name = stringUtil.dasherize(rawName);
var camelName = str... | Update require statement for string utils | Update require statement for string utils | JavaScript | mit | dockyard/ember-cli-custom-assertions,dockyard/ember-cli-custom-assertions |
1b2e12784594fda9454242825befaf673492c40f | buffer-frame-container.js | buffer-frame-container.js | var iframe;
function initFrame() {
iframe = document.createElement('iframe');
document.body.appendChild(iframe);
}
// Listen to the parent window send src info to be set on the nested frame
function receiveNestedFrameData() {
var handler = function(e) {
if (e.source !== window.parent && !e.data.src) return;... | var iframe;
function initFrame() {
iframe = document.createElement('iframe');
document.body.appendChild(iframe);
}
// Listen to the parent window send src info to be set on the nested frame
function receiveNestedFrameData() {
var handler = function(e) {
if (e.source !== window.parent && !e.data.src) return;... | Make extension work in dev env too | Make extension work in dev env too
| JavaScript | mit | bufferapp/buffer-extension-shared,bufferapp/buffer-extension-shared |
b49c5f252d8eb3dd8e2803b3b1ebf3b3a107d740 | source/demyo-vue-frontend/src/services/publisher-service.js | source/demyo-vue-frontend/src/services/publisher-service.js | import AbstractModelService from './abstract-model-service'
import { axiosGet } from '@/helpers/axios'
/**
* API service for Publishers.
*/
class PublisherService extends AbstractModelService {
constructor() {
super('publishers/', {
fillMissingObjects: ['logo'],
sanitizeHtml: ['history']
})
}
/**
* F... | import AbstractModelService from './abstract-model-service'
import { axiosGet } from '@/helpers/axios'
/**
* API service for Publishers.
*/
class PublisherService extends AbstractModelService {
constructor() {
super('publishers/', {
fillMissingObjects: ['logo'],
sanitizeHtml: ['history']
})
}
/**
* F... | Create a method to search for a Publisher's Collections. | Create a method to search for a Publisher's Collections.
To be used in AlbumEdit.
Refs #78.
| JavaScript | agpl-3.0 | The4thLaw/demyo,The4thLaw/demyo,The4thLaw/demyo,The4thLaw/demyo |
fa1209db9af0166901f278452dc9b8c1d1d1fa5c | lib/autoload/hooks/responder/etag_304_revalidate.js | lib/autoload/hooks/responder/etag_304_revalidate.js | // Add Etag header to each http and rpc response
//
'use strict';
const crypto = require('crypto');
module.exports = function (N) {
N.wire.after([ 'responder:http', 'responder:rpc' ], { priority: 95 }, function etag_304_revalidate(env) {
if (env.status !== 200) return;
if (!env.body || typeof env.body !==... | // Add Etags, 304 responses, and force revalidate for each request
//
// - Should help with nasty cases, when quick page open use old
// assets and show errors until Ctrl+F5
// - Still good enougth for user, because 304 responses supported
//
'use strict';
const crypto = require('crypto');
module.exports = functio... | Improve cache headers and add comments | Improve cache headers and add comments
| JavaScript | mit | nodeca/nodeca.core,nodeca/nodeca.core |
ee58f2e977c884202d357a8ee5acfd567214da4f | src/app/containers/menu/Menu.js | src/app/containers/menu/Menu.js | import './Menu.css';
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { closeMenu } from 'shared/state/app/actions';
import shallowCompare from 'react-addons-shallow-compare';
class Menu extends Component {
constructor(props) {
super(props);
this._h... | import './Menu.css';
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { closeMenu } from 'shared/state/app/actions';
import shallowCompare from 'react-addons-shallow-compare';
class Menu extends Component {
constructor(props) {
super(props);
this._h... | Handle taps to close the menu. | Handle taps to close the menu.
| JavaScript | mit | npms-io/npms-www,npms-io/npms-www |
80e16145089eccd6841a8ad05888d28360ad3833 | build/serve.js | build/serve.js | import browserSync from 'browser-sync';
import paths from '../mconfig.json';
export const server = browserSync.create();
function serve(done) {
server.init({
notify: false,
proxy: paths.url,
host: paths.url,
open: 'external'
});
done();
}
export default serve;
| import browserSync from 'browser-sync';
import paths from '../mconfig.json';
export const server = browserSync.create();
function serve(done) {
server.init({
notify: false,
proxy: paths.url,
host: paths.url,
open: false,
ghostMode: false
});
done();
}
export defaul... | Remove browser-sync new window & ghostMode | Remove browser-sync new window & ghostMode
| JavaScript | mit | locomotivemtl/locomotive-boilerplate,locomotivemtl/locomotive-boilerplate,stephenbe/locomotive-boilerplate,stephenbe/locomotive-boilerplate,stephenbe/locomotive-boilerplate |
cd09645cc7d1abd1f4b5993b89cc3048ad65447c | src/createAppTemplate.js | src/createAppTemplate.js | const createAppTemplate = (app, template) => {
const hadClassName = !!app.className;
const quenchedClassName = `${app.className} quenched`.replace(/\bpre-quench\b/g, '');
let html = app.outerHTML
.replace(/<!--\s*<q>\s*-->[\s\S]*?<!--\s*<\/q>\s*-->/g, '')
.replace(/<!--\s*q-binding:.*?-->/g, '')
.rep... | const createAppTemplate = (app, template) => {
const quenchedClassName = `${app.className} quenched`.replace(/\bpre-quench\b/g, '');
const html = app.outerHTML
.replace(/<!--\s*<q>\s*-->[\s\S]*?<!--\s*<\/q>\s*-->/g, '')
.replace(/<!--\s*q-binding:.*?-->/g, '')
.replace(/\sq-binding=".*?\s+as\s+/g, ' q-b... | Fix apps with empty class attributes | Fix apps with empty class attributes
| JavaScript | mit | stowball/quench-vue |
a64bee572690ce186fda28a0cd98f16d5dcf9aa5 | src/lib/number_to_human.js | src/lib/number_to_human.js | const billion = 1000000000.0
const million = 1000000.0
const thousand = 1000.0
export function numberToHuman(number, showZero = true) {
if (number === 0 && !showZero) { return '' }
let num
let suffix
if (number >= billion) {
num = Math.round((number / billion) * 100.0) / 100.0
suffix = 'B'
} else if ... | const billion = 1000000000.0
const million = 1000000.0
const thousand = 1000.0
export function numberToHuman(number, showZero = true, precision = 1) {
if (number === 0 && !showZero) { return '' }
const roundingFactor = 10 ** precision
let num
let suffix
if (number >= billion) {
num = Math.round((number /... | Change the rounding precision to one decimal point | Change the rounding precision to one decimal point
| JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
bd36bfa8bb390a873ecfebbb7fe380a342f54de7 | index.js | index.js | function handleVueDestruction(vue) {
document.addEventListener('turbolinks:before-render', function teardown() {
vue.$destroy();
document.removeEventListener('turbolinks:before-render', teardown);
});
}
var TurbolinksAdapter = {
beforeMount: function() {
if (this.$el.parentNode) {
handleVueDest... | function handleVueDestruction(vue) {
document.addEventListener('turbolinks:visit', function teardown() {
vue.$destroy();
document.removeEventListener('turbolinks:visit', teardown);
});
}
var TurbolinksAdapter = {
beforeMount: function() {
if (this.$el.parentNode) {
handleVueDestruction(this);
... | Use turbolinks:visit event to handle teardowns, works whether caching is enabled or not | Use turbolinks:visit event to handle teardowns, works whether caching is enabled or not
| JavaScript | mit | jeffreyguenther/vue-turbolinks |
766e9a47d10710ed5649a21f0891919bb96399b2 | src/components/Message/Embed.js | src/components/Message/Embed.js | // @flow
import type { MessageThemeContext } from './types'
import React, { PureComponent } from 'react'
import styled from '../styled'
import Chat from './Chat'
import classNames from '../../utilities/classNames'
import css from './styles/Embed.css.js'
type Props = {
className?: string,
html: string,
}
type Cont... | // @flow
import type { MessageThemeContext } from './types'
import React, { PureComponent } from 'react'
import styled from '../styled'
import Chat from './Chat'
import classNames from '../../utilities/classNames'
import css from './styles/Embed.css.js'
type Props = {
className?: string,
html: string,
}
type Cont... | Add istanbul ignore. Line is tested. | Add istanbul ignore. Line is tested.
Istanbul isn't picking it up.
| JavaScript | mit | helpscout/blue,helpscout/blue,helpscout/blue |
df76de82feaa17e92979ccd28f3a74d8e59a4f1d | src/scripts/lib/server/utils/server-config/index.js | src/scripts/lib/server/utils/server-config/index.js | const Configstore = require('configstore')
const inq = require('inquirer')
const prompts = require('./setup-prompts')
module.exports = class ServerConfig {
constructor(defaults) {
this.db = new Configstore('wowser', defaults)
}
initSetup() {
return new Promise((resolve, reject) => {
console.log('... | const Configstore = require('configstore')
const inq = require('inquirer')
const pkg = require('../../../../package.json')
const prompts = require('./setup-prompts')
module.exports = class ServerConfig {
constructor(defaults) {
this.db = new Configstore(pkg.name, defaults)
}
initSetup() {
return new Pr... | Use package name from package.json as a configstore id | Use package name from package.json as a configstore id
| JavaScript | mit | wowserhq/wowser,timkurvers/wowser,eoy/wowser,wowserhq/wowser,eoy/wowser,timkurvers/wowser |
b7803e394d2bd4047e5d8fd7990a196bb06e5643 | src/content.js | src/content.js | var content = (function() {
return {
normalizeTags: function(element) {
var i, j, node, sibling;
var fragment = document.createDocumentFragment();
for (i = 0; i < element.childNodes.length; i++) {
node = element.childNodes[i];
if(!node) continue;
// skip empty tags, so... | var content = (function() {
return {
normalizeTags: function(element) {
var i, j, node, sibling;
var fragment = document.createDocumentFragment();
for (i = 0; i < element.childNodes.length; i++) {
node = element.childNodes[i];
if(!node) continue;
// skip empty tags, so... | Normalize trailing spaces as well | Normalize trailing spaces as well
This doesn't remove spaces at the end, it just converts
the last one to make it visible. I think the strategy of not
having spaces at all in the end should go in a config
option and shouldn't be a task of normalizeSpaces.
Conflicts:
src/content.js
| JavaScript | mit | nickbalestra/editable.js,upfrontIO/editable.js |
56c9ee0611428ec8db267d293d93d63f11b8021a | src/helpers/find-root.js | src/helpers/find-root.js | 'use babel'
import Path from 'path'
import {getDir, findFile} from './common'
import {CONFIG_FILE_NAME} from '../defaults'
export function findRoot(path, options) {
if (options.root !== null) {
return options.root
}
const searchPath = getDir(path.indexOf('*') === -1 ? path : options.cwd)
const configFile... | 'use babel'
import Path from 'path'
import {getDir, findFile} from './common'
import {CONFIG_FILE_NAME} from '../defaults'
import isGlob from 'is-glob'
export function findRoot(path, options) {
if (options.root !== null) {
return options.root
}
const searchPath = getDir(isGlob(path) ? options.cwd : path)
... | Use is-glob when finding root | :new: Use is-glob when finding root
| JavaScript | mit | steelbrain/UCompiler |
3ceb8ea7eede62614d665f986d7954cedab71352 | src/helpers.js | src/helpers.js | const moment = require('moment-timezone');
const chalk = require('chalk');
exports.printMessage = function (message) {
console.log(message);
};
exports.printError = function (message) {
const errorOutput = chalk`{bgRed Error} ${message}`;
console.log(errorOutput);
};
exports.convertTimezone = function (time, ... | const moment = require('moment-timezone');
const chalk = require('chalk');
exports.printMessage = function (message) {
console.log(message);
};
exports.printError = function (message) {
const errorOutput = chalk`{bgRed Error} ${message}`;
console.log(errorOutput);
};
exports.isValidTimezone = function (timezo... | Add helper with timezone validity info | Add helper with timezone validity info
| JavaScript | mit | Belar/space-cli |
3ed922da5e3c2e404f40d7896061553128a3c73b | index.js | index.js | require('./dist/dialogs.js');
require('./dist/dialogs-default-translations.js');
require('./dist/dialogs.css');
module.exports = 'dialogs.main';
| require('./dist/dialogs.js');
require('./dist/dialogs-default-translations.js');
module.exports = 'dialogs.main';
| Fix problems with importing file | Fix problems with importing file
require css file was giving unexpected error | JavaScript | mit | m-e-conroy/angular-dialog-service,m-e-conroy/angular-dialog-service |
fa6f27dabf3c50895e9f7a0703e40962b0e1056c | index.js | index.js | module.exports = function (opts={}) {
var isJsonFile = opts.filter || /\.json$/;
return function (override, transform, control) {
transform("readSource", function (source) {
const asset = this.args[0];
if (isJsonFile.test(asset.path)) {
source = `module.exports = ${source};`;
}
... | module.exports = function (opts={}) {
var isJsonFile = opts.filter || /\.json$/;
return function (override, transform, control) {
transform("readSource", function (source, args) {
const asset = args[0];
if (isJsonFile.test(asset.path)) {
source = `module.exports = ${source};`;
}
... | Update transform to accomodate more explicit transform API changes. | Update transform to accomodate more explicit transform API changes.
| JavaScript | mit | interlockjs/plugins,interlockjs/plugins |
0ef56b936013ea773b69581954c64f7eef2b2419 | index.js | index.js | var originalDataModule = require('data-module');
var gutil = require('gulp-util');
var through2 = require('through2');
var DataModuleError = gutil.PluginError.bind(null, 'gulp-data-module');
var dataModule = function dataModule (options) { 'use strict';
if (!options) options = {};
var parsing = options.parsi... | var _dataModule = require('data-module');
var gutil = require('gulp-util');
var stream = require('through2').obj;
var DataModuleError = gutil.PluginError.bind(null, 'gulp-data-module');
var dataModule = function dataModule (options) { 'use strict';
if (!options) options = {};
var parsing = options.parsing ||... | Update from wherever 0.0.3 came from | Update from wherever 0.0.3 came from
| JavaScript | mit | tomekwi/gulp-data-module |
5445265dda092ef114c92a414e7d3692cf062bc2 | index.js | index.js | /* jshint node: true */
'use strict';
const REFLECT_JS_VERSION = '0.1.59',
REFLECT_JAVASCRIPT = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION +'/reflect.js',
REFLECT_CSS = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION + '/reflect.css';
const HEAD = '<script src="' + REFLECT_JAVASCRIPT + '" type="text/ja... | /* jshint node: true */
'use strict';
const REFLECT_JS_VERSION = '0.1.59',
REFLECT_JAVASCRIPT = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION +'/reflect.js';
const getHead = function(config) {
let cssSource;
if (config.reflect && config.reflect.css) {
cssSource = config.reflect.css;
} else {
css... | Allow user to define their own css source | Allow user to define their own css source
| JavaScript | mit | reflect/ember-cli-reflect,reflect/ember-cli-reflect |
81ae02b295ea2dabdc94c81c0aa5afcc8aa9b9b0 | public/app/project-list/project-featured-controller.js | public/app/project-list/project-featured-controller.js | define(function() {
var ProjectsFeaturedController = function(ProjectResource) {
this.projects = ProjectResource.list({
// Add feature tags here
'tags[]': []
})
}
ProjectsFeaturedController.$inject = ['ProjectResource']
return ProjectsFeaturedController
})
| define(function() {
var ProjectsFeaturedController = function(ProjectResource) {
this.projects = ProjectResource.list({
// Add feature tags here
'tags[]': ['noit', 'explore']
})
}
ProjectsFeaturedController.$inject = ['ProjectResource']
return ProjectsFeaturedCo... | Edit tags in featured projects controller | Edit tags in featured projects controller
| JavaScript | mit | tenevdev/idiot,tenevdev/idiot |
8ea9755b10f7ee7a6e4b06c757c8105a4237e0aa | src/swap-case.js | src/swap-case.js | import R from 'ramda';
import compose from './util/compose.js';
import join from './util/join.js';
import upperCase from './util/upper-case.js';
import lowerCase from './util/lower-case.js';
import isUpperCase from '../src/is-upper-case.js';
// a -> a
const swapCase = compose(
join(''),
R.map(
R.either(
... | import R from 'ramda';
import compose from './util/compose.js';
import join from './util/join.js';
import not from './util/not.js';
import upperCase from './util/upper-case.js';
import lowerCase from './util/lower-case.js';
import isUpperCase from '../src/is-upper-case.js';
// a -> a
const swapCase = compose(
join('... | Refactor swapCase function to use custom not function | Refactor swapCase function to use custom not function
| JavaScript | mit | restrung/restrung-js |
02d15a7a06435db9769cac4ae4dccbc756b0b8e4 | spec/async-spec-helpers.js | spec/async-spec-helpers.js | // Lifted from Atom
exports.beforeEach = function (fn) {
global.beforeEach(function () {
var result = fn()
if (result instanceof Promise) {
waitsForPromise(function () { return result })
}
})
}
exports.afterEach = function (fn) {
global.afterEach(function () {
var result = fn()
if (res... | // Lifted from Atom
exports.beforeEach = function (fn) {
global.beforeEach(function () {
var result = fn()
if (result instanceof Promise) {
waitsForPromise(function () { return result })
}
})
}
exports.afterEach = function (fn) {
global.afterEach(function () {
var result = fn()
if (res... | Make async `runs` a bit better. | Make async `runs` a bit better.
| JavaScript | mit | atom/github,atom/github,atom/github |
853a002aed8dfaf42e42918cc6d291d4744ffcee | tests/date-format.spec.js | tests/date-format.spec.js | 'use strict';
var expect = require('chai').expect;
var validator = require('../');
describe('Date validator', function () {
var simpleRules = {
birthday: ['date-format:YYYY-MM-DD']
};
var getTestObject = function () {
return {
birthday: '1993-09-02',
};
};
it('should success', function (... | 'use strict';
var expect = require('chai').expect;
var validator = require('../');
describe('Date validator', function () {
var simpleRules = {
birthday: ['date-format:YYYY-MM-DD']
};
var getTestObject = function () {
return {
birthday: '1993-09-02',
};
};
it('should success', function (... | Update test assertion on validation message | Update test assertion on validation message
| JavaScript | mit | cermati/satpam,sendyhalim/satpam |
61909991a69685cc68625f98223337b1cdfd2770 | server/game/playattachmentaction.js | server/game/playattachmentaction.js | const BaseAbility = require('./baseability.js');
const Costs = require('./costs.js');
class PlayAttachmentAction extends BaseAbility {
constructor() {
super({
cost: [
Costs.payReduceableFateCost('play'),
Costs.playLimited()
],
target: {
... | const BaseAbility = require('./baseability.js');
const Costs = require('./costs.js');
class PlayAttachmentAction extends BaseAbility {
constructor() {
super({
cost: [
Costs.payReduceableFateCost('play'),
Costs.playLimited()
],
target: {
... | Add game message to play attachment | Add game message to play attachment
| JavaScript | mit | gryffon/ringteki,jeremylarner/ringteki,jeremylarner/ringteki,jeremylarner/ringteki,gryffon/ringteki,gryffon/ringteki |
e97915274bcbf7c202656257645884a5c3b1adcb | app/scripts/models/item.js | app/scripts/models/item.js | define([
'underscore',
'jquery',
'models/resource',
'collections/bullet',
'collections/paragraph'
], function (_, $, Resource, BulletCollection, ParagraphCollection) {
'use strict';
var ItemModel = Resource.extend({
defaults: {
name: '',
title: '',
heading: ''
},
resource: ... | define([
'underscore',
'jquery',
'models/resource',
'collections/bullet',
'collections/paragraph'
], function (_, $, Resource, BulletCollection, ParagraphCollection) {
'use strict';
var ItemModel = Resource.extend({
defaults: {
name: '',
title: '',
heading: ''
},
resource: ... | Add paragraphIds method to Item model. | Add paragraphIds method to Item model.
| JavaScript | mit | jmflannery/jackflannery.me,jmflannery/jackflannery.me,jmflannery/rez-backbone,jmflannery/rez-backbone |
abd5c2ec804e65cc621b4f82f67992b3cf1b24f8 | src/sal.js | src/sal.js | import './sal.scss';
let options = {
rootMargin: '0px',
threshold: 0,
animateClassName: 'sal-animate',
selector: '[data-sal]',
disableFor: null,
};
let elements = [];
let intersectionObserver = null;
const animate = element => (
element.classList.add(options.animateClassName)
);
const isAnimated = eleme... | import './sal.scss';
let options = {
rootMargin: '0px',
threshold: 0.5,
animateClassName: 'sal-animate',
selector: '[data-sal]',
once: true,
disableFor: null,
};
let elements = [];
let intersectionObserver = null;
const animate = element => (
element.classList.add(options.animateClassName)
);
const re... | Add once option to manage working mode. Fix threshold value. | Add once option to manage working mode. Fix threshold value.
| JavaScript | mit | mciastek/sal,mciastek/sal |
a46ff61e935bd029ddde1a6610fea27479e47777 | src/services/fetchStats.js | src/services/fetchStats.js | import fetch from 'node-fetch';
import { hashToHypen } from './formatText';
import { API_URL, HTTP_HEADERS } from '../constants';
const headers = HTTP_HEADERS;
const fetchStats = (battletag) => {
const url = `${API_URL}/${hashToHypen(battletag)}/blob`;
return fetch(encodeURI(url), { headers })
.then((respons... | import fetch from 'node-fetch';
import { hashToHypen } from './formatText';
import { API_URL, HTTP_HEADERS } from '../constants';
const headers = HTTP_HEADERS;
const fetchStats = (battletag,platform) => {
const url = `${API_URL}/${hashToHypen(battletag)}/blob?platform=${platform}`;
return fetch(encodeURI(url), {... | Add console support, p. 2 | Add console support, p. 2 | JavaScript | mit | chesterhow/overwatch-telegram-bot |
a266f3dd6007a87ae96e31f847c6768dc7e2e807 | corehq/apps/style/static/style/js/daterangepicker.config.js | corehq/apps/style/static/style/js/daterangepicker.config.js | $(function () {
'use strict';
$.fn.getDateRangeSeparator = function () {
return ' to ';
};
$.fn.createBootstrap3DateRangePicker = function(
range_labels, separator, startdate, enddate
) {
var now = moment();
var ranges = {};
ranges[range_labels.last_7_days] = ... | $(function () {
'use strict';
$.fn.getDateRangeSeparator = function () {
return ' to ';
};
$.fn.createBootstrap3DateRangePicker = function(
range_labels, separator, startdate, enddate
) {
var now = moment();
var ranges = {};
ranges[range_labels.last_7_days] = ... | Clear date range picker if no start and end date given | Clear date range picker if no start and end date given
| JavaScript | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq |
14689228a91934327620537a8930a005d020ef79 | src/models/message_comparator.js | src/models/message_comparator.js | var logger = require('../utils/logger')('MessageComparator'),
Response = require('./response');
/**
* Represents a MessageComparator capable of determining whether an
* incoming message must be relayed to a module or not.
* @param {RegExp} regex Regex to which every incoming
* ... | var logger = require('../utils/logger')('MessageComparator'),
Response = require('./response');
/**
* Represents a MessageComparator capable of determining whether an
* incoming message must be relayed to a module or not.
* @param {RegExp} regex Regex to which every incoming
* ... | Add suspension capabilities to MessageComparator | Add suspension capabilities to MessageComparator
| JavaScript | mit | victorgama/Giskard,victorgama/Giskard,victorgama/Giskard |
d53ad4bf24b431086605670c73b78f743d2bb9cc | tests/Bamboo/Fixtures/episodes_recommendations.js | tests/Bamboo/Fixtures/episodes_recommendations.js | module.exports = function (creator, fixtureName) {
return creator.createFixture('/episodes/p00y1h7j/recommendations').then(function (fixture) {
fixture.save(fixtureName);
});
};
| module.exports = function (creator, fixtureName) {
return creator.createFixture('/episodes/p00y1h7j/recommendations').then(function (fixture) {
fixture.addEpisode();
fixture.save(fixtureName);
});
};
| Fix recommendations fixture for when no recomendations are returned by iBL | Fix recommendations fixture for when no recomendations are returned by iBL
| JavaScript | mit | DaMouse404/bamboo,DaMouse404/bamboo,DaMouse404/bamboo |
6a3d5e602529c7991a94ae5c9df79083bca6829c | 04-responsive/Gruntfile.js | 04-responsive/Gruntfile.js | /*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Task configuration.
watch: {
lib_test: {
files: [ 'styles/**/*.css', '*.html' ],
tasks: [],
options: {
livereload: true
}
}
}
});
// These... | /*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Task configuration.
watch: {
lib_test: {
files: [ '*.css', '*.html' ],
tasks: [],
options: {
livereload: true
}
}
}
});
// These plugins p... | Watch styles in main folder | Watch styles in main folder
| JavaScript | mit | hkdobrev/softuni-html-exam |
1f1d8af3e6e8a98113daeec8f3e554b47c876ce0 | assets/js/components/settings-notice.js | assets/js/components/settings-notice.js | /**
* Settings notice 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.0... | /**
* Settings notice 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.0... | Add support for suggestion style to SettingsNotice component. | Add support for suggestion style to SettingsNotice component.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp |
a5463c4c1021009be6958c3821605e8b803edc45 | local-cli/run-packager.js | local-cli/run-packager.js | 'use strict';
var path = require('path');
var child_process = require('child_process');
module.exports = function(newWindow) {
if (newWindow) {
var launchPackagerScript =
path.resolve(__dirname, '..', 'packager', 'launchPackager.command');
if (process.platform === 'darwin') {
child_process.spawn... | 'use strict';
var path = require('path');
var child_process = require('child_process');
module.exports = function(newWindow) {
if (newWindow) {
var launchPackagerScript =
path.resolve(__dirname, '..', 'packager', 'launchPackager.command');
if (process.platform === 'darwin') {
child_process.spawn... | Fix 'react-native start' on Windows | [cli] Fix 'react-native start' on Windows
Based on https://github.com/facebook/react-native/pull/2989
Thanks @BerndWessels!
| JavaScript | bsd-3-clause | machard/react-native,Tredsite/react-native,cdlewis/react-native,myntra/react-native,ankitsinghania94/react-native,mrngoitall/react-native,hzgnpu/react-native,negativetwelve/react-native,CntChen/react-native,Maxwell2022/react-native,lprhodes/react-native,makadaw/react-native,philonpang/react-native,wesley1001/react-nati... |
ceb5988e1c62a500f3bd70def008e350ff066bb6 | src/mixins/reactiveProp.js | src/mixins/reactiveProp.js | module.exports = {
props: {
chartData: {
required: true
}
},
watch: {
'chartData': {
handler (newData, oldData) {
if (oldData) {
let chart = this._chart
// Get new and old DataSet Labels
let newDatasetLabels = newData.datasets.map((dataset) => {
... | module.exports = {
props: {
chartData: {
required: true
}
},
watch: {
'chartData': {
handler (newData, oldData) {
if (oldData) {
let chart = this._chart
// Get new and old DataSet Labels
let newDatasetLabels = newData.datasets.map((dataset) => {
... | Resolve reactive props animation issue. | Resolve reactive props animation issue.
A small consequence of replacing the entire dataset in the mixins files is that it causes certain charts to completely re-render even if only the 'data' attribute of a dataset is changing. In my case, I set up a reactive doughnut chart with two data points but whenever the data ... | JavaScript | mit | apertureless/vue-chartjs,apertureless/vue-chartjs,apertureless/vue-chartjs |
216e7e7026f515d95a4c2a1f3dc4f1858d4bf4a3 | src/scripts/StationList.js | src/scripts/StationList.js | /** ngInject **/
function StationListCtrl($scope, $interval, EventBus, PvlService) {
let vm = this;
vm.imgUrls = {};
vm.nowPlaying = {};
vm.currentIndex = null;
vm.setSelected = setSelected;
var refreshDataBindings = $interval(null, 1000);
function setSelected(index) {
vm.currentIndex = index;
... | /** ngInject **/
function StationListCtrl($scope, EventBus, PvlService) {
let vm = this;
vm.imgUrls = {};
vm.nowPlaying = {};
vm.currentIndex = null;
vm.setSelected = setSelected;
function setSelected(index) {
vm.currentIndex = index;
EventBus.emit('pvl:stationSelect', vm.stations[index]);
}
... | Revert "Quick patch to constantly update currently playing song without requiring user interaction" | Revert "Quick patch to constantly update currently playing song without requiring user interaction"
| JavaScript | mit | berwyn/Ponyville-Live--Desktop-App,Poniverse/PVLive-Chrome-Desktop-App,berwyn/Ponyville-Live--Desktop-App,BravelyBlue/PVLive-Chrome-Desktop-App,berwyn/Ponyville-Live--Desktop-App,Poniverse/PVLive-Chrome-Desktop-App,BravelyBlue/PVLive-Chrome-Desktop-App |
4c758e6856af13f199660bcfc74874fe06928bff | media/js/google-search.js | media/js/google-search.js | google.load('search', '1', {style : google.loader.themes.V2_DEFAULT});
google.setOnLoadCallback(function() {
var customSearchOptions = {};
var customSearchControl = new google.search.CustomSearchControl(
'003721718359151553648:qipcq6hq6uy', customSearchOptions);
customSearchControl.setResultSetSize(... | google.load('search', '1', {style : google.loader.themes.V2_DEFAULT});
google.setOnLoadCallback(function() {
var customSearchOptions = {};
var customSearchControl = new google.search.CustomSearchControl(
'003721718359151553648:qipcq6hq6uy', customSearchOptions);
customSearchControl.setResultSetSize(... | Remove code that did not fix google search pagination issue. | Remove code that did not fix google search pagination issue.
| JavaScript | bsd-3-clause | mozilla/betafarm,mozilla/betafarm,mozilla/betafarm,mozilla/betafarm |
3bdb76d839b7f9424136e791f581cf1c473615c7 | scripts/download-win-lib.js | scripts/download-win-lib.js | var download = require('./download').download;
var path = require('path');
var fs = require('fs');
var TAR_URL = 'https://github.com/nteract/zmq-prebuilt/releases/download/win-libzmq-4.1.5-v140/libzmq-' + process.arch + '.lib';
var DIR_NAME = path.join(__dirname, '..', 'windows', 'lib');
var FILE_NAME = path.join(DIR_... | var download = require('./download').download;
var path = require('path');
var fs = require('fs');
var TAR_URL = 'https://github.com/nteract/libzmq-win/releases/download/v1.0.0/libzmq-' + process.arch + '.lib';
var DIR_NAME = path.join(__dirname, '..', 'windows', 'lib');
var FILE_NAME = path.join(DIR_NAME, 'libzmq.lib... | Store windows lib in different repo | Store windows lib in different repo
| JavaScript | mit | lgeiger/zmq-prebuilt,lgeiger/zmq-prebuilt,interpretor/zeromq.js,lgeiger/zmq-prebuilt,interpretor/zeromq.js,interpretor/zeromq.js,interpretor/zeromq.js,lgeiger/zmq-prebuilt,lgeiger/zmq-prebuilt,interpretor/zeromq.js |
89fc255726bb2073f095bfd82ba05f00b217e3e2 | src/components/OutsideClickable/OutsideClickable.js | src/components/OutsideClickable/OutsideClickable.js | /* OutsideClickable only accepts one top-level child */
import React, { Component, Children, cloneElement } from "react";
import ReactDOM from "react-dom";
import PropTypes from "prop-types";
export default class OutsideClickable extends Component {
static propTypes = {
children: PropTypes.node,
onOutsideCli... | /* OutsideClickable only accepts one top-level child */
import React, { Component, Children, cloneElement } from "react";
import ReactDOM from "react-dom";
import PropTypes from "prop-types";
export default class OutsideClickable extends Component {
static propTypes = {
children: PropTypes.node,
onOutsideCli... | Fix iOS and Android touch events | Fix iOS and Android touch events
| JavaScript | mit | tutti-ch/react-styleguide,tutti-ch/react-styleguide |
dd22023e3c6aa064b1e5881cfd7f48a2e79e894e | defaults/preferences/spamness.js | defaults/preferences/spamness.js | pref("extensions.rspamd-spamness.header", "x-spamd-result");
pref("extensions.rspamd-spamness.display.column", 0);
pref("extensions.rspamd-spamness.display.messageScore", true);
pref("extensions.rspamd-spamness.display.messageRules", true);
pref("extensions.rspamd-spamness.display.messageGreylist", true);
pref("extensi... | /* global pref:false */
/* eslint strict: ["error", "never"] */
pref("extensions.rspamd-spamness.header", "x-spamd-result");
pref("extensions.rspamd-spamness.display.column", 0);
pref("extensions.rspamd-spamness.display.messageScore", true);
pref("extensions.rspamd-spamness.display.messageRules", true);
pref("extensio... | Add ESLint config to preferences | [Chore] Add ESLint config to preferences
| JavaScript | bsd-3-clause | moisseev/spamness,moisseev/rspamd-spamness,moisseev/rspamd-spamness |
ac20f325b34bc952d89d0073e036aa2f87e79388 | src/delir-core/tests/delir/plugin-registory-spec.js | src/delir-core/tests/delir/plugin-registory-spec.js | // @flow
import path from 'path';
import PluginRegistory from '../../src/services/plugin-registory'
describe('PluginRegistory', () => {
it('exporting: PluginFeatures', () => {
expect(PluginRegistory.PluginFeatures).to.not.eql(null)
expect(PluginRegistory.PluginFeatures).to.be.an('object')
})
... | // @flow
import path from 'path';
import PluginRegistory from '../../src/services/plugin-registory'
describe('PluginRegistory', () => {
it('exporting: PluginFeatures', () => {
expect(PluginRegistory.PluginFeatures).to.not.eql(null)
expect(PluginRegistory.PluginFeatures).to.be.an('object')
})
... | Fix PluginRegistry error (missing global.require) | Fix PluginRegistry error (missing global.require)
| JavaScript | mit | Ragg-/Delir,Ragg-/Delir,Ragg-/Delir,Ragg-/Delir |
f1fb384cd62dc13d0b4647c9f988f6f46cbf4b6f | src/test/run-make/wasm-export-all-symbols/verify.js | src/test/run-make/wasm-export-all-symbols/verify.js | const fs = require('fs');
const process = require('process');
const assert = require('assert');
const buffer = fs.readFileSync(process.argv[2]);
let m = new WebAssembly.Module(buffer);
let list = WebAssembly.Module.exports(m);
console.log('exports', list);
const my_exports = {};
let nexports = 0;
for (const entry of... | const fs = require('fs');
const process = require('process');
const assert = require('assert');
const buffer = fs.readFileSync(process.argv[2]);
let m = new WebAssembly.Module(buffer);
let list = WebAssembly.Module.exports(m);
console.log('exports', list);
const my_exports = {};
let nexports = 0;
for (const entry of... | Check for the entry kind | Check for the entry kind
| JavaScript | apache-2.0 | aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust |
beeeec389b04ae44852b3388afa760bbc7f1a3df | components/link/Link.js | components/link/Link.js | import React, { Fragment, PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import theme from './theme.css';
class Link extends PureComponent {
render() {
const { children, className, icon, iconPlacement, element, inherit, ...others } = this.props;
const classNam... | import React, { Fragment, PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import theme from './theme.css';
class Link extends PureComponent {
render() {
const { children, className, icon, iconPlacement, element, inherit, ...others } = this.props;
const classNam... | Add element to defaultProps and assign 'a' to it | Add element to defaultProps and assign 'a' to it
| JavaScript | mit | teamleadercrm/teamleader-ui |
31c98ed24c50375890e579efaac52e53762c6b89 | commands/copy-assets.js | commands/copy-assets.js |
'use strict';
const path = require('path');
module.exports = (() => {
// const akasha = require('../index');
const Command = require('cmnd').Command;
class CopyAssetsCommand extends Command {
constructor() {
super('copy-assets');
}
help() {
... |
'use strict';
const path = require('path');
module.exports = (() => {
// const akasha = require('../index');
const Command = require('cmnd').Command;
class CopyAssetsCommand extends Command {
constructor() {
super('copy-assets');
}
help() {
... | Check for missing config file name | Check for missing config file name
| JavaScript | apache-2.0 | akashacms/akasharender,akashacms/akasharender,akashacms/akasharender |
8d379ebcb0ac8087fe1f4ead76722db46efc913f | test/parser.js | test/parser.js | var testCase = require('nodeunit').testCase,
parser = require('../language/parser'),
tokenizer = require('../language/tokenizer')
test('TextLiteral', '"hello world"', static("hello world"))
test('NumberLiteral', '1', static(1))
test('Declaration', 'let greeting = "hello"', {
type:'DECLARATION',
name:'greeting',
v... | var testCase = require('nodeunit').testCase,
parser = require('../language/parser'),
tokenizer = require('../language/tokenizer')
/* TESTS */
test('text literal', '"hello world"', static("hello world"))
test('number literal', '1', static(1))
test('declaration', 'let greeting = "hello"', { type:'DECLARATION', name:'g... | Make the tests more reader friendly | Make the tests more reader friendly
| JavaScript | mit | marcuswestin/fun |
f27ace3130340b9b3ca2c452d9973a5b685c207a | less-engine.js | less-engine.js | module.exports = require("less/dist/less");
| // Without these options Less will inject a `body { display: none !important; }`
var less = window.less || (window.less = {});
less.async = true;
module.exports = require("less/dist/less");
| Make less use async mode in the browser | Make less use async mode in the browser
This makes less use async mode in the browser. We were already doing
this for our less requests, but now we also set it before less executes,
otherwise it tries to do some weird display: none stuff. Fixes https://github.com/donejs/donejs/issues/1113
| JavaScript | mit | stealjs/steal-less,stealjs/steal-less |
90b029782ef2e7d0ba10c005931b79b9b06f7723 | test/stores/literal-test.js | test/stores/literal-test.js | /*
* literal-test.js: Tests for the nconf literal store.
*
* (C) 2011, Charlie Robbins
*
*/
var vows = require('vows'),
assert = require('assert'),
helpers = require('../helpers'),
nconf = require('../../lib/nconf');
vows.describe('nconf/stores/literal').addBatch({
"An instance of nconf.Literal": {... | /*
* literal-test.js: Tests for the nconf literal store.
*
* (C) 2011, Charlie Robbins
*
*/
var vows = require('vows'),
assert = require('assert'),
helpers = require('../helpers'),
nconf = require('../../lib/nconf');
vows.describe('nconf/stores/literal').addBatch({
"An instance of nconf.Literal": {... | Update tests to use optional options API | [test] Update tests to use optional options API
| JavaScript | mit | olalonde/nconf,philip1986/nconf,ChristianMurphy/nconf,HansHammel/nconf,remy/nconf,bryce-gibson/nconf,imjerrybao/nconf,indexzero/nconf,NickHeiner/nconf,Dependencies/nconf |
8a677340e99b15271f6db7404f56295a2b1f6bd6 | src/socket.js | src/socket.js | import SocketIO from 'socket.io';
import { createClient } from 'redis';
import { redisUrl } from './config';
const io = SocketIO();
io.use((socket, next) => {
return next();
});
io.of('/live-chatroom')
.use((socket, next) => {
return next();
})
.on('connection', (socket) => {
const redis = createCli... | import SocketIO from 'socket.io';
import { createClient } from 'redis';
import { redisUrl } from './config';
const io = SocketIO();
io.use((socket, next) => {
return next();
});
io.of('/live-chatroom')
.use((socket, next) => {
return next();
})
.on('connection', (socket) => {
const redis = createCli... | Fix bug: if the reds subscriber quit, members who still in the room cannot receive the messages. | Fix bug: if the reds subscriber quit, members who still in the room cannot receive the messages.
| JavaScript | mit | Calvin-Huang/LiveAPIExplore-Server,Calvin-Huang/LiveAPIExplore-Server |
07493a4b131cf0185f1b653f12d6d9f1129626e4 | database/emulator-suite.js | database/emulator-suite.js |
export async function onDocumentReady() {
//[START rtdb_emulator_connect]
let firebaseConfig = {
// Point to the RTDB emulator running on localhost.
// Here we supply database namespace 'foo'.
databaseURL: "http://localhost:9000?ns=foo"
}
var myApp = firebase.initializeApp(firebaseConfig);
con... |
export async function onDocumentReady() {
//[START rtdb_emulator_connect]
let firebaseConfig = {
// Point to the RTDB emulator running on localhost.
// Here we supply database namespace 'foo'.
databaseURL: "http://localhost:9000?ns=foo"
}
var myApp = firebase.initializeApp(firebaseConfig);
con... | Add RTDB flush method using platform SDK methods. | Add RTDB flush method using platform SDK methods.
| JavaScript | apache-2.0 | firebase/snippets-web,firebase/snippets-web,firebase/snippets-web,firebase/snippets-web |
712e512cfb33c897a9a7dd8cea0e1001f39b1bea | src/dom-utils/instanceOf.js | src/dom-utils/instanceOf.js | // @flow
import getWindow from './getWindow';
/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
Element); */
function isElement(node) {
const OwnElement = getWindow(node).Element;
return node instanceof OwnElement;
}
/*:: declare function isHTMLElement(node: mixed): boolean %checks(... | // @flow
import getWindow from './getWindow';
/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
Element); */
function isElement(node) {
const OwnElement = getWindow(node).Element;
return node instanceof OwnElement || node instanceof Element;
}
/*:: declare function isHTMLElement(nod... | Fix error in some situations with iframes | Fix error in some situations with iframes
When using popper in an iframe, if the elements are created in the code's global context and added to the iframe, exceptions are thrown because prototypeOf does not accurately assess which nodes are Elements or HTMLElements.
This fixes https://github.com/popperjs/popper-cor... | JavaScript | mit | floating-ui/floating-ui,FezVrasta/popper.js,FezVrasta/popper.js,floating-ui/floating-ui,FezVrasta/popper.js,floating-ui/floating-ui,FezVrasta/popper.js |
ae1e8915d76d4bd983d5a743bbb32dcb7369b985 | SPAWithAngularJS/module3/httpService/js/app.menuCategoriesController.js | SPAWithAngularJS/module3/httpService/js/app.menuCategoriesController.js | // app.menuCategoriesController.js
(function() {
"use strict";
angular.module("MenuCategoriesApp")
.controller("MenuCategoriesController", MenuCategoriesController);
MenuCategoriesController.$inject = ["MenuCategoriesService"];
function MenuCategoriesController(MenuCategoriesService) {
let vm = this... | // app.menuCategoriesController.js
(function() {
"use strict";
angular.module("MenuCategoriesApp")
.controller("MenuCategoriesController", MenuCategoriesController);
MenuCategoriesController.$inject = ["GitHubDataService"];
function MenuCategoriesController(GitHubDataService) {
let vm = this;
v... | Use new service. Implement getRepos | Use new service. Implement getRepos
| JavaScript | mit | var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training |
b49edd06baa6d7326f58cf319bfd41cd61147f71 | dwinelle/web/js/spaces.js | dwinelle/web/js/spaces.js | function hallwayType1(length) {
var space = new THREE.Group();
space.add(makeArrowHelper(0,0,0,0,1,0));
// Lighting
for (var i = -length/2; i <= length/2; i+=10) {
space.add(makePointLight(i,0,2.5, space));
}
// Floor
space.add(makePlane(5 , length, 0, 0 , 0, null, null, Math.PI/2, floorMat));
//... | function hallwayType1(length) {
var space = new THREE.Group();
space.add(makeArrowHelper(0,0,0,0,1,0));
// Lighting
for (var i = -length/2; i <= length/2; i+=10) {
space.add(makePointLight(i,0,2.5, space));
}
// Floor
space.add(makePlane(5 , length, 0, 0 , 0, null, null, Math.PI/2, plainLightGray))... | Make things gray and black so it doesn't kill my browser | Make things gray and black so it doesn't kill my browser
| JavaScript | mit | oliverodaa/cs184-final-proj,oliverodaa/cs184-final-proj,oliverodaa/cs184-final-proj |
d813789dd4a515e6f3db9f7303ffdaf1c2c0083d | lib/resources/Customers.js | lib/resources/Customers.js | 'use strict';
var FusebillResource = require('../FusebillResource');
var utils = require('../utils');
var fusebillMethod = FusebillResource.method;
module.exports = FusebillResource.extend({
path: 'customers',
includeBasic: [
'create', 'list', 'retrieve', 'update', 'del',
],
/**
* Customer: Subscri... | 'use strict';
var FusebillResource = require('../FusebillResource');
var utils = require('../utils');
var fusebillMethod = FusebillResource.method;
module.exports = FusebillResource.extend({
path: 'customers',
includeBasic: [
'create', 'list', 'retrieve', 'update', 'del',
],
/**
* Customer: Subscri... | Add back customer list payment methods | Add back customer list payment methods
| JavaScript | mit | DanielAudino/fusebill-node,fingerfoodstudios/fusebill-node,bradcavanagh-ffs/fusebill-node |
0d17ee888f562ba70d678d9ad9b412704bc2d3af | src/heading/heading_view.js | src/heading/heading_view.js | "use strict";
var TextView = require('../text/text_view');
// Substance.Heading.View
// ==========================================================================
var HeadingView = function(node) {
TextView.call(this, node);
this.$el.addClass('heading');
};
HeadingView.Prototype = function() {};
HeadingView.P... | "use strict";
var TextView = require('../text/text_view');
// Substance.Heading.View
// ==========================================================================
var HeadingView = function(node) {
TextView.call(this, node);
this.$el.addClass('heading');
this.$el.addClass('level-'+this.node.level);
};
Headi... | Add css classes for heading levels. | Add css classes for heading levels.
| JavaScript | mit | substance/nodes |
0cb49fd90bf58848859a1e8626cf88ee3158b132 | brunch-config.js | brunch-config.js | exports.files = {
javascripts: {
joinTo: {
'fateOfAllFools.js': /^(?!test)/
}
},
stylesheets: {
joinTo: 'fateOfAllFools.css'
}
};
// Tests are handled by Karma
exports.conventions = {
ignored: /^test/
};
| exports.files = {
javascripts: {
joinTo: {
'fateOfAllFools.js': /^(?!test)/
}
},
stylesheets: {
joinTo: 'fateOfAllFools.css'
}
};
/*
1. Tests are handled by Karma. This is to silence a warning that Brunch
reports (which is helpful actually in most cases!) because it sees JS files
... | Add detail to exclusion reasoning | Add detail to exclusion reasoning
| JavaScript | mit | rslifka/fate_of_all_fools,rslifka/fate_of_all_fools |
7e7d86162597794f3452ab69d177300df1cadefd | src/model/fancy/location.js | src/model/fancy/location.js | /**
* model/fancy/location.js
*/
function changePathGen (method) {
return function changePath(path) {
root.history[method + 'State'](EMPTY_OBJECT, '', path);
$(root).trigger(method + 'state');
};
}
models.location = baseModel.extend({
/**
* Example:
* var loc = tbone.models.loc... | /**
* model/fancy/location.js
*/
function changePathGen (method) {
return function changePath(path) {
root.history[method + 'State'](EMPTY_OBJECT, '', path);
window.dispatchEvent(new root.Event(method + 'state'));
};
}
models.location = baseModel.extend({
/**
* Example:
* var l... | Remove dependency on JQuery for binding/triggering hashchange/pushstate events | Remove dependency on JQuery for binding/triggering hashchange/pushstate events
| JavaScript | mit | appneta/tbone,appneta/tbone,rachellaserzhao/tbone,tillberg/tbone,tillberg/tbone,rachellaserzhao/tbone |
ee3fb6243a6a49c1cc0d5d3f78aec555089885d5 | public/services/gitlab.js | public/services/gitlab.js | app
.factory("gitlab",
["$http", "$q", "Config",
function($http, $q, Config) {
function gitlab() {}
gitlab.prototype.imageUrl = function(path) {
return Config.gitlabUrl + path;
};
gitlab.prototype.callapi = function(method, path) {
var deferred = $q.defer();
v... | app
.factory("gitlab",
["$http", "$q", "Config",
function($http, $q, Config) {
function gitlab() {}
gitlab.prototype.imageUrl = function(path) {
return Config.gitlabUrl.replace(/\/*$/, "") + path;
};
gitlab.prototype.callapi = function(method, path) {
var deferred = $... | Remove trailing slash in GitLab url | Remove trailing slash in GitLab url
Signed-off-by: kfei <1da1ad03e627cea4baf20871022464fcc6a4b2c4@kfei.net>
| JavaScript | mit | kfei/gitlab-auditor,kfei/gitlab-auditor,kfei/gitlab-auditor |
adcc739f86f2bb24dc0f2ebe0d7d6bba1501b81c | test/index.js | test/index.js | var vCard = require( '..' )
var fs = require( 'fs' )
var assert = require( 'assert' )
suite( 'vCard', function() {
suite( 'Character Sets', function() {
test( 'charset should not be part of value', function() {
var data = fs.readFileSync( __dirname + '/data/xing.vcf' )
var card = new vCard( d... | var vCard = require( '..' )
var fs = require( 'fs' )
var assert = require( 'assert' )
suite( 'vCard', function() {
suite( 'Character Sets', function() {
test( 'charset should not be part of value', function() {
var data = fs.readFileSync( __dirname + '/data/xing.vcf' )
var card = new vCard( d... | Update test: Adjust assertions to removal of cardinality checks | Update test: Adjust assertions to removal of cardinality checks
| JavaScript | mit | jhermsmeier/node-vcf |
88da1a072569a503afb157e83e6759779c700da8 | test/index.js | test/index.js | const minecraftItems = require('../')
const tap = require('tap')
const testItem = (test, item, name) => {
test.type(item, 'object')
test.equal(item.name, name)
test.end()
}
tap.test('should be able to get an item by numeric type', t => {
testItem(t, minecraftItems.get(1), 'Stone')
})
tap.test('should be able... | const minecraftItems = require('../')
const tap = require('tap')
const testItem = (test, item, name) => {
test.type(item, 'object')
test.equal(item.name, name)
test.notEqual(typeof item.id, 'undefined', 'items should have an id property')
test.notEqual(typeof item.type, 'undefined', 'items should have a type p... | Test for inclusion of icon data. | :white_check_mark: Test for inclusion of icon data.
| JavaScript | mit | pandapaul/minecraft-items |
cd3b76de38f6d050c8c3c927c06f4575ab456cd2 | src/bot/postback.js | src/bot/postback.js | // import { getDocument } from './lib/couchdb';
// getDocument('3cfc9a96341c0e24')
// .then(d => console.log(d))
// .catch(d => console.log(d))
export default (bot) => {
return async (payload, reply) => {
let text = payload.postback.payload;
try {
const profile = await bot.getProfile(payload.sende... | // import { getDocument } from './lib/couchdb';
// getDocument('3cfc9a96341c0e24')
// .then(d => console.log(d))
// .catch(d => console.log(d))
export default (bot) => {
return async (payload, reply) => {
let text = payload.postback.payload;
try {
const profile = await bot.getProfile(payload.sende... | Change the template for account linking | Change the template for account linking
| JavaScript | mit | nikolay-radkov/ebudgie-server,nikolay-radkov/ebudgie-server |
dbdc7968923e320677f3e61f0f381f15d0ddb757 | app/assets/javascripts/connect/views/SubscriptionListView.js | app/assets/javascripts/connect/views/SubscriptionListView.js | define([
'backbone', 'handlebars', 'moment',
'connect/collections/Subscriptions',
'connect/views/SubscriptionListItemView',
'text!connect/templates/subscriptionList.handlebars'
], function(Backbone, Handlebars, moment, Subscriptions, SubscriptionListItemView, tpl) {
'use strict';
var SubscriptionListView ... | define([
'backbone', 'handlebars', 'moment',
'connect/collections/Subscriptions',
'connect/views/SubscriptionListItemView',
'text!connect/templates/subscriptionList.handlebars'
], function(Backbone, Handlebars, moment, Subscriptions, SubscriptionListItemView, tpl) {
'use strict';
var SubscriptionListView ... | Sort subscription list by date | Sort subscription list by date
| JavaScript | mit | Vizzuality/gfw,Vizzuality/gfw |
346cd3bd917ef642ed8d132d559e4b16342b29b7 | src/transforms/__tests__/textShadow.js | src/transforms/__tests__/textShadow.js | import transformCss from '../..'
it('textShadow with all values', () => {
expect(transformCss([['text-shadow', '10px 20px 30px red']])).toEqual({
textShadowOffset: { width: 10, height: 20 },
textShadowRadius: 30,
textShadowColor: 'red',
})
})
it('textShadow omitting blur', () => {
expect(transformCs... | import transformCss from '../..'
it('textShadow with all values', () => {
expect(transformCss([['text-shadow', '10px 20px 30px red']])).toEqual({
textShadowOffset: { width: 10, height: 20 },
textShadowRadius: 30,
textShadowColor: 'red',
})
})
it('textShadow omitting blur', () => {
expect(transformCs... | Remove duplicate test, fix duplicate test | Remove duplicate test, fix duplicate test
| JavaScript | mit | styled-components/css-to-react-native |
8d4d2eb1b16bb5e527aeb051931d6f834da8b21b | test/scenario/game-start.js | test/scenario/game-start.js | // @flow
import { expect } from "chai";
import {
Game,
GameDescriptor,
DefaultDeck
} from "stormtide-core";
import type {
PlayerDescriptor
} from "stormtide-core";
describe("Scenario: Game Start", () => {
const settings = new GameDescriptor();
const player1: PlayerDescriptor = {
deck: DefaultDeck
};
cons... | // @flow
import { expect } from "chai";
import {
Game,
GameDescriptor,
DefaultDeck
} from "stormtide-core";
import type {
PlayerDescriptor
} from "stormtide-core";
describe("Scenario: Game Start", () => {
const settings = new GameDescriptor();
const player1: PlayerDescriptor = {
deck: DefaultDeck
};
cons... | Add minor note about future changes | Add minor note about future changes
| JavaScript | mit | StormtideGame/stormtide-core |
ea02da4f1d26c736d04b83dfdabde3297bba8dc7 | packages/ember-runtime/lib/controllers/object_controller.js | packages/ember-runtime/lib/controllers/object_controller.js | require('ember-runtime/system/object_proxy');
require('ember-runtime/controllers/controller');
/**
@module ember
@submodule ember-runtime
*/
/**
`Ember.ObjectController` is part of Ember's Controller layer. A single shared
instance of each `Ember.ObjectController` subclass in your application's
namespace will b... | require('ember-runtime/system/object_proxy');
require('ember-runtime/controllers/controller');
/**
@module ember
@submodule ember-runtime
*/
/**
`Ember.ObjectController` is part of Ember's Controller layer.
`Ember.ObjectController` derives its functionality from its superclass
`Ember.ObjectProxy` and the `Embe... | Remove obsolete paragraph from ObjectController comments | Remove obsolete paragraph from ObjectController comments
| JavaScript | mit | trentmwillis/ember.js,mitchlloyd/ember.js,kidaa/ember.js,seanpdoyle/ember.js,cyberkoi/ember.js,csantero/ember.js,kellyselden/ember.js,michaelBenin/ember.js,cesarizu/ember.js,JesseQin/ember.js,xcambar/ember.js,jmurphyau/ember.js,nruth/ember.js,Trendy/ember.js,seanjohnson08/ember.js,knownasilya/ember.js,rwjblue/ember.js,... |
3cf539e029290331c735da82b1c0dc3189eeff6b | src/sprites/Player/index.js | src/sprites/Player/index.js | import Phaser from 'phaser';
import frames from '../../sprite-frames';
import update from './update';
export default class extends Phaser.Sprite {
constructor({ game, x, y }) {
super(game, x, y, 'guy', frames.GUY.STAND_DOWN);
this.anchor.setTo(0.5, 0.5);
this.faceDirection = 'DOWN';
this.faceObje... | import Phaser from 'phaser';
import frames from '../../sprite-frames';
import update from './update';
import Inventory from './inventory';
export default class extends Phaser.Sprite {
constructor({ game, x, y }) {
super(game, x, y, 'guy', frames.GUY.STAND_DOWN);
this.anchor.setTo(0.5, 0.5);
this.face... | Use inventory class instead of plain object | Use inventory class instead of plain object
| JavaScript | mit | ThomasMays/incremental-forest,ThomasMays/incremental-forest |
bf85e9c098f4223c23c86ff3626bf8e36917b46c | src/templates/navigation.js | src/templates/navigation.js | import React from 'react'
import { NavLink } from 'react-router-dom'
import styles from './navigation.module.styl'
export default ({ sports }) => (
<nav>
<ol className={`${styles['sports-list']}`}>
{
sports.map(({ node }, idx) => (
<li key={idx} className={`${styles['sport-item']}`}>
... | import React from 'react'
import NavLink from 'gatsby-link'
import styles from './navigation.module.styl'
export default ({ sports }) => (
<nav>
<ol className={`${styles['sports-list']}`}>
{
sports.map(({ node }, idx) => (
<li key={idx} className={`${styles['sport-item']}`}>
... | Update NavLinks: use gatsby-link to avoid code chunks necessary for pages not being loaded. | Update NavLinks: use gatsby-link to avoid code chunks necessary for pages not being loaded.
| JavaScript | mit | LuisLoureiro/placard-wrapper |
ba1b1ddf5181e78d3220c5e3d1d880bcf775c9ea | blueprints/ember-cli-template-lint/files/.template-lintrc.js | blueprints/ember-cli-template-lint/files/.template-lintrc.js | /* jshint node:true */
'use strict';
module.exports = {
'bare-strings': true,
'block-indentation': 2,
'html-comments': true,
'nested-interactive': true,
'lint-self-closing-void-elements': true,
'triple-curlies': true,
'deprecated-each-syntax': true
};
| /* jshint node:true */
'use strict';
module.exports = {
extend: 'recommended'
};
| Use the recommended config from ember-template-lint. | Use the recommended config from ember-template-lint.
| JavaScript | mit | rwjblue/ember-cli-template-lint,rwjblue/ember-cli-template-lint |
6a2776fef20474fdcd75abb063ba76b830ea82b3 | ws-fallback.js | ws-fallback.js | module.exports = WebSocket || MozWebSocket || window.WebSocket || window.MozWebSocket
|
var ws = null
if (typeof WebSocket !== 'undefined') {
ws = WebSocket
} else if (typeof MozWebSocket !== 'undefined') {
ws = MozWebSocket
} else {
ws = window.WebSocket || window.MozWebSocket
}
module.exports = ws
| Use typeof for checking globals. | Use typeof for checking globals.
| JavaScript | bsd-2-clause | maxogden/websocket-stream,maxogden/websocket-stream |
4874126c3445112d491f091be13eb999bf9f8fa3 | system/res/js/key_import.js | system/res/js/key_import.js | var KeyImporterController = function() {
this.sendArmor = function() {
armorContainer = $('#import-armor');
data = "armor="+armorContainer.val();
$.post(
'/node/api/keyring/post/import',
data,
function(data){
obj = $.parseJSON(data);
if(obj.result != 'ok') {
$('#i... | var KeyImporterController = function() {
this.sendArmor = function() {
armorContainer = $('#import-armor');
data = "armor="+encodeURIComponent(armorContainer.val());
$.post(
'/node/api/keyring/post/import',
data,
function(data){
obj = $.parseJSON(data);
if(obj.result != 'ok... | Correct encoding for key import | Correct encoding for key import
The armor was getting mashed on transmission
| JavaScript | apache-2.0 | SpringDVS/php.web.node,SpringDVS/nodeweb_php,SpringDVS/php.web.node,SpringDVS/nodeweb_php |
5c1cee5e80329595c654e95be79888b9d11387cc | app/models/session-type.js | app/models/session-type.js | import DS from 'ember-data';
export default DS.Model.extend({
title: DS.attr('string'),
sessionTypeCssClass: DS.attr('string'),
assessment: DS.attr('boolean'),
assessmentOption: DS.belongsTo('assessment-option', {async: true}),
school: DS.belongsTo('school', {async: true}),
aamcMethods: DS.hasMany('aamc-me... | import DS from 'ember-data';
export default DS.Model.extend({
title: DS.attr('string'),
sessionTypeCssClass: DS.attr('string'),
assessment: DS.attr('boolean'),
assessmentOption: DS.belongsTo('assessment-option', {async: true}),
school: DS.belongsTo('school', {async: true}),
aamcMethods: DS.hasMany('aamc-me... | Remove sessions from seasionType model | Remove sessions from seasionType model
No longer part of the API
| JavaScript | mit | jrjohnson/frontend,dartajax/frontend,dartajax/frontend,gboushey/frontend,jrjohnson/frontend,djvoa12/frontend,thecoolestguy/frontend,ilios/frontend,stopfstedt/frontend,thecoolestguy/frontend,ilios/frontend,stopfstedt/frontend,gboushey/frontend,djvoa12/frontend,gabycampagna/frontend,gabycampagna/frontend |
0640d35ab77d16c24db7e9b889723ab7f093df2f | build/dev-server-chrome.js | build/dev-server-chrome.js | require('./check-versions')();
var config = require('../config');
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV);
}
var webpack = require('webpack');
var webpackConfig = require('./webpack.dev.conf');
const compiler = webpack(webpackConfig);
const watching = compiler.watch... | require('./check-versions')();
let config = require('../config');
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV);
}
let webpack = require('webpack');
let webpackConfig = require('./webpack.dev.conf');
const compiler = webpack(webpackConfig);
const watching = compiler.watch... | Improve output message and lint | Improve output message and lint
| JavaScript | mit | nextgensparx/quantum-router,nextgensparx/quantum-router |
43bf846321bdbfed04a3f2338805013342bb84d9 | js/controllers/imprint.js | js/controllers/imprint.js | "use strict";
// Serves the imprint for the application
module.exports = 'controllers/imprint';
var dependencies = [];
angular.module(module.exports, dependencies)
.controller('ImprintCtrl', function ($scope, $http) {
$scope.config = config;
if (config.server) {
$http.get(config.serve... | "use strict";
// Serves the imprint for the application
module.exports = 'controllers/imprint';
var dependencies = [];
angular.module(module.exports, dependencies)
.controller('ImprintCtrl', function ($scope, $http) {
$scope.config = config;
$http
.get(config.server + '/')
... | Remove unneeded check if there is a server | Remove unneeded check if there is a server
| JavaScript | mit | dragonservice/sso-client,dragonservice/sso-client |
96ab389bb9a363adecec8241bc4c71e95c71d4c8 | coursebuilder/modules/student_groups/_static/js/student_groups_list.js | coursebuilder/modules/student_groups/_static/js/student_groups_list.js | var XSSI_PREFIX = ")]}'";
function parseJson(s) {
return JSON.parse(s.replace(XSSI_PREFIX, ""));
}
$(function(){
$('div[data-delete-url]').each(function(index, element){
var groupName = $(element).data('group-name');
var button = $('<button id="delete-' + groupName + '" ' +
'class="gcb-list__icon ... | var XSSI_PREFIX = ")]}'";
function parseJson(s) {
return JSON.parse(s.replace(XSSI_PREFIX, ""));
}
$(function(){
$('div[data-delete-url]').each(function(index, element){
var groupName = $(element).data('group-name');
var button = $('<button id="delete-' + groupName + '" ' +
'class="gcb-list__icon ... | Change JS parser to only look for 200 success code not the actual "OK". | Change JS parser to only look for 200 success code not the actual "OK".
Oddly, in production, Chrome returns request.status as 'parsererror'
rather than "OK", which is what we get when running against a dev server.
The 'parseerror' is actually fairly reasonable -- we send back JSON
with our script-buster prefix of })]... | JavaScript | apache-2.0 | andela-angene/coursebuilder-core,andela-angene/coursebuilder-core,andela-angene/coursebuilder-core,andela-angene/coursebuilder-core |
644b2a98ded16b7268f0cd2f28b20cbfb4814505 | lib/cli/src/generators/REACT/template-csf/.storybook/main.js | lib/cli/src/generators/REACT/template-csf/.storybook/main.js | module.exports = {
stories: ['../stories/**/*.stories.js'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
};
| module.exports = {
stories: ['../stories/**/*.stories.(ts|tsx|js|jsx)'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
};
| Support Both js and jsx or ts and tsx | Support Both js and jsx or ts and tsx
| JavaScript | mit | kadirahq/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook |
6fb67b0a4047610c067b2e118a695bca742a6201 | cloudcode/cloud/main.js | cloudcode/cloud/main.js | // Parse CloudCode
Parse.Cloud.beforeSave(Parse.Installation, function(request, response) {
Parse.Cloud.useMasterKey();
var androidId = request.object.get("androidId");
if (androidId == null || androidId == "") {
console.warn("No androidId found, exit");
response.success();
}
var query = new Parse... | // Parse CloudCode
Parse.Cloud.beforeSave(Parse.Installation, function(request, response) {
Parse.Cloud.useMasterKey();
var androidId = request.object.get("androidId");
if (androidId == null || androidId == "") {
console.warn("No androidId found, exit");
return response.success();
}
... | Fix typo on error handling conditional | Fix typo on error handling conditional
| JavaScript | mit | timanrebel/Parse,DouglasHennrich/Parse,gimdongwoo/Parse,timanrebel/Parse,DouglasHennrich/Parse,DouglasHennrich/Parse,DouglasHennrich/Parse,timanrebel/Parse,gimdongwoo/Parse,DouglasHennrich/Parse,timanrebel/Parse,gimdongwoo/Parse,gimdongwoo/Parse |
a8cf1c8156c2c87cf8a68a5cc362797a29cf760c | src/webWorker/decodeTask/decoders/decodeJPEGLossless.js | src/webWorker/decodeTask/decoders/decodeJPEGLossless.js | "use strict";
(function (cornerstoneWADOImageLoader) {
function decodeJPEGLossless(imageFrame, pixelData) {
// check to make sure codec is loaded
if(typeof jpeg === 'undefined' ||
typeof jpeg.lossless === 'undefined' ||
typeof jpeg.lossless.Decoder === 'undefined') {
throw 'No JPEG Lossless... | "use strict";
(function (cornerstoneWADOImageLoader) {
function decodeJPEGLossless(imageFrame, pixelData) {
// check to make sure codec is loaded
if(typeof jpeg === 'undefined' ||
typeof jpeg.lossless === 'undefined' ||
typeof jpeg.lossless.Decoder === 'undefined') {
throw 'No JPEG Lossless... | Fix a bug which causes that JPEG lossless images cannot be decompressed in Safari | Fix a bug which causes that JPEG lossless images cannot be decompressed in Safari
| JavaScript | mit | mikewolfd/cornerstoneWADOImageLoader,google/cornerstoneWADOImageLoader,google/cornerstoneWADOImageLoader,chafey/cornerstoneWADOImageLoader,cornerstonejs/cornerstoneWADOImageLoader,mikewolfd/cornerstoneWADOImageLoader,chafey/cornerstoneWADOImageLoader,cornerstonejs/cornerstoneWADOImageLoader,google/cornerstoneWADOImageL... |
224e79ca27a2d1d7c0ea4b312ba850ea69e37c40 | lib/binding_web/prefix.js | lib/binding_web/prefix.js | var TreeSitter = function() {
var initPromise;
class Parser {
constructor() {
this.initialize();
}
initialize() {
throw new Error("cannot construct a Parser before calling `init()`");
}
static init(moduleOptions) {
if (initPromise) return initPromise;
Module = Object.as... | var TreeSitter = function() {
var initPromise;
var document = typeof window == 'object'
? {currentScript: window.document.currentScript}
: null;
class Parser {
constructor() {
this.initialize();
}
initialize() {
throw new Error("cannot construct a Parser before calling `init()`")... | Fix script directory that's passed to locateFile | web: Fix script directory that's passed to locateFile
| JavaScript | mit | tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter |
45ba55ea6238a1123c3937c50a8036ab9909159c | client/components/titleEditor/titleEditor.controller.js | client/components/titleEditor/titleEditor.controller.js | 'use strict';
/*global Wodo*/
angular.module('manticoreApp')
.controller('TitleEditorCtrl', function ($scope, $timeout) {
function handleTitleChanged(changes) {
var title = changes.setProperties['dc:title'];
if (title !== undefined && title !== $scope.title) {
$timeout(function () {
... | 'use strict';
/*global Wodo*/
angular.module('manticoreApp')
.controller('TitleEditorCtrl', function ($scope, $timeout) {
function handleTitleChanged(changes) {
var title = changes.setProperties['dc:title'];
if (title !== undefined && title !== $scope.title) {
$timeout(function () {
... | Set metadata as UI title only when someone changes it | Set metadata as UI title only when someone changes it
| JavaScript | agpl-3.0 | adityab/Manticore,adityab/Manticore,adityab/Manticore |
4131eb36ac232a33980f706ec201c33c68681596 | .infrastructure/webpack/helpers/loadersByExtension.js | .infrastructure/webpack/helpers/loadersByExtension.js | function extsToRegExp (exts) {
return new RegExp('\\.(' + exts.map(function (ext) {
return ext.replace(/\./g, '\\.')
}).join('|') + ')(\\?.*)?$')
}
module.exports = function loadersByExtension (obj) {
var loaders = []
Object.keys(obj).forEach(function (key) {
v... | function extsToRegExp (exts) {
return new RegExp('\\.(' + exts.map(function (ext) {
return ext.replace(/\./g, '\\.')
}).join('|') + ')(\\?.*)?$')
}
module.exports = function loadersByExtension (obj) {
var loaders = []
Object.keys(obj).forEach(function (key) {
var exts = key.split('|')
var value = o... | Update coding styles in webpack loaders | Update coding styles in webpack loaders
| JavaScript | mpl-2.0 | beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.