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 |
|---|---|---|---|---|---|---|---|---|---|
4709845f2b65c0cab88b2f15793eca4b131ce760 | route/index.js | route/index.js | 'use strict';
var path = require('path');
var util = require('util');
var ngUtil = require('../util');
var ScriptBase = require('../script-base.js');
var Generator = module.exports = function Generator() {
ScriptBase.apply(this, arguments);
};
util.inherits(Generator, ScriptBase);
Generator.prototype.prompting = f... | 'use strict';
var path = require('path');
var util = require('util');
var ngUtil = require('../util');
var ScriptBase = require('../script-base.js');
var Generator = module.exports = function Generator() {
ScriptBase.apply(this, arguments);
};
util.inherits(Generator, ScriptBase);
Generator.prototype.prompting = f... | Revert "fix(route): don't default to creating a new module" | Revert "fix(route): don't default to creating a new module"
| JavaScript | mit | DaftMonk/generator-ng-component,DaftMonk/generator-ng-component |
0775ff498a1ade564744368e40ab00f6e0256d5c | app/assets/javascripts/components/jumbotron.es6.js | app/assets/javascripts/components/jumbotron.es6.js | // Require React
React = require('react/addons');
// Define component
const Jumbotron = React.createClass({
render() {
return (
<div className="header header--bg">
<div className="container">
<div className="jumbotron jumbotron--small">
<div className="col-6">
... | // Require React
React = require('react/addons');
// Define component
const Jumbotron = React.createClass({
render() {
return (
<div className="header header--bg">
<div className="container">
<div className="jumbotron jumbotron--small">
<div className="col-6">
... | Move example tags to jumbotron | Move example tags to jumbotron
| JavaScript | artistic-2.0 | Hireables/hireables,gauravtiwari/hireables,gauravtiwari/hireables,gauravtiwari/hireables,gauravtiwari/techhire,Hireables/hireables,gauravtiwari/techhire,Hireables/hireables,gauravtiwari/techhire |
eac717cd153ee246b8f6c6a07a8be33872fab641 | src/client/login/login.controller.js | src/client/login/login.controller.js | angular.module('ccdb.login', ['ccdb.authentication.authentication', 'ccdb.authentication.user.authentication', 'ui.bootstrap'])
.config(function ($routeProvider) {
$routeProvider.when(
'/login',
{
templateUrl: 'login/login.html',
controller: 'LoginCon... | angular.module('ccdb.login', ['ccdb.authentication.authentication', 'ccdb.authentication.user.authentication', 'ui.bootstrap'])
.config(function ($routeProvider) {
$routeProvider.when(
'/login',
{
templateUrl: 'login/login.html',
controller: 'LoginCon... | Add alert for invalid creds | Add alert for invalid creds
| JavaScript | mit | igiveadamn/ccdb,igiveadamn/ccdb,igiveadamn/ccdb |
4013fc58b154ed7a53f7ebaf57035dd477e309fe | src/components/input/TextArea.js | src/components/input/TextArea.js | import React, { Component, PropTypes } from 'react';
import TextareaAutosize from 'react-textarea-autosize';
import styles from '../../chat.scss';
export default class TextArea extends Component {
componentDidUpdate(prevProps) {
if (prevProps.inputValue !== this.props.inputValue) {
if (document.activeEleme... | import React, { Component, PropTypes } from 'react';
import TextareaAutosize from 'react-textarea-autosize';
import styles from '../../chat.scss';
export default class TextArea extends Component {
componentDidUpdate(prevProps) {
if (prevProps.inputValue !== this.props.inputValue) {
if (!this.fromInput) {
... | Set input focus on change without document.activeElement | Set input focus on change without document.activeElement
| JavaScript | mit | zalmoxisus/react-chat |
5b497ac1d3c49cbe30c0499bf58610bef80e4949 | public/javascripts/app.js | public/javascripts/app.js | var mainModule = angular.module('mainApp', ['ngSanitize', 'slideshow']);
var slideshowModule = angular.module('slideshow', ['ngResource']);
slideshowModule.controller('slideshowController', ['$scope', 'Slide',
function ($scope, Slide) {
$scope.currentSlide = Slide.get({slideId: 1});
$scope.allSlides = Slide... | var mainModule = angular.module('mainApp', ['ngSanitize', 'slideshow']);
var slideshowModule = angular.module('slideshow', ['ngResource']);
slideshowModule.controller('slideshowController', ['$scope', 'Slide',
function ($scope, Slide) {
$scope.currentSlide = Slide.get({slideId: 1});
$scope.allSlides = Slide... | Add a default cache for slide GET requests | Add a default cache for slide GET requests
| JavaScript | mit | pads/angular-talk |
b15524462a1325468ec458e5f1f5774333a51fe4 | public/js/instructions.js | public/js/instructions.js | /**
* Instructions view block for jsSART
*/
var
instructions = [],
participant_id = getParticipantId();
var instructions_block = {
type: "instructions",
pages: [
"<p>Welcome!</p> " +
"<p>In this study you will be presented with a single digit (<code>1-9</code>) in varying sizes in the middle of the s... | /**
* Instructions view block for jsSART
*/
var
instructions = [],
participant_id = getParticipantId();
var instructions_block = {
type: "instructions",
pages: [
"<p>Welcome!</p> " +
"<p>In this study you will be presented with a single digit (<code>1-9</code>) in varying sizes in the middle of the s... | Remove notice re practice trials (to avoid confusion) | Remove notice re practice trials (to avoid confusion)
| JavaScript | mit | shamrt/jsSART,shamrt/jsSART,shamrt/jsSART |
e2d580b46ed603ede58febc6aa4b1286646d20b1 | Resources/private/js/app.js | Resources/private/js/app.js | (function($) {
$.fn.extend({
requireConfirmation: function() {
return this.each(function() {
return $(this).on('click', function(event) {
event.preventDefault();
var actionButton = $(this);
if (actionButton.is('a')) {
$('#confirmation-button').attr('href',... | (function($) {
$.fn.extend({
requireConfirmation: function() {
return this.each(function() {
return $(this).on('click', function(event) {
event.preventDefault();
var actionButton = $(this);
if (actionButton.is('a')) {
$('#confirmation-button').attr('href',... | Improve the UI of cancelling and completing an order | [Admin] Improve the UI of cancelling and completing an order
| JavaScript | mit | Sylius/SyliusUiBundle,Sylius/SyliusUiBundle |
b17d907e3d57db0991138cc30fbf481595aa39d3 | admin/public/js/onenorth.js | admin/public/js/onenorth.js | jQuery(function($) {
$('#sidebar-toggle').click(function(e) {
e.preventDefault();
$('body').toggleClass("sidebar-collapse");
});
});
| jQuery(function($) {
var path = window.location.pathname;
$('#sidebar-toggle').click(function(e) {
e.preventDefault();
$('body').toggleClass("sidebar-collapse");
});
$('.sidebar-nav a').filter(function(idx, link) {
if (link.getAttribute('href') === path) {
link.classList.add('is-active');
}
... | Check location.path against sidebar link href for active link | Check location.path against sidebar link href for active link
| JavaScript | mit | onenorth/keystone,onenorth/keystone |
342506267db9524146695a9dc4ea483fb0849f85 | client/tests/end2end/test-admin-configure-users.js | client/tests/end2end/test-admin-configure-users.js | var utils = require('./utils.js');
describe('admin add users', function() {
it('should add new users', function(done) {
browser.setLocation('admin/users');
var add_user = function(username, role, roleSelector, name, address) {
return protractor.promise.controlFlow().execute(function() {
var de... | var utils = require('./utils.js');
describe('admin add users', function() {
it('should add new users', function(done) {
browser.setLocation('admin/users');
var add_user = function(role, roleSelector, name, address) {
return protractor.promise.controlFlow().execute(function() {
var deferred = p... | Update e2e tests in relation to latest ui changes | Update e2e tests in relation to latest ui changes
| JavaScript | agpl-3.0 | vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks |
749978c98f5f7293f97df68da9162c92df977c64 | test/learning/SinonTest.js | test/learning/SinonTest.js |
define(
[
'chai',
'sinon',
'jquery'
],
function(chai, undefined, undefined) {
var assert = chai.assert;
describe('sinon', function() {
it('should be an object', function() {
assert.isObject(sinon, 'Check sinon object.');
});
describe('fakeServer', function() ... |
define(
[
'chai',
'sinon',
'jquery'
],
function(chai, undefined, undefined) {
var assert = chai.assert;
// Assertions
var assertCleanXHR = function() {
assert.isNotFunction(
XMLHttpRequest.restore,
'XMLHttpRequest lacks method `restore`.'
);
};
... | Add learning test for sinon sandbox. | Add learning test for sinon sandbox.
| JavaScript | mit | argumenta/argumenta-widgets,argumenta/argumenta-widgets |
c1bf6f63b247437ae4243d98040d4a0f78ff4b70 | Gruntfile.js | Gruntfile.js | module.exports = function (grunt) {
'use strict';
var initConfig;
// Loading external tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
// Project configuration.
initConfig = {
bower: 'bower_components',
pkg: grunt.... | module.exports = function (grunt) {
'use strict';
var initConfig;
// Loading external tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
// Project configuration.
initConfig = {
bower: 'bower_components',
pkg: grunt.... | Add a watch grunt task to use karma's autoWatch | Add a watch grunt task to use karma's autoWatch
| JavaScript | mit | deepuke/ui-select2,mufl1h/ui-select2,deepuke/ui-select2,mufl1h/ui-select2,angular-ui/ui-select2,Abbaty/ui-select2,Intilery/ui-select2 |
bce2021130131e2379a8720e4a90ca2809cd713b | app/routes/projects--get.js | app/routes/projects--get.js | 'use strict';
import Joi from 'joi';
import Boom from 'boom';
import db from '../db/';
module.exports = [
{
path: '/projects',
method: 'GET',
handler: (request, reply) => {
let {page, limit} = request;
let offset = (page - 1) * limit;
Promise.all([
db('projects').count('id'),
... | 'use strict';
import Joi from 'joi';
import Boom from 'boom';
import Promise from 'bluebird';
import db from '../db/';
import { ProjectNotFoundError } from '../utils/errors';
module.exports = [
{
path: '/projects',
method: 'GET',
handler: (request, reply) => {
let {page, limit} = request;
le... | Add file information to projects endpoints | Add file information to projects endpoints
| JavaScript | mit | WorldBank-Transport/ram-backend,WorldBank-Transport/Rural-Road-Accessibility,WorldBank-Transport/Rural-Road-Accessibility,WorldBank-Transport/ram-backend,WorldBank-Transport/Rural-Road-Accessibility,WorldBank-Transport/ram-backend |
5c721528dc820e7b0aeb7276351e47c0c9a64ebd | collections/Keys.js | collections/Keys.js | Keys = new Mongo.Collection("keys");
KeySchema = new SimpleSchema({
keyID: {
type: Number,
label: "Key ID",
min: 0
},
vCode: {
type: String,
label: "Verification Code",
regEx: /^[0-9a-zA-Z]+$/,
custom: function() {
if (this.field("keyID").isSet === false) return "keyIDMissing";
... | Keys = new Mongo.Collection("keys");
KeySchema = new SimpleSchema({
keyID: {
type: Number,
label: "Key ID",
min: 0
},
vCode: {
type: String,
label: "Verification Code",
regEx: /^[0-9a-zA-Z]+$/,
custom: function() {
if (this.field("keyID").isSet === false) return "keyIDMissing";
... | Replace Meteor.call with Meteor.apply for supposedly synchronous behavior | Replace Meteor.call with Meteor.apply for supposedly synchronous behavior
| JavaScript | mit | eve-apps/spaicheck,eve-apps/spaicheck |
5fea8764ed28371e0e8b16a3ef3a21e9fe3504f4 | Gruntfile.js | Gruntfile.js | /*
** lite-proxyserver
** Design and Development by msg Applied Technology Research
** Copyright (c) 2016 msg systems ag (http://www.msg.group/)
*/
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-connect-proxy')
grunt.loadNpmTasks('grunt-ext... | /*
** lite-proxyserver
** Design and Development by msg Applied Technology Research
** Copyright (c) 2016 msg systems ag (http://www.msg.group/)
*/
var path = require("path");
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-connect-proxy')
... | Load config relative to current dir. | Load config relative to current dir. | JavaScript | mit | msg-systems/lite-proxyserver |
333a0766b3e0cc55f57cdf25bd75a968f778f69a | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-traceur');
grunt.initConfig({
connect: {
docs: {
options: {
keepalive: true,
open: 'http://localhost:8000/docs'
}
... | module.exports = function(grunt) {
'use strict';
var host = grunt.option('host') || 'localhost';
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-traceur');
grunt.initConfig({
connect: {
docs: {
options: {
keepalive: true,
... | Allow passing of a hostname for the docs server. | Allow passing of a hostname for the docs server.
| JavaScript | mit | skatejs/skatejs,chrisdarroch/skatejs,antitoxic/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs |
57b115db17198c4e9e08c7fdeba3a77aab83415c | application/layout/index.js | application/layout/index.js | var builder = require('focus').component.builder;
var React = require('react');
var AppHeader = require('./app-header');
var stylableBehaviour = require('../../mixin/stylable');
var contentActionsMixin = {
mixins: [stylableBehaviour],
/** @inheriteddoc */
render: function renderActions() {
return (
<div... | var builder = require('focus').component.builder;
var React = require('react');
var AppHeader = require('./app-header');
var stylableBehaviour = require('../../mixin/stylable');
var contentActionsMixin = {
mixins: [stylableBehaviour],
getDefaultProps: function getDefaultLayoutProps(){
return {
AppHeader: ... | Update left menu from props. | [layout] Update left menu from props.
| JavaScript | mit | anisgh/focus-components,KleeGroup/focus-components,Bernardstanislas/focus-components,JRLK/focus-components,sebez/focus-components,get-focus/focus-components,JRLK/focus-components,JRLK/focus-components,KleeGroup/focus-components,asimsir/focus-components,Jerom138/focus-components,Ephrame/focus-components,Bernardstanislas... |
d29392a7194dfa8b016d2003b9bf7b906ace701d | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-release");
grunt.initConfig({
release: {
options: {
github: {
repo: "sebz/airvantage.js",
usernameVar: "GITHUB_USERNAME",
passwordVar: "GITHUB_PASSWORD"
... | module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-release");
grunt.initConfig({
release: {
options: {
github: {
repo: "sebz/airvantage.js",
accessTokenVar: "GITHUB_ACCESS_TOKEN"
}
}
}
... | Switch to a github access token for release process | Switch to a github access token for release process
| JavaScript | mit | sebz/airvantage.js |
1d1cd0a4edb11015ebf9ec279a8acf1be5041462 | assets/js/views/advanced.js | assets/js/views/advanced.js | $(document).ready(function() {
// Add RFC1918 addresses
$("#addrfc").click(function(e) { e.preventDefault(); advancedAdd('addrfc', e.target); });
// Add 'this host'
$("#addhost").click(function(e) { e.preventDefault(); advancedAdd('addthishost', e.target); });
// Add 'this network'
$("#addnetwork").click(funct... | $(document).ready(function() {
// Add RFC1918 addresses
$("#addrfc").click(function(e) { e.preventDefault(); advancedAdd('addrfc', e.target); });
// Add 'this host'
$("#addhost").click(function(e) { e.preventDefault(); advancedAdd('addthishost', e.target); });
// Add 'this network'
$("#addnetwork").click(funct... | Make the buttons do something when clicked | Make the buttons do something when clicked
| JavaScript | agpl-3.0 | FreePBX/firewall,FreePBX/firewall,FreePBX/firewall |
b592d659271475ee0143bba6c58aad61cd6af7cc | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['lib/**/*.js']
},
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile... | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
bin: {
src: ['bin/*.js']
},
lib: {
src: ['lib/**/*.js']
},
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.... | Fix jshint to also check the files in bin/. | Fix jshint to also check the files in bin/.
| JavaScript | mit | redwerks/ssmount |
29ed9009138b08845e4a046562d31aa9e3ea001d | app/static/js/DigitCanvas.js | app/static/js/DigitCanvas.js | 'use strict';
var Utils = require('./Utils');
function DigitCanvas(element, width, height) {
this.canvas = document.getElementById(element);
this.canvas.width = width;
this.canvas.height = height;
this.context = this.canvas.getContext('2d');
this.gridWidth = this.canvas.width/28;
this.gridHei... | 'use strict';
var Utils = require('./Utils');
function DigitCanvas(element, width, height) {
this.canvas = document.getElementById(element);
this.context = this.canvas.getContext('2d');
this.lastValue = null;
this.setSize(width, height);
}
DigitCanvas.prototype.draw = function(valueArray) {
for(... | Add resize event to digit canvas | Add resize event to digit canvas
| JavaScript | mit | starcalibre/MNIST3D,starcalibre/MNIST3D,starcalibre/MNIST3D |
5bdfcbfddf113a9572f615eee37638e89f900103 | server/models/index.js | server/models/index.js | import fs from 'fs';
import path from 'path';
import Sequelize from 'sequelize';
import config from '../../config/config';
const basename = path.basename(module.filename);
const db = {};
const sequelize = new Sequelize(config.db.database, config.db.user,
config.db.password, config.db.options);
fs
.readdirSync(__... | import fs from 'fs';
import path from 'path';
import Sequelize from 'sequelize';
import config from '../../config/config';
const basename = path.basename(module.filename);
const db = {};
let sequelize;
if (process.env.NODE_ENV === 'production') {
sequelize = new Sequelize(process.env.DATABASE_URL);
} else {
sequ... | Use connection string for production's sequelize connection | Deployment: Use connection string for production's sequelize connection
| JavaScript | apache-2.0 | andela-foladeji/dms-api |
4001b8d9042186b97d0324ce1942142fc88196a0 | bin/mini-harp.js | bin/mini-harp.js | #!/usr/local/bin/node
createMiniHarp = require("../")
var app = createMiniHarp();
var argv = require('minimist')(process.argv.slice(2));
var port = argv['port'];
if (port == undefined)
port = 4000;
// port must be a value an positive integer less than or equal to 65535
// var integerRegex = /^\d+$/;
// var parsed ... | #!/usr/local/bin/node
createMiniHarp = require("../")
var app = createMiniHarp();
var argv = require('minimist')(process.argv.slice(2));
var port = argv['port'];
if (port == undefined)
port = 4000;
// port must be a value an positive integer less than or equal to 65535
// var integerRegex = /^\d+$/;
// var parsed ... | Implement A Current Time Middleware | Implement A Current Time Middleware
| JavaScript | mit | escray/besike-nodejs-harp,escray/besike-nodejs-harp |
59bd09a2182476be78055c49ea7722499ba7158c | server/migrations/user.js | server/migrations/user.js | let mongoose = require('mongoose');
let Schema = mongoose.Schema;
let UserSchema = new Schema({
name: {
type: String,
lowercase: true,
required: true,
unique: true
},
password: {
type: String,
min: 6,
max: 50,
required: true
},
email: ... | let mongoose = require('mongoose');
let Schema = mongoose.Schema;
let UserSchema = new Schema({
name: {
type: String,
lowercase: true,
required: true,
unique: true
},
password: {
type: String,
min: 6,
max: 50,
required: true
},
email: ... | Add deleted_at key to User model | Add deleted_at key to User model
| JavaScript | mit | yujiahaol68/vue-express-boilerplate,yujiahaol68/vue-express-boilerplate |
adbd01ff29d9e02abbc4d81d631a8643f466e67b | examples/have-some-mentos.js | examples/have-some-mentos.js | var quickconnect = require('rtc-quickconnect');
var buffered = require('..');
// include the base64 encoded image data
var mentosImage = require('../test/data/dietcoke-mentos');
quickconnect('http://rtc.io/switchboard', { room: 'buffertest' })
.createDataChannel('mentos')
.once('mentos:open', function(dc, id) {
... | var quickconnect = require('rtc-quickconnect');
var buffered = require('..');
// include the base64 encoded image data
var mentosImage = require('../test/data/dietcoke-mentos');
quickconnect('https://switchboard.rtc.io/', { room: 'buffertest' })
.createDataChannel('mentos')
.once('channel:opened:mentos', function... | Update example to work with quickconnect@4 | Update example to work with quickconnect@4
| JavaScript | apache-2.0 | rtc-io/rtc-bufferedchannel |
6a4b1d6490f4ab54fa6cf070ed0902e07bb22929 | addon/components/bootstrap-power-select.js | addon/components/bootstrap-power-select.js | import Ember from 'ember';
import layout from '../templates/components/bootstrap-power-select';
import InputableMixin from '../mixins/components/inputable';
export default Ember.Component.extend(InputableMixin, {
classNames: ['form-group', 'bootstrap-input-component'],
classNameBindings: ['hasSuccess:has-success',... | import Ember from 'ember';
import layout from '../templates/components/bootstrap-power-select';
import InputableMixin from '../mixins/components/inputable';
export default Ember.Component.extend(InputableMixin, {
classNames: ['form-group', 'bootstrap-power-select-component'],
classNameBindings: ['hasSuccess:has-su... | Add power-select class to component | Add power-select class to component
| JavaScript | mit | wildland/ember-bootstrap-controls,wildland/ember-bootstrap-controls,temecom/ember-bootstrap-controls,temecom/ember-bootstrap-controls |
a725db68a9adf24f677d67e9e4e8d01925695d74 | share/spice/npm/npm.js | share/spice/npm/npm.js | function ddg_spice_npm (api_result) {
"use strict";
if (api_result.error) {
return;
}
Spice.render({
data : api_result,
force_big_header : true,
header1 : api_result.name + ' (' + api_result.version + ')',
source_name : "npmjs.org", // Mor... | function ddg_spice_npm (api_result) {
"use strict";
if (api_result.error) {
return;
}
Spice.render({
data : api_result,
force_big_header : true,
header1 : api_result.name + ' (' + api_result.version + ')',
source_name : "npmjs.org", // More at ...
source_u... | Fix whitespace tabs-versus-spaces conflict in Npm Spice. | Fix whitespace tabs-versus-spaces conflict in Npm Spice.
| JavaScript | apache-2.0 | GrandpaCardigan/zeroclickinfo-spice,brianrisk/zeroclickinfo-spice,digit4lfa1l/zeroclickinfo-spice,gautamkrishnar/zeroclickinfo-spice,bdjnk/zeroclickinfo-spice,Kakkoroid/zeroclickinfo-spice,rmad17/zeroclickinfo-spice,Kr1tya3/zeroclickinfo-spice,rmad17/zeroclickinfo-spice,mayo/zeroclickinfo-spice,ColasBroux/zeroclickinfo... |
ffdf0ebd099534266c41b8e3b17140c448d0ad97 | app/assets/javascripts/pageflow/editor/views/file_meta_data_item_value_view.js | app/assets/javascripts/pageflow/editor/views/file_meta_data_item_value_view.js | /**
* Base class for views used as `valueView` for file type meta data
* attributes.
*
* @param {string} [options.name]
* Name of the meta data item used in translation keys.
*
* @param {string} [options.settingsDialogTabLink]
* Dispaly a link to open the specified tab of the file settings
* dialog.
*
... | /**
* Base class for views used as `valueView` for file type meta data
* attributes.
*
* @param {string} [options.name]
* Name of the meta data item used in translation keys.
*
* @param {string} [options.settingsDialogTabLink]
* Dispaly a link to open the specified tab of the file settings
* dialog.
*
... | Switch off file meta data edit links when uploading | Switch off file meta data edit links when uploading
| JavaScript | mit | tf/pageflow,Modularfield/pageflow,codevise/pageflow,tf/pageflow,Modularfield/pageflow,tf/pageflow,codevise/pageflow,codevise/pageflow,tf/pageflow,Modularfield/pageflow,Modularfield/pageflow,codevise/pageflow |
48eb93339ab5ba759d1926431f69f86dd55fbb3b | tests/integration/components/animate-on-change-test.js | tests/integration/components/animate-on-change-test.js | import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('animate-on-change', 'Integration | Component | animate on property change', {
integration: true
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'val... | import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('animate-on-change', 'Integration | Component | animate on property change', {
integration: true
});
test('it renders', function (assert) {
assert.expect(2);
this.render(hbs`{{animate-on-cha... | Add integration tests for `animate-on-change` | Add integration tests for `animate-on-change`
Summary:
Add integration tests for the `animate-on-change` component.
Depends on D3916.
Reviewers: fdanielsen, asteinlein
Reviewed By: asteinlein
Differential Revision: http://dev.e5r.no/D3918
| JavaScript | mit | eliksir/ember-css-animation-triggers,eliksir/ember-css-animation-triggers |
620fd7ab8624432b17b0254fb35fd49fbbf6dc63 | polyfills/Object/getOwnPropertyNames/polyfill.js | polyfills/Object/getOwnPropertyNames/polyfill.js | Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
var buffer = [];
var key;
// Non-enumerable properties cannot be discovered but can be checked for by name.
// Define those used internally by JS to allow an incomplete solution
var commonProps = ['length', "name", "arguments", "caller", "prototy... | Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
var buffer = [];
var key;
// Non-enumerable properties cannot be discovered but can be checked for by name.
// Define those used internally by JS to allow an incomplete solution
var commonProps = ['length', "name", "arguments", "caller", "prototy... | Make window.hasOwnProperty work in IE8. | Make window.hasOwnProperty work in IE8.
| JavaScript | mit | jonathan-fielding/polyfill-service,mcshaz/polyfill-service,kdzwinel/polyfill-service,kdzwinel/polyfill-service,mcshaz/polyfill-service,jonathan-fielding/polyfill-service,jonathan-fielding/polyfill-service,JakeChampion/polyfill-service,kdzwinel/polyfill-service,mcshaz/polyfill-service,JakeChampion/polyfill-service |
68e172d80863e43428352f89e0e2ceb66de2c2d0 | migrations/20190308075713-add-archivedAt-column-to-collective.js | migrations/20190308075713-add-archivedAt-column-to-collective.js | 'use strict';
const colName = 'archivedAt';
/**
* Add a `archivedAt` column to collectives.
*/
module.exports = {
up: async (queryInterface, Sequelize) => {
const colParams = { type: Sequelize.DATE };
await queryInterface.addColumn('Collectives', colName, colParams);
await queryInterface.addColumn('Co... | 'use strict';
const colName = 'archivedAt';
/**
* Add a `archivedAt` column to collectives.
*/
module.exports = {
up: async (queryInterface, Sequelize) => {
const colParams = { type: Sequelize.DATE };
await queryInterface.addColumn('Collectives', colName, colParams);
},
down: async queryInterface => ... | Remove addColumn and removeColumn for archiveAt in collectiveHistories | Remove addColumn and removeColumn for archiveAt in collectiveHistories
I'm removing this because I just realized archiveAt already exist in collectiveHistories table
| JavaScript | mit | OpenCollective/opencollective-api,OpenCollective/opencollective-api,OpenCollective/opencollective-api |
312d10a9d6a23628fce90eb98eb75f1a4a19b269 | client/module/wikiResponseExtractor.js | client/module/wikiResponseExtractor.js | function removeDuplicateAliases(aliases){
return aliases.map(alias => {
return alias.toLowerCase();
}).filter((alias, index, self) => {
return self.indexOf(alias) === index;
});
}
module.exports = {
extractDescription: page => {
let description = '';
if(page.terms && page.terms.description)
... | function removeDuplicateAliases(aliases) {
return aliases
.map(alias => alias.toLowerCase())
.filter((alias, index, self) => self.indexOf(alias === index));
}
function extractDescription(page) {
let description = '';
if (page.terms && page.terms.description) {
description = page.terms.description[0]... | Update extractor to export only one function, which uses previously used functions together | Update extractor to export only one function, which uses previously used functions together
| JavaScript | mit | j-oliver/react-example,j-oliver/react-example |
3ac755bd489b649ccac525f04d319e876dde9960 | api/index.js | api/index.js | 'use strict';
require('app-module-path').addPath('./');
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
const config = require('./config');
const Hapi = require('hapi');
const server = new Hapi.Server({ app: config });
server.connection({ port: config.port });
server.register([
{register: requir... | 'use strict';
require('app-module-path').addPath('./');
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
const config = require('./config');
const Hapi = require('hapi');
const server = new Hapi.Server({ app: config });
server.connection({ port: config.port, routes: { cors: true }});
server.register(... | Enable CORS in the proxy | Enable CORS in the proxy
| JavaScript | mit | locnguyen/meetarang,locnguyen/meetarang |
2ab871459e668496e6a187a961d38d2810c13f51 | packages/components/containers/addresses/helper.js | packages/components/containers/addresses/helper.js | import { ADDRESS_STATUS, ADDRESS_TYPE, MEMBER_PRIVATE, RECEIVE_ADDRESS } from 'proton-shared/lib/constants';
const { TYPE_ORIGINAL, TYPE_CUSTOM_DOMAIN, TYPE_PREMIUM } = ADDRESS_TYPE;
const { READABLE, UNREADABLE } = MEMBER_PRIVATE;
export const getStatus = ({ address: { Status, Receive, DomainID, HasKeys }, i }) => {... | import { ADDRESS_STATUS, ADDRESS_TYPE, MEMBER_PRIVATE, RECEIVE_ADDRESS } from 'proton-shared/lib/constants';
const { TYPE_ORIGINAL, TYPE_CUSTOM_DOMAIN, TYPE_PREMIUM } = ADDRESS_TYPE;
const { READABLE } = MEMBER_PRIVATE;
export const getStatus = ({ address: { Status, Receive, DomainID, HasKeys }, i }) => {
const i... | Fix condition for when keys for self can be generated | Fix condition for when keys for self can be generated
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
f2ac422cb506bd09a5d9bbbe37f9a7e79b44f799 | gatsby-node.js | gatsby-node.js | let fetch = require('node-fetch');
const getRepository = async (slug) => {
const response = await fetch(`https://api.github.com/repos/mirego/${slug}`, {
headers: {
Authorization: `token ${process.env.GITHUB_TOKEN}`,
},
});
return await response.json();
};
exports.sourceNodes = async ({actions, cr... | let fetch = require('node-fetch');
const getRepository = async (slug) => {
const response = await fetch(`https://api.github.com/repos/mirego/${slug}`, {
headers: {
Authorization: `token ${process.env.GITHUB_TOKEN}`,
},
});
return await response.json();
};
exports.sourceNodes = async ({actions, cr... | Use Promise.all to fetch project data in parallel | Use Promise.all to fetch project data in parallel
| JavaScript | bsd-3-clause | mirego/mirego-open-web,mirego/mirego-open-web |
185e0d81b6b688b04c27e5b980ff86b6af208899 | scripts/prepublish.js | scripts/prepublish.js | 'use strict';
const fs = require('fs');
const path = require('path');
const regex = /module\.exports = punycode;/;
const sourceContents = fs.readFileSync(path.resolve(__dirname, '../punycode.js'), 'utf-8');
if (!regex.test(sourceContents)) {
throw new Error('The underlying library has changed. Please update the pr... | 'use strict';
const fs = require('fs');
const path = require('path');
const regex = /module\.exports = punycode;/;
const output = 'export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;';
const sourceContents = fs.readFileSync(path.resolve(__dirname, '../punycode.js'), 'utf-... | Add support for named exports | Add support for named exports
Closes #63. | JavaScript | mit | bestiejs/punycode.js |
ee0e37a1e57808bd148b02d38b0d28d6517f00bd | components/bullet/Bullet.js | components/bullet/Bullet.js | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Box from '../box';
import cx from 'classnames';
import theme from './theme.css';
class Bullet extends PureComponent {
static propTypes = {
className: PropTypes.string,
color: PropTypes.oneOf(['neutral', 'mint', 'aqua', '... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Box from '../box';
import cx from 'classnames';
import theme from './theme.css';
class Bullet extends PureComponent {
static propTypes = {
className: PropTypes.string,
color: PropTypes.oneOf(['neutral', 'mint', 'aqua', '... | Use a span as the element | Use a span as the element
| JavaScript | mit | teamleadercrm/teamleader-ui |
ad5fa17cc1f2287ca1dea2e3c03523a7f6e5a93e | src/core/permissionDirective.js | src/core/permissionDirective.js | (function () {
'use strict';
/**
* Show/hide elements based on provided permissions/roles
*
* @example
* <div permission only="'USER'"></div>
* <div permission only="['USER','ADMIN']" except="'MANAGER'"></div>
* <div permission except="'MANAGER'"></div>
*/
angular
.module('permission')
... | (function () {
'use strict';
/**
* Show/hide elements based on provided permissions/roles
*
* @example
* <div permission only="'USER'"></div>
* <div permission only="['USER','ADMIN']" except="'MANAGER'"></div>
* <div permission except="'MANAGER'"></div>
*/
angular
.module('permission')
... | Add isolate scope to permission directive. | Add isolate scope to permission directive.
| JavaScript | mit | Narzerus/angular-permission,Narzerus/angular-permission |
23e6ba1617c5f9f8e990e2e5e739fd330e0546e9 | app/index.js | app/index.js | import React from 'react';
import { render } from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import Root from './containers/Root';
import { configureStore, history } from './store/configureStore';
import './app.global.css';
import { ipcRenderer } from 'electron';
ipcRenderer.on('ConfigApp', (event, ... | import React from 'react';
import { render } from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import Root from './containers/Root';
import { configureStore, history } from './store/configureStore';
import './app.global.css';
import { ipcRenderer } from 'electron';
const store = configureStore({});
r... | Remove fermion.config.json event logic applying available components to store | Remove fermion.config.json event logic applying available components to store
| JavaScript | mit | FermORG/FermionJS,FermORG/FermionJS |
29fe72cf753ca904fe9c38c5548405e055f4eb65 | config-sample/mongo.init.js | config-sample/mongo.init.js | // WARNING This script creates MongoDB users and their permissions
// as required by TresDB development. Do not use this script in production
// without careful modification of all the credentials below.
// NOTE This script needs a MongoDB instance without --auth flag
// to be running and listening the default port.
co... | // WARNING This script creates MongoDB users and their permissions
// as required by TresDB development. Do not use this script in production
// without careful modification of all the credentials below.
// NOTE This script needs a MongoDB instance without --auth flag
// to be running and listening the default port.
co... | Add backup role to enable mongodump | Add backup role to enable mongodump
| JavaScript | mit | axelpale/tresdb,axelpale/tresdb |
931c7e9d6e646910c51fe9d8ec2ee129fb8bb952 | app/intro.js | app/intro.js | onload = function() {
var feedUrlNode = document.getElementById('feed-url');
feedUrlNode.focus();
document.getElementById('intent-form').onsubmit = function(event) {
var feedUrl = feedUrlNode.value;
var intent = new WebKitIntent(
'http://webintents.org/view', 'application/atom+xml', feedUrl);
... | onload = function() {
var feedUrlNode = document.getElementById('feed-url');
feedUrlNode.focus();
document.getElementById('intent-form').onsubmit = function(event) {
var feedUrl = feedUrlNode.value;
var intent = new WebKitIntent({
action: 'http://webintents.org/view',
type: 'application/atom... | Use an explicit intent when we want to invoke ourselves. | Use an explicit intent when we want to invoke ourselves.
| JavaScript | apache-2.0 | mihaip/feed-intent-viewer |
08a1ce91d8d85f42c4d8f300cc1708915f73e8c6 | test/test-parser.js | test/test-parser.js |
var vows = require('vows'),
expect = require('expect.js'),
types = require('../lib/types'),
AST = require('../lib/ast'),
parseAndWalk = require('./helper').parseAndWalk
describe('Parser', function () {
describe('given a var declaration', function () {
it('should par... |
var vows = require('vows'),
expect = require('expect.js'),
types = require('../lib/types'),
AST = require('../lib/ast'),
parseAndWalk = require('./helper').parseAndWalk
describe('Parser', function () {
describe('given a var declaration', function () {
it('should par... | Fix in parser test for instances | Fix in parser test for instances
| JavaScript | bsd-3-clause | dirk/hummingbird,dirk/hummingbird,dirk/hummingbird |
f24695765f0fd27e97392fc08d7e6353cd07210b | source/internal/_dispatchable.js | source/internal/_dispatchable.js | import _isArray from './_isArray.js';
import _isTransformer from './_isTransformer.js';
/**
* Returns a function that dispatches with different strategies based on the
* object in list position (last argument). If it is an array, executes [fn].
* Otherwise, if it has a function with one of the given method names, ... | import _isArray from './_isArray.js';
import _isTransformer from './_isTransformer.js';
/**
* Returns a function that dispatches with different strategies based on the
* object in list position (last argument). If it is an array, executes [fn].
* Otherwise, if it has a function with one of the given method names, ... | Copy arguments only when necessary | Copy arguments only when necessary
| JavaScript | mit | davidchambers/ramda,CrossEye/ramda,davidchambers/ramda,ramda/ramda,Bradcomp/ramda,Bradcomp/ramda,ramda/ramda,ramda/ramda,CrossEye/ramda,CrossEye/ramda |
467dd1021709d05ddaa5e240677e91565f9ad255 | renderer-process/scrubVideoToTimestamp.js | renderer-process/scrubVideoToTimestamp.js | const moment = require('moment')
const scrubVideoToTimestamp = function () {
let player = document.querySelector('.video-js')
const timeToGoTo = moment.duration(this.innerHTML).asSeconds()
console.log(this.innerHTML)
console.log(player)
if (player !== null && player.duration) {
if (timeToGoTo >= 0 && ti... | const moment = require('moment')
const scrubVideoToTimestamp = function () {
let player = document.getElementsByTagName('video')[0]
let timestamp = this.innerHTML
const timeToGoTo = moment.duration({
seconds: timestamp.split(':')[1],
hours: timestamp.split(':')[0]
}).asSeconds()
console.log(timestam... | Make timestamps seek video to their timecodes | Make timestamps seek video to their timecodes
| JavaScript | agpl-3.0 | briandk/transcriptase,briandk/transcriptase |
e846f504c9a69e191abf34bf46d730dd0b2357f6 | packages/ember-data/lib/system/application_ext.js | packages/ember-data/lib/system/application_ext.js | var set = Ember.set;
Ember.onLoad('Ember.Application', function(Application) {
Application.registerInjection({
name: "store",
before: "controllers",
injection: function(app, stateManager, property) {
if (property === 'Store') {
set(stateManager, 'store', app[property].create());
}
... | var set = Ember.set;
Ember.onLoad('Ember.Application', function(Application) {
Application.registerInjection({
name: "store",
before: "controllers",
injection: function(app, stateManager, property) {
if (!stateManager) { return; }
if (property === 'Store') {
set(stateManager, 'store'... | Support apps without a router | Support apps without a router
| JavaScript | mit | simaob/data,pdud/data,Turbo87/ember-data,jmurphyau/data,minasmart/data,pdud/data,vikram7/data,wecc/data,nickiaconis/data,sammcgrail/data,Kuzirashi/data,k-fish/data,Globegitter/ember-data-evolution,sandstrom/ember-data,davidpett/data,mphasize/data,sebweaver/data,PrecisionNutrition/data,fsmanuel/data,H1D/data,splattne/da... |
8fcdeb16de24ff215a9d39e3e611578bcc1927c1 | karma.conf.js | karma.conf.js | var webpackConfig = require('./webpack.config.js');
webpackConfig.devtool = 'inline-source-map';
webpackConfig.module.rules.push({
test: /\.ts$/,
enforce: 'post',
loader: 'istanbul-instrumenter-loader',
exclude: [
'node_modules',
/\.test\.ts$/
]
});
module.exports = function(config)... | var webpackConfig = require('./webpack.config.js');
webpackConfig.devtool = 'inline-source-map';
webpackConfig.module.rules.push({
test: /\.ts$/,
enforce: 'post',
loader: 'istanbul-instrumenter-loader',
exclude: [
'node_modules',
/\.test\.ts$/
]
});
module.exports = function(config)... | Enable console logs in karma tests | Enable console logs in karma tests
| JavaScript | mit | jledentu/konigsberg,jledentu/konigsberg |
ef78cbd9b1714d9335741a266610c930abe904e7 | lib/util/getVerification.js | lib/util/getVerification.js | // Dependencies
var url = require('url');
// Includes
var http = require('./http.js').func;
var getHash = require('./getHash.js').func;
var getVerificationInputs = require('./getVerificationInputs.js').func;
var cache = require('../cache');
// Args
exports.required = ['url'];
exports.optional = ['ignoreCache', 'getBo... | // Dependencies
var url = require('url');
// Includes
var http = require('./http.js').func;
var getHash = require('./getHash.js').func;
var getVerificationInputs = require('./getVerificationInputs.js').func;
var cache = require('../cache');
// Args
exports.required = ['url'];
exports.optional = ['ignoreCache', 'getBo... | Return __RequestVerificationToken cookie if it exists | Return __RequestVerificationToken cookie if it exists
| JavaScript | mit | sentanos/roblox-js,FroastJ/roblox-js |
6eabfd977ad36ff5edcacd1a1fc8b0cce6c11341 | config/locals.js | config/locals.js | 'use strict';
// Load environment variables from .env file, where API keys and passwords are configured.
const dotenv = require('dotenv');
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = 'development';
}
dotenv.config({ path: `.env.${process.env.NODE_ENV}` });
const {
MONGO_HOST,
MONGO_PORT,
MONGO_USER,
... | 'use strict';
// Load environment variables from .env file, where API keys and passwords are configured.
const dotenv = require('dotenv');
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = 'development';
}
dotenv.config({ path: `.env.${process.env.NODE_ENV}` });
const {
MONGO_HOST,
MONGO_PORT,
MONGO_USER,
... | Add support to custom mongo database name | Add support to custom mongo database name
| JavaScript | mit | gcriva/gcriva-backend |
02cff9af59f0eabc02114ba61d43394da2779988 | src/routes/auth-whoami.js | src/routes/auth-whoami.js | export default class {
constructor(auth) {
this.auth = auth;
}
/*
* npm whoami sends its token to the server and requests a username
* This route verifies which user is logged in and sends back its username
*/
process(httpRequest, httpResponse) {
let token = httpRequest.headers.authorization.sub... | export default class {
constructor(auth) {
this.auth = auth;
}
/*
* npm whoami sends its token to the server and requests a username
* This route verifies which user is logged in and sends back its username
*/
process(httpRequest, httpResponse) {
let token = httpRequest.headers.authorization.sub... | Move to using promises in auth-user-whoami | Move to using promises in auth-user-whoami
| JavaScript | mit | genkgo/ap-npm |
f7834ef703ee7b03c9efb401e4b98ad59c8266af | src/default_options.js | src/default_options.js | /**
* Provides default values and verifies that requied values are set.
*/
var DefaultOptions = {}
DefaultOptions.options = {
cacheDir: null,
port: process.env.MOCKINGJAYS_PORT || 9000,
serverBaseUrl: null
}
DefaultOptions.merge = function(options) {
var defaults = this.options;
// Directory where the cac... | /**
* Provides default values and verifies that requied values are set.
*/
var DefaultOptions = function() {}
DefaultOptions.prototype.options = {
cacheDir: null,
port: process.env.MOCKINGJAYS_PORT || 9000,
serverBaseUrl: null
}
DefaultOptions.prototype.merge = function(options) {
var defaults = this.option... | Make Default Options a Class | Make Default Options a Class
| JavaScript | apache-2.0 | blad/mockingjays |
37728c00b535793d9f6316acacacabf46ff66f92 | src/leaflet.zoomcss.js | src/leaflet.zoomcss.js | /*
Leaflet.ZoomCSS
Adding a css class on the map div element, so other elements, such as markers can be automatically styled based on the zoom level using css instead of javascript
Copyright (c) 2014, Dag Jomar Mersland, dagjomar@gmail.com, @dagjomar
https://github.com/dagjomar/Leaflet.ZoomCSS
*/
L.Map.merge... | /*
Leaflet.ZoomCSS
Adding a css class on the map div element, so other elements, such as markers can be automatically styled based on the zoom level using css instead of javascript
Copyright (c) 2014, Dag Jomar Mersland, dagjomar@gmail.com, @dagjomar
https://github.com/dagjomar/Leaflet.ZoomCSS
*/
L.Map.merge... | Set class on page load. | Set class on page load.
| JavaScript | mit | dagjomar/Leaflet.ZoomCSS |
8584064fa6d73be8a097ff8b35f96dd801bc08b8 | bin/build.js | bin/build.js | #!/usr/bin/env node
const fs = require('fs')
const path = require('path')
const handlebars = require('handlebars')
const workingDir = process.cwd()
const output = workingDir + '/dist'
const tags = {
greeting: 'Hello!'
}
try {
const files = fs.readdirSync(workingDir + '/pages')
} catch (err) {
throw err
}
fil... | #!/usr/bin/env node
const fs = require('fs')
const path = require('path')
const handlebars = require('handlebars')
const workingDir = process.cwd()
const output = workingDir + '/dist'
const tags = {
greeting: 'Hello!'
}
try {
const files = fs.readdirSync(workingDir + '/pages')
} catch (err) {
throw err
}
fun... | Use a promise chain to be sure that everything's built | Use a promise chain to be sure that everything's built
| JavaScript | mit | leo/cory,leo/cory |
3f015e0f06fb59cafcebb980b47172cddff4ff3b | lib/pipenv.js | lib/pipenv.js | const fse = require('fs-extra');
const path = require('path');
const {spawnSync} = require('child_process');
/**
* pipenv install
* @return {Promise}
*/
function pipfileToRequirements() {
if (!this.options.usePipenv || !fse.existsSync(path.join(this.servicePath, 'Pipfile')))
return;
this.serverless.cli.... | const fse = require('fs-extra');
const path = require('path');
const {spawnSync} = require('child_process');
/**
* pipenv install
* @return {Promise}
*/
function pipfileToRequirements() {
if (!this.options.usePipenv || !fse.existsSync(path.join(this.servicePath, 'Pipfile')))
return;
this.serverless.cli.... | Fix bug when a deploymentBucket is used | Fix bug when a deploymentBucket is used | JavaScript | mit | UnitedIncome/serverless-python-requirements,UnitedIncome/serverless-python-requirements |
f1da1ad6bf2b72e3a9cc1e4cdc9a8641c13cb155 | api/model/auth/fbToken.js | api/model/auth/fbToken.js | var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var FBToken = new Schema({
facebookId: {
type: String,
required: true,
unique: true
},
token: {
type: String,
unique: true,
required: true
},
scopes: {
type: [String],
required: true
},
expi... | var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var FBToken = new Schema({
facebookId: {
type: String,
required: true
},
token: {
type: String,
unique: true
},
scopes: {
type: [String],
required: true
},
expires: {
type: Date,
required:... | Remove required on token properties | Remove required on token properties
| JavaScript | mit | justinsacbibit/omi,justinsacbibit/omi,justinsacbibit/omi |
9b4d3522dc6a955c0af660f3b167f7a9b61443ea | app/components/map/map.js | app/components/map/map.js | 'use strict';
angular.module('okcCoffee.map', [
'okcCoffee.map.map-directive'
])
.controller('MapCtrl', ['$scope', function($scope){
$scope.mapfilter = null;
$scope.$watch('mapfilter', function(newVal, oldVal){
$scope.$emit('filterMap', newVal);
});
$scope.zoomAll = function(){
$scope.$emit('zoomMap... | 'use strict';
angular.module('okcCoffee.map', [
'okcCoffee.map.map-directive'
])
.controller('MapCtrl', ['$scope', function($scope){
$scope.mapfilter = null;
$scope.$watch('mapfilter', function(newVal, oldVal){
$scope.$emit('filterMap', newVal);
});
$scope.zoomAll = function(){
$scope.$emit('zoomMap... | Reset input when you remove filters. | Reset input when you remove filters.
| JavaScript | mit | darrenjaworski/coffee-lovers-okc-app,darrenjaworski/coffee-lovers-okc-app |
2de9eb510c6ece5f666c94544097f1d2c51e8a88 | lib/markdown-table-editor.js | lib/markdown-table-editor.js | 'use babel';
import Controller from './controller.js';
export default {
controler: null,
activate() {
this.controller = new Controller();
},
deactivate() {
this.controller.destroy();
},
serialize() {
}
};
| 'use babel';
import Controller from './controller.js';
class MarkdownTableEditor {
constructor() {
this.controller = null;
}
activate() {
this.controller = new Controller();
}
deactivate() {
this.controller.destroy();
}
serialize() {
}
}
export default new MarkdownTableEditor();
| Define main module as a class | Define main module as a class
| JavaScript | mit | susisu/markdown-table-editor |
2fc65e1d053b20597c9affa93fd7aa41756097ec | app/js/views/init-view.js | app/js/views/init-view.js | 'use strict';
var Backbone = require('backbone');
var $ = require('jquery');
Backbone.$ = $;
var InitView = Backbone.View.extend({
tagName: 'div',
initialize: function() {
this.render();
},
render: function() {
// Add logic for finding current location!
// If current location exists, set #start to it; othe... | 'use strict';
var Backbone = require('backbone');
var $ = require('jquery');
Backbone.$ = $;
// Test business collection
var BusinessCollection = require('../collections/business-collection');
var testCollection = new BusinessCollection();
testCollection.fetch();
var InitView = Backbone.View.extend({
tagName: 'div'... | Add quick test of Backbone access to API endpoint | Add quick test of Backbone access to API endpoint
| JavaScript | mit | Localhost3000/along-the-way |
f10a833869c2382b141532e073dba416a8183c06 | src/components/control-strip-defaults-component.js | src/components/control-strip-defaults-component.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
// Prevents the defaultValue/defaultChecked fields from rendering with value/checked
class ComponentWrapper extends Component {
render() {
/* eslint-disable no-unused-vars */
const {
defaultValue,
defaultChecked,
... | import React, { Component } from 'react';
import PropTypes from 'prop-types';
// Prevents the defaultValue/defaultChecked fields from rendering with value/checked
class ComponentWrapper extends Component {
render() {
/* eslint-disable no-unused-vars */
const {
defaultValue,
defaultChecked,
... | Add value fallback to empty string | Add value fallback to empty string
| JavaScript | mit | davidkpiano/react-redux-form,davidkpiano/redux-simple-form |
b81b22cf17d55bd4014921b74bb9f6e2a8373717 | lib/util/resolve.js | lib/util/resolve.js | 'use strict'
module.exports = resolve
function resolve(h, url) {
if (url === null || url === undefined) {
return ''
}
return h.frozenBaseURL ? String(new URL(url, h.frozenBaseURL)) : url
}
| 'use strict'
module.exports = resolve
function resolve(h, url) {
if (url === null || url === undefined) {
return ''
}
if (h.frozenBaseURL && typeof URL !== 'undefined') {
return String(new URL(url, h.frozenBaseURL))
}
return url
}
| Fix error when using `<base>` without `URL` | Fix error when using `<base>` without `URL`
Related to cf92230.
| JavaScript | mit | syntax-tree/hast-util-to-mdast |
b96df3fe387e767c211a39540b4e0499f44738d8 | bs-config.js | bs-config.js | module.exports = {
port: 8082,
files: [
'coverage/**/*.html',
],
snippetOptions: {
rule: {
match: /(<!DOCTYPE html>|^)/i,
fn: function (snippet, match) {
return match + '\n' + snippet;
},
},
},
}; | module.exports = {
port: 8082,
files: [
'coverage/**/*.html',
],
server: {
baseDir: 'coverage',
},
snippetOptions: {
rule: {
match: /(<!DOCTYPE html>|^)/i,
fn: function (snippet, match) {
return match + '\n' + snippet;
},
},
},
}; | Set coverage/ as baseDir for lite-server | Set coverage/ as baseDir for lite-server
| JavaScript | bsd-3-clause | cumulous/web,cumulous/web,cumulous/web,cumulous/web |
04ac35b3bb126d1677b246aca22c7e99c4935fde | lib/file/track.js | lib/file/track.js | 'use strict';
var id = 0;
/**
* Track
*
* Represent a Standard MIDI file track
*
* @constructor
* @param {Array<Event>} events - List of events in the track
*/
function Track(events) {
this.id = 'TRACK_' + id;
if (events === undefined || events === null) {
this.events = [];
} else {
... | 'use strict';
var id = 0;
/**
* Track
*
* Represent a Standard MIDI file track
*
* @constructor
* @param {Array<Event>} events - List of events in the track
*/
function Track(events) {
this.id = 'TRACK_' + id;
if (arguments.length > 1) {
this.events = [].slice.call(arguments);
} else i... | Allow passing events list as args list | :bulb: Allow passing events list as args list
| JavaScript | mit | MattouFP/midijs,eriser/midijs,FlatIO/midijs,matteodelabre/midijs,corentingurtner/midijs |
b4849092ba8680ce395e1a4768363f24655bc831 | data/fix-menus.js | data/fix-menus.js | var classes = ["MainMenuButton", "MainMenuDDButton"];
for (var i=0; i<classes.length; i++) {
var elements = document.getElementsByClassName(classes[i]);
for (var j=0; j<elements.length; j++) {
if (typeof(elements[j].href) !== 'undefined') {
elements[j].href = elements[j].href.replace( /javascript:MenuClick\('(.*... | var elements = document.querySelectorAll('.MainMenuButton, .MainMenuDDButton');
for (var j=0; j<elements.length; j++) {
if (typeof(elements[j].href) !== 'undefined') {
elements[j].href = elements[j].href.replace( /javascript:MenuClick\('(.*)'\)/, "$1");
}
}
| Implement review feedback: use querySelectorAll() | Implement review feedback: use querySelectorAll()
| JavaScript | mit | diocles/contact-creator-bugfixes |
d13b0e0614b7961fb7bfdfef245fedf8c4a7dd5f | src/reducer/loading.js | src/reducer/loading.js | import { FETCH_START, FETCH_END, FETCH_ERROR, FETCH_CANCEL } from '../actions/fetchActions';
export default (previousState = 0, { type }) => {
switch (type) {
case FETCH_START:
return previousState + 1;
case FETCH_END:
case FETCH_ERROR:
case FETCH_CANCEL:
return previousState - 1;
... | import { FETCH_START, FETCH_END, FETCH_ERROR, FETCH_CANCEL } from '../actions/fetchActions';
export default (previousState = 0, { type }) => {
switch (type) {
case FETCH_START:
return previousState + 1;
case FETCH_END:
case FETCH_ERROR:
case FETCH_CANCEL:
return Math.max(previousSta... | Fix a bug where loader disappears when navigating too fast | Fix a bug where loader disappears when navigating too fast
| JavaScript | mit | matteolc/admin-on-rest,marmelab/admin-on-rest,matteolc/admin-on-rest,marmelab/admin-on-rest |
990d2a8bf44baad0ee5d3d2d1550c77a2e42766b | documentation/.eslintrc.js | documentation/.eslintrc.js | module.exports = {
root: false,
plugins: ['markdown'],
globals: {
expect: false
}
};
| module.exports = {
root: false,
plugins: ['markdown'],
globals: {
expect: false
},
rules: {
'no-unused-vars': 0,
'no-undef': 0
}
};
| Disable the no-unused-vars and no-undef rules | Disable the no-unused-vars and no-undef rules
Avoid errors from the snippets being linted independently
| JavaScript | mit | unexpectedjs/unexpected |
32b521bfe29660043f72bc97f377f1cbb3663b61 | src/howler_integration.js | src/howler_integration.js | const Howl = require('howler').Howl;
module.exports = {
initialize(soundsData) {
let soundOptions;
const soundNames = Object.getOwnPropertyNames(soundsData);
this.sounds = soundNames.reduce((memo, name) => {
soundOptions = soundsData[name];
// Allow strings instead of objects, for when all... | const Howl = require('howler').Howl;
module.exports = {
initialize(soundsData) {
let soundOptions;
const soundNames = Object.getOwnPropertyNames(soundsData);
this.sounds = soundNames.reduce((memo, name) => {
soundOptions = soundsData[name];
// Allow strings instead of objects, for when all... | Refactor out Object.assign in favor of { ...merge } | Refactor out Object.assign in favor of { ...merge }
| JavaScript | mit | joshwcomeau/redux-sounds,joshwcomeau/redux-sounds,joshwcomeau/redux-sounds |
32122486def2364c4d6106853057ee74f589040c | public/app/ui/pages/search/SearchMapper.js | public/app/ui/pages/search/SearchMapper.js | (function () {
'use strict';
define(
[
'lodash',
'knockout'
],
function (_, ko) {
return function (selectedSearchTypeObservable, resultFieldsObservable, detailUrlTemplate) {
return {
mapType: function (searchType) {... | (function () {
'use strict';
define(
[
'lodash',
'knockout'
],
function (_, ko) {
return function (selectedSearchTypeObservable, resultFieldsObservable, detailUrlTemplate) {
return {
mapType: function (searchType) {... | Add default fallback to mapping logic. | Add default fallback to mapping logic.
| JavaScript | mit | rwahs/research-frontend,rwahs/research-frontend |
a0a050cd1799553a3dc8c9fbb213e38b383691e5 | website/src/app/models/api/accounts-api.service.js | website/src/app/models/api/accounts-api.service.js | class AccountsAPIService {
/*@ngInject*/
constructor(apiService, Restangular, toast) {
this.apiService = apiService;
this.Restangular = Restangular;
this.toast = toast;
}
createAccount(name, email, password) {
return this.Restangular.one('v3').one('createNewUser').custom... | class AccountsAPIService {
/*@ngInject*/
constructor(apiService, Restangular, toast) {
this.apiService = apiService;
this.Restangular = Restangular;
this.toast = toast;
}
createAccount(name, email, password) {
return this.Restangular.one('v3').one('createNewUser').custom... | Move mcapid calls to top of api to make it easier to identify REST routes that need to be replaced | Move mcapid calls to top of api to make it easier to identify REST routes that need to be replaced
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
8154f2832776f432bfc36bb9d3bbe0a3a4a60cf1 | src/components/Scheme4.js | src/components/Scheme4.js | import React, { Component } from 'react';
import Threading from './Threading';
import Weave from './Weave';
import TieUp from './TieUp';
import Treadling from './Treadling';
import '../styles/Scheme4.css';
class Scheme4 extends Component {
render() {
return (
<div className='Scheme4'>
<span class... | import React, { Component } from 'react';
import { connect } from 'react-redux';
import {weaveOn, weaveOff, threadingOn, threadingOff} from '../actions/scheme4';
import Threading from './Threading';
import Weave from './Weave';
import TieUp from './TieUp';
import Treadling from './Treadling';
import '../styles/Scheme... | Make this component more smarter | Make this component more smarter
| JavaScript | mit | nobus/weaver,nobus/weaver |
fcf516550e10a1a5ad7fea9dd491b91acb6e4fef | src/urlQueryDecoder.js | src/urlQueryDecoder.js | import { decode } from './serialize';
/**
* Decodes a query based on the config. It compares against cached values to see
* if decoding is necessary or if it can reuse old values.
*
* @param {Object} query The query object (typically from props.location.query)
*
* @return {Object} the decoded values `{ key: deco... | import { decode } from './serialize';
/**
* Decodes a query based on the config. It compares against cached values to see
* if decoding is necessary or if it can reuse old values.
*
* @param {Object} query The query object (typically from props.location.query)
*
* @return {Object} the decoded values `{ key: deco... | Validate works on decoded values now | Validate works on decoded values now
| JavaScript | mit | pbeshai/react-url-query |
97cba7f88504cbcd588c7d2eb7f37d609fe6fd01 | js/application.js | js/application.js | (function(){
console.log('Ready to rock!');
})();
| (function(document){
var playground = document.getElementById('playground');
playground.width = document.body.clientWidth;
playground.height = document.body.clientHeight;
})(document);
| Scale the canvas to match the body | Scale the canvas to match the body
| JavaScript | mit | dvberkel/housewarming,dvberkel/housewarming |
616e2ee816fb5b750356deedc83f10c283da450b | src/utils/load-json.js | src/utils/load-json.js | function loadJson (jsonFile, callback) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeType('application/json');
xobj.open('GET', jsonFile, true);
xobj.onreadystatechange = function () {
if (xobj.readyState == 4 && xobj.status == '200') {
callback(JSON.parse(xobj.responseText))... | /**
* Loads a JSON File and passes the content to a callback function
* @param {string} jsonFile The location of the JSON file in which to load.
* @param {Function} callback A function in which to run on completing teh load of the file.
*
* @example
* var file = 'http://example.com/pokemon.json',
* callback... | Add JSDoc info for loadJson | Add JSDoc info for loadJson
| JavaScript | mit | rockabox/Auxilium.js |
54695eb76480395addbe6ffbf72dde5a41cccf5d | gulp/serve.js | gulp/serve.js | const CONFIG = {
ports: {
frontend: 8080,
backend: 4900
}
};
const browserSync = require('browser-sync');
const ecstatic = require('ecstatic');
const http = require('http');
module.exports = function(gulp) {
gulp.task(
'serve:browsersync',
'proxies the localhost server vi... | const CONFIG = {
ports: {
frontend: 8080,
backend: 4900
}
};
const browserSync = require('browser-sync');
const ecstatic = require('ecstatic');
const http = require('http');
module.exports = function(gulp) {
gulp.task(
'serve:browsersync',
'proxies the localhost server vi... | Remove automatic localtunnel (crashes periodically) | Remove automatic localtunnel (crashes periodically)
| JavaScript | mit | planetary/airframe,planetary/airframe |
e79395b9c7dac176b09180e3272ce34106d12add | app/js/other/arethusa_external_api.js | app/js/other/arethusa_external_api.js | "use strict";
window.ArethusaExternalApi = (function () {
var obj = {};
obj.isArethusaLoaded = function() {
try {
angular.module('arethusa');
} catch(err) {
return false;
}
};
// I guess it might come to this sort of guarding close, so that other plugin
// can implement this safely.... | "use strict";
window.ArethusaExternalApi = function () {
var obj = {};
obj.isArethusaLoaded = function() {
try {
angular.module('arethusa');
} catch(err) {
return false;
}
};
// I guess it might come to this sort of guarding close, so that other plugin
// can implement this safely. ... | Make external api to a factory function | Make external api to a factory function
| JavaScript | mit | fbaumgardt/arethusa,PonteIneptique/arethusa,PonteIneptique/arethusa,Masoumeh/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,Masoumeh/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,alpheios-project/arethusa |
76f746f990f37d9569d884e7e8996a659ef0af3f | fake-honeybadger.js | fake-honeybadger.js | var os = require ('os');
var request = require ('request');
var HONEYBADGER_API_KEY = process.env.HONEYBADGER_API_KEY;
exports.notify = function(data) {
console.log("Exception: " + data.message);
var requestOptions = {
url:'https://api.honeybadger.io/v1/notices',
headers:{
'content-type':'appl... | var os = require ('os');
var request = require ('request');
var HONEYBADGER_API_KEY = process.env.HONEYBADGER_API_KEY;
exports.notify = function(data) {
console.log("Exception: " + data.message);
var requestOptions = {
url:'https://api.honeybadger.io/v1/notices',
headers:{
'content-type':'appl... | Set default values for data fields | Set default values for data fields
| JavaScript | mit | jmontrose/fake-honeybadger |
98c4ca7d1d904d8b24a8eadc674b9d2fb206dc4d | local_modules/webapp/webpack.config.js | local_modules/webapp/webpack.config.js | const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const WebpackOnBuildPlugin = require('on-build-webpack')
const replace = require('replace')
const path = require('path')
module.exports = {
entry: [
'./app/index.js'
],
output: {
filename: 'bundle.js',
path: p... | const HtmlWebpackPlugin = require('html-webpack-plugin')
const WebpackOnBuildPlugin = require('on-build-webpack')
const replace = require('replace')
const path = require('path')
module.exports = {
entry: [
'./app/index.js'
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},... | Fix unused webpack eslint error | Fix unused webpack eslint error
| JavaScript | mit | phi-nomenal/phi-nomenal,phi-nomenal/phi-nomenal,phi-nomenal/phi-nomenal |
5f147450d89c0cbbe31a60ca61cc75ae145884a3 | models/user.js | models/user.js | var database = require("../config/database");
var pivotal = require("../libs/pivotal");
var bcrypt = require('bcrypt');
var inspect = require('eyes').inspector({ stream: null });
module.exports = {
getByUsername: function(username, callback){
database.open(function(err, db){
db.collection('users', fun... | var database = require("../config/database");
var pivotal = require("../libs/pivotal");
var bcrypt = require('bcrypt');
var inspect = require('eyes').inspector({ stream: null });
module.exports = {
getByUsername: function(username, callback){
this.collection.findOne({email: username}, function(err, user){
... | Use only one instance of mongo to create querys | Use only one instance of mongo to create querys
| JavaScript | mit | tangosource/pokerestimate,tangosource/pokerestimate |
92d6c0b5d5d9533248727af3bcd607ba8eccd95a | models/user.js | models/user.js | module.exports = function(sequelize, DataTypes) {
var User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
password: {
type: DataTypes.STRING,
allowNull: false
},
em... | module.exports = function(sequelize, DataTypes) {
var User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
password: {
type: DataTypes.STRING,
allowNull: false
},
em... | Change level and experience to regular integers. | Change level and experience to regular integers.
| JavaScript | mit | kevinwang/questkey |
54025e8e6b8afd53fe2ce8b26f63594c6f120f8b | test/preposttasks/pre-sample.js | test/preposttasks/pre-sample.js | module.exports = {
run(context) {
console.log('In pretask!!!');
return context.runWithDriver((driver) => {
driver.get('https://www.sitespeed.io')
.then(() => {
return driver.getCurrentUrl();
})
.then((url) => {
console.log('Loaded url: ' + url);
});
... | module.exports = {
run(context) {
console.log('In pretask!!!');
return context.runWithDriver((driver) => {
return driver.get('https://www.sitespeed.io')
.then(() => {
return driver.getTitle();
})
.then((title) => {
console.log('Loaded page with title: ' + titl... | Make sure to return promise created by pretask. | Make sure to return promise created by pretask.
Also update exemple to fetch page title instead of url.
| JavaScript | apache-2.0 | sitespeedio/browsertime,sitespeedio/browsertime,sitespeedio/browsertime,tobli/browsertime,sitespeedio/browsertime |
0bdd011f4b563f05ffc17883522636124476c24b | app/xmpp/msg-processors/roster-get.js | app/xmpp/msg-processors/roster-get.js | 'use strict';
var MessageProcessor = require('./../msg-processor'),
settings = require('./../../config');
module.exports = MessageProcessor.extend({
if: function() {
return this.request.type === 'get' && this.ns['jabber:iq:roster'];
},
// Roster is always empty - everyone is friendless
/... | 'use strict';
var _ = require('lodash'),
MessageProcessor = require('./../msg-processor'),
settings = require('./../../config'),
helper = require('./../helper');
module.exports = MessageProcessor.extend({
if: function() {
return this.request.type === 'get' && this.ns['jabber:iq:roster'];
... | Implement XMPP get roster request | Implement XMPP get roster request
| JavaScript | mit | jjz/lets-chat,webbab/lets-chat,linhmtran168/lets-chat,eetuuuu/lets-chat,cesarmarinhorj/lets-chat,CodesScripts/lets-chat,evdevgit/lets-chat,sitexa/lets-chat,gvmatera/lets-chat,8bitjeremy/velochat,ashwini-angular/lets-chat,aaryn101/lets-chat,jparyani/lets-chat,lihuanghai/lets-chat,robin1liu/lets-chat,fabianschwarzfritz/l... |
442cfad1e067797eb5e7103475fec17bef063870 | src/isomorphic/element.js | src/isomorphic/element.js | const createElement = (nodeName, attributes, ...args) => {
let children, i;
for(i = 0; i < args.length; i++) {
if (typeof args[i] === 'number') args[i] = String(args[i]);
}
children = args.length ? [].concat(...args) : null;
return { nodeName, attributes, children };
}
export default createElement;
| const createElement = (nodeName, attributes, ...args) => {
let children = args.length ? [].concat(...args) : null;
return { nodeName, attributes, children };
}
export default createElement;
| Revert "Converts the child with the type of number to string" | Revert "Converts the child with the type of number to string"
This reverts commit e13e57750557263eff361f8127893139cf1535ac.
| JavaScript | mit | liferay-labs-br/fiber |
480aaa392c74528c59da38cc057330ba3388959c | demo/chat.js | demo/chat.js | var chat = require('../lib/server'),
router = require("../lib/router");
var chatServer = chat.createServer();
chatServer.listen(8001);
chatServer.addChannel({ basePath: "/chat" });
chatServer.passThru("/", router.staticHandler("index.html"));
// CSS
chatServer.passThru("/css/layout.css", router.staticHandler("css/la... | var chat = require('../lib/server'),
router = require("../lib/router");
// create chat server and a single channel
var chatServer = chat.createServer();
chatServer.listen(8001);
chatServer.addChannel({ basePath: "/chat" });
// chat app
chatServer.passThru("/", router.staticHandler("index.html"));
// CSS
chatServer.... | Use .forEach() instead of a for loop for image handling. | Use .forEach() instead of a for loop for image handling.
| JavaScript | mit | scottgonzalez/node-chat |
60963a7dd29744f672862133ac472a785a1798ab | client/templates/query.js | client/templates/query.js | Template.showResponses.helpers({
'responses' : function () {
Session.set('queryId', this._id);
return Responses.find({queryId: this._id});
}
});
Template.addResponse.events({
'click #submitResponse' : function (event) {
event.preventDefault();
var response = $('#yourResponse... | Template.showResponses.helpers({
'responses' : function () {
Session.set('queryId', this._id);
return Responses.find({queryId: this._id});
}
});
Template.addResponse.events({
'click #submitResponse' : function (event) {
event.preventDefault();
// Get the values for the resp... | Clear out form field on submit. | Clear out form field on submit.
| JavaScript | agpl-3.0 | brylie/quaker-connect |
a575ab97df64a6a3ba02c57a04a5ec77cefebd1f | javascript.js | javascript.js | $(document).ready(function() {
// Allow all sortable rows to be sortable
$(".sortable").sortable();
// Disallow selection
$(".sortable").disableSelection();
$(document).bind("contextmenu", function (e) {
// Don't allow the browsers to handle the right-click
e.preventDefault()... | $(document).ready(function() {
// Allow all sortable rows to be sortable
$(".sortable").sortable();
// Disallow selection
$(".sortable").disableSelection();
$(document).bind("contextmenu", function (e) {
// Don't allow the browsers to handle the right-click
e.preventDefault()... | Load size on right click | Load size on right click
| JavaScript | mit | ErinvanderVeen/BootstrapEditor,ErinvanderVeen/BootstrapEditor |
d8e8096eba2f7da4f13bd2867c011f0fd74c86d8 | apps/federatedfilesharing/js/settings-personal.js | apps/federatedfilesharing/js/settings-personal.js | $(document).ready(function() {
$('#fileSharingSettings button.pop-up').click(function() {
var url = $(this).data('url');
if (url) {
var width = 600;
var height = 400;
var left = (screen.width/2)-(width/2);
var top = (screen.height/2)-(height/2);
window.open(url, 'name', 'width=' + width + ', heigh... | $(document).ready(function() {
$('#fileSharingSettings button.pop-up').click(function() {
var url = $(this).data('url');
if (url) {
var width = 600;
var height = 400;
var left = (screen.width/2)-(width/2);
var top = (screen.height/2)-(height/2);
window.open(url, 'name', 'width=' + width + ', heigh... | Make 'Add to your website' toggleable | Make 'Add to your website' toggleable
| JavaScript | agpl-3.0 | endsguy/server,jbicha/server,Ardinis/server,Ardinis/server,andreas-p/nextcloud-server,whitekiba/server,whitekiba/server,jbicha/server,Ardinis/server,nextcloud/server,pixelipo/server,xx621998xx/server,pmattern/server,pmattern/server,pmattern/server,xx621998xx/server,endsguy/server,whitekiba/server,pixelipo/server,jbicha... |
96ec21e199b3404b42db94ed0060a0c9306dde63 | core/controllers/index.js | core/controllers/index.js | const Router = use('core/router');
const Errors = use('core/errors');
const getHandlersDefinitions = require('./handlersDefinitions');
const controllersCollection = new Map();
class Controllers {
static define (controller){
if(!controller.path) {
thro... | const Router = use('core/router');
const Errors = use('core/errors');
const getHandlersDefinitions = require('./handlersDefinitions');
const controllersCollection = new Map();
class Controllers {
static define (controller){
if(!controller.path) {
thro... | Allow controller to have the same path | Allow controller to have the same path
| JavaScript | mit | yura-chaikovsky/dominion |
3f4e00a3cc1568d112988116a2500249894d2ed0 | lib/validation.js | lib/validation.js | const chalk = require('chalk')
const exitWithError = require('./error')
const packageConfig = require('../package.json')
/**
* Sample program execution command used in error message
*
* @type {String}
*/
const exampleText = chalk.inverse('node ' + packageConfig.main + ' "AH TH KD QC JS"')
/**
* Validate card cou... | const chalk = require('chalk')
const exitWithError = require('./error')
const packageConfig = require('../package.json')
/**
* Sample program execution command used in error message
*
* @type {String}
*/
const exampleText = chalk.inverse('node ' + packageConfig.main + ' "AH TH KD QC JS"')
/**
* Validate card cou... | Remove inaccurate DocBlock tag from function | Remove inaccurate DocBlock tag from function
| JavaScript | mit | notmessenger/poker-analysis |
d6f05d5868166838fd82c715543084971080441c | src/js/components/item-details.js | src/js/components/item-details.js | import React from 'react'
import { connectFromRoute } from '../router-mapping'
import { sparqlConnect } from '../sparql/configure-sparql'
import { LOADING, LOADED, FAILED } from 'sparql-connect'
import Loading from './loading'
import { Link } from 'react-router'
import { uriToLink } from '../router-mapping'
import Ite... | import React from 'react'
import { connectFromRoute } from '../router-mapping'
import { sparqlConnect } from '../sparql/configure-sparql'
import { LOADING, LOADED, FAILED } from 'sparql-connect'
import Loading from './loading'
import { Link } from 'react-router'
import { uriToLink } from '../router-mapping'
import Item... | Add link to classification details from item details | Add link to classification details from item details
| JavaScript | mit | Antoine-Dreyer/Classification-Explorer,UNECE/Classification-Explorer,UNECE/Classification-Explorer,Antoine-Dreyer/Classification-Explorer |
c8a65053f5ef08b06042c413e742b6ac6b5796bf | src/js/markovDictionaryBuilder.js | src/js/markovDictionaryBuilder.js | 'use strict';
var markovDictionaryBuilder = (function() {
function buildDict(wordSet, chainSize) {
console.log("building dictionary from " + wordSet.length + " words with a chain size of " + chainSize);
var map = [];
var dict = [];
for (var i = 0, len = wordSet.length - chainSize; i < len; i++) {
va... | 'use strict';
var markovDictionaryBuilder = (function() {
function buildDict(wordSet, chainSize) {
console.log("building dictionary from " + wordSet.length + " words with a chain size of " + chainSize);
var map = [];
var dict = [];
for (var i = 0, len = wordSet.length - chainSize; i < len; i++) {
va... | Remove previous cheap hack by changing the 'key doesn't exist in map' logic from === 'undefined' to !== 'number' | Remove previous cheap hack by changing the 'key doesn't exist in map' logic from === 'undefined' to !== 'number'
| JavaScript | bsd-3-clause | petejscott/jsMarkov |
5b18332557baaccfa066e14397d2bea205518eca | src/templates/speakers.js | src/templates/speakers.js | import React from 'react';
import Img from 'gatsby-image';
import { Container, Section, Title } from 'bloomer';
import Markdown from 'react-markdown';
function SpeakerTemplate(props) {
const speaker = props.data.contentfulSpeaker;
return (
<Section>
<Container>
<Title>{speaker.name}</Title>
... | import React from 'react';
import Img from 'gatsby-image';
import { Container, Section, Title } from 'bloomer';
import Markdown from 'react-markdown';
function SpeakerTemplate(props) {
const speaker = props.data.datoCmsSpeaker;
return (
<Section>
<Container>
<Title>{speaker.name}</Title>
... | Use dato data instead of contentful | Use dato data instead of contentful
| JavaScript | mit | sioked/ecomchicago |
a7878ba27768fc330f5e22df85d8fb15c54e66f6 | app/lib/reducers/library.js | app/lib/reducers/library.js | function matchesSearch( searchString, location ) {
if ( searchString.length < 2 ) return true;
return ( ~ location.name.toLowerCase().indexOf( searchString ) || ~ location.address.toLowerCase().indexOf( searchString ) );
}
// Find the element in state.locations that matches the ID in action.location,
// then updat... | function matchesSearch( searchString, location ) {
if ( searchString.length < 2 ) return true;
return ( ~ location.name.toLowerCase().indexOf( searchString.toLowerCase() ) || ~ location.address.toLowerCase().indexOf( searchString.toLowerCase() ) );
}
// Find the element in state.locations that matches the ID in ac... | Make sure search supports capital letters | Make sure search supports capital letters
| JavaScript | mit | sirbrillig/voyageur-js-client,sirbrillig/voyageur-js-client |
227b2d1faf56683ae3dd0ec3bbc90ba86552b65b | bika/lims/skins/bika/bika_widgets/datetimewidget.js | bika/lims/skins/bika/bika_widgets/datetimewidget.js | jQuery( function($) {
$(document).ready(function(){
$('[datepicker=1]').datepicker({'dateFormat': window.jsi18n_bika('date_format_short_datepicker')});
});
});
| jQuery( function($) {
$(document).ready(function(){
dateFormat = window.jsi18n_bika('date_format_short_datepicker');
$('[datepicker=1]').datepicker({
dateFormat: dateFormat,
changeMonth:true,
changeYear:true
});
});
});
| Add Month/Year selectors to default datetime widget | Add Month/Year selectors to default datetime widget
| JavaScript | agpl-3.0 | rockfruit/bika.lims,anneline/Bika-LIMS,labsanmartin/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,labsanmartin/Bika-LIMS,DeBortoliWines/Bika-LIMS,anneline/Bika-LIMS,veroc/Bika-LIMS,veroc/Bika-LIMS,anneline/Bika-LIMS,rockfruit/bika.lims,veroc/Bika-LIMS,DeBortoliWines/Bika-LIMS |
808c575bd188a882d6fa717bae400f9142546276 | app/routes/contact/index.js | app/routes/contact/index.js | // @flow
import * as React from 'react';
import { Route, Switch } from 'react-router-dom';
import ContactRoute from './ContactRoute';
import PageNotFoundRoute from '../pageNotFound/PageNotFoundRoute';
const contactRoute = ({ match }: { match: { path: string } }) => (
<Switch>
<Route exact path={`${match.path}`} ... | // @flow
import * as React from 'react';
import { Route, Switch } from 'react-router-dom';
import ContactRoute from './ContactRoute';
import RouteWrapper from 'app/components/RouteWrapper';
import { UserContext } from 'app/routes/app/AppRoute';
import PageNotFoundRoute from '../pageNotFound/PageNotFoundRoute';
const c... | Fix user state in contact form | Fix user state in contact form
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp |
2dfb36ecc527454179ec2704da154640c71298e7 | app/assets/javascripts/new_pin.js | app/assets/javascripts/new_pin.js | $(document).ready(function() {
$("PLACE ON MAP").on("click", function(event){
event.preventDefault()
$.ajax({
url: '/prototypes/' + id,
type: 'get',
}).done(function(data){
$this.append(data)
})
})
})
| $(document).ready(function() {
console.log("I'm LISTENING!!!!")
$("#map-placeholder").on("click", "#new-gem-button", function(event){
console.log("I LISTENED!!!!")
event.preventDefault()
var url = $(event.target).attr('href');
console.log(url);
$.ajax({
url: url,
... | Write ajax request in the pin js | Write ajax request in the pin js
| JavaScript | mit | TEAM-KAST/City_Gems,TEAM-KAST/City_Gems,TEAM-KAST/City_Gems |
77bf6d15dca045999fb750347be254392c320e15 | updates/0.0.1-list_family-constellations.js | updates/0.0.1-list_family-constellations.js | exports.create = {
'Family Constellation': [{
familyConstellation: 'single male'
}, {
familyConstellation: 'single gay male'
}, {
familyConstellation: 'single straight male'
}, {
familyConstellation: 'single female'
}, {
familyConstellation: 'single gay female'
}, {
familyConstellation: 'single s... | exports.create = {
'Family Constellation': [{
familyConstellation: 'single male'
}, {
familyConstellation: 'single gay male'
}, {
familyConstellation: 'single straight male'
}, {
familyConstellation: 'single female'
}, {
familyConstellation: 'single gay female'
}, {
familyConstellation: 'single straig... | Add male/female couple to the family constellation auto update scripts. | Add male/female couple to the family constellation auto update scripts.
| JavaScript | mit | autoboxer/MARE,autoboxer/MARE |
0a149c3993a6147f812e858714da97dbd3a6a5a5 | app/components/story/StoryList.js | app/components/story/StoryList.js | import React, { Component } from 'react'
import CreateStoryButton from './CreateStoryButton'
import Story from './Story'
import reactCSS from 'reactcss'
export default class StoryList extends Component {
componentWillReceiveProps(props) {
this.contents = null;
if (props.selectedContactId.length) {... | import React, { Component } from 'react'
import CreateStoryButton from './CreateStoryButton'
import Story from './Story'
import reactCSS from 'reactcss'
export default class StoryList extends Component {
componentWillReceiveProps(props) {
this.contents = null;
if (props.selectedContactId.length) {... | Create story floating button is not shown if no contact is selected | Create story floating button is not shown if no contact is selected
| JavaScript | mit | Arthelon/ContactStories,Arthelon/ContactStories |
beb018a477b90403d3b31ccfdee73e497ca961f1 | service.js | service.js | var request = require('request');
module.exports = function(uri, serviceName, invokeUri){
this.uri = uri;
this.serviceName = serviceName;
this.invokeUri = invokeUri;
this.invoke = function(data, callback){
request(
{ method: 'PUT'
, uri: this.invokeUri
, bod... | var request = require('request');
module.exports = function(uri, serviceName, invokeUri){
this.uri = uri;
this.serviceName = serviceName;
this.invokeUri = invokeUri;
this.invoke = function(data, callback){
request(
{ method: 'PUT'
, uri: this.invokeUri
, bod... | Add specific errors for get*Schema returning !200 | Add specific errors for get*Schema returning !200
| JavaScript | apache-2.0 | UkRobJones/zosconnect-node,zosconnect/zosconnect-node,crshnburn/zosconnect-node |
ecd35e7981c503e64b965b45c3e939bb503b81ff | db/migrations/20131216233400-create-ripple-txs.js | db/migrations/20131216233400-create-ripple-txs.js | var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('ripple_transactions', {
id: { type: 'int', primaryKey: true, autoIncrement: true, notNull: true, unique: true },
issuance: { type: 'boolean', notNull: true },
toCurrency: { type: 'string', notNu... | var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('ripple_transactions', {
id: { type: 'int', primaryKey: true, autoIncrement: true, notNull: true, unique: true },
issuance: { type: 'boolean', notNull: true },
toCurrency: { type: 'string', notNu... | Remove balanceId from ripple transactions table | [FEATURE] Remove balanceId from ripple transactions table
| JavaScript | isc | xdv/gatewayd,crazyquark/gatewayd,crazyquark/gatewayd,Parkjeahwan/awegeeks,whotooktwarden/gatewayd,zealord/gatewayd,whotooktwarden/gatewayd,zealord/gatewayd,xdv/gatewayd,Parkjeahwan/awegeeks |
cfc861b16126ca36a23c73758779c6017ca89d06 | src/orbit/interfaces/queryable.js | src/orbit/interfaces/queryable.js | import Orbit from '../main';
import { assert } from '../lib/assert';
import { extend } from '../lib/objects';
import Query from '../query';
import Source from '../source';
export default {
/**
Mixes the `Queryable` interface into a source
@method extend
@param {Object} source - Source to extend
@returns... | import Orbit from '../main';
import { assert } from '../lib/assert';
import { extend } from '../lib/objects';
import Query from '../query';
import Source from '../source';
export default {
/**
Mixes the `Queryable` interface into a source
@method extend
@param {Object} source - Source to extend
@returns... | Fix argument coercion in `query` to use `queryBuilder` if present. | Fix argument coercion in `query` to use `queryBuilder` if present.
| JavaScript | mit | jpvanhal/orbit.js,jpvanhal/orbit.js,orbitjs/orbit.js,orbitjs/orbit-core,jpvanhal/orbit-core,jpvanhal/orbit-core,SmuliS/orbit.js,orbitjs/orbit.js,SmuliS/orbit.js |
82a86d909f37ec3d5349d03f80c5f0c432e32c08 | src/resources/js/modules/enso/__.js | src/resources/js/modules/enso/__.js | import store from '../../store';
const __ = store.getters[ 'localisation/__' ];
export default function (key, params) {
if (!store.getters[ 'localisation/isInitialised' ]) {
return key;
}
let translation = __(key);
if (typeof translation === 'undefined'
&& store.state.localisation.ke... | import store from '../../store';
export default (key, params = null) => {
if (!store.getters['localisation/isInitialised']) {
return key;
}
let translation = store.getters['localisation/__'](key);
if (typeof translation === 'undefined' || translation == null) {
translation = key;
... | Implement proposed changes + add `== null` check | Implement proposed changes + add `== null` check | JavaScript | mit | laravel-enso/Core,laravel-enso/Core |
de204bfe5faa155d6cd79a75183cd51ffcc41440 | src/types/var-type.js | src/types/var-type.js | const DocumentedItem = require('./item');
class DocumentedVarType extends DocumentedItem {
registerMetaInfo(data) {
this.directData = data;
}
serialize() {
const names = [];
for(const name of this.directData.names) names.push(splitVarName(name));
return { types: names };
}
}
/*
{
"names":[
"String"... | const DocumentedItem = require('./item');
class DocumentedVarType extends DocumentedItem {
registerMetaInfo(data) {
this.directData = data;
}
serialize() {
const names = [];
for(const name of this.directData.names) names.push(this.constructor.splitVarName(name));
return { types: names };
}
static splitV... | Make splitVarName a static method | Make splitVarName a static method
| JavaScript | apache-2.0 | hydrabolt/discord.js-docgen |
3def08dabdc272ae329d699cda5d7e254275a799 | lib/ExpressRedisCache/del.js | lib/ExpressRedisCache/del.js | module.exports = (function () {
'use strict';
/** Delete cache entries
*
* @function
* @description
* @return void{}
* @arg {Object} query - Optional
* @arg {Function} callback
*/
function del (name, callback) {
var self = this;
var domain = require('domain').create();
... | module.exports = (function () {
'use strict';
/** Delete cache entries
*
* @function
* @description
* @return void{}
* @arg {Object} query - Optional
* @arg {Function} callback
*/
function del (name, callback) {
var self = this;
var domain = require('domain').create();
... | Use intercept instead of callbacks on last commit | Use intercept instead of callbacks on last commit
| JavaScript | mit | sontakey/bridg-express-redis-cache,ScheerMT/express-redis-cache,sameer-bridg/bridg-express-redis-cache,fandaa/express-cache-route,rv-kip/express-redis-cache,ScheerMT/express-redis-cache,matsu911/express-redis-cache,pwmckenna/express-redis-cache,co2-git/express-redis-cache,matsu911/express-redis-cache,benmcmeen/express-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.