commit
stringlengths
40
40
old_file
stringlengths
4
264
new_file
stringlengths
4
264
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
624
message
stringlengths
15
4.7k
lang
stringclasses
3 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
cd4c98d937e07c4d7c7d0750509cac40e1f1ffc3
src/components/videos/VideoView.js
src/components/videos/VideoView.js
import React from 'react' import { connect } from 'react-redux' import { compose } from 'recompose' import { updateVideo } from '../../actions/videos' import { withDatabaseSubscribe } from '../hocs' import CommentList from '../CommentList' import PerformanceFrame from '../PerformanceFrame' const mapStateToProps = ({videos}) => ({ videos }) const enhance = compose( connect(mapStateToProps), withDatabaseSubscribe( 'value', (props) => (`videos/${props.params.videoId}`), (props) => (snapshot) => ( props.dispatch(updateVideo({ videoId: props.params.videoId, videoSnapshot: snapshot.val() })) ) ), ) const styles = { videoContainer: { height: 'calc(100vh - 56px)', display: 'flex', flexWrap: 'wrap', } } const VideoView = ({videos, params}) => ( <div style={styles.videoContainer}> {(params.videoId in videos && videos[params.videoId] !== null) ? <PerformanceFrame size={{width: 854, height: 480}} layout={{ videoStreams: [{videoId: params.videoId, z_index: 0, scale: 1.0}]}} /> : <p>{"404 not found"}</p> } {videos[params.videoId] !== null ? <CommentList videoId={params.videoId}/> : <p>{"duh"}</p> } </div> ) export default enhance(VideoView)
import * as _ from 'lodash' import React from 'react' import {connect} from 'react-redux' import {compose, withProps} from 'recompose' import {updateVideo} from '../../actions/videos' import CommentList from '../CommentList' import {withDatabaseSubscribe} from '../hocs' const mapStateToProps = ({videos}) => ({ videos }) const enhance = compose( connect(mapStateToProps), withProps(({match}) => ({ videoId: match.params.videoId, })), withDatabaseSubscribe( 'value', (props) => (`videos/${props.videoId}`), (props) => (snapshot) => ( props.dispatch(updateVideo( { videoId: props.videoId, videoSnapshot: snapshot.val() })) ) ), ) const styles = { videoContainer: { height: 'calc(100vh - 56px)', display: 'flex', flexWrap: 'wrap', } } const VideoView = ({videos, videoId}) => ( <div style={styles.videoContainer}> {JSON.stringify(_.get(videos, videoId, {}))} <CommentList videoId={videoId}/> </div> ) export default enhance(VideoView)
Fix video view and remove some sub components
Fix video view and remove some sub components - Fixes #28
JavaScript
mit
mg4tv/mg4tv-web,mg4tv/mg4tv-web
2d9fe3d781899e9d2a4fbe4d49c71fdcfeba3808
Server/Models/usersModel.js
Server/Models/usersModel.js
const mongoose = require('mongoose'); const Schema = mongoose.Schema var userSchema = new Schema({ name: {type: String, required: true}, photo: {type: String, required: true}, email: {type: String, required: true, unique: true}, fbId: {type: String}, fbAccessToken: {type: String}, googleId: {type: String}, createdPins: [{type: Schema.ObjectId, ref:'locations'}], savedPins: [{type: Schema.ObjectId, ref: 'locations'}], }); var User = mongoose.model('User', userSchema) module.exports = User
const mongoose = require('mongoose'); const Schema = mongoose.Schema var userSchema = new Schema({ name: {type: String, required: true}, photo: {type: String, required: true}, email: {type: String, required: true, unique: true}, fbId: {type: String}, fbAccessToken: {type: String}, googleId: {type: String}, createdPins: [{type: Schema.ObjectId, ref:'Location'}], savedPins: [{type: Schema.ObjectId, ref: 'Location'}], }); var User = mongoose.model('User', userSchema) module.exports = User
Adjust user model to populate locations correctly
Adjust user model to populate locations correctly
JavaScript
mit
JabroniZambonis/pLot
a4443b203db029fe5ee7df682ca372259b3e4f1c
models/index.js
models/index.js
'use strict'; var mongoose = require('mongoose'); mongoose.model('User', require('./User')); mongoose.connect("mongodb://localhost/passport-lesson"); module.exports = mongoose;
'use strict'; var mongoose = require('mongoose'); mongoose.Promise = Promise; mongoose.model('User', require('./User')); mongoose.connect("mongodb://localhost/passport-lesson"); module.exports = mongoose;
Set mongoose to use native promises
Set mongoose to use native promises
JavaScript
mit
dhuddell/teachers-lounge-back-end
e850a2ce6a17813c537f71807a26d42c4e0165db
2015-03-MHVLUG/webapp/webapp.js
2015-03-MHVLUG/webapp/webapp.js
// simple-todos.js // TODO: Add tasks from console to populate collection // On Server: // db.tasks.insert({ text: "Hello world!", createdAt: new Date() }); // On Client: // Tasks.insert({ text: "Hello world!", createdAt: new Date() }); Tasks = new Mongo.Collection("tasks"); if (Meteor.isClient) { // This code only runs on the client Template.body.helpers({ tasks: function () { return Tasks.find({}); } }); // Inside the if (Meteor.isClient) block, right after Template.body.helpers: Template.body.events({ "submit .new-task": function (event) { // This function is called when the new task form is submitted var text = event.target.text.value; Tasks.insert({ text: text, createdAt: new Date() // current time }); // Clear form event.target.text.value = ""; // Prevent default form submit return false; } }); }
// simple-todos.js // TODO: Add tasks from console to populate collection // On Server: // db.tasks.insert({ text: "Hello world!", createdAt: new Date() }); // On Client: // Tasks.insert({ text: "Hello world!", createdAt: new Date() }); Tasks = new Mongo.Collection("tasks"); if (Meteor.isClient) { // This code only runs on the client Template.body.helpers({ tasks: function () { // Show newest tasks first return Tasks.find({}, {sort: {createdAt: -1}}); } }); // Inside the if (Meteor.isClient) block, right after Template.body.helpers: Template.body.events({ "submit .new-task": function (event) { // This function is called when the new task form is submitted var text = event.target.text.value; Tasks.insert({ text: text, createdAt: new Date() // current time }); // Clear form event.target.text.value = ""; // Prevent default form submit return false; } }); }
Sort tasks by createdAt timestamp
WebApp-4b: Sort tasks by createdAt timestamp
JavaScript
apache-2.0
MeteorHudsonValley/talks,MeteorHudsonValley/talks
687fcbb285430d6d4df0758ef2eab4a048ab7f07
docs/config.js
docs/config.js
self.$config = { landing: false, debug: false, repo: 'soruly/whatanime.ga', twitter: 'soruly', url: 'https://whatanime.ga', sidebar: false, disableSidebarToggle: true, nav: { default: [] }, icons: [], plugins: [] }
self.$config = { landing: false, debug: false, repo: 'soruly/whatanime.ga', twitter: 'soruly', url: 'https://whatanime.ga', sidebar: true, disableSidebarToggle: false, nav: { default: [] }, icons: [], plugins: [] }
Enable sidebar on API docs
Enable sidebar on API docs
JavaScript
mit
soruly/whatanime.ga,soruly/whatanime.ga,soruly/whatanime.ga
07ec1f9de2c8a5233bdafbc0a16b606520ee1be8
js/webpack.config.js
js/webpack.config.js
var loaders = [ { test: /\.json$/, loader: "json-loader" }, ]; module.exports = [ {// Notebook extension entry: './src/extension.js', output: { filename: 'extension.js', path: '../pythreejs/static', libraryTarget: 'amd' } }, {// bqplot bundle for the notebook entry: './src/index.js', output: { filename: 'index.js', path: '../pythreejs/static', libraryTarget: 'amd' }, devtool: 'source-map', module: { loaders: loaders }, externals: ['jupyter-js-widgets'] }, {// embeddable bqplot bundle entry: './src/index.js', output: { filename: 'embed.js', path: './dist/', libraryTarget: 'amd' }, devtool: 'source-map', module: { loaders: loaders }, externals: ['jupyter-js-widgets'] } ];
var loaders = [ { test: /\.json$/, loader: "json-loader" }, ]; module.exports = [ {// Notebook extension entry: './src/extension.js', output: { filename: 'extension.js', path: '../pythreejs/static', libraryTarget: 'amd' } }, {// bqplot bundle for the notebook entry: './src/index.js', output: { filename: 'index.js', path: '../pythreejs/static', libraryTarget: 'amd' }, devtool: 'source-map', module: { loaders: loaders }, externals: ['jupyter-js-widgets'] }, {// embeddable bqplot bundle entry: './src/index.js', output: { filename: 'index.js', path: './dist/', libraryTarget: 'amd' }, devtool: 'source-map', module: { loaders: loaders }, externals: ['jupyter-js-widgets'] } ];
Use new scheme for npmcdn
Use new scheme for npmcdn
JavaScript
bsd-3-clause
jasongrout/pythreejs,jasongrout/pythreejs
1887b3c7024779ebb8873277b2472dbe9141d0f5
server/controllers/signup.js
server/controllers/signup.js
// SignupController // ================ // Handles routing for signing up for the pp 'use strict'; let express = require('express'), SignupController = express.Router(), bcrypt = require('bcrypt'), User = require(__dirname + '/../models/user'); SignupController.route('/?') // GET /signup/ // ----------- // Render login page .get(function(req, res, next) { res.render('authentication/signup', { csrf: req.csrfToken(), scripts: ['/js/signup.min.js'] }); }) // POST /signup/ // ------------ // Registers a new user .post(function(req, res, next) { // Check if user exists in database User .where({ email: req.body.email }) .fetch() .then(function(user) { if (user) { bcrypt.hash(req.body.password, 10, function(err, hash) { if (err) return next(new Error('Could not hash password')); // Create a new user new User({ email: req.body.email, password: hash }) .save() .then(function(user) { res.send('User created'); }) .catch(function(err) { res.send('username or email already taken'); }); }); } else { res.send('could not create new user'); } }) .catch(function(err) { console.log(err, 'FETCH ERROR'); res.send('Could not run fetch query'); }); }); module.exports = SignupController;
// SignupController // ================ // Handles routing for signing up for the pp 'use strict'; let express = require('express'), SignupController = express.Router(), bcrypt = require('bcrypt'), User = require(__dirname + '/../models/user'); SignupController.route('/?') // GET /signup/ // ----------- // Render login page .get(function(req, res, next) { res.render('authentication/signup', { csrf: req.csrfToken(), scripts: ['/js/signup.min.js'] }); }) // POST /signup/ // ------------ // Registers a new user .post(function(req, res, next) { // Check if user exists in database User.where({ email: req.body.email }) .fetchAll() .then(function(user) { if (user) { bcrypt.hash(req.body.password, 10, function(err, hash) { if (err) return next(new Error('Could not hash password')); // Create a new user new User({ email: req.body.email, password: hash }) .save() .then(function(user) { res.send('User created'); }) .catch(function(err) { res.send('username or email already taken'); }); }); } else { res.send('could not create new user'); } }) .catch(function(err) { console.log(err, 'FETCH ERROR'); res.send('Could not run fetch query'); }); }); module.exports = SignupController;
Fix issue where users were not saving to the database.
Fix issue where users were not saving to the database. We use .fetchAll() rather than .fetch() to find all instances of a user. Added auto-timestamp functionality so all create and update times are automatically marked with no manual intervention needed.
JavaScript
mit
billpatrianakos/coverage-web,billpatrianakos/coverage-web,billpatrianakos/coverage-web
40350431927e12b74874ebf17b761535cccc76c5
src/features/spellchecker/index.js
src/features/spellchecker/index.js
import { autorun, observable } from 'mobx'; import { DEFAULT_FEATURES_CONFIG } from '../../config'; const debug = require('debug')('Franz:feature:spellchecker'); export const config = observable({ isIncludedInCurrentPlan: DEFAULT_FEATURES_CONFIG.isSpellcheckerIncludedInCurrentPlan, }); export default function init(stores) { debug('Initializing `spellchecker` feature'); autorun(() => { const { isSpellcheckerIncludedInCurrentPlan } = stores.features.features; config.isIncludedInCurrentPlan = isSpellcheckerIncludedInCurrentPlan !== undefined ? isSpellcheckerIncludedInCurrentPlan : DEFAULT_FEATURES_CONFIG.isSpellcheckerIncludedInCurrentPlan; if (!stores.user.data.isPremium && config.isIncludedInCurrentPlan && stores.settings.app.enableSpellchecking) { debug('Override settings.spellcheckerEnabled flag to false'); Object.assign(stores.settings.app, { enableSpellchecking: false, }); } }); }
import { autorun, observable } from 'mobx'; import { DEFAULT_FEATURES_CONFIG } from '../../config'; const debug = require('debug')('Franz:feature:spellchecker'); export const config = observable({ isIncludedInCurrentPlan: DEFAULT_FEATURES_CONFIG.isSpellcheckerIncludedInCurrentPlan, }); export default function init(stores) { debug('Initializing `spellchecker` feature'); autorun(() => { const { isSpellcheckerIncludedInCurrentPlan } = stores.features.features; config.isIncludedInCurrentPlan = isSpellcheckerIncludedInCurrentPlan !== undefined ? isSpellcheckerIncludedInCurrentPlan : DEFAULT_FEATURES_CONFIG.isSpellcheckerIncludedInCurrentPlan; if (!stores.user.data.isPremium && !config.isIncludedInCurrentPlan && stores.settings.app.enableSpellchecking) { debug('Override settings.spellcheckerEnabled flag to false'); Object.assign(stores.settings.app, { enableSpellchecking: false, }); } }); }
Fix disabling spellchecker after app start
fix(Spellchecker): Fix disabling spellchecker after app start
JavaScript
apache-2.0
meetfranz/franz,meetfranz/franz,meetfranz/franz
c9ee70bdc817e010bd00468bac99daf236035e2e
src/frontend/pages/Logout/index.js
src/frontend/pages/Logout/index.js
// @flow import * as React from 'react' import { Redirect } from 'react-router-dom' import performLogout from 'frontend/firebase/logout' class Logout extends React.Component<*> { componentDidMount() { performLogout() } render() { return <Redirect to="/" /> } } export default Logout
// @flow import * as React from 'react' import { connect } from 'react-redux' import { Redirect } from 'react-router-dom' import { USER_LOGGED_OUT } from 'frontend/actions/types' import performLogout from 'frontend/firebase/logout' type Props = { logout: Function } class Logout extends React.Component<Props> { componentDidMount() { performLogout() this.props.logout() } render() { return <Redirect to="/" /> } } const mapDispatchToProps = (dispatch: Function) => ({ logout: () => dispatch({ type: USER_LOGGED_OUT }) }) export default connect(null, mapDispatchToProps)(Logout)
Clear user login state in Redux on logout.
Clear user login state in Redux on logout.
JavaScript
mit
jsonnull/aleamancer,jsonnull/aleamancer
682c1bc6ec836f3a16543845444aafabafa788f9
lib/unexpectedExif.js
lib/unexpectedExif.js
/*global Uint8Array*/ var exifParser = require('exif-parser'), fs = require('fs'); module.exports = { name: 'unexpected-exif', version: require('../package.json').version, installInto: function (expect) { expect.installPlugin(require('magicpen-media')); expect.addAssertion(['string', 'Buffer'], 'to have (exif|EXIF) data satisfying', function (expect, subject, value) { var title, subjectUrl; if (typeof subject === 'string') { var matchDataUrl = subject.match(/^data:[^;]*;base64,(.*)$/); if (matchDataUrl) { subject = new Buffer(matchDataUrl[1], 'base64'); } else { title = subject; subjectUrl = subject; subject = fs.readFileSync(subject); } } else if (subject instanceof Uint8Array) { subject = new Buffer(subject); } this.subjectOutput = function () { this.image(subjectUrl || subject, { width: 10, height: 5, link: true, title: title }); }; var exifData = exifParser.create(subject).parse(); if (exifData && exifData.startMarker) { delete exifData.startMarker; } return expect(exifData, 'to satisfy', value); }); } };
/*global Uint8Array*/ var exifParser = require('exif-parser'), fs = require('fs'); module.exports = { name: 'unexpected-exif', version: require('../package.json').version, installInto: function (expect) { expect.installPlugin(require('magicpen-media')); expect.addAssertion('<string|Buffer> to have (exif|EXIF) data satisfying <any>', function (expect, subject, value) { var title, subjectUrl; if (typeof subject === 'string') { var matchDataUrl = subject.match(/^data:[^;]*;base64,(.*)$/); if (matchDataUrl) { subject = new Buffer(matchDataUrl[1], 'base64'); } else { title = subject; subjectUrl = subject; subject = fs.readFileSync(subject); } } else if (subject instanceof Uint8Array) { subject = new Buffer(subject); } this.subjectOutput = function () { this.image(subjectUrl || subject, { width: 10, height: 5, link: true, title: title }); }; var exifData = exifParser.create(subject).parse(); if (exifData && exifData.startMarker) { delete exifData.startMarker; } return expect(exifData, 'to satisfy', value); }); } };
Update to unexpected v10's addAssertion syntax .
Update to unexpected v10's addAssertion syntax [ci skip].
JavaScript
bsd-3-clause
unexpectedjs/unexpected-exif
5fc74d690fcf059940d7449bce11ec6b56b73eb2
lib/process-manager.js
lib/process-manager.js
/** @babel */ import childProcess from 'child_process' import kill from 'tree-kill' import { Disposable } from 'atom' export default class ProcessManager extends Disposable { processes = new Set() constructor () { super(() => this.killChildProcesses()) } executeChildProcess (command, options = {}) { const { allowKill, showError, ...execOptions } = options return new Promise(resolve => { // Windows does not like \$ appearing in command lines so only escape // if we need to. if (process.platform !== 'win32') command = command.replace('$', '\\$') const { pid } = childProcess.exec(command, execOptions, (error, stdout, stderr) => { if (allowKill) { this.processes.delete(pid) } if (error && showError) { latex.log.error(`An error occurred while trying to run "${command}" (${error.code}).`) } resolve({ statusCode: error ? error.code : 0, stdout, stderr }) }) if (allowKill) { this.processes.add(pid) } }) } killChildProcesses () { for (const pid of this.processes.values()) { kill(pid) } this.processes.clear() } }
/** @babel */ import childProcess from 'child_process' import kill from 'tree-kill' import { Disposable } from 'atom' export default class ProcessManager extends Disposable { processes = new Set() constructor () { super(() => this.killChildProcesses()) } executeChildProcess (command, options = {}) { const { allowKill, showError, ...execOptions } = options return new Promise(resolve => { // Windows does not like \$ appearing in command lines so only escape // if we need to. if (process.platform !== 'win32') command = command.replace('$', '\\$') const { pid } = childProcess.exec(command, execOptions, (error, stdout, stderr) => { if (allowKill) { this.processes.delete(pid) } if (error && showError && latex && latex.log) { latex.log.error(`An error occurred while trying to run "${command}" (${error.code}).`) } resolve({ statusCode: error ? error.code : 0, stdout, stderr }) }) if (allowKill) { this.processes.add(pid) } }) } killChildProcesses () { for (const pid of this.processes.values()) { kill(pid) } this.processes.clear() } }
Add guard to process error log
Add guard to process error log In case process is still running when package is disabled.
JavaScript
mit
thomasjo/atom-latex,thomasjo/atom-latex,thomasjo/atom-latex
754eafc1736174f00d9d7b1ceb8df1b20af66417
app/soc/content/js/templates/modules/gsoc/_survey.js
app/soc/content/js/templates/modules/gsoc/_survey.js
/* Copyright 2011 the Melange authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author <a href="mailto:[email protected]">Mario Ferraro</a> */ (function() { var template_name = "survey"; melange.template[template_name] = function(_self, context) { }; melange.template[template_name].prototype = new melange.templates._baseTemplate(); melange.template[template_name].prototype.constructor = melange.template[template_name]; melange.template[template_name].apply( melange.template[template_name], [melange.template[template_name], melange.template[template_name].prototype.context] ); }());
/* Copyright 2011 the Melange authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author <a href="mailto:[email protected]">Mario Ferraro</a> */ melange.templates.inherit( function (_self, context) { } );
Make the skeleton survey JS compatible with the new JS templates.
Make the skeleton survey JS compatible with the new JS templates.
JavaScript
apache-2.0
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
f6e40afb28c93c3b537d73d2313fc2bf17e7548f
src/build.js
src/build.js
import fs from 'fs' import postcss from 'postcss' import tailwind from '..' import CleanCSS from 'clean-css' function buildDistFile(filename) { return new Promise((resolve, reject) => { console.log(`Processing ./${filename}.css...`) fs.readFile(`./${filename}.css`, (err, css) => { if (err) throw err return postcss([tailwind(), require('autoprefixer')]) .process(css, { from: `./${filename}.css`, to: `./dist/${filename}.css`, map: { inline: false }, }) .then(result => { fs.writeFileSync(`./dist/${filename}.css`, result.css) if (result.map) { fs.writeFileSync(`./dist/${filename}.css.map`, result.map) } return result }) .then(result => { const minified = new CleanCSS().minify(result.css) fs.writeFileSync(`./dist/${filename}.min.css`, minified.styles) }) .then(resolve) .catch(error => { console.log(error) reject() }) }) }) } console.info('Building Tailwind!') Promise.all([ buildDistFile('preflight'), buildDistFile('components'), buildDistFile('utilities'), buildDistFile('tailwind'), ]).then(() => { console.log('Finished Building Tailwind!') })
import fs from 'fs' import postcss from 'postcss' import tailwind from '..' import CleanCSS from 'clean-css' function buildDistFile(filename) { return new Promise((resolve, reject) => { console.log(`Processing ./${filename}.css...`) fs.readFile(`./${filename}.css`, (err, css) => { if (err) throw err return postcss([tailwind(), require('autoprefixer')]) .process(css, { from: `./${filename}.css`, to: `./dist/${filename}.css`, map: { inline: false }, }) .then(result => { fs.writeFileSync(`./dist/${filename}.css`, result.css) if (result.map) { fs.writeFileSync(`./dist/${filename}.css.map`, result.map) } return result }) .then(result => { const minified = new CleanCSS().minify(result.css) fs.writeFileSync(`./dist/${filename}.min.css`, minified.styles) }) .then(resolve) .catch(error => { console.log(error) reject() }) }) }) } console.info('Building Tailwind!') Promise.all([ buildDistFile('base'), buildDistFile('components'), buildDistFile('utilities'), buildDistFile('tailwind'), ]).then(() => { console.log('Finished Building Tailwind!') })
Build base instead of preflight
Build base instead of preflight
JavaScript
mit
tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss
6d0946dd4d0746486bc0290e65df86ead40337dd
lib/wait-for-socket.js
lib/wait-for-socket.js
'use strict'; var net = require('net'), utils = require('radiodan-client').utils, logger = utils.logger(__filename); function create(port, socket) { var deferred = utils.promise.defer(), retries = 0, timeout = 1000; socket = socket || new net.Socket(); socket.setTimeout(2500); function addHandlers() { socket.on('connect', handleConnect); socket.on('error', handleError); } function handleConnect() { logger.debug('Connected to', port); deferred.resolve(port); } function handleError() { logger.warn('Cannot connect, attempt #' + ++retries); setTimeout(function () { socket.connect(port); }, timeout); } function connect() { logger.debug('Connecting to port', port); addHandlers(); socket.connect(port); return deferred.promise; } return { _addHandlers: addHandlers, connect: connect }; } module.exports = { create: create };
'use strict'; var net = require('net'), utils = require('radiodan-client').utils, logger = utils.logger(__filename); function create(port, socket) { var deferred = utils.promise.defer(), retries = 0, timeout = 1000; socket = socket || new net.Socket(); socket.setTimeout(2500); function addHandlers() { socket.on('connect', handleConnect); socket.on('error', handleError); } function handleConnect() { logger.debug('Connected to', port); deferred.resolve(port); } function handleError() { retries++; logger.warn('Cannot connect, attempt #' + retries); setTimeout(function () { socket.connect(port); }, timeout); } function connect() { logger.debug('Connecting to port', port); addHandlers(); socket.connect(port); return deferred.promise; } return { _addHandlers: addHandlers, connect: connect }; } module.exports = { create: create };
Increment `retries` variable in a way that pleases `jshint`.
Increment `retries` variable in a way that pleases `jshint`.
JavaScript
apache-2.0
radiodan/radiodan.js,radiodan/radiodan.js
1e7ce40caa9255e40bfabfc8c9238cae159d562a
migrations/1_add_paths.js
migrations/1_add_paths.js
'use strict'; exports.up = function(knex, Promise) { return knex.schema. createTable('paths', function (t) { t.increments('id'); t.text('curator').notNullable(); t.text('curator_org'); t.specificType('collaborators', 'text[]'); t.text('name').notNullable(); t.text('description'); t.text('version').notNullable(); t.text('license'); t.text('image_url'); t.text('asset_urls'); t.text('keywords'); t.timestamp('created').notNullable().defaultTo(knex.raw('CURRENT_TIMESTAMP')); }); }; exports.down = function(knex, Promise) { return knex.schema.dropTableIfExists('paths'); };
'use strict'; exports.up = function(knex, Promise) { return knex.schema. createTable('paths', function (t) { t.increments('id'); t.text('curator').notNullable(); t.text('curator_org'); t.specificType('collaborators', 'text[]'); t.text('name').notNullable(); t.text('description'); t.text('version').notNullable(); t.text('license'); t.text('image_url'); t.specificType('asset_urls', 'text[]'); t.specificType('keywords', 'text[]'); t.timestamp('created').notNullable().defaultTo(knex.raw('CURRENT_TIMESTAMP')); }); }; exports.down = function(knex, Promise) { return knex.schema.dropTableIfExists('paths'); };
Update keyword and asset_url fields to accept arrays.
Update keyword and asset_url fields to accept arrays. Resolves #16
JavaScript
mit
coding-the-humanities/unacademic_backend,coding-the-humanities/unacademic_backend
3a7bad8761e57ec39100f780360908de036be3f2
models/InternalNote.js
models/InternalNote.js
var keystone = require('keystone'), Types = keystone.Field.Types; // Create model. Additional options allow menu name to be used what auto-generating URLs var InternalNotes = new keystone.List('Internal Note', { track: true, autokey: { path: 'key', from: 'slug', unique: true }, defaultSort: 'date' }); // Create fields InternalNotes.add({ child: { type: Types.Relationship, label: 'child', ref: 'Child', initial: true, }, family: { type: Types.Relationship, label: 'family', ref: 'Prospective Parent or Family', initial: true }, date: { type: Types.Text, label: 'note date', note: 'mm/dd/yyyy', required: true, noedit: true, initial: true, }, employee: { type: Types.Relationship, label: 'note creator', ref: 'User', required: true, noedit: true, initial: true, }, note: { type: Types.Textarea, label: 'note', required: true, initial: true, } }); // Pre Save InternalNotes.schema.pre('save', function(next) { 'use strict'; // generate an internal ID based on the current highest internal ID // get the employee who is currently logged in and save ID to employee // TODO: Assign a registration number if one isn't assigned next(); }); // Define default columns in the admin interface and register the model InternalNotes.defaultColumns = 'date, child, family, note'; InternalNotes.register();
var keystone = require('keystone'), Types = keystone.Field.Types; // Create model. Additional options allow menu name to be used what auto-generating URLs var InternalNotes = new keystone.List('Internal Note', { track: true, autokey: { path: 'key', from: 'slug', unique: true }, defaultSort: 'date' }); // Create fields InternalNotes.add({ child: { type: Types.Relationship, label: 'child', ref: 'Child', initial: true, }, prospectiveParentOrFamily: { type: Types.Relationship, label: 'family', ref: 'Prospective Parent or Family', initial: true }, date: { type: Types.Text, label: 'note date', note: 'mm/dd/yyyy', required: true, noedit: true, initial: true, }, employee: { type: Types.Relationship, label: 'note creator', ref: 'User', required: true, noedit: true, initial: true, }, note: { type: Types.Textarea, label: 'note', required: true, initial: true, } }); // Pre Save InternalNotes.schema.pre('save', function(next) { 'use strict'; // generate an internal ID based on the current highest internal ID // get the employee who is currently logged in and save ID to employee // TODO: Assign a registration number if one isn't assigned next(); }); // Define default columns in the admin interface and register the model InternalNotes.defaultColumns = 'date, child, family, note'; InternalNotes.register();
Fix a bad reference value in the Internal Note model.
Fix a bad reference value in the Internal Note model.
JavaScript
mit
autoboxer/MARE,autoboxer/MARE
2be619f254bf2794346c2482f16666b3670182ca
src/index.js
src/index.js
define([ "less!src/stylesheets/main.less" ], function() { var manager = new codebox.tabs.Manager(); // Add tabs to grid codebox.app.grid.addView(manager, { width: 20 }); // Render the tabs manager manager.render(); // Make the tab manager global codebox.panels = manager; });
define([ "less!src/stylesheets/main.less" ], function() { var manager = new codebox.tabs.Manager(); // Add tabs to grid codebox.app.grid.addView(manager, { width: 20, at: 0 }); // Render the tabs manager manager.render(); // Make the tab manager global codebox.panels = manager; });
Add at first position in grid
Add at first position in grid
JavaScript
apache-2.0
CodeboxIDE/package-panels,etopian/codebox-package-panels
2af8c1d2919d0cbe9dd92c28058d0bd199d08836
src/index.js
src/index.js
#!/usr/bin/env node var argv = process.argv.splice(2) var log = require('./helpers/log.js') var whitelist = ['build', 'run', 'test', 'lint', 'setup'] if (argv.length === 0 || argv[0] === 'help') { console.log('abc [command]\n\nCommands:') console.log(' build Compiles the source files from src/ into a build/ directory. ') console.log(' run src/file.js Runs a specified file.') console.log(' test Runs the test files in the tests/ directory.') console.log(' lint Checks if your code is consistent and follows best practices. ') console.log(' setup Creates the directories and files for the whole project to run.') console.log(' help This help page you are looking at!') process.exit(0) } if (whitelist.indexOf(argv[0]) === -1) { log.error('Command `' + argv[0] + '` does not exist') process.exit(1) } var callback = require('./' + argv[0] + '.js') callback.apply(null, argv.splice(1))
#!/usr/bin/env node var argv = process.argv.splice(2) var log = require('./helpers/log.js') var whitelist = ['build', 'run', 'test', 'lint', 'setup'] if (argv.length === 0 || argv[0] === 'help') { console.log('abc [command]') console.log('') console.log('Commands:') console.log(' setup Creates the directories and files for the whole project to run.') console.log(' build Compiles the source files from src/ into a build/ directory.') console.log(' test Runs the test files in the tests/ directory.') console.log(' lint Checks if your code is consistent and follows best practices.') console.log(' run src/file.js Runs a specified file.') console.log(' help This help page you are looking at!') process.exit(0) } if (whitelist.indexOf(argv[0]) === -1) { log.error('Command `' + argv[0] + '` does not exist') process.exit(1) } var callback = require('./' + argv[0] + '.js') callback.apply(null, argv.splice(1))
Remove whitespace & use same order as in readme
Remove whitespace & use same order as in readme
JavaScript
mit
queicherius/abc-environment,queicherius/abc-environment
b390a49f0ff94cb6944623e467383af4d0f436b7
src/index.js
src/index.js
module.exports = function mutableProxyFactory(defaultTarget) { let mutableHandler; let mutableTarget; function setTarget(target) { if (!(target instanceof Object)) { throw new Error(`Target "${target}" is not an object`); } mutableTarget = target; } function setHandler(handler) { Object.keys(handler).forEach(key => { const value = handler[key]; if (typeof value !== 'function') { throw new Error(`Trap "${key}: ${value}" is not a function`); } if (!Reflect[key]) { throw new Error(`Trap "${key}: ${value}" is not a valid trap`); } }); mutableHandler = handler; } if (defaultTarget) { setTarget(defaultTarget); } setHandler(Reflect); // Dynamically forward all the traps to the associated methods on the mutable handler const handler = new Proxy({}, { get(target, property) { return (...args) => { const patched = [mutableTarget].concat(...args.slice(1)); return mutableHandler[property].apply(null, patched); }; } }); return { setTarget, setHandler, getTarget() { return mutableTarget; }, getHandler() { return mutableHandler; }, proxy: new Proxy(() => {}, handler) }; };
module.exports = function mutableProxyFactory(defaultTarget) { let mutableHandler; let mutableTarget; function setTarget(target) { if (!(target instanceof Object)) { throw new Error(`Target "${target}" is not an object`); } mutableTarget = target; } function setHandler(handler) { Object.keys(handler).forEach(key => { const value = handler[key]; if (typeof value !== 'function') { throw new Error(`Trap "${key}: ${value}" is not a function`); } if (!Reflect[key]) { throw new Error(`Trap "${key}: ${value}" is not a valid trap`); } }); mutableHandler = handler; } if (defaultTarget) { setTarget(defaultTarget); } setHandler(Reflect); // Dynamically forward all the traps to the associated methods on the mutable handler const handler = new Proxy({}, { get(target, property) { return (...args) => mutableHandler[property].apply(null, [mutableTarget, ...args.slice(1)]); } }); return { setTarget, setHandler, getTarget() { return mutableTarget; }, getHandler() { return mutableHandler; }, proxy: new Proxy(() => {}, handler) }; };
Revert proxy handler change for coverage
Revert proxy handler change for coverage
JavaScript
mit
Griffingj/mutable-proxy
f215aeb4e0ff59d2028088349e965e6207f08228
mysite/ct/static/js/ct.js
mysite/ct/static/js/ct.js
function setInterest(targeturl, state, csrftoken) { $.post(targeturl, { csrfmiddlewaretoken:csrftoken, state:state }); } function toggleInterest(o, targeturl, csrftoken) { if (o.value == "1") { o.value="0"; } else { o.value="1"; } setInterest(targeturl, o.value, csrftoken); } $(document).ready(function(){ var GRADEABLE_SUB_KINDS = ['numbers', 'equation']; var elements = $("#div_id_number_max_value,#div_id_number_min_value,#div_id_number_precision,#div_id_enable_auto_grading"); var sub_kind_field = $('#id_sub_kind'); if ($.inArray($(sub_kind_field).val(), GRADEABLE_SUB_KINDS) == -1 ) { elements.hide(); } sub_kind_field.on('change', function(e){ // show and hide numbers related fields if ($.inArray($(this).val(), GRADEABLE_SUB_KINDS) != -1 ) { elements.show(); } else { elements.hide(); $("#id_enable_auto_grading").prop('checked', false); } }) });
function setInterest(targeturl, state, csrftoken) { $.post(targeturl, { csrfmiddlewaretoken:csrftoken, state:state }); } function toggleInterest(o, targeturl, csrftoken) { if (o.value == "1") { o.value="0"; } else { o.value="1"; } setInterest(targeturl, o.value, csrftoken); } $(document).ready(function(){ var GRADEABLE_SUB_KINDS = ['numbers', 'equation']; var number_elements = $("#div_id_number_max_value,#div_id_number_min_value,#div_id_number_value"); var grading_elements = $("#div_id_enable_auto_grading"); var sub_kind_field = $('#id_sub_kind'); if (sub_kind_field.val() !== 'numbers') { number_elements.hide(); } if ($.inArray(sub_kind_field.val(), GRADEABLE_SUB_KINDS) == -1 ) { grading_elements.hide(); } sub_kind_field.on('change', function(e){ // show and hide numbers related fields if ($.inArray($(this).val(), GRADEABLE_SUB_KINDS) != -1 ) { grading_elements.show(); } else { grading_elements.hide(); $("#id_enable_auto_grading").prop('checked', false); } }) });
Fix for nnumbers to show\hide fields
Fix for nnumbers to show\hide fields
JavaScript
apache-2.0
raccoongang/socraticqs2,raccoongang/socraticqs2,cjlee112/socraticqs2,raccoongang/socraticqs2,raccoongang/socraticqs2,cjlee112/socraticqs2,cjlee112/socraticqs2,cjlee112/socraticqs2
9002c6ea6bf1137afb67d2449e67d63c9cf83c3e
js/models/tag.js
js/models/tag.js
ds.models.tag = function(data) { "use strict"; var storage = {} , self = {} limivorous.observable(self, storage) .property(self, 'id', storage) .property(self, 'href', storage) .property(self, 'name', storage) .property(self, 'description', storage) .property(self, 'color', storage) .property(self, 'count', storage) Object.defineProperty(self, 'is_tag', {value: true}); if (data) { if (data.is_tag) { return data } else if (typeof data === 'string') { self.name = data } else { self.id = data.id self.href = data.href self.name = data.name self.description = data.description self.color = data.color self.count = data.count } } self.toJSON = function() { return { id: self.id, href: self.href, name: self.name, description: self.description, color: self.color, count: self.count } } return self }
ds.models.tag = function(data) { "use strict"; var storage = {} , self = {} limivorous.observable(self, storage) .property(self, 'id', storage) .property(self, 'href', storage) .property(self, 'name', storage) .property(self, 'description', storage) .property(self, 'color', storage) .property(self, 'count', storage) Object.defineProperty(self, 'is_tag', {value: true}); if (data) { if (data.is_tag) { return data } else if (typeof data === 'string') { self.name = data } else { self.id = data.id self.href = data.href self.name = data.name self.description = data.description self.color = data.color self.count = data.count } } self.toJSON = function() { var json = {} if (self.id) json.id = self.id if (self.href) json.href = self.href if (self.name) json.name = self.name if (self.description) json.description = self.description if (self.color) json.color = self.color if (self.count) json.count = self.count return json } return self }
Rewrite toJSON to eliminate null values
Rewrite toJSON to eliminate null values
JavaScript
apache-2.0
urbanairship/tessera,section-io/tessera,jmptrader/tessera,tessera-metrics/tessera,jmptrader/tessera,jmptrader/tessera,filippog/tessera,urbanairship/tessera,urbanairship/tessera,urbanairship/tessera,aalpern/tessera,filippog/tessera,tessera-metrics/tessera,filippog/tessera,section-io/tessera,jmptrader/tessera,section-io/tessera,Slach/tessera,aalpern/tessera,Slach/tessera,tessera-metrics/tessera,aalpern/tessera,aalpern/tessera,aalpern/tessera,urbanairship/tessera,Slach/tessera,Slach/tessera,tessera-metrics/tessera,tessera-metrics/tessera,section-io/tessera,jmptrader/tessera
2567834bb6ae44d6b2834a7d36709d97e166b790
lib/commands/lint.js
lib/commands/lint.js
'use strict' module.exports = function (dep) { let cmd = {} cmd.command = 'lint' cmd.desc = 'Run linters and fix possible code' cmd.handler = function (argv) { let { join, log, process, __rootdirname, gherkinLinter } = dep // Linters const configPath = join(__rootdirname, '/lib/sdk/cucumber/gherkin-lint-rules.json') const featureDirs = [join(process.cwd(), '/features/**/*.')] log.log('Checking files:', featureDirs.toString()) if (gherkinLinter.run(configPath, featureDirs) !== 0) { log.exit('There are errors to fix on the feature files') } else { log.log('All feature files look correct!') } } return cmd }
'use strict' module.exports = function (dep) { function validate () { let {validation, help} = dep if (!validation.isPatataRootDir()) { help.errorDueRootPath() } } let cmd = {} cmd.command = 'lint' cmd.desc = 'Run linters and fix possible code' cmd.handler = function (argv) { let { join, log, process, __rootdirname, gherkinLinter } = dep validate() // Linters const configPath = join(__rootdirname, '/lib/sdk/cucumber/gherkin-lint-rules.json') const featureDirs = [join(process.cwd(), '/features/**/*.')] log.log('Checking files:', featureDirs.toString()) if (gherkinLinter.run(configPath, featureDirs) !== 0) { log.exit('There are errors to fix on the feature files') } else { log.log('All feature files look correct!') } } return cmd }
Fix bug checking root of project.
Linter: Fix bug checking root of project.
JavaScript
mit
eridem/patata,appersonlabs/patata
6578d26b06121f1e1e87fea267d1e6696b1ddb34
js/scrollback.js
js/scrollback.js
document.addEventListener("wheel", function(e) { if (e.shiftKey && e.deltaX != 0) { window.history.go(-Math.sign(e.deltaX)); return e.preventDefault(); } });
document.addEventListener("wheel", function(e) { if (e.shiftKey && (e.deltaX != 0 || e.deltaY != 0)) { window.history.go(-Math.sign(e.deltaX ? e.deltaX : e.deltaY)); return e.preventDefault(); } });
Fix a problem of deltaX and deltaY
Fix a problem of deltaX and deltaY Signed-off-by: Dongyun Jin <[email protected]>
JavaScript
mit
jezcope/chrome-scroll-back
70785353a9526b56a11f71df0f6f8d40591aeaa4
api/controllers/requests.js
api/controllers/requests.js
var OwerRequestModel = require('../models/requests/owerRequest.js') , error = require('../utils/error.js'); var allOwerRequests = function(req, res) { var facebookId = req.user.facebookId , type = req.query.type; if (type) { if (type === 'received') { conditions.to = facebookId; } else if (type === 'sent') { conditions.from = facebookId; } else { return error.badRequest(res, 'Invalid parameter: type must be either "received" or "sent"'); } } OwerRequestModel.findAsync(conditions) .then(function(owerRequests) { res.json(owerRequests); }) .catch(error.serverHandler(res)); }; exports.owers = { all: allOwerRequests };
var OwerRequestModel = require('../models/requests/owerRequest.js') , error = require('../utils/error.js'); var allOwerRequests = function(req, res) { var type = req.query.type; var facebookId; if (req.user && req.user.facebookId) { facebookId = req.user.facebookId; } if (type && facebookId) { if (type === 'received') { conditions.to = facebookId; } else if (type === 'sent') { conditions.from = facebookId; } else { return error.badRequest(res, 'Invalid parameter: type must be either "received" or "sent"'); } } OwerRequestModel.findAsync(conditions) .then(function(owerRequests) { res.json(owerRequests); }) .catch(error.serverHandler(res)); }; exports.owers = { all: allOwerRequests };
Fix admin not being able to access reqs
Fix admin not being able to access reqs
JavaScript
mit
justinsacbibit/omi,justinsacbibit/omi,justinsacbibit/omi
421f01a63ce4446abf5ce8927122fca20e7c6505
app/adapters/application.js
app/adapters/application.js
import LFAdapter from 'ember-localforage-adapter/adapters/localforage'; export default LFAdapter.extend({ namespace: 'expenses', caching: 'model' });
import LFAdapter from 'ember-localforage-adapter/adapters/localforage'; export default LFAdapter.extend({ namespace: 'api', caching: 'model' });
Change adapter namespace to api
refactor: Change adapter namespace to api
JavaScript
mit
pe1te3son/spendings-tracker,pe1te3son/spendings-tracker
347ec3d58a8d30303575d8ac7e5d6bf2ba47dfc6
test/unit.js
test/unit.js
describe('skatejs-web-components', () => { });
import '../src/index'; describe('skatejs-web-components', () => { it('should create a custom element with a shadow root', () => { const Elem = class extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } }; window.customElements.define('x-test', Elem); const elem = new Elem(); expect(!!elem.shadowRoot).to.equal(true); }); });
Add test that ensures all V1 APIs exist when the library is imported.
test: Add test that ensures all V1 APIs exist when the library is imported.
JavaScript
mit
skatejs/web-components
86c36fd831a8cacd988ce1b56288200960dd84c1
src/OData.js
src/OData.js
import React, { Component } from 'react'; import Fetch, { renderChildren } from 'react-fetch-component'; import buildQuery from 'odata-query'; function buildUrl(baseUrl, query) { return query !== false && baseUrl + buildQuery(query); } class OData extends Component { render() { const { baseUrl, query, children, ...rest } = this.props; const url = buildUrl(baseUrl, query); return ( <Fetch url={url} {...rest}> {({ fetch, ...props }) => { return renderChildren(children, { ...props, fetch: (query, options, updateOptions) => fetch( buildUrl(baseUrl, query || this.props.query), options || this.props.options, updateOptions ) }); }} </Fetch> ); } } export { buildQuery, renderChildren }; export default OData;
import React, { Component } from 'react'; import Fetch, { renderChildren } from 'react-fetch-component'; import buildQuery from 'odata-query'; function buildUrl(baseUrl, query) { return query !== false && baseUrl + buildQuery(query); } class OData extends Component { render() { const { baseUrl, query = {}, ...rest } = this.props; return ( <Fetch url={query} fetchFunction={(query, options, updateOptions) => { const url = buildUrl(baseUrl, query); return fetch(url, options, updateOptions); }} {...rest} /> ); } } export { buildQuery, renderChildren }; export default OData;
Use fetchFunction instead of currying functions
Use fetchFunction instead of currying functions
JavaScript
mit
techniq/react-odata
29c1630e2c6597bd5ab9e923ffb0e091f0934bb8
test/bitgo.js
test/bitgo.js
// // Tests for BitGo Object // // Copyright 2014, BitGo, Inc. All Rights Reserved. // var assert = require('assert'); var should = require('should'); var BitGoJS = require('../src/index'); describe('BitGo', function() { describe('methods', function() { it('includes version', function() { var bitgo = new BitGoJS.BitGo(); bitgo.should.have.property('version'); var version = bitgo.version(); assert.equal(typeof(version), 'string'); }); it('includes market', function(done) { var bitgo = new BitGoJS.BitGo(); bitgo.should.have.property('market'); bitgo.market(function(marketData) { marketData.should.have.property('last'); marketData.should.have.property('bid'); marketData.should.have.property('ask'); marketData.should.have.property('volume'); marketData.should.have.property('high'); marketData.should.have.property('low'); done(); }); }); }); });
// // Tests for BitGo Object // // Copyright 2014, BitGo, Inc. All Rights Reserved. // var assert = require('assert'); var should = require('should'); var BitGoJS = require('../src/index'); describe('BitGo', function() { describe('methods', function() { it('includes version', function() { var bitgo = new BitGoJS.BitGo(); bitgo.should.have.property('version'); var version = bitgo.version(); assert.equal(typeof(version), 'string'); }); it('includes market', function(done) { var bitgo = new BitGoJS.BitGo(); bitgo.should.have.property('market'); bitgo.market(function(marketData) { marketData.should.have.property('last'); marketData.should.have.property('bid'); marketData.should.have.property('ask'); marketData.should.have.property('volume'); marketData.should.have.property('high'); marketData.should.have.property('low'); marketData.should.have.property('updateTime'); done(); }); }); }); });
Add updateTime check to test.
Add updateTime check to test.
JavaScript
apache-2.0
BitGo/BitGoJS,BitGo/BitGoJS,BitGo/BitGoJS,BitGo/BitGoJS
1eaf541f9c88d135ddb5bf6828937a4e6505f688
test/index.js
test/index.js
'use strict'; /* global describe it */ var assert = require('assert'); var flattenObjectStrict = require('../lib'); describe('flatten-object-strict', function() { it('an empty object produces an empty object', function() { assert.deepEqual(flattenObjectStrict({}), {}); }); });
'use strict'; /* global describe it */ var assert = require('assert'); var flattenObjectStrict = require('../lib'); describe('flatten-object-strict', function() { it('an empty object produces an empty object', function() { assert.deepEqual(flattenObjectStrict({}), {}); }); it('a object that\'s already flat doesn\'t change', function() { [ { a: 'a', b: [1, 2, 3], c: function() {} }, { foo: 'bar', baz: 'boom' }, { one: 'one', two: 'two', three: 'three', four: 'four', five: 'five' } ].forEach(function(flatObject) { assert.deepEqual(flattenObjectStrict(flatObject), flatObject); }); }); });
Add test for flat objects
Add test for flat objects
JavaScript
mit
voltrevo/flatten-object-strict
5fe20444cef17cd889803ecbcb3a7c96b47c47e3
lib/assets/javascripts/cartodb/new_dashboard/entry.js
lib/assets/javascripts/cartodb/new_dashboard/entry.js
var Router = require('new_dashboard/router'); var $ = require('jquery'); var cdb = require('cartodb.js'); var MainView = require('new_dashboard/main_view'); /** * The Holy Dashboard */ $(function() { cdb.init(function() { cdb.templates.namespace = 'cartodb/'; cdb.config.set(config); // import config if (cdb.config.isOrganizationUrl()) { cdb.config.set('url_prefix', cdb.config.organizationUrl()); } var router = new Router(); // Mixpanel test if (window.mixpanel) { new cdb.common.Mixpanel({ user: user_data, token: mixpanel_token }); } // Store JS errors new cdb.admin.ErrorStats({ user_data: user_data }); // Main view var dashboard = new MainView({ el: document.body, user_data: user_data, upgrade_url: upgrade_url, config: config, router: router }); window.dashboard = dashboard; // History Backbone.history.start({ pushState: true, root: cdb.config.prefixUrl() + '/' //cdb.config.prefixUrl() + '/dashboard/' }); }); });
var Router = require('new_dashboard/router'); var $ = require('jquery'); var cdb = require('cartodb.js'); var MainView = require('new_dashboard/main_view'); /** * The Holy Dashboard */ $(function() { cdb.init(function() { cdb.templates.namespace = 'cartodb/'; cdb.config.set(window.config); // import config if (cdb.config.isOrganizationUrl()) { cdb.config.set('url_prefix', cdb.config.organizationUrl()); } var router = new Router(); // Mixpanel test if (window.mixpanel) { new cdb.common.Mixpanel({ user: user_data, token: mixpanel_token }); } // Store JS errors new cdb.admin.ErrorStats({ user_data: user_data }); // Main view var dashboard = new MainView({ el: document.body, user_data: user_data, upgrade_url: upgrade_url, config: config, router: router }); window.dashboard = dashboard; // History Backbone.history.start({ pushState: true, root: cdb.config.prefixUrl() + '/' //cdb.config.prefixUrl() + '/dashboard/' }); }); });
Make the config dependency's origin
Make the config dependency's origin Set in global namespace from a script tag rendered by Rails app
JavaScript
bsd-3-clause
splashblot/dronedb,codeandtheory/cartodb,splashblot/dronedb,dbirchak/cartodb,nuxcode/cartodb,UCL-ShippingGroup/cartodb-1,raquel-ucl/cartodb,CartoDB/cartodb,thorncp/cartodb,nuxcode/cartodb,splashblot/dronedb,dbirchak/cartodb,bloomberg/cartodb,splashblot/dronedb,nuxcode/cartodb,UCL-ShippingGroup/cartodb-1,nyimbi/cartodb,future-analytics/cartodb,nyimbi/cartodb,thorncp/cartodb,future-analytics/cartodb,nuxcode/cartodb,CartoDB/cartodb,bloomberg/cartodb,DigitalCoder/cartodb,thorncp/cartodb,CartoDB/cartodb,codeandtheory/cartodb,nyimbi/cartodb,DigitalCoder/cartodb,future-analytics/cartodb,UCL-ShippingGroup/cartodb-1,splashblot/dronedb,nyimbi/cartodb,UCL-ShippingGroup/cartodb-1,UCL-ShippingGroup/cartodb-1,future-analytics/cartodb,codeandtheory/cartodb,thorncp/cartodb,DigitalCoder/cartodb,dbirchak/cartodb,thorncp/cartodb,DigitalCoder/cartodb,DigitalCoder/cartodb,bloomberg/cartodb,bloomberg/cartodb,CartoDB/cartodb,raquel-ucl/cartodb,future-analytics/cartodb,dbirchak/cartodb,codeandtheory/cartodb,dbirchak/cartodb,nyimbi/cartodb,nuxcode/cartodb,raquel-ucl/cartodb,CartoDB/cartodb,raquel-ucl/cartodb,codeandtheory/cartodb,bloomberg/cartodb,raquel-ucl/cartodb
df8210287256f88244996a4a905c3be2197829bf
aura-impl/src/main/resources/aura/model/Model.js
aura-impl/src/main/resources/aura/model/Model.js
/* * Copyright (C) 2012 salesforce.com, inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint sub: true */ /** * @namespace Creates a Model instance. * @constructor * @param {Object} def * @param {Object} data * @param {Component} component * @returns {Function} */ function Model(def, data, component){ /** BEGIN HACK--MUST BE REMOVED **/ if (def.getDescriptor().getQualifiedName() === "java://ui.aura.components.forceProto.FilterListModel") { for (var i in data["rowTemplate"]) { data["rowTemplate"][i] = new SimpleValue(data["rowTemplate"][i], def, component); } } if (def.getDescriptor().getQualifiedName() === "java://org.auraframework.component.ui.DataTableModel") { for (var j in data["itemTemplate"]) { data["itemTemplate"][j] = new SimpleValue(data["itemTemplate"][j], def, component); } } /** END HACK**/ return new MapValue(data, def, component); }
/* * Copyright (C) 2012 salesforce.com, inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint sub: true */ /** * @namespace Creates a Model instance. * @constructor * @param {Object} def * @param {Object} data * @param {Component} component * @returns {Function} */ function Model(def, data, component){ return new MapValue(data, def, component); }
Remove model hack--no longer needed for lists
Remove model hack--no longer needed for lists
JavaScript
apache-2.0
lhong375/aura,badlogicmanpreet/aura,DebalinaDey/AuraDevelopDeb,navyliu/aura,madmax983/aura,forcedotcom/aura,lhong375/aura,forcedotcom/aura,TribeMedia/aura,DebalinaDey/AuraDevelopDeb,badlogicmanpreet/aura,TribeMedia/aura,igor-sfdc/aura,DebalinaDey/AuraDevelopDeb,TribeMedia/aura,lcnbala/aura,SalesforceSFDC/aura,madmax983/aura,SalesforceSFDC/aura,badlogicmanpreet/aura,madmax983/aura,DebalinaDey/AuraDevelopDeb,madmax983/aura,SalesforceSFDC/aura,igor-sfdc/aura,SalesforceSFDC/aura,badlogicmanpreet/aura,igor-sfdc/aura,TribeMedia/aura,forcedotcom/aura,badlogicmanpreet/aura,navyliu/aura,madmax983/aura,navyliu/aura,lhong375/aura,navyliu/aura,lcnbala/aura,DebalinaDey/AuraDevelopDeb,igor-sfdc/aura,lcnbala/aura,SalesforceSFDC/aura,forcedotcom/aura,badlogicmanpreet/aura,navyliu/aura,DebalinaDey/AuraDevelopDeb,SalesforceSFDC/aura,madmax983/aura,lcnbala/aura,TribeMedia/aura,lcnbala/aura,navyliu/aura,TribeMedia/aura,lcnbala/aura,igor-sfdc/aura,lhong375/aura,forcedotcom/aura
a864bc226ec204bc2083e2abd98a4493afa2da04
karma.component.config.js
karma.component.config.js
module.exports = function(config) { config.set({ basePath: process.env['INIT_CWD'], frameworks: ['mocha', 'chai', 'karma-typescript', 'sinon'], browsers: ['ChromeHeadless', 'FirefoxHeadless'], files: [ './node_modules/@webcomponents/webcomponentsjs/webcomponents-sd-ce.js', { pattern: 'dist/*.bundled.js' }, { pattern: 'test/*.test.ts' }, { pattern: 'test/**/*.json', watched: true, served: true, included: false }, ], reporters: ['progress', 'karma-typescript'], singleRun: true, port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: false, concurrency: Infinity, preprocessors: { '**/*.ts': ['karma-typescript'], }, karmaTypescriptConfig: { compilerOptions: { target: 'es2015', }, bundlerOptions: { transforms: [require('karma-typescript-es6-transform')({ presets: 'env' })], }, }, }); }
module.exports = function(config) { config.set({ basePath: process.env['INIT_CWD'], frameworks: ['mocha', 'chai', 'karma-typescript', 'sinon'], browsers: ['ChromeHeadless'], files: [ './node_modules/@webcomponents/webcomponentsjs/webcomponents-sd-ce.js', { pattern: 'dist/*.bundled.js' }, { pattern: 'test/*.test.ts' }, { pattern: 'test/**/*.json', watched: true, served: true, included: false }, ], reporters: ['progress', 'karma-typescript'], singleRun: true, port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: false, concurrency: Infinity, preprocessors: { '**/*.ts': ['karma-typescript'], }, karmaTypescriptConfig: { compilerOptions: { target: 'es2015', }, bundlerOptions: { transforms: [require('karma-typescript-es6-transform')({ presets: 'env' })], }, }, }); }
Disable Firefox until their ShadowDOM is in place
Disable Firefox until their ShadowDOM is in place
JavaScript
mit
abraham/nutmeg-cli,abraham/nutmeg-cli,abraham/nutmeg-cli
d48b188b3ebe03ccbe9dfd57bb267261de962178
samples/VanillaJSTestApp2.0/app/b2c/authConfig.js
samples/VanillaJSTestApp2.0/app/b2c/authConfig.js
// Config object to be passed to Msal on creation const msalConfig = { auth: { clientId: "e3b9ad76-9763-4827-b088-80c7a7888f79", authority: "https://login.microsoftonline.com/tfp/msidlabb2c.onmicrosoft.com/B2C_1_SISOPolicy/", knownAuthorities: ["login.microsoftonline.com"] }, cache: { cacheLocation: "localStorage", // This configures where your cache will be stored storeAuthStateInCookie: false, // Set this to "true" if you are having issues on IE11 or Edge }, system: { telemetry: { applicationName: 'msalVanillaTestApp', applicationVersion: 'test1.0', telemetryEmitter: (events) => { console.log("Telemetry Events", events); } } } }; // Add here scopes for id token to be used at MS Identity Platform endpoints. const loginRequest = { scopes: ["https://msidlabb2c.onmicrosoft.com/msidlabb2capi/read"], forceRefresh: false // Set this to "true" to skip a cached token and go to the server to get a new token };
// Config object to be passed to Msal on creation const msalConfig = { auth: { clientId: "e3b9ad76-9763-4827-b088-80c7a7888f79", authority: "https://login.microsoftonline.com/tfp/msidlabb2c.onmicrosoft.com/B2C_1_SISOPolicy/", knownAuthorities: ["login.microsoftonline.com"] }, cache: { cacheLocation: "localStorage", // This configures where your cache will be stored storeAuthStateInCookie: false, // Set this to "true" if you are having issues on IE11 or Edge } }; // Add here scopes for id token to be used at MS Identity Platform endpoints. const loginRequest = { scopes: ["https://msidlabb2c.onmicrosoft.com/msidlabb2capi/read"], forceRefresh: false // Set this to "true" to skip a cached token and go to the server to get a new token };
Remove telemetry config from 2.0 sample
Remove telemetry config from 2.0 sample
JavaScript
mit
AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js,AzureAD/microsoft-authentication-library-for-js
5ea58b636d98ef0bb9294c241ee588d2a065c551
scripts/postinstall.js
scripts/postinstall.js
require("es6-shim"); var exec = require("child_process").exec; var os = require("os"); var useMraa = (function() { var release = os.release(); return release.includes("yocto") || release.includes("edison"); })(); if (useMraa) { exec("npm install [email protected]"); }
require("es6-shim"); var exec = require("child_process").exec; var os = require("os"); var useMraa = (function() { var release = os.release(); return release.includes("yocto") || release.includes("edison"); })(); var safeBuild = "0.6.1+git0+805d22f0b1-r0"; var safeVersion = "0.6.1-36-gbe4312e"; if (useMraa) { console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); console.log(" Do not quit the program until npm completes the installation process. "); console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); exec("opkg info libmraa0", function(error, stdout, stderr) { if (!stdout.includes(safeBuild)) { console.log(""); console.log(" Galileo-IO needs to install a trusted version of libmraa0."); console.log(" This process takes approximately one minute."); console.log(" Thanks for your patience."); exec("npm install mraa@" + safeVersion, function() { console.log(" Completed!"); console.log(""); }); } }); }
Check for safe version of libmraa0 before installing own copy.
Check for safe version of libmraa0 before installing own copy. - Displays information during postinstall to help user understand the process
JavaScript
mit
ashishdatta/galileo-io,kimathijs/galileo-io,julianduque/galileo-io,vj-ug/galileo-io,rwaldron/galileo-io
c6a12035debea100fcce7e2078a5ecd7be95a974
tests/test_middleware.js
tests/test_middleware.js
var async = require('async'); var request = require('request'); var sugar = require('object-sugar'); var rest = require('../lib/rest-sugar'); var serve = require('./serve'); var conf = require('./conf'); var models = require('./models'); var utils = require('./utils'); var queries = require('./queries'); function tests(done) { var port = conf.port + 1; var resource = conf.host + ':' + port + conf.prefix + 'authors'; var app = serve(conf); var api = rest.init(app, conf.prefix, { authors: models.Author }, sugar); api.pre(function() { api.use(rest.only('GET')); api.use(function(req, res, next) { next(); }); }); api.post(function() { api.use(function(data, next) { next(); }); }); // TODO: figure out how to spawn servers and close them. alternatively // move this handling to higher level app.listen(port, function(err) { if(err) return console.error(err); utils.runTests([ queries.get(resource), queries.create(resource, utils.forbidden), queries.createViaGet(resource, utils.forbidden) ], done); }); } module.exports = tests;
var assert = require('assert'); var async = require('async'); var request = require('request'); var sugar = require('object-sugar'); var rest = require('../lib/rest-sugar'); var serve = require('./serve'); var conf = require('./conf'); var models = require('./models'); var utils = require('./utils'); var queries = require('./queries'); function tests(done) { var port = conf.port + 1; var resource = conf.host + ':' + port + conf.prefix + 'authors'; var app = serve(conf); var api = rest.init(app, conf.prefix, { authors: models.Author }, sugar); var preTriggered, postTriggered; api.pre(function() { api.use(rest.only('GET')); api.use(function(req, res, next) { preTriggered = true; next(); }); }); api.post(function() { api.use(function(data, next) { postTriggered = true; next(); }); }); // TODO: figure out how to spawn servers and close them. alternatively // move this handling to higher level app.listen(port, function(err) { if(err) return console.error(err); utils.runTests([ queries.get(resource), queries.create(resource, utils.forbidden), queries.createViaGet(resource, utils.forbidden) ], function() { assert.ok(preTriggered); assert.ok(postTriggered); done(); }); }); } module.exports = tests;
Check that middlewares get triggered properly
Check that middlewares get triggered properly
JavaScript
mit
sugarjs/rest-sugar
2042a3e49ee1e3ab461f79acd488d34b2d5ec219
editor/js/Menubar.Status.js
editor/js/Menubar.Status.js
/** * @author mrdoob / http://mrdoob.com/ */ Menubar.Status = function ( editor ) { var container = new UI.Panel(); container.setClass( 'menu right' ); var checkbox = new UI.Checkbox( editor.config.getKey( 'autosave' ) ); checkbox.onChange( function () { editor.config.setKey( 'autosave', this.getValue() ); } ); container.add( checkbox ); var title = new UI.Panel(); title.setClass( 'title' ); title.setTextContent( 'Autosave' ); container.add( title ); editor.signals.savingStarted.add( function () { title.setTextDecoration( 'underline' ); } ); editor.signals.savingFinished.add( function () { title.setTextDecoration( 'none' ); } ); return container; };
/** * @author mrdoob / http://mrdoob.com/ */ Menubar.Status = function ( editor ) { var container = new UI.Panel(); container.setClass( 'menu right' ); var checkbox = new UI.Checkbox( editor.config.getKey( 'autosave' ) ); checkbox.onChange( function () { var value = this.getValue(); editor.config.setKey( 'autosave', value ); if ( value === true ) { editor.signals.sceneGraphChanged.dispatch(); } } ); container.add( checkbox ); var title = new UI.Panel(); title.setClass( 'title' ); title.setTextContent( 'Autosave' ); container.add( title ); editor.signals.savingStarted.add( function () { title.setTextDecoration( 'underline' ); } ); editor.signals.savingFinished.add( function () { title.setTextDecoration( 'none' ); } ); return container; };
Save scene when enabling autosave.
Editor: Save scene when enabling autosave.
JavaScript
mit
srifqi/three.js,NicolasRannou/three.js,colombod/three.js,dhritzkiv/three.js,Zerschmetterling91/three.js,matgr1/three.js,njam/three.js,aardgoose/three.js,tamarintech/three.js,dushmis/three.js,stevenliujw/three.js,WoodMath/three.js,hacksalot/three.js,davidvmckay/three.js,ZhenxingWu/three.js,fta2012/three.js,AntTech/three.js,tdmsinc/three.js,takahirox/three.js,satori99/three.js,rlugojr/three.js,tamarintech/three.js,amakaroff82/three.js,Jonham/three.js,Seagat2011/three.js,elisee/three.js,rgaino/three.js,threejsworker/three.js,TristanVALCKE/three.js,sasha240100/three.js,elephantatwork/ZAAK.IO-EditorInternal,elisee/three.js,toxicFork/three.js,NicolasRannou/three.js,Samsy/three.js,elephantatwork/three.js,ondys/three.js,liusashmily/three.js,gsssrao/three.js,Aldrien-/three.js,robmyers/three.js,controlzee/three.js,toxicFork/three.js,godlzr/Three.js,eq0rip/three.js,stanford-gfx/three.js,matgr1/three.js,brianchirls/three.js,tdmsinc/three.js,byhj/three.js,pailhead/three.js,amazg/three.js,mese79/three.js,0merta/three.js,dhritzkiv/three.js,meizhoubao/three.js,mrdoob/three.js,Nitrillo/three.js,coderrick/three.js,vizorvr/three.js,DeanLym/three.js,unconed/three.js,MasterJames/three.js,JingYongWang/three.js,dimensia/three.js,p5150j/three.js,fomenyesu/three.js,rbarraud/three.js,jango2015/three.js,ZAAK-ZURICHBERLIN/ZAAK.IO-Editor,eq0rip/three.js,mese79/three.js,datalink747/three.js,huobaowangxi/three.js,pletzer/three.js,SatoshiKawabata/three.js,rbarraud/three.js,gdebojyoti/three.js,coffeine-009/three.js,lovewitty/three.js,mattholl/three.js,SET001/three.js,beni55/three.js,Joeldk/three.js,cc272309126/three.js,Liuer/three.js,carlosanunes/three.js,benaadams/three.js,coderrick/three.js,VimVincent/three.js,redheli/three.js,JeckoHeroOrg/three.js,Astrak/three.js,ducminhn/three.js,ngokevin/three.js,podgorskiy/three.js,lchl7890987/WebGL,swieder227/three.js,flimshaw/three.js,vizorvr/three.js,sasha240100/three.js,Stinkdigital/three.js,srifqi/three.js,easz/three.js,Astrak/three.js,missingdays/three.js-amd,lovewitty/three.js,surround-io/three.js,GammaGammaRay/three.js,blokhin/three.js,alexbelyeu/three.js,satori99/three.js,toxicFork/three.js,jpweeks/three.js,holmberd/three.js,Black-Alpha/three.js,mattholl/three.js,dubejf/three.js,sreith1/three.js,brickify/three.js,jayschwa/three.js,eq0rip/three.js,Samsung-Blue/three.js,Gheehnest/three.js,MasterJames/three.js,jzitelli/three.js,Gheehnest/three.js,benaadams/three.js,SatoshiKawabata/three.js,Gheehnest/three.js,jeromeetienne/three.js,snovak/three.js,rfm1201/rfm.three.js,dubejf/three.js,YajunQiu/three.js,humbletim/three.js,Fox32/three.js,spite/three.js,arodic/three.js,AlexanderMazaletskiy/three.js,takahirox/three.js,wuxinwei240/three.js,sttz/three.js,sufeiou/three.js,kkjeer/three.js,gigakiller/three.js,opensim-org/three.js,arodic/three.js,arodic/three.js,Delejnr/three.js,MetaStackers/three.js,liammagee/three.js,donmccurdy/three.js,blokhin/three.js,redheli/three.js,JeckoHeroOrg/three.js,quinonez/three.js,lag945/three.js,anvaka/three.js,AdactiveSAS/three.js,fernandojsg/three.js,Ludobaka/three.js,camellhf/three.js,VimVincent/three.js,quinonez/three.js,Nitrillo/three.js,AltspaceVR/three.js,camellhf/three.js,Hectate/three.js,DelvarWorld/three.js,jeromeetienne/three.js,hedgerh/three.js,agnivade/three.js,thomasxu1991/three.js,ngokevin/three.js,ngokevin/three.js,xundaokeji/three.js,BenediktS/three.js,Kakakakakku/three.js,yxxme/three.js,BrianSipple/three.js,jayschwa/three.js,bdysvik/three.js,ma-tech/three.js,timcastelijn/three.js,mese79/three.js,coloringchaos/three.js,MarcusLongmuir/three.js,erich666/three.js,tschw/three.js,JuudeDemos/three.js,Leeft/three.js,Samsung-Blue/three.js,IceCreamYou/three.js,gpranay4/three.js,erich666/three.js,matgr1/three.js,shanmugamss/three.js-modified,fkammer/three.js,wuxinwei240/three.js,archilogic-ch/three.js,mainelander/three.js,matthartman/oculus-matt,borismus/three.js,AltspaceVR/three.js,Fox32/three.js,jllodra/three.js,Aldrien-/three.js,BenediktS/three.js,Ymaril/three.js,ZhenxingWu/three.js,gigakiller/three.js,dubejf/three.js,dhritzkiv/three.js,camellhf/three.js,alexconlin/three.js,redheli/three.js,nhalloran/three.js,DelvarWorld/three.js,leitzler/three.js,rgaino/three.js,unphased/three.js,Amritesh/three.js,JeckoHeroOrg/three.js,brianchirls/three.js,lchl7890987/WebGL,Kasual666/WebGl,pailhead/three.js,mainelander/three.js,HongJunLi/three.js,sweetmandm/three.js,StefanHuzz/three.js,g-rocket/three.js,vizorvr/three.js,tdmsinc/three.js,kkjeer/three.js,RAtechntukan/three.js,surround-io/three.js,daoshengmu/three.js,mabo77/three.js,nraynaud/three.js,programulya/three.js,111t8e/three.js,mabo77/three.js,elisee/three.js,lchl7890987/WebGL,richtr/three.js,coderrick/three.js,supergometan/three.js,wuxinwei240/three.js,prika/three.js,elephantatwork/three.js,mess110/three.js,dushmis/three.js,digital360/three.js,QingchaoHu/three.js,mainelander/three.js,luxigo/three.js,wanby/three.js,JeckoHeroOrg/three.js,sunbc0120/three.js,NicolasRannou/three.js,sherousee/three.js,chuckfairy/three.js,anvaka/three.js,aleen42/three.js,fkammer/three.js,godlzr/Three.js,plepers/three.js,mhoangvslev/data-visualizer,rayantony/three.js,StefanHuzz/three.js,dglogik/three.js,wizztjh/three.js,carlosanunes/three.js,acrsteiner/three.js,gero3/three.js,edge/three.js,ZAAK-ZURICHBERLIN/ZAAK.IO-Editor,leitzler/three.js,anvaka/three.js,nraynaud/three.js,ValtoLibraries/ThreeJS,mindofmatthew/three.js,gpranay4/three.js,mhoangvslev/data-visualizer,gpranay4/three.js,ngokevin/three-dev,unphased/three.js,yrns/three.js,Jozain/three.js,mataron/three.js,nopjia/three.js,liusashmily/three.js,rlugojr/three.js,elephantatwork/three.js,DeanLym/three.js,HongJunLi/three.js,TristanVALCKE/three.js,rlugojr/three.js,GammaGammaRay/three.js,brickify/three.js,leeric92/three.js,q437634645/three.js,pletzer/three.js,Seagat2011/three.js,rougier/three.js,ZAAK-ZURICHBERLIN/ZAAK.IO-Editor,ThiagoGarciaAlves/three.js,rlugojr/three.js,swieder227/three.js,VimVincent/three.js,RAtechntukan/three.js,Wilt/three.js,rougier/three.js,mataron/three.js,jayhetee/three.js,RemusMar/three.js,StefanHuzz/three.js,Delejnr/three.js,huobaowangxi/three.js,richtr/three.js,Nitrillo/three.js,beni55/three.js,archcomet/three.js,GammaGammaRay/three.js,holmberd/three.js,jayschwa/three.js,Black-Alpha/three.js,mese79/three.js,stevenliujw/three.js,agnivade/three.js,SatoshiKawabata/three.js,takahirox/three.js,rfm1201/rfm.three.js,Joeldk/three.js,Zerschmetterling91/three.js,Itee/three.js,erich666/three.js,stevenliujw/three.js,coffeine-009/three.js,ZAAK-ZURICHBERLIN/ZAAK.IO-Editor,elephantatwork/ZAAK.IO-EditorInternal,prabhu-k/three.js,LaughingSun/three.js,unconed/three.js,rougier/three.js,gigakiller/three.js,Seagat2011/three.js,RAtechntukan/three.js,wuxinwei240/three.js,0merta/three.js,AdactiveSAS/three.js,hacksalot/three.js,Jericho25/three.js,lollerbus/three.js,Stinkdigital/three.js,programulya/three.js,WoodMath/three.js,Astrak/three.js,ValtoLibraries/ThreeJS,Jonham/three.js,julapy/three.js,sitexa/three.js,carlosanunes/three.js,ZhenxingWu/three.js,wavesoft/three.js,wanby/three.js,Wilt/three.js,liammagee/three.js,takahirox/three.js,Zerschmetterling91/three.js,JuudeDemos/three.js,masterex1000/three.js,dhritzkiv/three.js,lchl7890987/WebGL,podgorskiy/three.js,AltspaceVR/three.js,GGAlanSmithee/three.js,sufeiou/three.js,AVGP/three.js,gwindes/three.js,YajunQiu/three.js,archilogic-com/three.js,simonThiele/three.js,podgorskiy/three.js,mrkev/three.js,YajunQiu/three.js,jeromeetienne/three.js,applexiaohao/three.js,matthiascy/three.js,sreith1/three.js,jostschmithals/three.js,coffeine-009/three.js,TristanVALCKE/three.js,Delejnr/three.js,Jonham/three.js,jayschwa/three.js,AltspaceVR/three.js,fta2012/three.js,zhanglingkang/three.js,jzitelli/three.js,Jerdak/three.js,VimVincent/three.js,sebasbaumh/three.js,Meshu/three.js,datalink747/three.js,mattdesl/three.js,UnboundVR/three.js,NicolasRannou/three.js,mudithkr/three.js,alexbelyeu/three.js,SpookW/three.js,fraguada/three.js,Jerdak/three.js,brason/three.js,richtr/three.js,mattdesl/three.js,JingYongWang/three.js,fta2012/three.js,julapy/three.js,dyx/three.js,stanford-gfx/three.js,timcastelijn/three.js,thomasxu1991/three.js,dimensia/three.js,dyx/three.js,robmyers/three.js,DeanLym/three.js,lag945/three.js,robsix/3ditor,haozi23333/three.js,borismus/three.js,Amritesh/three.js,AntTech/three.js,rayantony/three.js,prabhu-k/three.js,fernandojsg/three.js,chaoallsome/three.js,Leeft/three.js,JamesHagerman/three.js,haozi23333/three.js,RAtechntukan/three.js,nopjia/three.js,SpinVR/three.js,AscensionFoundation/three.js,matthartman/oculus-matt,freekh/three.js,jostschmithals/three.js,supergometan/three.js,zhangwenyan/three.js,ndebeiss/three.js,AlexanderMazaletskiy/three.js,wizztjh/three.js,jayhetee/three.js,prika/three.js,amakaroff82/three.js,Jericho25/three.js,yifanhunyc/three.js,erich666/three.js,stevenliujw/three.js,brickify/three.js,jllodra/three.js,coloringchaos/three.js,SET001/three.js,Peekmo/three.js,SatoshiKawabata/three.js,lollerbus/three.js,jeffgoku/three.js,pharos3d/three.js,applexiaohao/three.js,dayo7116/three.js,Black-Alpha/three.js,crazyyaoyao/yaoyao,Zerschmetterling91/three.js,coffeine-009/three.js,leeric92/three.js,WoodMath/three.js,gwindes/three.js,matthiascy/three.js,Delejnr/three.js,JingYongWang/three.js,AlexanderMazaletskiy/three.js,sweetmandm/three.js,freekh/three.js,Coburn37/three.js,arodic/three.js,StefanHuzz/three.js,srifqi/three.js,jee7/three.js,unphased/three.js,MasterJames/three.js,ngokevin/three.js,byhj/three.js,edge/three.js,Joeldk/three.js,Wilt/three.js,GammaGammaRay/three.js,zbm2001/three.js,gwindes/three.js,Kasual666/WebGl,yifanhunyc/three.js,kaisalmen/three.js,NicolasRannou/three.js,holmberd/three.js,tamarintech/three.js,AntTech/three.js,amazg/three.js,spite/three.js,unconed/three.js,DelvarWorld/three.js,BrianSipple/three.js,dushmis/three.js,SET001/three.js,Samsung-Blue/three.js,Peekmo/three.js,MarcusLongmuir/three.js,UnboundVR/three.js,masterex1000/three.js,ondys/three.js,GastonBeaucage/three.js,vizorvr/three.js,TristanVALCKE/three.js,JamesHagerman/three.js,wanby/three.js,mess110/three.js,chaoallsome/three.js,AlexanderMazaletskiy/three.js,xundaokeji/three.js,shanmugamss/three.js-modified,YajunQiu/three.js,ilovezy/three.js,ValtoLibraries/ThreeJS,dforrer/three.js,arodic/three.js,AscensionFoundation/three.js,mkkellogg/three.js,spite/three.js,Jozain/three.js,Mohammed-Ashour/three.js,RemusMar/three.js,threejsworker/three.js,jllodra/three.js,sebasbaumh/three.js,GGAlanSmithee/three.js,ilovezy/three.js,fanzhanggoogle/three.js,rbarraud/three.js,zhanglingkang/three.js,applexiaohao/three.js,timcastelijn/three.js,humbletim/three.js,Wilt/three.js,Pro/three.js,alexconlin/three.js,stopyransky/three.js,colombod/three.js,zbm2001/three.js,snipermiller/three.js,erich666/three.js,pharos3d/three.js,simonThiele/three.js,Coburn37/three.js,GammaGammaRay/three.js,gsssrao/three.js,toguri/three.js,prika/three.js,lovewitty/three.js,Ludobaka/three.js,Leeft/three.js,RemusMar/three.js,gdebojyoti/three.js,ndebeiss/three.js,byhj/three.js,ZAAK-ZURICHBERLIN/ZAAK.IO-Editor,pletzer/three.js,Ludobaka/three.js,jango2015/three.js,Astrak/three.js,Black-Alpha/three.js,googlecreativelab/three.js,zodsoft/three.js,mkkellogg/three.js,sheafferusa/three.js,Kasual666/WebGl,Mohammed-Ashour/three.js,GGAlanSmithee/three.js,meizhoubao/three.js,rougier/three.js,SpookW/three.js,GGAlanSmithee/three.js,zhangwenyan/three.js,SpookW/three.js,WestLangley/three.js,Hectate/three.js,xundaokeji/three.js,wanby/three.js,liammagee/three.js,JeckoHeroOrg/three.js,jeffgoku/three.js,alienity/three.js,nadirhamid/three.js,sitexa/three.js,gveltri/three.js,nopjia/three.js,Itee/three.js,thomasxu1991/three.js,MetaStackers/three.js,matgr1/three.js,yrns/three.js,q437634645/three.js,nraynaud/three.js,makc/three.js.fork,GastonBeaucage/three.js,sufeiou/three.js,dyx/three.js,YajunQiu/three.js,surround-io/three.js,snipermiller/three.js,redheli/three.js,JamesHagerman/three.js,Wilt/three.js,unphased/three.js,anvaka/three.js,srifqi/three.js,jayschwa/three.js,brason/three.js,coffeine-009/three.js,mess110/three.js,amakaroff82/three.js,archilogic-com/three.js,fkammer/three.js,sufeiou/three.js,cadenasgmbh/three.js,mess110/three.js,Joeldk/three.js,hedgerh/three.js,bhouston/three.js,julapy/three.js,dushmis/three.js,missingdays/three.js-amd,ngokevin/three.js,Seagat2011/three.js,datalink747/three.js,tschw/three.js,framelab/three.js,r8o8s1e0/three.js,Samsy/three.js,gveltri/three.js,gdebojyoti/three.js,plepers/three.js,godlzr/Three.js,podgorskiy/three.js,beni55/three.js,WoodMath/three.js,zodsoft/three.js,gwindes/three.js,aleen42/three.js,Leeft/three.js,imshibaji/three.js,ondys/three.js,zhoushijie163/three.js,programulya/three.js,dubejf/three.js,googlecreativelab/three.js,hsimpson/three.js,elephantatwork/ZAAK.IO-EditorInternal,liusashmily/three.js,fraguada/three.js,mainelander/three.js,dforrer/three.js,carlosanunes/three.js,hsimpson/three.js,zeropaper/three.js,Ymaril/three.js,zodsoft/three.js,flimshaw/three.js,3DGEOM/three.js,gigakiller/three.js,Amritesh/three.js,Peekmo/three.js,gigakiller/three.js,applexiaohao/three.js,daoshengmu/three.js,haozi23333/three.js,BrianSipple/three.js,Aldrien-/three.js,Zerschmetterling91/three.js,Jericho25/three.js,nhalloran/three.js,Ymaril/three.js,IceCreamYou/three.js,missingdays/three.js-amd,eq0rip/three.js,Pro/three.js,alexconlin/three.js,fraguada/three.js,acrsteiner/three.js,yifanhunyc/three.js,SET001/three.js,datalink747/three.js,amakaroff82/three.js,matthartman/oculus-matt,StefanHuzz/three.js,mataron/three.js,stevenliujw/three.js,missingdays/three.js-amd,njam/three.js,ngokevin/three-dev,3DGEOM/three.js,archilogic-ch/three.js,GGAlanSmithee/three.js,liusashmily/three.js,matthiascy/three.js,Fox32/three.js,holmberd/three.js,pharos3d/three.js,masterex1000/three.js,zhangwenyan/three.js,davidvmckay/three.js,sasha240100/three.js,r8o8s1e0/three.js,jee7/three.js,fomenyesu/three.js,sebasbaumh/three.js,satori99/three.js,njam/three.js,JuudeDemos/three.js,edivancamargo/three.js,shinate/three.js,simonThiele/three.js,ilovezy/three.js,coloringchaos/three.js,acrsteiner/three.js,programulya/three.js,easz/three.js,mabo77/three.js,Hectate/three.js,masterex1000/three.js,fluxio/three.js,AntTech/three.js,mattdesl/three.js,UnboundVR/three.js,mudithkr/three.js,IceCreamYou/three.js,zodsoft/three.js,jeromeetienne/three.js,dimensia/three.js,sreith1/three.js,alexbelyeu/three.js,q437634645/three.js,arose/three.js,yuhualingfeng/three.js,LeoEatle/three.js,p5150j/three.js,LaughingSun/three.js,ondys/three.js,ikerr/three.js,cc272309126/three.js,ikerr/three.js,nadirhamid/three.js,meizhoubao/three.js,zatchgordon/webGL,ThiagoGarciaAlves/three.js,YajunQiu/three.js,zatchgordon/webGL,Nitrillo/three.js,Aldrien-/three.js,bdysvik/three.js,mindofmatthew/three.js,matgr1/three.js,hsimpson/three.js,camellhf/three.js,fluxio/three.js,toxicFork/three.js,jzitelli/three.js,kaisalmen/three.js,rgaino/three.js,dayo7116/three.js,HongJunLi/three.js,Samsy/three.js,leitzler/three.js,ilovezy/three.js,Ymaril/three.js,DelvarWorld/three.js,nopjia/three.js,crazyyaoyao/yaoyao,anvaka/three.js,haozi23333/three.js,BenediktS/three.js,Meshu/three.js,jostschmithals/three.js,davidvmckay/three.js,humbletim/three.js,BrianSipple/three.js,chuckfairy/three.js,Coburn37/three.js,fluxio/three.js,zhangwenyan/three.js,sunbc0120/three.js,billfeller/three.js,zbm2001/three.js,TristanVALCKE/three.js,jeromeetienne/three.js,threejsworker/three.js,imshibaji/three.js,MarcusLongmuir/three.js,3DGEOM/three.js,snipermiller/three.js,alexbelyeu/three.js,bdysvik/three.js,podgorskiy/three.js,LeoEatle/three.js,sasha240100/three.js,ducminhn/three.js,Fox32/three.js,MasterJames/three.js,flimshaw/three.js,pharos3d/three.js,meizhoubao/three.js,googlecreativelab/three.js,06wj/three.js,elephantatwork/ZAAK.IO-EditorInternal,Pro/three.js,surround-io/three.js,nraynaud/three.js,crazyyaoyao/yaoyao,AlexanderMazaletskiy/three.js,Pro/three.js,Pro/three.js,agnivade/three.js,fraguada/three.js,podgorskiy/three.js,fanzhanggoogle/three.js,Seagat2011/three.js,cc272309126/three.js,njam/three.js,AdactiveSAS/three.js,fomenyesu/three.js,0merta/three.js,spite/three.js,cc272309126/three.js,fkammer/three.js,zbm2001/three.js,fluxio/three.js,rayantony/three.js,shinate/three.js,coderrick/three.js,jayhetee/three.js,GammaGammaRay/three.js,jbaicoianu/three.js,Ymaril/three.js,mrdoob/three.js,edivancamargo/three.js,mattdesl/three.js,SatoshiKawabata/three.js,archilogic-com/three.js,nopjia/three.js,archcomet/three.js,byhj/three.js,jbaicoianu/three.js,Mohammed-Ashour/three.js,Meshu/three.js,hedgerh/three.js,sitexa/three.js,gsssrao/three.js,DelvarWorld/three.js,alienity/three.js,alexbelyeu/three.js,luxigo/three.js,kkjeer/three.js,pletzer/three.js,dglogik/three.js,dimensia/three.js,wavesoft/three.js,GastonBeaucage/three.js,JingYongWang/three.js,godlzr/Three.js,MetaStackers/three.js,nadirhamid/three.js,Leeft/three.js,jbaicoianu/three.js,HongJunLi/three.js,shanmugamss/three.js-modified,ilovezy/three.js,dushmis/three.js,Black-Alpha/three.js,AVGP/three.js,ondys/three.js,enche/three.js,fkammer/three.js,tdmsinc/three.js,QingchaoHu/three.js,r8o8s1e0/three.js,mrkev/three.js,ducminhn/three.js,amazg/three.js,zhanglingkang/three.js,Kasual666/WebGl,mudithkr/three.js,mrkev/three.js,SET001/three.js,gveltri/three.js,mhoangvslev/data-visualizer,rfm1201/rfm.three.js,jayhetee/three.js,Kakakakakku/three.js,StefanHuzz/three.js,yxxme/three.js,mrkev/three.js,ZAAK-ZURICHBERLIN/ZAAK.IO-Editor,srifqi/three.js,thomasxu1991/three.js,alexconlin/three.js,satori99/three.js,dushmis/three.js,Meshu/three.js,LeoEatle/three.js,chuckfairy/three.js,AscensionFoundation/three.js,tdmsinc/three.js,freekh/three.js,robsix/3ditor,ma-tech/three.js,carlosanunes/three.js,archcomet/three.js,gsssrao/three.js,3DGEOM/three.js,sebasbaumh/three.js,unconed/three.js,LeoEatle/three.js,archilogic-ch/three.js,gpranay4/three.js,pailhead/three.js,JamesHagerman/three.js,jayhetee/three.js,GastonBeaucage/three.js,JamesHagerman/three.js,meizhoubao/three.js,digital360/three.js,Peekmo/three.js,humbletim/three.js,Zerschmetterling91/three.js,technohippy/three.js,googlecreativelab/three.js,dforrer/three.js,blokhin/three.js,sheafferusa/three.js,beni55/three.js,coloringchaos/three.js,AdactiveSAS/three.js,BrianSipple/three.js,Meshu/three.js,chaoallsome/three.js,zhangwenyan/three.js,alienity/three.js,elisee/three.js,surround-io/three.js,gigakiller/three.js,3DGEOM/three.js,ZhenxingWu/three.js,leeric92/three.js,ikerr/three.js,aleen42/three.js,shinate/three.js,freekh/three.js,UnboundVR/three.js,sasha240100/three.js,timcastelijn/three.js,jayschwa/three.js,prika/three.js,gdebojyoti/three.js,blokhin/three.js,yrns/three.js,JamesHagerman/three.js,leeric92/three.js,daoshengmu/three.js,missingdays/three.js-amd,Mohammed-Ashour/three.js,supergometan/three.js,jango2015/three.js,Meshu/three.js,borismus/three.js,Seagat2011/three.js,dyx/three.js,digital360/three.js,AscensionFoundation/three.js,ndebeiss/three.js,squarefeet/three.js,threejsworker/three.js,coloringchaos/three.js,matthartman/oculus-matt,sweetmandm/three.js,sunbc0120/three.js,blokhin/three.js,r8o8s1e0/three.js,toguri/three.js,06wj/three.js,satori99/three.js,byhj/three.js,ilovezy/three.js,g-rocket/three.js,MarcusLongmuir/three.js,Mugen87/three.js,archilogic-ch/three.js,g-rocket/three.js,Benjamin-Dobell/three.js,fta2012/three.js,wavesoft/three.js,ThiagoGarciaAlves/three.js,benaadams/three.js,elephantatwork/three.js,beni55/three.js,billfeller/three.js,Jericho25/three.js,Joeldk/three.js,wavesoft/three.js,Jerdak/three.js,archcomet/three.js,yrns/three.js,edivancamargo/three.js,squarefeet/three.js,0merta/three.js,mindofmatthew/three.js,Coburn37/three.js,ducminhn/three.js,AntTech/three.js,Joeldk/three.js,mattdesl/three.js,SpookW/three.js,chuckfairy/three.js,wizztjh/three.js,rgaino/three.js,robmyers/three.js,Mohammed-Ashour/three.js,controlzee/three.js,yifanhunyc/three.js,holmberd/three.js,snipermiller/three.js,sitexa/three.js,byhj/three.js,jeromeetienne/three.js,DeanLym/three.js,takahirox/three.js,jeffgoku/three.js,IceCreamYou/three.js,sasha240100/three.js,yuhualingfeng/three.js,digital360/three.js,Kasual666/WebGl,zhoushijie163/three.js,JeckoHeroOrg/three.js,ZhenxingWu/three.js,prika/three.js,enche/three.js,WoodMath/three.js,fomenyesu/three.js,fraguada/three.js,fyoudine/three.js,nhalloran/three.js,dayo7116/three.js,0merta/three.js,gveltri/three.js,controlzee/three.js,jbaicoianu/three.js,applexiaohao/three.js,mkkellogg/three.js,jango2015/three.js,shanmugamss/three.js-modified,luxigo/three.js,ThiagoGarciaAlves/three.js,arose/three.js,imshibaji/three.js,p5150j/three.js,robmyers/three.js,coderrick/three.js,zhanglingkang/three.js,elephantatwork/three.js,fluxio/three.js,redheli/three.js,Mugen87/three.js,Cakin-Kwong/three.js,r8o8s1e0/three.js,jee7/three.js,amakaroff82/three.js,swieder227/three.js,mkkellogg/three.js,gpranay4/three.js,mhoangvslev/data-visualizer,MarcusLongmuir/three.js,unphased/three.js,jzitelli/three.js,technohippy/three.js,cadenasgmbh/three.js,controlzee/three.js,sitexa/three.js,srifqi/three.js,alexconlin/three.js,aleen42/three.js,gwindes/three.js,fanzhanggoogle/three.js,Aldrien-/three.js,Stinkdigital/three.js,Kakakakakku/three.js,amazg/three.js,edivancamargo/three.js,matthartman/oculus-matt,Kakakakakku/three.js,mindofmatthew/three.js,111t8e/three.js,luxigo/three.js,jayhetee/three.js,humbletim/three.js,sheafferusa/three.js,carlosanunes/three.js,lag945/three.js,ondys/three.js,Gheehnest/three.js,jbaicoianu/three.js,zeropaper/three.js,googlecreativelab/three.js,bdysvik/three.js,mataron/three.js,zatchgordon/webGL,UnboundVR/three.js,sheafferusa/three.js,NicolasRannou/three.js,mataron/three.js,Jonham/three.js,yuhualingfeng/three.js,BenediktS/three.js,MetaStackers/three.js,TristanVALCKE/three.js,crazyyaoyao/yaoyao,elisee/three.js,lollerbus/three.js,shanmugamss/three.js-modified,richtr/three.js,matgr1/three.js,nadirhamid/three.js,tschw/three.js,sole/three.js,zatchgordon/webGL,snipermiller/three.js,mabo77/three.js,plepers/three.js,mabo77/three.js,greggman/three.js,easz/three.js,shinate/three.js,dforrer/three.js,AscensionFoundation/three.js,daoshengmu/three.js,MasterJames/three.js,WoodMath/three.js,agnivade/three.js,liammagee/three.js,satori99/three.js,mese79/three.js,nhalloran/three.js,sunbc0120/three.js,q437634645/three.js,borismus/three.js,LeoEatle/three.js,arodic/three.js,matthiascy/three.js,acrsteiner/three.js,Jonham/three.js,Samsy/three.js,stopyransky/three.js,rgaino/three.js,Kakakakakku/three.js,njam/three.js,applexiaohao/three.js,imshibaji/three.js,tschw/three.js,sreith1/three.js,cc272309126/three.js,Jericho25/three.js,donmccurdy/three.js,huobaowangxi/three.js,mese79/three.js,DeanLym/three.js,simonThiele/three.js,edge/three.js,Jonham/three.js,MasterJames/three.js,holmberd/three.js,alienity/three.js,liusashmily/three.js,robmyers/three.js,njam/three.js,Jericho25/three.js,mattholl/three.js,ThiagoGarciaAlves/three.js,erich666/three.js,Benjamin-Dobell/three.js,shinate/three.js,dhritzkiv/three.js,enche/three.js,leeric92/three.js,toguri/three.js,zodsoft/three.js,edivancamargo/three.js,dubejf/three.js,googlecreativelab/three.js,ndebeiss/three.js,gero3/three.js,davidvmckay/three.js,jango2015/three.js,luxigo/three.js,nopjia/three.js,enche/three.js,wizztjh/three.js,yxxme/three.js,masterex1000/three.js,VimVincent/three.js,sweetmandm/three.js,MarcusLongmuir/three.js,snovak/three.js,aleen42/three.js,mess110/three.js,RemusMar/three.js,mrkev/three.js,richtr/three.js,Mugen87/three.js,bdysvik/three.js,dyx/three.js,jllodra/three.js,quinonez/three.js,easz/three.js,hedgerh/three.js,Delejnr/three.js,ngokevin/three-dev,hacksalot/three.js,wizztjh/three.js,leitzler/three.js,enche/three.js,LaughingSun/three.js,yifanhunyc/three.js,IceCreamYou/three.js,fluxio/three.js,p5150j/three.js,benaadams/three.js,dforrer/three.js,Nitrillo/three.js,sole/three.js,billfeller/three.js,sufeiou/three.js,fanzhanggoogle/three.js,Cakin-Kwong/three.js,sweetmandm/three.js,wavesoft/three.js,swieder227/three.js,robsix/3ditor,jllodra/three.js,LaughingSun/three.js,pharos3d/three.js,Stinkdigital/three.js,stopyransky/three.js,wuxinwei240/three.js,Hectate/three.js,yrns/three.js,sole/three.js,liammagee/three.js,gwindes/three.js,colombod/three.js,yrns/three.js,haozi23333/three.js,mess110/three.js,alexconlin/three.js,JingYongWang/three.js,wizztjh/three.js,Benjamin-Dobell/three.js,archilogic-com/three.js,edge/three.js,arose/three.js,ma-tech/three.js,arose/three.js,prabhu-k/three.js,edge/three.js,robmyers/three.js,Benjamin-Dobell/three.js,Astrak/three.js,lovewitty/three.js,mainelander/three.js,stevenliujw/three.js,amazg/three.js,flimshaw/three.js,gsssrao/three.js,rayantony/three.js,AltspaceVR/three.js,Jerdak/three.js,LeoEatle/three.js,dhritzkiv/three.js,rgaino/three.js,rbarraud/three.js,coloringchaos/three.js,huobaowangxi/three.js,sunbc0120/three.js,mudithkr/three.js,dubejf/three.js,wanby/three.js,crazyyaoyao/yaoyao,sttz/three.js,Samsung-Blue/three.js,Cakin-Kwong/three.js,eq0rip/three.js,jostschmithals/three.js,camellhf/three.js,quinonez/three.js,elephantatwork/ZAAK.IO-EditorInternal,rougier/three.js,archcomet/three.js,acrsteiner/three.js,snovak/three.js,dayo7116/three.js,unconed/three.js,eq0rip/three.js,Cakin-Kwong/three.js,Ludobaka/three.js,gsssrao/three.js,Mohammed-Ashour/three.js,nadirhamid/three.js,dforrer/three.js,toguri/three.js,ikerr/three.js,arose/three.js,toxicFork/three.js,yxxme/three.js,shinate/three.js,sebasbaumh/three.js,Kakakakakku/three.js,kkjeer/three.js,Pro/three.js,sreith1/three.js,Fox32/three.js,amazg/three.js,fyoudine/three.js,yuhualingfeng/three.js,RAtechntukan/three.js,technohippy/three.js,SpookW/three.js,technohippy/three.js,mattholl/three.js,imshibaji/three.js,supergometan/three.js,fraguada/three.js,Jozain/three.js,coffeine-009/three.js,humbletim/three.js,brason/three.js,jeffgoku/three.js,tdmsinc/three.js,edivancamargo/three.js,colombod/three.js,ma-tech/three.js,IceCreamYou/three.js,Black-Alpha/three.js,111t8e/three.js,RemusMar/three.js,rayantony/three.js,aleen42/three.js,Stinkdigital/three.js,archilogic-ch/three.js,ducminhn/three.js,amakaroff82/three.js,mkkellogg/three.js,lovewitty/three.js,JuudeDemos/three.js,anvaka/three.js,Peekmo/three.js,dayo7116/three.js,Leeft/three.js,prabhu-k/three.js,ndebeiss/three.js,Delejnr/three.js,brason/three.js,unphased/three.js,xundaokeji/three.js,yxxme/three.js,programulya/three.js,GastonBeaucage/three.js,ma-tech/three.js,beni55/three.js,wavesoft/three.js,enche/three.js,mabo77/three.js,leitzler/three.js,ValtoLibraries/ThreeJS,vizorvr/three.js,vizorvr/three.js,opensim-org/three.js,fernandojsg/three.js,AntTech/three.js,rayantony/three.js,yuhualingfeng/three.js,sole/three.js,Cakin-Kwong/three.js,snovak/three.js,brianchirls/three.js,leeric92/three.js,JuudeDemos/three.js,acrsteiner/three.js,zeropaper/three.js,lag945/three.js,rlugojr/three.js,hedgerh/three.js,toguri/three.js,stopyransky/three.js,gdebojyoti/three.js,yuhualingfeng/three.js,lag945/three.js,mkkellogg/three.js,Astrak/three.js,sheafferusa/three.js,stopyransky/three.js,tschw/three.js,sitexa/three.js,squarefeet/three.js,supergometan/three.js,Benjamin-Dobell/three.js,zatchgordon/webGL,wuxinwei240/three.js,GGAlanSmithee/three.js,gveltri/three.js,ma-tech/three.js,sherousee/three.js,Gheehnest/three.js,ducminhn/three.js,looeee/three.js,jbaicoianu/three.js,kkjeer/three.js,mhoangvslev/data-visualizer,Aldrien-/three.js,pharos3d/three.js,leitzler/three.js,freekh/three.js,jostschmithals/three.js,AVGP/three.js,lchl7890987/WebGL,spite/three.js,squarefeet/three.js,bdysvik/three.js,fomenyesu/three.js,timcastelijn/three.js,hedgerh/three.js,g-rocket/three.js,edge/three.js,AltspaceVR/three.js,snipermiller/three.js,Gheehnest/three.js,toguri/three.js,nadirhamid/three.js,dayo7116/three.js,agnivade/three.js,borismus/three.js,mhoangvslev/data-visualizer,flimshaw/three.js,chaoallsome/three.js,Fox32/three.js,SET001/three.js,zbm2001/three.js,redheli/three.js,mindofmatthew/three.js,fanzhanggoogle/three.js,LaughingSun/three.js,camellhf/three.js,hacksalot/three.js,matthiascy/three.js,prabhu-k/three.js,jeffgoku/three.js,thomasxu1991/three.js,xundaokeji/three.js,surround-io/three.js,111t8e/three.js,Ludobaka/three.js,gveltri/three.js,rougier/three.js,ValtoLibraries/ThreeJS,JingYongWang/three.js,masterex1000/three.js,nhalloran/three.js,tschw/three.js,snovak/three.js,BenediktS/three.js,Wilt/three.js,easz/three.js,looeee/three.js,tamarintech/three.js,RemusMar/three.js,Samsung-Blue/three.js,ngokevin/three-dev,aardgoose/three.js,SpinVR/three.js,brason/three.js,dyx/three.js,chuckfairy/three.js,lollerbus/three.js,technohippy/three.js,BrianSipple/three.js,AVGP/three.js,brickify/three.js,ThiagoGarciaAlves/three.js,prika/three.js,3DGEOM/three.js,benaadams/three.js,SpookW/three.js,brianchirls/three.js,tamarintech/three.js,rbarraud/three.js,brickify/three.js,r8o8s1e0/three.js,Hectate/three.js,ZhenxingWu/three.js,greggman/three.js,alexbelyeu/three.js,bhouston/three.js,UnboundVR/three.js,brianchirls/three.js,sole/three.js,sebasbaumh/three.js,squarefeet/three.js,archcomet/three.js,plepers/three.js,archilogic-ch/three.js,nraynaud/three.js,MetaStackers/three.js,zbm2001/three.js,mainelander/three.js,jzitelli/three.js,simonThiele/three.js,lovewitty/three.js,zeropaper/three.js,ngokevin/three-dev,colombod/three.js,snovak/three.js,111t8e/three.js,AdactiveSAS/three.js,jllodra/three.js,HongJunLi/three.js,VimVincent/three.js,datalink747/three.js,jango2015/three.js,tamarintech/three.js,spite/three.js,blokhin/three.js,godlzr/Three.js,borismus/three.js,technohippy/three.js,pletzer/three.js,xundaokeji/three.js,q437634645/three.js,haozi23333/three.js,missingdays/three.js-amd,mataron/three.js,sunbc0120/three.js,prabhu-k/three.js,ngokevin/three-dev,colombod/three.js,dimensia/three.js,Jozain/three.js,0merta/three.js,Benjamin-Dobell/three.js,simonThiele/three.js,lollerbus/three.js,mudithkr/three.js,ngokevin/three.js,jzitelli/three.js,brason/three.js,coderrick/three.js,lag945/three.js,benaadams/three.js,threejsworker/three.js,swieder227/three.js,Samsung-Blue/three.js,g-rocket/three.js,billfeller/three.js,AscensionFoundation/three.js,cc272309126/three.js,Nitrillo/three.js,datalink747/three.js,quinonez/three.js,111t8e/three.js,bhouston/three.js,controlzee/three.js,mattholl/three.js,supergometan/three.js,archilogic-com/three.js,Jerdak/three.js,kkjeer/three.js,nhalloran/three.js,swieder227/three.js,stopyransky/three.js,pletzer/three.js,liammagee/three.js,elephantatwork/three.js,easz/three.js,jpweeks/three.js,thomasxu1991/three.js,billfeller/three.js,bhouston/three.js,sreith1/three.js,Cakin-Kwong/three.js,mindofmatthew/three.js,sufeiou/three.js,sweetmandm/three.js,Kasual666/WebGl,p5150j/three.js,elisee/three.js,lollerbus/three.js,p5150j/three.js,framelab/three.js,brianchirls/three.js,elephantatwork/ZAAK.IO-EditorInternal,HongJunLi/three.js,huobaowangxi/three.js,Liuer/three.js,gpranay4/three.js,MetaStackers/three.js,chuckfairy/three.js,unconed/three.js,jeffgoku/three.js,Ymaril/three.js,sole/three.js,mattholl/three.js,alienity/three.js,Peekmo/three.js,digital360/three.js,davidvmckay/three.js,lchl7890987/WebGL,AlexanderMazaletskiy/three.js,controlzee/three.js,Coburn37/three.js,chaoallsome/three.js,framelab/three.js,ValtoLibraries/ThreeJS,daoshengmu/three.js,WestLangley/three.js,richtr/three.js,toxicFork/three.js,timcastelijn/three.js,flimshaw/three.js,liusashmily/three.js,BenediktS/three.js,Jerdak/three.js,davidvmckay/three.js,mattdesl/three.js,AdactiveSAS/three.js,yifanhunyc/three.js,meizhoubao/three.js,huobaowangxi/three.js,wanby/three.js,yxxme/three.js,agnivade/three.js,q437634645/three.js,zeropaper/three.js,Jozain/three.js,DeanLym/three.js,chaoallsome/three.js,Stinkdigital/three.js,mudithkr/three.js,SatoshiKawabata/three.js,GastonBeaucage/three.js,sheafferusa/three.js,RAtechntukan/three.js,zodsoft/three.js,imshibaji/three.js,sherousee/three.js,Samsy/three.js,brickify/three.js,g-rocket/three.js,fanzhanggoogle/three.js,bhouston/three.js,matthiascy/three.js,fkammer/three.js,mrkev/three.js,programulya/three.js,Ludobaka/three.js,zatchgordon/webGL,fomenyesu/three.js,rbarraud/three.js,luxigo/three.js,takahirox/three.js,shanmugamss/three.js-modified,makc/three.js.fork,archilogic-com/three.js,Hectate/three.js,nraynaud/three.js,freekh/three.js,billfeller/three.js,fta2012/three.js,squarefeet/three.js,Samsy/three.js,dimensia/three.js,ndebeiss/three.js,ikerr/three.js,LaughingSun/three.js,godlzr/Three.js,hacksalot/three.js,rlugojr/three.js,zhangwenyan/three.js,AVGP/three.js,zhanglingkang/three.js,plepers/three.js,Coburn37/three.js,Jozain/three.js,jostschmithals/three.js,daoshengmu/three.js,alienity/three.js,zhanglingkang/three.js,zeropaper/three.js,hacksalot/three.js,bhouston/three.js,quinonez/three.js,threejsworker/three.js,gdebojyoti/three.js,JuudeDemos/three.js
678a5f6f558c833bc05de1f68120efed8cbcdb18
frameworks/datastore/tests/models/record/core_methods.js
frameworks/datastore/tests/models/record/core_methods.js
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2009 Apple, Inc. and contributors. // License: Licened under MIT license (see license.js) // ========================================================================== /*globals module ok equals same test MyApp */ var MyApp; module("SC.Record core methods", { setup: function() { MyApp = SC.Object.create({ store: SC.Store.create() }) ; MyApp.Foo = SC.Record.extend({}); MyApp.json = { foo: "bar", number: 123, bool: YES, array: [1,2,3] }; MyApp.foo = MyApp.store.createRecord(MyApp.Foo, MyApp.json); } }); test("statusToString", function() { var status = MyApp.store.readStatus(MyApp.foo); equals(SC.Record.statusToString(status), 'EMPTY', 'status string should be EMPTY'); });
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2009 Apple, Inc. and contributors. // License: Licened under MIT license (see license.js) // ========================================================================== /*globals module ok equals same test MyApp */ var MyApp; module("SC.Record core methods", { setup: function() { MyApp = SC.Object.create({ store: SC.Store.create() }) ; MyApp.Foo = SC.Record.extend({}); MyApp.json = { foo: "bar", number: 123, bool: YES, array: [1,2,3] }; MyApp.foo = MyApp.store.createRecord(MyApp.Foo, MyApp.json); } }); test("statusString", function() { equals(MyApp.foo.statusString(), 'READY_NEW', 'status string should be READY_NEW'); });
Fix SC.Record statusString unit test
Fix SC.Record statusString unit test
JavaScript
mit
Eloqua/sproutcore,Eloqua/sproutcore,Eloqua/sproutcore
ce627bb604bbb4ce42a14af38f5f7aceef11df4d
gulp/config.js
gulp/config.js
// // https://github.com/kogakure/gulp-tutorial/blob/master/gulp/config.js // var banner = [ '/**', ' * <%= pkg.name %> - <%= pkg.description %>', ' * <%= pkg.author %>', ' * Version <%= pkg.version %>', ' * <%= pkg.license %> Licensed', ' */', ''].join('\n'); module.exports = { banner: banner, clean: { files: [ 'dist' ] }, jshint: { src: [ 'index.js', 'gulpfile.js', 'src/**/*.js' ], options: require('../config/jshint') }, uglify: { debug: { output: { beautify: true, comments: true }, compress: false, mangle: false }, dist: { compress: true, mangle: true } } };
// // https://github.com/kogakure/gulp-tutorial/blob/master/gulp/config.js // var banner = [ '/**', ' * <%= pkg.name %> - <%= pkg.description %>', ' * <%= pkg.author %>', ' * Version <%= pkg.version %>', ' * <%= pkg.license %> Licensed', ' */', ''].join('\n'); module.exports = { banner: banner, clean: { files: [ 'dist' ] }, jshint: { src: [ 'index.js', 'gulpfile.js', 'src/**/*.js', 'lib/**/*.js' ], options: require('../config/jshint') }, uglify: { debug: { output: { beautify: true, comments: true }, compress: false, mangle: false }, dist: { compress: true, mangle: true } } };
Validate files under lib with jshint
Validate files under lib with jshint
JavaScript
mit
cheton/i18next-text
9686768f335f876d674183fd899125a5fb09e101
lib/node_modules/@stdlib/buffer/from-string/lib/index.js
lib/node_modules/@stdlib/buffer/from-string/lib/index.js
'use strict'; /** * Allocate a buffer containing a provided string. * * @module @stdlib/buffer/from-string * * @example * var string2buffer = require( '@stdlib/buffer/from-string' ); * * var buf = string2buffer( 'beep boop' ); * // returns <Buffer> */ // MODULES // var hasFrom = require( './has_from.js' ); // MAIN // var string2buffer; if ( hasFrom ) { string2buffer = require( './main.js' ); } else { string2buffer = require( './polyfill.js' ); } // EXPORTS // module.exports = string2buffer;
'use strict'; /** * Allocate a buffer containing a provided string. * * @module @stdlib/buffer/from-string * * @example * var string2buffer = require( '@stdlib/buffer/from-string' ); * * var buf = string2buffer( 'beep boop' ); * // returns <Buffer> */ // MODULES // var hasFrom = require( './has_from.js' ); var main = require( './main.js' ); var polyfill = require( './polyfill.js' ); // MAIN // var string2buffer; if ( hasFrom ) { string2buffer = main; } else { string2buffer = polyfill; } // EXPORTS // module.exports = string2buffer;
Refactor to avoid dynamic module resolution
Refactor to avoid dynamic module resolution
JavaScript
apache-2.0
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
ea020e5e5759189d2576aea6a58114ddb24dd001
src/index.js
src/index.js
import React from 'react' import ReactDOM from 'react-dom' import { createGlobalStyle } from 'styled-components' import { App } from './App' import woff2 from './fonts/source-sans-pro-v11-latin-regular.woff2' import woff from './fonts/source-sans-pro-v11-latin-regular.woff' import registerServiceWorker from './registerServiceWorker' const GlobalStyle = createGlobalStyle` body { margin: 0; padding: 0; font-family: 'Source Sans Pro', sans-serif; overscroll-behavior-y: none; } /* source-sans-pro-regular - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 400; font-display: optional; src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(${woff2}) format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url(${woff}) format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } ` ReactDOM.render( <> <GlobalStyle /> <App /> </>, document.getElementById('root') ) registerServiceWorker()
import React from 'react' import ReactDOM from 'react-dom' import { createGlobalStyle } from 'styled-components' import { App } from './App' import woff2 from './fonts/source-sans-pro-v11-latin-regular.woff2' import woff from './fonts/source-sans-pro-v11-latin-regular.woff' import registerServiceWorker from './registerServiceWorker' const GlobalStyle = createGlobalStyle` html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } body { margin: 0; padding: 0; font-family: 'Source Sans Pro', sans-serif; overscroll-behavior-y: none; } /* source-sans-pro-regular - latin */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 400; font-display: optional; src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(${woff2}) format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url(${woff}) format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } ` ReactDOM.render( <> <GlobalStyle /> <App /> </>, document.getElementById('root') ) registerServiceWorker()
Use border-box style for all elements
Use border-box style for all elements
JavaScript
mit
joelgeorgev/file-hash-verifier,joelgeorgev/file-hash-verifier
12ee708accce42f2bdeb557888590851df1ff12c
src/index.js
src/index.js
var Transmitter = function (config) { var router = require('./router.js'); router(config); var io = require('socket.io')(router.server); // Socket.io connection handling io.on('connection', function(socket){ console.log('PULSAR: client connected'); socket.on('disconnect', function() { console.log('PULSAR: client disconnected'); }); }); var Processor = require('@dermah/pulsar-input-keyboard'); var processor = new Processor(config); processor.on('pulse', pulse => { io.emit('pulse', pulse) }); processor.on('pulsar control', pulse => { io.emit('pulsar control', pulse) }); processor.on('pulse update', pulse => { io.emit('pulse update', pulse); }); } module.exports = Transmitter;
class Detector { constructor(config) { let router = require('./router.js'); router(config); this.io = require('socket.io')(router.server); // Socket.io connection handling this.io.on('connection', function(socket){ console.log('PULSAR: client connected'); socket.on('disconnect', function() { console.log('PULSAR: client disconnected'); }); }); } detect (pulseType, pulse) { this.io.emit(pulseType, pulse); } } module.exports = Detector;
Convert export to a class with a pulse detector function
Convert export to a class with a pulse detector function
JavaScript
mit
Dermah/pulsar-transmitter
78d557fc3c8bda380271c29f02b9a2b3cceb6b9a
src/index.js
src/index.js
/** * * ___| | | | | * | | | | | * | ___ |___ __| * \____|_| _| _| * * @author Shinichirow KAMITO * @license MIT */ import { createStore, destroyStore, getAllStores, destroyAllStores, trigger, regist } from './core'; import dispatcher from './dispatcher'; let ch4 = { createStore: createStore, getAllStores: getAllStores, destroyStore: destroyStore, destroyAllStores: destroyAllStores, trigger: trigger, regist: regist, dispatcher: dispatcher }; export { createStore, destroyStore, getAllStores, destroyAllStores, trigger, regist, dispatcher } export default ch4;
/** * * ___| | | | | * | | | | | * | ___ |___ __| * \____|_| _| _| * * @author Shinichirow KAMITO * @license MIT */ import { createStore, destroyStore, getAllStores, destroyAllStores, trigger, regist } from './core'; import dispatcher from './dispatcher'; import logger from './logger'; let ch4 = { createStore: createStore, getAllStores: getAllStores, destroyStore: destroyStore, destroyAllStores: destroyAllStores, trigger: trigger, regist: regist, dispatcher: dispatcher, logger: logger }; export { createStore, destroyStore, getAllStores, destroyAllStores, trigger, regist, dispatcher, logger } export default ch4;
Add logger to export modules.
Add logger to export modules.
JavaScript
mit
kamito/ch4
1f7a9bd17e7611c0afb13b4c9f546cb8c7ef06af
src/index.js
src/index.js
export function createSelectorCreator(valueEquals) { return (selectors, resultFunc) => { if (!Array.isArray(selectors)) { selectors = [selectors]; } const memoizedResultFunc = memoize(resultFunc, valueEquals); return state => { const params = selectors.map(selector => selector(state)); return memoizedResultFunc(...params); } }; } export function createSelector(...args) { return createSelectorCreator(defaultValueEquals)(...args); } export function defaultValueEquals(a, b) { return a === b; } // the memoize function only caches one set of arguments. This // actually good enough, rather surprisingly. This is because during // calculation of a selector result the arguments won't // change if called multiple times. If a new state comes in, we *want* // recalculation if and only if the arguments are different. function memoize(func, valueEquals) { let lastArgs = null; let lastResult = null; return (...args) => { if (lastArgs !== null && argsEquals(args, lastArgs, valueEquals)) { return lastResult; } lastArgs = args; lastResult = func(...args); return lastResult; } } function argsEquals(a, b, valueEquals) { return a.every((value, index) => valueEquals(value, b[index])); }
export function createSelectorCreator(valueEquals) { return (selectors, resultFunc) => { if (!Array.isArray(selectors)) { selectors = [selectors]; } const memoizedResultFunc = memoize(resultFunc, valueEquals); return state => { const params = selectors.map(selector => selector(state)); return memoizedResultFunc(params); } }; } export function createSelector(...args) { return createSelectorCreator(defaultValueEquals)(...args); } export function defaultValueEquals(a, b) { return a === b; } // the memoize function only caches one set of arguments. This // actually good enough, rather surprisingly. This is because during // calculation of a selector result the arguments won't // change if called multiple times. If a new state comes in, we *want* // recalculation if and only if the arguments are different. function memoize(func, valueEquals) { let lastArgs = null; let lastResult = null; return (args) => { if (lastArgs !== null && argsEquals(args, lastArgs, valueEquals)) { return lastResult; } lastArgs = args; lastResult = func(...args); return lastResult; } } function argsEquals(a, b, valueEquals) { return a.every((value, index) => valueEquals(value, b[index])); }
Remove unnecessary use of spread
Remove unnecessary use of spread
JavaScript
mit
sericaia/reselect,chentsulin/reselect,faassen/reselect,SpainTrain/reselect,reactjs/reselect,chromakode/reselect,reactjs/reselect,tgriesser/reselect,scottcorgan/reselect,zalmoxisus/reselect,babsonmatt/reselect,rackt/reselect,ellbee/reselect
79e51f7510a554c5fa900759f9ad55f9201c7715
app/components/ocre-step.js
app/components/ocre-step.js
import Ember from 'ember'; import _ from 'lodash/lodash'; import steps from '../ressources/ocre-quest'; export default Ember.Component.extend({ progress: '', stepIndex: 0, target: 0, onChange: () => {}, actions: { update(item, delta) { let progress = this.get('progress'); progress = progress.split(''); progress[item.index] = item.value + delta; progress = progress.join(''); this.get('onChange')(progress, this.get('stepIndex')); } }, progressBars: Ember.computed('parsedItems', 'target', function() { const parsedItems = this.get('parsedItems'); return _.times(this.get('target'), (index) => { return _.filter(parsedItems, parsedItem => parsedItem.value > index).length / parsedItems.length; }); }), minimum: Ember.computed('progress', function() { const progress = this.get('progress'); return Math.min(..._.map(progress.split(''), number => parseInt(number, 10))); }), parsedItems: Ember.computed('progress', function() { const progress = this.get('progress'); const items = steps[this.get('stepIndex') - 1]; return _.map(items, (item, index) => { const value = parseInt(progress[index], 10); return { name: item[0], note: item[1], index: index, cantAdd: value >= 9, cantRemove: value <= 1, value: value }; }); }) });
import Ember from 'ember'; import _ from 'lodash/lodash'; import steps from '../ressources/ocre-quest'; export default Ember.Component.extend({ progress: '', stepIndex: 0, target: 0, onChange: () => {}, actions: { update(item, delta) { let progress = this.get('progress'); progress = progress.split(''); progress[item.index] = item.value + delta; progress = progress.join(''); this.get('onChange')(progress, this.get('stepIndex')); } }, progressBars: Ember.computed('parsedItems', 'target', function() { const parsedItems = this.get('parsedItems'); return _.times(this.get('target'), (index) => { return _.filter(parsedItems, parsedItem => parsedItem.value > index).length / parsedItems.length; }); }), minimum: Ember.computed('progress', function() { const progress = this.get('progress'); return Math.min(..._.map(progress.split(''), number => parseInt(number, 10))); }), parsedItems: Ember.computed('progress', function() { const progress = this.get('progress'); const items = steps[this.get('stepIndex') - 1]; return _.map(items, (item, index) => { const value = parseInt(progress[index], 10); return { name: item[0], note: item[1], index: index, cantAdd: value >= 9, cantRemove: value <= 0, value: value }; }); }) });
Fix the bug where a mob can't be put back to 0
Fix the bug where a mob can't be put back to 0
JavaScript
mit
pboutin/dofus-workbench,pboutin/dofus-workbench
c1bf4d635ecfb5f471f4d4230401ae3c0ded3468
app/controllers/PhotoRow.js
app/controllers/PhotoRow.js
var FileLoader = require("file_loader"); var args = arguments[0] || {}; var url = "http://photos.tritarget.org/photos/washington2012/" + args.photo; FileLoader.download(url) .then(function(file) { // Ti.API.info("Displaying image: " + file.getPath()); $.photo.image = file.getFile(); $.info.color = file.downloaded ? "#CF0000" : "#07D100"; $.info.text = (file.downloaded ? "Downloaded" : "Cached") + "\n(" + file.id.substr(0, 12) + ")"; }) .fail(function(error) { var message = error.message || error.error || error; Ti.API.error("" + message + " loading cache with url: " + url); // We don't want to throw an error here. That would be a mess. }) .done(); $.title.text = args.photo; /* vim:set ts=2 sw=2 et fdm=marker: */
var FileLoader = require("file_loader"); var args = arguments[0] || {}; var url = "http://photos.tritarget.org/photos/washington2012/" + args.photo; function updateRow(file) { $.photo.image = file.getFile(); $.info.color = file.downloaded ? "#CF0000" : "#07D100"; $.info.text = (file.downloaded ? "Downloaded" : "Cached") + "\n(" + file.id.substr(0, 12) + ")"; } function onError(error) { var message = error.message || error.error || error; Ti.API.error("" + message + " loading cache with url: " + url); // We don't want to throw an error here. That would be a mess. } if (args.use_promises) { FileLoader.download(url).then(updateRow).fail(onError).done(); } else { FileLoader.download(url, { onload: updateRow, onerror: onError, }); } $.title.text = args.photo; /* vim:set ts=2 sw=2 et fdm=marker: */
Add support for choosing promises or callbacks
Add support for choosing promises or callbacks For testing and demo
JavaScript
mit
sukima/TiCachedImages,0x00evil/TiCachedImages,0x00evil/TiCachedImages,sukima/TiCachedImages
cd93d090958b3b4c058cabe384668725d23622b1
app/components/layer-file/component.js
app/components/layer-file/component.js
import Ember from 'ember'; export default Ember.Component.extend({ showSelect: false, noFileFound: true, didRender() { if(!this.get('layer.settings.values.downloadLink')){ this.get('node.files').then((result)=>{ result.objectAt(0).get('files').then((files)=>{ if(files.length === 0){ this.set('noFileFound', true); return false; }else{ this.set('noFileFound', false); } let fileDatesLinks = {} let fileModifiedDates = [] for(let i = 0; i < files.length; i++){ fileModifiedDates.push(files.objectAt(i).get('dateModified')); fileDatesLinks[files.objectAt(i).get('dateModified')] = files.objectAt(i).get('links').download; } let mostRecentDate = new Date(Math.max.apply(null,fileModifiedDates)); this.set('layer.settings.values.downloadLink' , fileDatesLinks[mostRecentDate]); }); }); } }, actions: { fileDetail(file) { this.set('showSelect', false); this.set('layer.settings.values.downloadLink' , file.data.links.download) }, showSelect(){ this.set('showSelect', true); }, hideSelect(){ this.set('showSelect', false); } } });
import Ember from 'ember'; export default Ember.Component.extend({ showSelect: false, noFileFound: true, //make computed property that observers the layers.[] and if change see if there is a file didRender() { console.log(this.get('layer.settings.values.downloadLink') , this.get('noFileFound')) if(!this.get('layer.settings.values.downloadLink')){ this.get('node.files').then((result)=>{ result.objectAt(0).get('files').then((files)=>{ console.log("files.length" , files.length); if(files.length === 0){ this.set('noFileFound', true); return false; }else{ this.set('noFileFound', false); } let fileDatesLinks = {} let fileModifiedDates = [] for(let i = 0; i < files.length; i++){ fileModifiedDates.push(files.objectAt(i).get('dateModified')); fileDatesLinks[files.objectAt(i).get('dateModified')] = files.objectAt(i).get('links').download; } let mostRecentDate = new Date(Math.max.apply(null,fileModifiedDates)); this.set('layer.settings.values.downloadLink' , fileDatesLinks[mostRecentDate]); }); }); }else{ this.set('noFileFound', false); } }, actions: { fileDetail(file) { this.set('showSelect', false); this.set('layer.settings.values.downloadLink' , file.data.links.download) }, showSelect(){ this.set('showSelect', true); }, hideSelect(){ this.set('showSelect', false); } } });
Fix 'No Files Found" showing when files are found
Fix 'No Files Found" showing when files are found
JavaScript
apache-2.0
caneruguz/osfpages,caneruguz/osfpages,Rytiggy/osfpages,Rytiggy/osfpages
bd812f12f00375232dd413e17a4356d8320f9c80
lib/vttregion-extended.js
lib/vttregion-extended.js
// If we're in Node.js then require VTTRegion so we can extend it, otherwise assume // VTTRegion is on the global. if (typeof module !== "undefined" && module.exports) { this.VTTRegion = require("./vttregion").VTTRegion; } // Extend VTTRegion with methods to convert to JSON, from JSON, and construct a // VTTRegion from an options object. The primary purpose of this is for use in the // vtt.js test suite. It's also useful if you need to work with VTTRegions in // JSON format. (function(root) { root.VTTRegion.create = function(options) { var region = new root.VTTRegion(); for (var key in options) { if (region.hasOwnProperty(key)) { region[key] = options[key]; } } return region; }; root.VTTRegion.create = function(json) { return this.create(JSON.parse(json)); }; }(this));
// If we're in Node.js then require VTTRegion so we can extend it, otherwise assume // VTTRegion is on the global. if (typeof module !== "undefined" && module.exports) { this.VTTRegion = require("./vttregion").VTTRegion; } // Extend VTTRegion with methods to convert to JSON, from JSON, and construct a // VTTRegion from an options object. The primary purpose of this is for use in the // vtt.js test suite. It's also useful if you need to work with VTTRegions in // JSON format. (function(root) { root.VTTRegion.create = function(options) { var region = new root.VTTRegion(); for (var key in options) { if (region.hasOwnProperty(key)) { region[key] = options[key]; } } return region; }; root.VTTRegion.fromJSON = function(json) { return this.create(JSON.parse(json)); }; }(this));
Fix accidental change of fromJSON() to create().
Fix accidental change of fromJSON() to create().
JavaScript
apache-2.0
gkatsev/vtt.js,mozilla/vtt.js,gkatsev/vtt.js,mozilla/vtt.js
4a5944329d737b0671a5a094e428e23b803b359c
lib/constants.js
lib/constants.js
var fs = require('fs') var pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json').toString()) exports.VERSION = pkg.version exports.DEFAULT_PORT = process.env.PORT || 9876 exports.DEFAULT_HOSTNAME = process.env.IP || 'localhost' // log levels exports.LOG_DISABLE = 'OFF' exports.LOG_ERROR = 'ERROR' exports.LOG_WARN = 'WARN' exports.LOG_INFO = 'INFO' exports.LOG_DEBUG = 'DEBUG' // Default patterns for the pattern layout. exports.COLOR_PATTERN = '%[%p [%c]: %]%m' exports.NO_COLOR_PATTERN = '%p [%c]: %m' // Default console appender exports.CONSOLE_APPENDER = { type: 'console', layout: { type: 'pattern', pattern: exports.COLOR_PATTERN } } exports.EXIT_CODE = '\x1FEXIT'
var fs = require('fs') var pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json').toString()) exports.VERSION = pkg.version exports.DEFAULT_PORT = process.env.PORT || 9876 exports.DEFAULT_HOSTNAME = process.env.IP || 'localhost' // log levels exports.LOG_DISABLE = 'OFF' exports.LOG_ERROR = 'ERROR' exports.LOG_WARN = 'WARN' exports.LOG_INFO = 'INFO' exports.LOG_DEBUG = 'DEBUG' // Default patterns for the pattern layout. exports.COLOR_PATTERN = '%[%d{DATE}:%p [%c]: %]%m' exports.NO_COLOR_PATTERN = '%d{DATE}:%p [%c]: %m' // Default console appender exports.CONSOLE_APPENDER = { type: 'console', layout: { type: 'pattern', pattern: exports.COLOR_PATTERN } } exports.EXIT_CODE = '\x1FEXIT'
Add date/time stamp to log output
feat(logger): Add date/time stamp to log output The `"%d{DATE}"` in the log pattern adds a date and time stamp to log lines. So you get output like this from karma's logging: ``` 30 06 2015 15:19:56.562:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-43808925 ``` The date and time are handy for figuring out if karma is running slowly.
JavaScript
mit
clbond/karma,powerkid/karma,brianmhunt/karma,hitesh97/karma,simudream/karma,karma-runner/karma,skycocker/karma,vtsvang/karma,SamuelMarks/karma,unional/karma,tomkuk/karma,gayancliyanage/karma,kahwee/karma,IsaacChapman/karma,Sanjo/karma,rhlass/karma,clbond/karma,kahwee/karma,maksimr/karma,maksimr/karma,skycocker/karma,chrisirhc/karma,panrafal/karma,mprobst/karma,KrekkieD/karma,KrekkieD/karma,harme199497/karma,buley/karma,skycocker/karma,karma-runner/karma,youprofit/karma,skycocker/karma,simudream/karma,aiboy/karma,pedrotcaraujo/karma,hitesh97/karma,gayancliyanage/karma,oyiptong/karma,IsaacChapman/karma,maksimr/karma,brianmhunt/karma,harme199497/karma,shirish87/karma,jamestalmage/karma,brianmhunt/karma,pmq20/karma,astorije/karma,jjoos/karma,astorije/karma,pmq20/karma,unional/karma,hitesh97/karma,buley/karma,IveWong/karma,buley/karma,karma-runner/karma,mprobst/karma,oyiptong/karma,johnjbarton/karma,tomkuk/karma,vtsvang/karma,xiaoking/karma,wesleycho/karma,powerkid/karma,IsaacChapman/karma,chrisirhc/karma,jjoos/karma,johnjbarton/karma,IveWong/karma,simudream/karma,unional/karma,mprobst/karma,codedogfish/karma,Dignifiedquire/karma,xiaoking/karma,Klaudit/karma,panrafal/karma,panrafal/karma,astorije/karma,jamestalmage/karma,pedrotcaraujo/karma,Sanjo/karma,kahwee/karma,clbond/karma,timebackzhou/karma,Klaudit/karma,ernsheong/karma,wesleycho/karma,timebackzhou/karma,stevemao/karma,SamuelMarks/karma,KrekkieD/karma,harme199497/karma,powerkid/karma,codedogfish/karma,pmq20/karma,Sanjo/karma,patrickporto/karma,gayancliyanage/karma,aiboy/karma,marthinus-engelbrecht/karma,youprofit/karma,jamestalmage/karma,astorije/karma,gayancliyanage/karma,IsaacChapman/karma,vtsvang/karma,Dignifiedquire/karma,codedogfish/karma,rhlass/karma,pedrotcaraujo/karma,oyiptong/karma,patrickporto/karma,simudream/karma,clbond/karma,hitesh97/karma,Dignifiedquire/karma,powerkid/karma,kahwee/karma,ernsheong/karma,chrisirhc/karma,Dignifiedquire/karma,shirish87/karma,stevemao/karma,timebackzhou/karma,Sanjo/karma,johnjbarton/karma,timebackzhou/karma,chrisirhc/karma,patrickporto/karma,pedrotcaraujo/karma,aiboy/karma,david-garcia-nete/karma,shirish87/karma,jamestalmage/karma,wesleycho/karma,buley/karma,youprofit/karma,codedogfish/karma,wesleycho/karma,johnjbarton/karma,marthinus-engelbrecht/karma,xiaoking/karma,IveWong/karma,stevemao/karma,brianmhunt/karma,jjoos/karma,Klaudit/karma,david-garcia-nete/karma,rhlass/karma,marthinus-engelbrecht/karma,Klaudit/karma,jjoos/karma,david-garcia-nete/karma,oyiptong/karma,aiboy/karma,KrekkieD/karma,tomkuk/karma,youprofit/karma,marthinus-engelbrecht/karma,tomkuk/karma,vtsvang/karma,ernsheong/karma,karma-runner/karma,rhlass/karma,IveWong/karma,SamuelMarks/karma,stevemao/karma,xiaoking/karma,patrickporto/karma,pmq20/karma,unional/karma,harme199497/karma
3601d7ce7c5e2863c27e0a0c5a08746cbaddfcba
app/assets/javascripts/global.js
app/assets/javascripts/global.js
$(document) .ready(function() { // fix menu when passed $('.masthead') .visibility({ once: false, onBottomPassed: function() { $('.fixed.menu').transition('fade in'); }, onBottomPassedReverse: function() { $('.fixed.menu').transition('fade out'); } }) ; // create sidebar and attach to menu open $('.ui.sidebar') .sidebar('attach events', '.toc.item') ; }) ;
$(document) .ready(function() { // fix menu when passed $('.masthead') .visibility({ once: false, onBottomPassed: function() { $('.fixed.menu').transition('fade in'); }, onBottomPassedReverse: function() { $('.fixed.menu').transition('fade out'); } }); // create sidebar and attach to menu open $('.ui.sidebar') .sidebar('attach events', '.toc.item'); $('.message .close') .on('click', function() { $(this) .closest('.message') .transition('fade'); }); });
Make the flash message dismissable
Make the flash message dismissable
JavaScript
bsd-3-clause
payloadtech/payload,payloadtech/payload,amingilani/starter-web-app,amingilani/starter-web-app,payloadtech/payload,amingilani/starter-web-app
52213504d4c43fe43f572dc8bf84113a9af07797
routes/index.js
routes/index.js
var express = require('express'); var request = require('request'); var http = require('http'); var router = express.Router(); var fixtures = require('./fixtures'); /* GET home page. */ router.get('/', function(req, res, next) { res.render('index', { title: 'FootScores' }); }); /* GET any leagues matches */ router.get('/fixtures/:id', function(req, res, next) { var matches = fixtures.getMatches(req.params.id, function(data) { res.render('matches', {matches: data}); }); }); module.exports = router;
var express = require('express'); var request = require('request'); var http = require('http'); var router = express.Router(); var fixtures = require('./fixtures'); var database = require('../database/mongo'); /* GET home page. */ router.get('/', function(req, res, next) { res.render('index', { title: 'FootScores' }); }); /* GET any leagues matches */ router.get('/fixtures/:id', function(req, res, next) { var matches = fixtures.getMatchesByCompetition(req.params.id, function(data) { res.render('matches', {matches: data}); }); }); router.get('/matches', function(req, res, next) { database.getConnection(function(db) { fixtures.serveMatches(db.collection('partidos')); }); res.render('matches', {matches: {}}); }); module.exports = router;
Change names to be more self-explanatory
Change names to be more self-explanatory
JavaScript
mit
ngomez22/FootScores,ngomez22/FootScores
368c10724ead9b725bbd75f31a7922fcbe6fc0aa
app/javascript/helpers/string.js
app/javascript/helpers/string.js
/* FILE string.js */ (function () { this.sparks.string = {}; var str = sparks.string; str.strip = function (s) { s = s.replace(/\s*([^\s]*)\s*/, '$1'); return s; }; // Remove a dot in the string, and then remove 0's on both sides // e.g. '20100' => '201', '0.0020440' => '2044' str.stripZerosAndDots = function (s) { s = s.replace('.', ''); s = s.replace(/0*([^0].*)/, '$1'); s = s.replace(/(.*[^0])0*/, '$1'); return s; }; str.stripZeros = function (s) { s = s.replace(/0*([^0].*)/, '$1'); s = s.replace(/(.*[^0])0*/, '$1'); return s; }; })();
/* FILE string.js */ (function () { this.sparks.string = {}; var str = sparks.string; str.strip = function (s) { s = s.replace(/\s*([^\s]*)\s*/, '$1'); return s; }; // Remove a dot in the string, and then remove 0's on both sides // e.g. '20100' => '201', '0.0020440' => '2044' str.stripZerosAndDots = function (s) { s = s.replace('.', ''); s = s.replace(/0*([^0].*)/, '$1'); s = s.replace(/(.*[^0])0*/, '$1'); return s; }; str.stripZeros = function (s) { s = s.replace(/0*([^0].*)/, '$1'); s = s.replace(/(.*[^0])0*/, '$1'); return s; }; String.prototype.capFirst = function() { return this.charAt(0).toUpperCase() + this.slice(1); } })();
Add capitalize-first function to String
Add capitalize-first function to String
JavaScript
apache-2.0
concord-consortium/sparks,concord-consortium/sparks,concord-consortium/sparks,concord-consortium/sparks,concord-consortium/sparks
84854a6494b5c9f1a56be857ba2fc8762883f1c9
app/mixins/pagination-support.js
app/mixins/pagination-support.js
import Ember from 'ember'; export default Ember.Mixin.create({ hasPaginationSupport: true, total: 0, page: 0, pageSize: 10, didRequestPage: Ember.K, first: function () { return this.get('page') * this.get('pageSize') + 1; }.property('page', 'pageSize').cacheable(), last: function () { return Math.min((this.get('page') + 1) * this.get('pageSize'), this.get('total')); }.property('page', 'pageSize', 'total').cacheable(), hasPrevious: function () { return this.get('page') > 0; }.property('page').cacheable(), hasNext: function () { return this.get('last') < this.get('total'); }.property('last', 'total').cacheable(), nextPage: function () { if (this.get('hasNext')) { this.incrementProperty('page'); } }, previousPage: function () { if (this.get('hasPrevious')) { this.decrementProperty('page'); } }, totalPages: function () { return Math.ceil(this.get('total') / this.get('pageSize')); }.property('total', 'pageSize').cacheable(), pageDidChange: function () { this.didRequestPage(this.get('page')); }.observes('page') });
import Ember from 'ember'; export default Ember.Mixin.create({ hasPaginationSupport: true, total: 0, page: 0, pageSize: 10, didRequestPage: Ember.K, first: function () { return this.get('page') * this.get('pageSize') + 1; }.property('page', 'pageSize'), last: function () { return Math.min((this.get('page') + 1) * this.get('pageSize'), this.get('total')); }.property('page', 'pageSize', 'total'), hasPrevious: function () { return this.get('page') > 0; }.property('page'), hasNext: function () { return this.get('last') < this.get('total'); }.property('last', 'total'), nextPage: function () { if (this.get('hasNext')) { this.incrementProperty('page'); } }, previousPage: function () { if (this.get('hasPrevious')) { this.decrementProperty('page'); } }, totalPages: function () { return Math.ceil(this.get('total') / this.get('pageSize')); }.property('total', 'pageSize'), pageDidChange: function () { this.didRequestPage(this.get('page')); }.observes('page') });
Fix deprecation warnings for Ember 1.10.0.
Fix deprecation warnings for Ember 1.10.0.
JavaScript
apache-2.0
davidvmckay/Klondike,Stift/Klondike,davidvmckay/Klondike,jochenvangasse/Klondike,jochenvangasse/Klondike,themotleyfool/Klondike,Stift/Klondike,fhchina/Klondike,jochenvangasse/Klondike,fhchina/Klondike,themotleyfool/Klondike,fhchina/Klondike,themotleyfool/Klondike,Stift/Klondike,davidvmckay/Klondike
6cce0db72acfc12bf7fae13346be29928976b641
public/modules/core/controllers/sound-test.client.controller.js
public/modules/core/controllers/sound-test.client.controller.js
'use strict'; angular.module('core').controller('SoundTestController', ['$scope', 'TrialData', function($scope, TrialData) { /* global io */ var socket = io(); socket.on('oscMessageSent', function(data) { console.log('socket "oscMessageSent" event received with data: ' + data); }); socket.emit('sendOSCMessage', { oscType: 'message', address: '/eim/control/startSoundTest', args: { type: 'string', value: TrialData.data.metadata.session_number } }); $scope.stopSoundTest = function() { socket.emit('sendOSCMessage', { oscType: 'message', address: '/eim/control/stopSoundTest', args: { type: 'string', value: TrialData.data.metadata.session_number } }); }; $scope.trialDataJson = function() { return TrialData.toJson(); }; } ]);
'use strict'; angular.module('core').controller('SoundTestController', ['$scope', 'TrialData', function($scope, TrialData) { /* global io */ var socket = io(); socket.on('oscMessageSent', function(data) { console.log('socket "oscMessageSent" event received with data: ' + data); }); socket.emit('sendOSCMessage', { oscType: 'message', address: '/eim/control/soundTest', args: [ { type: 'integer', value: 1 }, { type: 'string', value: TrialData.data.metadata.session_number } ] }); $scope.stopSoundTest = function() { socket.emit('sendOSCMessage', { oscType: 'message', address: '/eim/control/soundTest', args: [ { type: 'integer', value: 0 }, { type: 'string', value: TrialData.data.metadata.session_number } ] }); }; // Send stop sound test message when controller is destroyed $scope.$on('$destroy', $scope.stopSoundTest); $scope.trialDataJson = function() { return TrialData.toJson(); }; } ]);
Reformat SoundTest OSC; stop sound test on SoundTest destroy
Reformat SoundTest OSC; stop sound test on SoundTest destroy
JavaScript
mit
brennon/eim,brennon/eim,brennon/eim,brennon/eim
4f93585a82adcc93b713cfd983d5343a23e262b3
app/renderer/reducers/player.js
app/renderer/reducers/player.js
import { SEEK, SET_DURATION, SET_CURRENT_SONG, CHANGE_VOLUME, CHANGE_CURRENT_SECONDS, PLAY, PAUSE } from './../actions/actionTypes' const initialState = { isPlaying: false, playFromSeconds: 0, totalSeconds: 0, currentSeconds: 0, currentSong: { title: '', artist: '', album: '', albumArt: '', src: '' }, volume: 1 } const player = (state = initialState, action) => { switch (action.type) { case PLAY: return { ...state, isPlaying: true } case PAUSE: return { ...state, isPlaying: false } case SEEK: return { ...state, playFromSeconds: action.playFromSeconds } case SET_CURRENT_SONG: return { ...state, currentSong: { id: action.id, title: action.title, artist: action.artist, album: action.album, albumArt: action.albumArt, src: action.src } } case SET_DURATION: return { ...state, totalSeconds: action.totalSeconds } case CHANGE_VOLUME: return { ...state, volume: action.volume } case CHANGE_CURRENT_SECONDS: return { ...state, currentSeconds: action.currentSeconds } default: return state } } export default player
import { SEEK, SET_DURATION, SET_CURRENT_SONG, CHANGE_VOLUME, CHANGE_CURRENT_SECONDS, PLAY, PAUSE } from './../actions/actionTypes' const initialState = { isPlaying: false, playFromSeconds: 0, totalSeconds: 0, currentSeconds: 0, currentSong: { id: '', title: '', artist: '', album: '', albumArt: '', src: '' }, volume: 1 } const player = (state = initialState, action) => { switch (action.type) { case PLAY: return { ...state, isPlaying: true } case PAUSE: return { ...state, isPlaying: false } case SEEK: return { ...state, playFromSeconds: action.playFromSeconds } case SET_CURRENT_SONG: return { ...state, currentSong: { id: action.id, title: action.title, artist: action.artist, album: action.album, albumArt: action.albumArt, src: action.src } } case SET_DURATION: return { ...state, totalSeconds: action.totalSeconds } case CHANGE_VOLUME: return { ...state, volume: action.volume } case CHANGE_CURRENT_SECONDS: return { ...state, currentSeconds: action.currentSeconds } default: return state } } export default player
Add missing id in initial state
Add missing id in initial state
JavaScript
mit
AbsoluteZero273/Deezic
e844bc03546c0189ba47bf1ff7915079abf2ca31
app/service/containers/route.js
app/service/containers/route.js
import Ember from 'ember'; import MultiStatsSocket from 'ui/utils/multi-stats'; export default Ember.Route.extend({ statsSocket: null, model() { return this.modelFor('service').get('service'); }, activate() { var stats = MultiStatsSocket.create({ resource: this.modelFor('service').get('service'), linkName: 'containerStats', }); this.set('statsSocket',stats); stats.on('dataPoint', (data) => { var controller = this.get('controller'); if ( controller ) { controller.onDataPoint(data); } }); }, deactivate() { this.get('statsSocket').close(); } });
import Ember from 'ember'; import MultiStatsSocket from 'ui/utils/multi-stats'; export default Ember.Route.extend({ statsSocket: null, model() { var promises = []; // Load the hosts for the instances if they're not already there var service = this.modelFor('service').get('service'); service.get('instances').forEach((instance) => { if ( !instance.get('primaryHost') ) { promises.push(instance.importLink('hosts')); } }); return Ember.RSVP.all(promises).then(() => { return service; }); }, activate() { var stats = MultiStatsSocket.create({ resource: this.modelFor('service').get('service'), linkName: 'containerStats', }); this.set('statsSocket',stats); stats.on('dataPoint', (data) => { var controller = this.get('controller'); if ( controller ) { controller.onDataPoint(data); } }); }, deactivate() { this.get('statsSocket').close(); } });
Fix unknown host on services
Fix unknown host on services
JavaScript
apache-2.0
vincent99/ui,westlywright/ui,lvuch/ui,rancherio/ui,pengjiang80/ui,vincent99/ui,rancherio/ui,nrvale0/ui,rancher/ui,nrvale0/ui,pengjiang80/ui,ubiquityhosting/rancher_ui,westlywright/ui,pengjiang80/ui,westlywright/ui,nrvale0/ui,rancher/ui,vincent99/ui,rancherio/ui,lvuch/ui,rancher/ui,ubiquityhosting/rancher_ui,lvuch/ui,ubiquityhosting/rancher_ui
8e1cba95872a228b21a76b1fb2edec7bc86af86b
app/src/Components/Base/Root.js
app/src/Components/Base/Root.js
import React from 'react' import PropTypes from 'prop-types' import { Provider } from 'react-redux' import { BrowserRouter } from 'react-router-dom' import ApolloClient from 'apollo-boost'; import { ApolloProvider } from 'react-apollo'; import BaseDataView from './BaseDataView' function getCookieValue(a) { var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)'); return b ? b.pop() : ''; } const client = new ApolloClient({ uri: process.env.REACT_APP_GRAPHQL_API_URL + 'graphql', headers: { 'Authorization': 'Bearer ' + getCookieValue('token') } // options: { mode: 'no-cors' } }); window.apiUrl = process.env.REACT_APP_FLASK_API_URL; const Root = ({ store }) => ( <ApolloProvider client={client}> <Provider store={store}> <BrowserRouter> <BaseDataView /> </BrowserRouter> </Provider> </ApolloProvider> ) Root.propTypes = { store: PropTypes.object.isRequired } export default Root
import React from 'react' import PropTypes from 'prop-types' import { Provider } from 'react-redux' import { BrowserRouter } from 'react-router-dom' import ApolloClient from 'apollo-boost'; import { ApolloProvider } from 'react-apollo'; import BaseDataView from './BaseDataView' function getCookieValue(a) { var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)'); return b ? b.pop() : ''; } const client = new ApolloClient({ uri: process.env.REACT_APP_FLASK_API_URL + 'graphql', headers: { 'Authorization': 'Bearer ' + getCookieValue('token') } // options: { mode: 'no-cors' } }); window.apiUrl = process.env.REACT_APP_FLASK_API_URL; const Root = ({ store }) => ( <ApolloProvider client={client}> <Provider store={store}> <BrowserRouter> <BaseDataView /> </BrowserRouter> </Provider> </ApolloProvider> ) Root.propTypes = { store: PropTypes.object.isRequired } export default Root
Use correct uri for AppolloClient
Use correct uri for AppolloClient
JavaScript
apache-2.0
alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality
2402f07c8ce1114389bac47c49b318d931134cdb
web_app/public/js/app.js
web_app/public/js/app.js
'use strict'; // Declare app level module which depends on filters, and services var app = angular.module( 'myApp', [ 'ngRoute', 'myApp.controllers', 'myApp.filters', 'myApp.services', 'myApp.directives', // 3rd party dependencies 'btford.socket-io' ] ); app.config( function ( $routeProvider, $locationProvider ) { $routeProvider. when( '/home', { templateUrl: 'partials/home', controller: 'HomeCtrl' } ). when( '/artist/:artistURI', { templateUrl: 'partials/artist', controller: 'ArtistCtrl' } ). when( '/album/:albumURI', { templateUrl: 'partials/album', controller: 'AlbumCtrl' } ). otherwise( { redirectTo: '/home' } ); $locationProvider.html5Mode( true ); });
'use strict'; // Declare app level module which depends on filters, and services var app = angular.module( 'myApp', [ 'ngRoute', 'myApp.controllers', 'myApp.filters', 'myApp.services', 'myApp.directives', // 3rd party dependencies 'btford.socket-io', 'fully-loaded' ] ); app.config( function ( $routeProvider, $locationProvider ) { $routeProvider. when( '/home', { templateUrl: 'partials/home', controller: 'HomeCtrl' } ). when( '/artist/:artistURI', { templateUrl: 'partials/artist', controller: 'ArtistCtrl' } ). when( '/album/:albumURI', { templateUrl: 'partials/album', controller: 'AlbumCtrl' } ). otherwise( { redirectTo: '/home' } ); $locationProvider.html5Mode( true ); });
Install this the right way
Install this the right way
JavaScript
mit
projectweekend/Pi-Jukebox,projectweekend/Pi-Jukebox,projectweekend/Pi-Jukebox
5de143e2e7268f50b55fedc392f7408e78355c28
src/client/assets/javascripts/app/App.js
src/client/assets/javascripts/app/App.js
import React, { PropTypes } from 'react'; const App = ({ children }) => ( <div className="page-container"> {children} </div> ); App.propTypes = { children: PropTypes.element.isRequired }; export default App;
import React, { PropTypes } from 'react'; const App = (props) => ( <div className="page-container"> {React.cloneElement({...props}.children, {...props})} </div> ); App.propTypes = { children: PropTypes.element.isRequired }; export default App;
Fix warning messages regarding refs and key
Fix warning messages regarding refs and key
JavaScript
mit
dead-in-the-water/ditw,nicksp/redux-webpack-es6-boilerplate,cloady/battleship,cloady/battleship,nicksp/redux-webpack-es6-boilerplate,richbai90/CS2810,dead-in-the-water/ditw,richbai90/CS2810,richbai90/CS2810,richbai90/CS2810
c14e89ab83e035103c58ed57c3681b64278c4a75
lib/utils/cmd.js
lib/utils/cmd.js
const fs = require('fs'); const path = require('path'); /** * Finds package.json file from either the directory the script was called from or a supplied path. * * console.log(findPackageFileInPath()); * console.log(findPackageFileInPath('./package.json')); * console.log(findPackageFileInPath('~/git/github/doxdox/')); * * @param {String} [input] Directory or file. * @return {String} Path to package.json file. * @public */ module.exports.findPackageFileInPath = input => { if (!input) { input = process.cwd(); } if (fs.existsSync(input)) { const stat = fs.statSync(input); if (stat.isDirectory()) { return path.resolve(path.join(input, '/package.json')); } else if (stat.isFile()) { return path.resolve(path.join(path.dirname(input), '/package.json')); } } return null; };
const fs = require('fs'); const path = require('path'); /** * Finds package.json file from either the directory the script was called from or a supplied path. * * console.log(findPackageFileInPath()); * console.log(findPackageFileInPath('./package.json')); * console.log(findPackageFileInPath('~/git/github/doxdox/')); * * @param {String} [input] Directory or file. * @return {String} Path to package.json file. * @public */ const findPackageFileInPath = input => { if (!input) { input = process.cwd(); } if (fs.existsSync(input)) { const stat = fs.statSync(input); if (stat.isDirectory()) { return path.resolve(path.join(input, '/package.json')); } else if (stat.isFile()) { return path.resolve(path.join(path.dirname(input), '/package.json')); } } return null; }; module.exports = { findPackageFileInPath };
Change how method is exported.
Change how method is exported.
JavaScript
mit
neogeek/doxdox
f1ab62de1b6c7bbe13e67361311f8cb14a38813e
src/helpers/find-root.js
src/helpers/find-root.js
'use babel' /* @flow */ import Path from 'path' import {findCached} from './common' import {CONFIG_FILE_NAME} from '../defaults' export function findRoot(directory: string): string { const configFile = findCached(directory, CONFIG_FILE_NAME) if (configFile !== null) { return Path.dirname(String(configFile)) } else return directory }
'use babel' /* @flow */ import Path from 'path' import {findCached} from './common' import {CONFIG_FILE_NAME} from '../defaults' export async function findRoot(directory: string): Promise<string> { const configFile = await findCached(directory, CONFIG_FILE_NAME) if (configFile) { return Path.dirname(configFile) } else return directory }
Upgrade findRoot to be async
:new: Upgrade findRoot to be async
JavaScript
mit
steelbrain/UCompiler
2ee0ebe084b73502b15a4a2f885a37a42abe7586
app/templates/Gruntfile.js
app/templates/Gruntfile.js
/*! * Generator-Gnar Gruntfile * http://gnarmedia.com * @author Adam Murphy */ // Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %> 'use strict'; /** * Grunt module */ module.exports = function (grunt) { /** * Generator-Gnar Grunt config */ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), /** * Set project info */ project: { src: 'src', dist: 'dist', assets: '<%= project.dist %>/assets', css: [ '<%= project.src %>/scss/style.scss' ], js: [ '<%= project.src %>/js/*.js' ] } }); /** * Default task * Run `grunt` on the command line */ grunt.registerTask('default', [ ]); };
/*! * Generator-Gnar Gruntfile * http://gnarmedia.com * @author Adam Murphy */ // Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %> 'use strict'; /** * Grunt module */ module.exports = function (grunt) { /** * Generator-Gnar Grunt config */ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), /** * Set project info */ project: { src: 'src', dist: 'dist', assets: '<%= project.dist %>/assets', css: [ '<%= project.src %>/scss/style.scss' ], js: [ '<%= project.src %>/js/*.js' ], html: [ '<%= project.src %>/html/*.html' ] } }); /** * Default task * Run `grunt` on the command line */ grunt.registerTask('default', [ ]); };
Add html property to project object
Add html property to project object
JavaScript
mit
gnarmedia/gnenerator-gnar
f0d015f6b45f599518e247c24c152fa5f17ba017
esm-samples/jsapi-custom-workers/webpack.config.js
esm-samples/jsapi-custom-workers/webpack.config.js
const path = require('path'); const HtmlWebPackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = { entry: { index: ['./src/index.css', './src/index.js'] }, node: false, output: { path: path.join(__dirname, 'dist'), chunkFilename: 'chunks/[id].js', clean: true }, devServer: { static: './dist', compress: true, port: 3001, }, module: { rules: [ { test: /\.js$/, enforce: "pre", use: ["source-map-loader"], }, { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader' ] }, ] }, plugins: [ new HtmlWebPackPlugin({ title: 'ArcGIS API for JavaScript', template: './public/index.html', filename: './index.html', chunksSortMode: 'none', inlineSource: '.(css)$' }), new MiniCssExtractPlugin({ filename: "[name].[chunkhash].css", chunkFilename: "[id].css" }) ] };
const path = require('path'); const HtmlWebPackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = { entry: { index: ['./src/index.css', './src/index.js'] }, node: false, output: { path: path.join(__dirname, 'dist'), chunkFilename: 'chunks/[id].js' }, devServer: { static: path.join(__dirname, 'dist'), compress: true, port: 3001, }, module: { rules: [ { test: /\.js$/, enforce: "pre", use: ["source-map-loader"], }, { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader' ] }, ] }, plugins: [ new HtmlWebPackPlugin({ title: 'ArcGIS API for JavaScript', template: './public/index.html', filename: './index.html', chunksSortMode: 'none', inlineSource: '.(css)$' }), new MiniCssExtractPlugin({ filename: "[name].[chunkhash].css", chunkFilename: "[id].css" }) ] };
Update webpack static, remove webpack clean so dist builds work again.
Update webpack static, remove webpack clean so dist builds work again.
JavaScript
apache-2.0
Esri/jsapi-resources,Esri/jsapi-resources,Esri/jsapi-resources
16e45622c0de9f26679cd0cdcbe6f301d3d6fd16
src/js/schemas/service-schema/EnvironmentVariables.js
src/js/schemas/service-schema/EnvironmentVariables.js
import {Hooks} from 'PluginSDK'; let EnvironmentVariables = { description: 'Set environment variables for each task your service launches in addition to those set by Mesos.', type: 'object', title: 'Environment Variables', properties: { variables: { type: 'array', duplicable: true, addLabel: 'Add Environment Variable', getter: function (service) { let variableMap = service.getEnvironmentVariables(); if (variableMap == null) { return [{}]; } return Object.keys(variableMap).map(function (key) { return Hooks.applyFilter('variablesGetter', { key, value: variableMap[key] }, service); }); }, itemShape: { properties: { key: { title: 'Key', type: 'string' }, value: { title: 'Value', type: 'string' } } } } } }; module.exports = EnvironmentVariables;
import {Hooks} from 'PluginSDK'; let EnvironmentVariables = { description: 'Set environment variables for each task your service launches in addition to those set by Mesos.', type: 'object', title: 'Environment Variables', properties: { variables: { type: 'array', duplicable: true, addLabel: 'Add Environment Variable', getter: function (service) { let variableMap = service.getEnvironmentVariables(); if (variableMap == null) { return []; } return Object.keys(variableMap).map(function (key) { return Hooks.applyFilter('variablesGetter', { key, value: variableMap[key] }, service); }); }, itemShape: { properties: { key: { title: 'Key', type: 'string' }, value: { title: 'Value', type: 'string' } } } } } }; module.exports = EnvironmentVariables;
Remove empty object from variables array
Remove empty object from variables array
JavaScript
apache-2.0
dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui
485e7c6a5c29f5e9f89048ef819ed2338cd54830
src/schema/infoSchema.js
src/schema/infoSchema.js
"use strict"; const Joi = require('joi'); const contactSchema = require('./contactSchema'); const licenseSchema = require('./licenseSchema'); const pathsSchema = require('./pathsSchema'); module.exports = Joi.object({ 'title': Joi.string() .required(), 'description': Joi.string(), 'termsOfService': Joi.string(), 'contact': contactSchema.required(), 'license': licenseSchema, 'paths': pathsSchema });
"use strict"; const Joi = require('joi'); const contactSchema = require('./contactSchema'); const licenseSchema = require('./licenseSchema'); const pathsSchema = require('./pathsSchema'); module.exports = Joi.object({ 'title': Joi.string() .required(), 'description': Joi.string(), 'termsOfService': Joi.string(), 'contact': contactSchema.required(), 'license': licenseSchema, 'paths': pathsSchema, 'permissionProvider': Joi.func() });
Add permission provider to the info schema
Add permission provider to the info schema
JavaScript
mit
Teagan42/Deepthought-Routing
f1749939532bd2e7aa659e2261aac94ded794285
client/main.js
client/main.js
import Vue from 'vue' import App from './App' import I18n from 'vue-i18n' import Cookie from 'vue-cookie' import { sync } from 'vuex-router-sync' import router from './router' import store from './store' import en from 'locales/en' import ja from 'locales/ja' if (process.env.NODE_ENV === 'production') { // Enable Progressive Web App require('./pwa') // Redirect HTTP to HTTPS if (window.location.protocol === 'http:') { window.location.protocol = 'https' } } sync(store, router) const locales = { en: en, ja: ja } Vue.use(Cookie) Vue.use(I18n) // Check if language cookie has been set // If so, use it // Else use English Vue.config.lang = Vue.cookie.get('lang') ? Vue.cookie.get('lang') : 'en' // Set fallback used for untranslated strings Vue.config.fallbackLang = 'en' Object.keys(locales).forEach(lang => { Vue.locale(lang, locales[lang]) }) /* eslint-disable no-new */ new Vue({ el: '#app', router, store, render: h => h(App) })
import Vue from 'vue' import App from './App' import I18n from 'vue-i18n' import Cookie from 'vue-cookie' import { sync } from 'vuex-router-sync' import router from './router' import store from './store' import en from 'locales/en' import ja from 'locales/ja' if (process.env.NODE_ENV === 'production') { // Enable Progressive Web App require('./pwa') // Redirect HTTP to HTTPS // if (window.location.protocol === 'http:') { // window.location.protocol = 'https' // } } sync(store, router) const locales = { en: en, ja: ja } Vue.use(Cookie) Vue.use(I18n) // Check if language cookie has been set // If so, use it // Else use English Vue.config.lang = Vue.cookie.get('lang') ? Vue.cookie.get('lang') : 'en' // Set fallback used for untranslated strings Vue.config.fallbackLang = 'en' Object.keys(locales).forEach(lang => { Vue.locale(lang, locales[lang]) }) /* eslint-disable no-new */ new Vue({ el: '#app', router, store, render: h => h(App) })
Use Cloudflare for HTTPS redirect
Use Cloudflare for HTTPS redirect
JavaScript
mit
wopian/hibari,wopian/hibari
3f594741d55735c20ae1b7f083222e9d10e35fb5
js/Main.js
js/Main.js
// Main JavaScript Document var cards = []; var mainContent = document.getElementId('main-content'); var mainContentRegion = new ZingTouch.Region(mainContent); //Create the card object template function contentCard(title, img, desc, link) { "use strict"; this.title = title; this.img = img; this.desc = desc; this.link = link; } var cardPicker = function() { };
// Main JavaScript Document var cards = []; var mainContent = document.getElementId('main-content'); var mainContentRegion = new ZingTouch.Region(mainContent); //Create the card object template function contentCard(title, img, desc, link) { "use strict"; this.title = title; this.img = img; this.desc = desc; this.link = link; } var cardPicker = (function() { "use strict"; var cards = []; var index = 0; function next() { index = index++ < cards.length ? index : 0; return cards(index); } function current() { return cards(index); } return { next: next, current: current }; })();
Create Card Object template and Card Picker
Create Card Object template and Card Picker
JavaScript
mit
AnthonyGordon1/sneaker-app,AnthonyGordon1/sneaker-app
b0a2e9415545bd7ee6d592c3a270b2d308b80a73
src/main/webapp/resources/js/modules/notifications.js
src/main/webapp/resources/js/modules/notifications.js
import Noty from "noty"; import "noty/src/noty.scss"; import "noty/src/themes/sunset.scss"; export function showNotification({ text, type = "success" }) { return new Noty({ theme: "sunset", timeout: 3500, // [integer|boolean] delay for closing event in milliseconds. Set false for sticky notifications layout: "bottomRight", progressBar: true, type, text, animation: { open: "animated fadeInUp", close: "animated fadeOutDown" } }).show(); } // TODO: Remove this after all notification usages are through a webpack bundle. window.notifications = (function() { return { show: showNotification }; })();
import Noty from "noty"; import "noty/src/noty.scss"; import "noty/src/themes/relax.scss"; export function showNotification({ text, type = "success" }) { return new Noty({ theme: "relax", timeout: 3500, // [integer|boolean] delay for closing event in milliseconds. Set false for sticky notifications layout: "bottomRight", progressBar: true, type, text, animation: { open: "animated fadeInUp", close: "animated fadeOutDown" } }).show(); } // TODO: Remove this after all notification usages are through a webpack bundle. window.notifications = (function() { return { show: showNotification }; })();
Update to use relax theme
Update to use relax theme
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
0ba67c44d9151fe6286603180e48d1f217344d26
client/util.js
client/util.js
var validateFloat = function(val) { if (typeof val != 'undefined') { val = parseFloat(val); if (! isNaN(val)) { if (val > -99999 ) { return val; } } } return Infinity; }; var enableFilter = function (id) { var f = window.app.filters.get(id); // FIXME: data keys are assumed to be lower case, but this is not checked/ensured var id_lower = id.toLowerCase(); f._dx = window.app.crossfilter.dimension( function(d) {return validateFloat(d[id_lower]);}); f.active = true; }; var disableFilter = function (id) { var f = window.app.filters.get(id); f._dx.dispose(); delete f._dx; }; module.exports = { validateFloat: validateFloat, enableFilter: enableFilter, disableFilter: disableFilter, };
var validateFloat = function(val) { if (typeof val != 'undefined') { val = parseFloat(val); if (! isNaN(val)) { if (val > -99999 ) { return val; } } } return Infinity; }; var enableFilter = function (id) { var f = window.app.filters.get(id); // FIXME: data keys are assumed to be lower case, but this is not checked/ensured var id_lower = id.toLowerCase(); f._dx = window.app.crossfilter.dimension( function(d) {return validateFloat(d[id_lower]);}); f.active = true; }; var disableFilter = function (id) { var f = window.app.filters.get(id); f._dx.dispose(); delete f._dx; f.active = false; }; module.exports = { validateFloat: validateFloat, enableFilter: enableFilter, disableFilter: disableFilter, };
Fix bug where filter was not set to inacative
Fix bug where filter was not set to inacative
JavaScript
apache-2.0
summerinthecity/uhitool,jspaaks/spot,NLeSC/spot,jspaaks/spot,jiskattema/uhitool,summerinthecity/uhitool,jiskattema/uhitool
204de9d56b72ce5387af7bdd5dffab60d16e31e9
nodejs/config.js
nodejs/config.js
require('dotenv').config({ silent: true, }) let makeHostConfig = (env, prefix) => { let host = env[prefix + '_HOST'] || '127.0.0.1' let port = parseInt(env[prefix + '_PORT'], 10) || 3030 let https = env[prefix + '_HTTPS'] === 'true' || env[prefix + '_HTTPS'] === true let default_port, protocol if (https) { default_port = 443 protocol = 'https' } else { default_port = 80 protocol = 'http' } let url = protocol + '://' + host + (port === default_port ? '' : ':' + port) return { host, port, url, protocol, https, } } const env = process.env.APP_ENV || 'local' const atom = { announcement_url: process.env.ATOM_PLUGIN_ANNOUNCEMENT_URL || '#', } module.exports = { node: makeHostConfig(process.env, 'NODE'), api: makeHostConfig(process.env, 'API'), external: makeHostConfig(process.env, 'APP'), websocket: makeHostConfig(process.env, 'ECHO'), debug: process.env.APP_DEBUG === 'true' || process.env.APP_DEBUG === true, env, production: env === 'production', dev: env !== 'production', atom, analytics_track_id: process.env.GOOGLE_ANALYTICS_TRACK_ID }
require('dotenv').config({ silent: true, }) let makeHostConfig = (env, prefix) => { let host = env[prefix + '_HOST'] || '127.0.0.1' let port = parseInt(env[prefix + '_PORT'], 10) || 3030 let https = env[prefix + '_HTTPS'] === 'true' || env[prefix + '_HTTPS'] === true let default_port, protocol if (https) { default_port = 443 protocol = 'https' } else { default_port = 80 protocol = 'http' } let url = protocol + '://' + host + (port === default_port ? '' : ':' + port) return { host, port, url, protocol, https, } } const env = process.env.APP_ENV || 'local' const atom = { announcement_url: process.env.ATOM_PLUGIN_ANNOUNCEMENT_URL || '#', } module.exports = { node: makeHostConfig(process.env, 'NODE'), api: makeHostConfig(process.env, 'API'), external: makeHostConfig(process.env, 'APP'), websocket: { host: process.env.ECHO_HOST || 'localhost', port: process.env.ECHO_PORT || '6002', }, debug: process.env.APP_DEBUG === 'true' || process.env.APP_DEBUG === true, env, production: env === 'production', dev: env !== 'production', atom, analytics_track_id: process.env.GOOGLE_ANALYTICS_TRACK_ID }
Implement HTTPS support for Docker
Implement HTTPS support for Docker
JavaScript
mit
viblo-asia/api-proxy
796488305ab4f2231a58bd18474268bd8c7b5952
components/EditableEntry.js
components/EditableEntry.js
/** * @flow */ import React from 'react'; import { StyleSheet, TextInput } from 'react-native'; import PropTypes from 'prop-types'; import Box from './Box'; class EditableEntry extends React.Component { render() { return ( <Box numberOfLines={1}> <TextInput style={styles.textInput} onChangeText={(text) => this.props.onChangeText(text)} onSubmitEditing={(event) => this.props.onSubmit(event.nativeEvent.text)} autoFocus={true} value={this.props.text} /> </Box> ); } } EditableEntry.propTypes = { text: PropTypes.string.isRequired, onChangeText: PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired }; const styles = StyleSheet.create({ textInput: { paddingTop: 6, paddingLeft: 6, height: 28, color: '#27ae60', alignItems: 'center', justifyContent: 'center', fontSize: 14, fontFamily: 'Helvetica', fontStyle: 'italic', fontWeight: 'bold', }, }); export default EditableEntry;
/** * @flow */ import React from 'react'; import { StyleSheet, TextInput } from 'react-native'; import PropTypes from 'prop-types'; import Box from './Box'; class EditableEntry extends React.Component { render() { return ( <Box numberOfLines={1}> <TextInput style={styles.textInput} onChangeText={(text) => this.props.onChangeText(text)} onSubmitEditing={(event) => this.props.onSubmit(event.nativeEvent.text)} autoFocus={true} value={this.props.text} returnKeyType="done" /> </Box> ); } } EditableEntry.propTypes = { text: PropTypes.string.isRequired, onChangeText: PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired }; const styles = StyleSheet.create({ textInput: { paddingTop: 6, paddingLeft: 6, height: 28, color: '#27ae60', alignItems: 'center', justifyContent: 'center', fontSize: 14, fontFamily: 'Helvetica', fontStyle: 'italic', fontWeight: 'bold', }, }); export default EditableEntry;
Add a returnKeyType to the input keyboard
Add a returnKeyType to the input keyboard
JavaScript
mit
nikhilsaraf/react-native-todo-app
65bbd24974974672c60eea3f250564be6a4bfead
webroot/rsrc/js/application/differential/behavior-user-select.js
webroot/rsrc/js/application/differential/behavior-user-select.js
/** * @provides javelin-behavior-differential-user-select * @requires javelin-behavior * javelin-dom * javelin-stratcom */ JX.behavior('differential-user-select', function() { var unselectable; function isOnRight(node) { return node.parentNode.firstChild != node.previousSibling; } JX.Stratcom.listen( 'mousedown', null, function(e) { var key = 'differential-unselectable'; if (unselectable) { JX.DOM.alterClass(unselectable, key, false); } var diff = e.getNode('differential-diff'); var td = e.getNode('tag:td'); if (diff && td && isOnRight(td)) { unselectable = diff; JX.DOM.alterClass(diff, key, true); } }); });
/** * @provides javelin-behavior-differential-user-select * @requires javelin-behavior * javelin-dom * javelin-stratcom */ JX.behavior('differential-user-select', function() { var unselectable; function isOnRight(node) { return node.previousSibling && node.parentNode.firstChild != node.previousSibling; } JX.Stratcom.listen( 'mousedown', null, function(e) { var key = 'differential-unselectable'; if (unselectable) { JX.DOM.alterClass(unselectable, key, false); } var diff = e.getNode('differential-diff'); var td = e.getNode('tag:td'); if (diff && td && isOnRight(td)) { unselectable = diff; JX.DOM.alterClass(diff, key, true); } }); });
Enable selecting text in Differential shield and gap
Enable selecting text in Differential shield and gap Test Plan: Selected text in shield. Selected text in right side. Reviewers: epriestley, btrahan Reviewed By: btrahan CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3522
JavaScript
apache-2.0
vuamitom/phabricator,r4nt/phabricator,denisdeejay/phabricator,Automattic/phabricator,Automattic/phabricator,hshackathons/phabricator-deprecated,wangjun/phabricator,telerik/phabricator,zhihu/phabricator,devurandom/phabricator,christopher-johnson/phabricator,huaban/phabricator,matthewrez/phabricator,aswanderley/phabricator,sharpwhisper/phabricator,huaban/phabricator,Khan/phabricator,dannysu/phabricator,aswanderley/phabricator,Automattic/phabricator,leolujuyi/phabricator,kanarip/phabricator,memsql/phabricator,akkakks/phabricator,parksangkil/phabricator,vuamitom/phabricator,kwoun1982/phabricator,hach-que/unearth-phabricator,huangjimmy/phabricator-1,wikimedia/phabricator-phabricator,phacility/phabricator,coursera/phabricator,tanglu-org/tracker-phabricator,akkakks/phabricator,jwdeitch/phabricator,wikimedia/phabricator,Khan/phabricator,christopher-johnson/phabricator,folsom-labs/phabricator,r4nt/phabricator,Soluis/phabricator,wusuoyongxin/phabricator,a20012251/phabricator,apexstudios/phabricator,tanglu-org/tracker-phabricator,folsom-labs/phabricator,Symplicity/phabricator,WuJiahu/phabricator,aik099/phabricator,devurandom/phabricator,MicroWorldwide/phabricator,aswanderley/phabricator,wikimedia/phabricator-phabricator,kalbasit/phabricator,devurandom/phabricator,kalbasit/phabricator,benchling/phabricator,NigelGreenway/phabricator,akkakks/phabricator,folsom-labs/phabricator,UNCC-OpenProjects/Phabricator,tanglu-org/tracker-phabricator,Soluis/phabricator,WuJiahu/phabricator,shl3807/phabricator,cjxgm/p.cjprods.org,librewiki/phabricator,huangjimmy/phabricator-1,MicroWorldwide/phabricator,akkakks/phabricator,Automatic/phabricator,freebsd/phabricator,wikimedia/phabricator,benchling/phabricator,wikimedia/phabricator,wangjun/phabricator,NigelGreenway/phabricator,optimizely/phabricator,codevlabs/phabricator,wusuoyongxin/phabricator,a20012251/phabricator,gsinkovskiy/phabricator,kanarip/phabricator,NigelGreenway/phabricator,ide/phabricator,Automatic/phabricator,Khan/phabricator,sharpwhisper/phabricator,shrimpma/phabricator,phacility/phabricator,christopher-johnson/phabricator,matthewrez/phabricator,eSpark/phabricator,jwdeitch/phabricator,MicroWorldwide/phabricator,librewiki/phabricator,zhihu/phabricator,aswanderley/phabricator,schlaile/phabricator,NigelGreenway/phabricator,aik099/phabricator,christopher-johnson/phabricator,r4nt/phabricator,uhd-urz/phabricator,vinzent/phabricator,shrimpma/phabricator,eSpark/phabricator,ryancford/phabricator,vuamitom/phabricator,hach-que/unearth-phabricator,ryancford/phabricator,vuamitom/phabricator,librewiki/phabricator,codevlabs/phabricator,gsinkovskiy/phabricator,kwoun1982/phabricator,huaban/phabricator,leolujuyi/phabricator,kwoun1982/phabricator,telerik/phabricator,wxstars/phabricator,r4nt/phabricator,parksangkil/phabricator,uhd-urz/phabricator,coursera/phabricator,dannysu/phabricator,codevlabs/phabricator,hach-que/unearth-phabricator,Soluis/phabricator,leolujuyi/phabricator,Drooids/phabricator,wxstars/phabricator,aik099/phabricator,ide/phabricator,wusuoyongxin/phabricator,denisdeejay/phabricator,sharpwhisper/phabricator,Khan/phabricator,cjxgm/p.cjprods.org,kanarip/phabricator,ide/phabricator,eSpark/phabricator,librewiki/phabricator,optimizely/phabricator,UNCC-OpenProjects/Phabricator,shl3807/phabricator,aswanderley/phabricator,shrimpma/phabricator,optimizely/phabricator,freebsd/phabricator,ide/phabricator,devurandom/phabricator,huangjimmy/phabricator-1,coursera/phabricator,hshackathons/phabricator-deprecated,christopher-johnson/phabricator,telerik/phabricator,phacility/phabricator,uhd-urz/phabricator,Automatic/phabricator,cjxgm/p.cjprods.org,denisdeejay/phabricator,leolujuyi/phabricator,matthewrez/phabricator,apexstudios/phabricator,wikimedia/phabricator,optimizely/phabricator,UNCC-OpenProjects/Phabricator,wxstars/phabricator,zhihu/phabricator,vinzent/phabricator,memsql/phabricator,zhihu/phabricator,devurandom/phabricator,schlaile/phabricator,vinzent/phabricator,huaban/phabricator,wxstars/phabricator,codevlabs/phabricator,huangjimmy/phabricator-1,eSpark/phabricator,denisdeejay/phabricator,jwdeitch/phabricator,Symplicity/phabricator,memsql/phabricator,gsinkovskiy/phabricator,eSpark/phabricator,UNCC-OpenProjects/Phabricator,memsql/phabricator,parksangkil/phabricator,memsql/phabricator,Drooids/phabricator,schlaile/phabricator,optimizely/phabricator,Symplicity/phabricator,kanarip/phabricator,hach-que/phabricator,hach-que/unearth-phabricator,freebsd/phabricator,WuJiahu/phabricator,r4nt/phabricator,hach-que/phabricator,ryancford/phabricator,hach-que/phabricator,shl3807/phabricator,benchling/phabricator,matthewrez/phabricator,folsom-labs/phabricator,MicroWorldwide/phabricator,codevlabs/phabricator,devurandom/phabricator,ryancford/phabricator,zhihu/phabricator,sharpwhisper/phabricator,Soluis/phabricator,dannysu/phabricator,WuJiahu/phabricator,kwoun1982/phabricator,coursera/phabricator,benchling/phabricator,phacility/phabricator,freebsd/phabricator,wangjun/phabricator,tanglu-org/tracker-phabricator,hach-que/phabricator,a20012251/phabricator,kanarip/phabricator,hshackathons/phabricator-deprecated,hshackathons/phabricator-deprecated,a20012251/phabricator,uhd-urz/phabricator,shl3807/phabricator,kwoun1982/phabricator,wikimedia/phabricator-phabricator,akkakks/phabricator,librewiki/phabricator,hshackathons/phabricator-deprecated,kalbasit/phabricator,NigelGreenway/phabricator,zhihu/phabricator,hach-que/unearth-phabricator,sharpwhisper/phabricator,vinzent/phabricator,wikimedia/phabricator-phabricator,wangjun/phabricator,hach-que/phabricator,wusuoyongxin/phabricator,aik099/phabricator,Soluis/phabricator,shrimpma/phabricator,Symplicity/phabricator,wikimedia/phabricator-phabricator,gsinkovskiy/phabricator,vinzent/phabricator,tanglu-org/tracker-phabricator,a20012251/phabricator,dannysu/phabricator,vuamitom/phabricator,Automatic/phabricator,Drooids/phabricator,apexstudios/phabricator,parksangkil/phabricator,kalbasit/phabricator,huangjimmy/phabricator-1,uhd-urz/phabricator,Drooids/phabricator,cjxgm/p.cjprods.org,schlaile/phabricator,cjxgm/p.cjprods.org,gsinkovskiy/phabricator,dannysu/phabricator,folsom-labs/phabricator,jwdeitch/phabricator
9d7031b6dcf8c8ce6a36cdfc73c9d467a44517b5
js/game.js
js/game.js
var Game = function(boardString){ var board = ''; this.board = ''; if (arguments.length === 1) { this.board = this.toArray(boardString); } else { function random() { return Math.floor(Math.random() * 10 + 6); }; var firstTwo = random(), secondTwo = random(); for ( var i = 0; i < 16; i++ ) { if (i === firstTwo || i === secondTwo) { board += '2'; } else { board += '0'; }; }; this.board = this.toArray(board); } }; Game.prototype = { toString: function() { for( var i = 0; i < 16; i += 4){ this.array = this.board.slice(0 + i, 4 + i) console.log(this.array) } }, toArray: function(chars) { var boardArray = []; for( var i = 0; i < 16; i += 4) { var subarray = chars.slice(0 + i, 4 + i); boardArray.push(subarray.split('')); } return boardArray; } };
var Game = function(boardString){ var board = ''; this.board = ''; if (arguments.length === 1) { this.board = this.toArray(boardString); } else { function random() { return Math.floor(Math.random() * 10 + 6); }; var firstTwo = random(), secondTwo = random(); for ( var i = 0; i < 16; i++ ) { if (i === firstTwo || i === secondTwo) { board += '2'; } else { board += '0'; }; }; this.board = this.toArray(board); } }; Game.prototype = { toString: function() { this.board.forEach(function(row) { console.log(row.join('')); }); }, toArray: function(chars) { var boardArray = []; for( var i = 0; i < 16; i += 4) { var subarray = chars.slice(0 + i, 4 + i); boardArray.push(subarray.split('')); } return boardArray; } };
Modify toString method for board array format
Modify toString method for board array format
JavaScript
mit
suprfrye/galaxy-256,suprfrye/galaxy-256
b795f71c87be22da3892c6cc9eca607b229c66bf
packages/ember-data/lib/instance-initializers/initialize-store-service.js
packages/ember-data/lib/instance-initializers/initialize-store-service.js
/** Configures a registry for use with an Ember-Data store. @method initializeStore @param {Ember.ApplicationInstance} applicationOrRegistry */ export default function initializeStoreService(applicationOrRegistry) { var registry, container; if (applicationOrRegistry.registry && applicationOrRegistry.container) { // initializeStoreService was registered with an // instanceInitializer. The first argument is the application // instance. registry = applicationOrRegistry.registry; container = applicationOrRegistry.container; } else { // initializeStoreService was called by an initializer instead of // an instanceInitializer. The first argument is a registy. This // case allows ED to support Ember pre 1.12 registry = applicationOrRegistry; container = registry.container(); } // Eagerly generate the store so defaultStore is populated. var store = container.lookup('store:application'); registry.register('service:store', store, { instantiate: false }); }
/** Configures a registry for use with an Ember-Data store. @method initializeStore @param {Ember.ApplicationInstance} applicationOrRegistry */ export default function initializeStoreService(applicationOrRegistry) { var registry, container; if (applicationOrRegistry.registry && applicationOrRegistry.container) { // initializeStoreService was registered with an // instanceInitializer. The first argument is the application // instance. registry = applicationOrRegistry.registry; container = applicationOrRegistry.container; } else { // initializeStoreService was called by an initializer instead of // an instanceInitializer. The first argument is a registy. This // case allows ED to support Ember pre 1.12 registry = applicationOrRegistry; if (registry.container) { // Support Ember 1.10 - 1.11 container = registry.container(); } else { // Support Ember 1.9 container = registry; } } // Eagerly generate the store so defaultStore is populated. var store = container.lookup('store:application'); registry.register('service:store', store, { instantiate: false }); }
Support for Ember 1.9's container API after `store:application` refactor.
Support for Ember 1.9's container API after `store:application` refactor.
JavaScript
mit
andrejunges/data,Turbo87/ember-data,fpauser/data,Turbo87/ember-data,gniquil/data,flowjzh/data,Kuzirashi/data,tstirrat/ember-data,webPapaya/data,gkaran/data,eriktrom/data,minasmart/data,dustinfarris/data,danmcclain/data,workmanw/data,ryanpatrickcook/data,jgwhite/data,minasmart/data,HeroicEric/data,ryanpatrickcook/data,offirgolan/data,usecanvas/data,minasmart/data,XrXr/data,bcardarella/data,seanpdoyle/data,faizaanshamsi/data,hibariya/data,stefanpenner/data,jgwhite/data,flowjzh/data,Robdel12/data,zoeesilcock/data,splattne/data,rtablada/data,fpauser/data,davidpett/data,hibariya/data,Eric-Guo/data,jgwhite/data,workmanw/data,heathharrelson/data,eriktrom/data,zoeesilcock/data,pdud/data,PrecisionNutrition/data,Kuzirashi/data,gabriel-letarte/data,sammcgrail/data,usecanvas/data,davidpett/data,acburdine/data,nickiaconis/data,dustinfarris/data,tarzan/data,hibariya/data,Robdel12/data,yaymukund/data,gabriel-letarte/data,gniquil/data,danmcclain/data,davidpett/data,tarzan/data,wecc/data,bf4/data,EmberSherpa/data,greyhwndz/data,acburdine/data,pdud/data,andrejunges/data,zoeesilcock/data,ryanpatrickcook/data,arenoir/data,bcardarella/data,lostinpatterns/data,seanpdoyle/data,davidpett/data,fsmanuel/data,heathharrelson/data,fsmanuel/data,swarmbox/data,duggiefresh/data,whatthewhat/data,topaxi/data,acburdine/data,PrecisionNutrition/data,Eric-Guo/data,Eric-Guo/data,bf4/data,tstirrat/ember-data,Robdel12/data,pdud/data,Kuzirashi/data,courajs/data,simaob/data,sebweaver/data,duggiefresh/data,PrecisionNutrition/data,arenoir/data,workmanw/data,hibariya/data,vikram7/data,whatthewhat/data,thaume/data,fpauser/data,lostinpatterns/data,InboxHealth/data,whatthewhat/data,sebweaver/data,sammcgrail/data,wecc/data,gkaran/data,vikram7/data,sammcgrail/data,sebweaver/data,vikram7/data,dustinfarris/data,gniquil/data,EmberSherpa/data,XrXr/data,minasmart/data,bcardarella/data,eriktrom/data,heathharrelson/data,gabriel-letarte/data,H1D/data,H1D/data,mphasize/data,Turbo87/ember-data,jgwhite/data,lostinpatterns/data,andrejunges/data,eriktrom/data,EmberSherpa/data,seanpdoyle/data,InboxHealth/data,Kuzirashi/data,XrXr/data,sammcgrail/data,dustinfarris/data,courajs/data,offirgolan/data,swarmbox/data,lostinpatterns/data,splattne/data,andrejunges/data,tarzan/data,mphasize/data,rtablada/data,nickiaconis/data,faizaanshamsi/data,thaume/data,thaume/data,duggiefresh/data,vikram7/data,pdud/data,tarzan/data,splattne/data,heathharrelson/data,arenoir/data,usecanvas/data,danmcclain/data,bf4/data,tstirrat/ember-data,flowjzh/data,topaxi/data,webPapaya/data,thaume/data,wecc/data,rtablada/data,offirgolan/data,bf4/data,simaob/data,sebastianseilund/data,swarmbox/data,ryanpatrickcook/data,mphasize/data,H1D/data,splattne/data,topaxi/data,yaymukund/data,duggiefresh/data,simaob/data,yaymukund/data,seanpdoyle/data,workmanw/data,webPapaya/data,fsmanuel/data,sebastianseilund/data,XrXr/data,H1D/data,stefanpenner/data,simaob/data,nickiaconis/data,nickiaconis/data,mphasize/data,Turbo87/ember-data,flowjzh/data,greyhwndz/data,faizaanshamsi/data,webPapaya/data,stefanpenner/data,InboxHealth/data,swarmbox/data,bcardarella/data,sebweaver/data,courajs/data,tstirrat/ember-data,greyhwndz/data,rtablada/data,Robdel12/data,arenoir/data,sebastianseilund/data,whatthewhat/data,greyhwndz/data,gabriel-letarte/data,gniquil/data,fsmanuel/data,danmcclain/data,acburdine/data,faizaanshamsi/data,fpauser/data,InboxHealth/data,PrecisionNutrition/data,yaymukund/data,zoeesilcock/data,usecanvas/data,topaxi/data,gkaran/data,sebastianseilund/data,EmberSherpa/data,gkaran/data,offirgolan/data,courajs/data,HeroicEric/data,stefanpenner/data,wecc/data,Eric-Guo/data,HeroicEric/data,HeroicEric/data
81248f3d84a40336e9d9d0e9a4f5c43441d0e381
main.js
main.js
var app = require('http').createServer(handler); var io = require('socket.io').listen(app); var fs = require('fs'); var util = require('util'); var Tail = require('tail').Tail; var static = require('node-static'); var file = new static.Server('./web', {cache: 6}); //cache en secondes function handler (req, res) { if( req.url == '/') { file.serveFile('/index.html', 200, {}, req, res); } req.addListener('end', function() { file.serve(req, res); }).resume(); } app.listen(1337, '0.0.0.0'); function followFile(socket, file) { try { tail = new Tail(file); } catch (err) { socket.emit('cant follow', {reason: err.code, file: file}); return; } tail.on("line", function(data) { socket.emit('line', {file:file, data:data}); }); socket.emit('followed', {file: file}); } io.sockets.on('connection', function (socket) { socket.on('follow', function(data) { followFile(socket, data.file); }); });
var app = require('http').createServer(handler); var io = require('socket.io').listen(app); var fs = require('fs'); var util = require('util'); var Tail = require('tail').Tail; var static = require('node-static'); var file = new static.Server('./web', {cache: 6}); //cache en secondes var loadNbLines = 10; function handler (req, res) { if( req.url == '/') { file.serveFile('/index.html', 200, {}, req, res); } req.addListener('end', function() { file.serve(req, res); }).resume(); } app.listen(1337, '0.0.0.0'); function followFile(socket, file) { try { tail = new Tail(file); } catch (err) { socket.emit('cant follow', {reason: err.code, file: file}); return; } fs.readFile(file, {encoding: "utf-8"}, function(err, data) { parts = data.split("\n"); len = parts.length; if (len <= loadNbLines) start = 0; else start = len - loadNbLines - 1; for (i = start; i < len; i++) { socket.emit('line', {file:file, data:parts[i]}); } }); tail.on("line", function(data) { socket.emit('line', {file:file, data:data}); }); socket.emit('followed', {file: file}); } io.sockets.on('connection', function (socket) { socket.on('follow', function(data) { followFile(socket, data.file); }); });
Read 10 lines from the file when starting to follow
Read 10 lines from the file when starting to follow
JavaScript
mit
feuloren/logreader
2e5ed8a3bbf39be10cc528047345b43c9595eecf
client/app/components/printerList/index.js
client/app/components/printerList/index.js
import React, { PropTypes } from 'react'; import style from './style.css'; import Printer from '../printer'; class PrinterListComponent extends React.Component { getPrinterComponent(key) { return (<Printer {...this.props.printers[key]} key={key} toggleSelected={() => { this.props.toggleSelected(key); }} />); } generatePrinterList() { let keys = Object.keys(this.props.printers); let printerRows = []; if (keys.length > 0) { let howManyTimes = Math.floor(keys.length / 2); for (let i = 0; i < howManyTimes; i+=1) { console.log(Math.floor(keys.length/2)); printerRows.push( <div key={i}> {this.getPrinterComponent(keys[i * 2])} { keys[(i * 2) + 1] && this.getPrinterComponent(keys[(i * 2) + 1])} </div>); } return printerRows; } return (<div></div>); } render() { return ( <div className={style.printerList}> {this.generatePrinterList()} </div>); } } PrinterListComponent.propTypes = { printers: PropTypes.object.isRequired, toggleSelected: PropTypes.func.isRequired, }; export default PrinterListComponent;
import React, { PropTypes } from 'react'; import style from './style.css'; import Printer from '../printer'; class PrinterListComponent extends React.Component { getPrinterComponent(key) { return (<Printer {...this.props.printers[key]} key={key} toggleSelected={() => { this.props.toggleSelected(key); }} />); } generatePrinterList() { let keys = Object.keys(this.props.printers); let printerRows = []; if (keys.length > 0) { let howManyTimes = Math.ceil(keys.length / 2); for (let i = 0; i < howManyTimes; i+=1) { printerRows.push( <div key={i}> {this.getPrinterComponent(keys[i * 2])} { keys[(i * 2) + 1] && this.getPrinterComponent(keys[(i * 2) + 1])} </div>); } return printerRows; } return (<div></div>); } render() { return ( <div className={style.printerList}> {this.generatePrinterList()} </div>); } } PrinterListComponent.propTypes = { printers: PropTypes.object.isRequired, toggleSelected: PropTypes.func.isRequired, }; export default PrinterListComponent;
Fix last printer not showing when there was odd number of printers
Fix last printer not showing when there was odd number of printers
JavaScript
agpl-3.0
MakersLab/farm-client,MakersLab/farm-client
bc548adb239f564fa0815fa050a9c0e9d6f59ed7
main.js
main.js
import Bot from 'telegram-api/build'; import Message from 'telegram-api/types/Message'; import subscribe from './commands/subscribe'; import doc from './commands/doc'; let bot = new Bot({ token: '121143906:AAFJz_-Bjwq_8KQqTmyY2MtlcPb-bX_1O7M' }); bot.start(); const welcome = new Message().text(`Hello! I give you services to search across various sources such as MDN, GitHub, etc. Commands: /subscribe - Subscribe to /r/javascript and get a message for each new message /unsubscribe - Unsubscribe /doc [subject] - Search MDN for the given subject`); bot.command('start', message => { bot.send(welcome.to(message.chat.id)); }); subscribe(bot); doc(bot);
import Bot from 'telegram-api/build'; import Message from 'telegram-api/types/Message'; import subscribe from './commands/subscribe'; import doc from './commands/doc'; let bot = new Bot({ token: '121143906:AAFJz_-Bjwq_8KQqTmyY2MtlcPb-bX_1O7M' }); bot.start(); const COMMANDS = `Commands: /subscribe - Subscribe to /r/javascript and get a message for each new message /unsubscribe - Unsubscribe /doc [subject] - Search MDN for the given subject /github [subject] - Search GitHub for a repository /npm [subject] - Search NPM for a package`; const start = new Message().text(`Hello! I give you services to search across various sources such as MDN, GitHub, etc. ${COMMANDS}`); bot.command('start', message => { bot.send(start.to(message.chat.id)); }); const help = new Message().text(COMMANDS); bot.command('help', message => { bot.send(help.to(message.chat.id)); }); subscribe(bot); doc(bot);
Add help command Add github and npm to commands
Add help command Add github and npm to commands
JavaScript
artistic-2.0
mdibaiee/webdevrobot
d23a9060c4174db9b99a2e54924223e79ac5a828
packages/custom/voteeHome/public/tests/voteeHome.spec.js
packages/custom/voteeHome/public/tests/voteeHome.spec.js
'use strict'; (function() { describe("voteeHome", function() { beforeEach(function() { module('mean'); module('mean.voteeHome'); }); var $controller; var $scope; beforeEach(inject(function(_$controller_){ // The injector unwraps the underscores (_) from around the parameter names when matching $controller = _$controller_; })); describe("voteeHome controller", function() { beforeEach(function() { $scope = {}; var controller = $controller('VoteeHomeController', { $scope: $scope }); }); it("stub", function() { expect(true).toBe(true); }); }); describe("header controller", function() { beforeEach(function() { $scope = {}; var controller = $controller('VoteeHeaderController', { $scope: $scope }); }); it("Has a menu", function() { expect($scope.menus).toBeDefined(); expect($scope.menus).not.toBeNull(); expect($scope.menus.length).not.toBe(0); }); }); }); }());
'use strict'; (function() { describe("voteeHome", function() { beforeEach(function() { module('mean'); module('mean.voteeHome'); }); var $controller; var $scope; beforeEach(inject(function(_$controller_){ // The injector unwraps the underscores (_) from around the parameter names when matching $controller = _$controller_; })); describe("voteeHome controller", function() { beforeEach(function() { $scope = {}; var controller = $controller('VoteeHomeController', { $scope: $scope }); }); it('should expose some global scope', function() { expect(true).toBeTruthy(); }); }); describe("header controller", function() { beforeEach(function() { $scope = {}; var controller = $controller('VoteeHeaderController', { $scope: $scope }); }); it("Has a menu", function() { expect($scope.menus).toBeDefined(); expect($scope.menus).not.toBeNull(); expect($scope.menus.length).not.toBe(0); }); }); }); }());
Use the 'should expose some global scope' test
Use the 'should expose some global scope' test As seen in examples when there doesn't seem to be anything else to test.
JavaScript
mit
lewkoo/Votee,lewkoo/Votee,lewkoo/Votee
ce9abc43dbc217d800f833cff36ee3e51e85a2e9
assignFAST/assignFASTExample.js
assignFAST/assignFASTExample.js
/* javascript in this file controls the html page demonstrating the autosubject functionality */ /**************************************************************************************/ /* Set up and initialization */ /**************************************************************************************/ /* initial setup - called from onLoad attaches the autocomplete function to the search box */ var currentSuggestIndexDefault = "suggestall"; //initial default value function setUpPage(number) { // connect the autoSubject to the input areas $('#keyword' + number).autocomplete( { source: autoSubjectExample, minLength: 1, select: function(event, ui) { $('#fastID' + number).val(ui.item.idroot); $('#fastType' + number).val(ui.item.tag); $('#fastInd' + number).val(ui.item.indicator); } //end select } ).data( "autocomplete" )._renderItem = function( ul, item ) { formatSuggest(ul, item);}; } //end setUpPage() /* example style - simple reformatting */ function autoSubjectExample(request, response) { currentSuggestIndex = currentSuggestIndexDefault; autoSubject(request, response, exampleStyle); } /* For this example, replace the common subfield break of -- with / */ function exampleStyle(res) { return res["auth"].replace("--","/") + ' (' + getTypeFromTag(res['tag']) + ')'; }
/* javascript in this file controls the html page demonstrating the autosubject functionality */ /**************************************************************************************/ /* Set up and initialization */ /**************************************************************************************/ /* initial setup - called from onLoad attaches the autocomplete function to the search box */ var currentSuggestIndexDefault = "suggest50"; //initial default value function setUpPage(number) { // connect the autoSubject to the input areas $('#keyword' + number).autocomplete( { source: autoSubjectExample, minLength: 1, select: function(event, ui) { $('#fastID' + number).val(ui.item.idroot); $('#fastType' + number).val(ui.item.tag); $('#fastInd' + number).val(ui.item.indicator); } //end select } ).data( "autocomplete" )._renderItem = function( ul, item ) { formatSuggest(ul, item);}; } //end setUpPage() /* example style - simple reformatting */ function autoSubjectExample(request, response) { currentSuggestIndex = currentSuggestIndexDefault; autoSubject(request, response, exampleStyle); } /* For this example, replace the common subfield break of -- with / */ function exampleStyle(res) { return res["auth"].replace("--","/"); }
Revert "Display the tag/facet of the selected term in the input"
Revert "Display the tag/facet of the selected term in the input" This reverts commit f85613a9af711a4aeb27b3bbe6efe8592e8318ce.
JavaScript
mit
dkudeki/metadata-maker,dkudeki/metadata-maker
81b1d18eff0f5734aa64b780897bd8f7bb1bdb31
models/user.js
models/user.js
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var UserSchema = new Schema( { lastName : String, firstName : String, username : String, passwordHash : String, privateKey : String, picture : String, level : String, description : String, created : Date, birthday : Date, universityGroup : String, website : String, }); module.exports = mongoose.model('User', UserSchema);
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var UserSchema = new Schema( { lastName : String, firstName : String, username : String, email : String, passwordHash : String, privateKey : String, picture : String, level : String, description : String, created : Date, birthday : Date, universityGroup : String, website : String, }); module.exports = mongoose.model('User', UserSchema);
Add Email field to User
Add Email field to User
JavaScript
mit
asso-labeli/labeli-api,asso-labeli/labeli-api,asso-labeli/labeli-api
be01e76023213f35d99f69ffc440906022e218ee
src/js/select2/i18n/hu.js
src/js/select2/i18n/hu.js
define(function () { // Hungarian return { errorLoading: function () { return 'Az eredmények betöltése nem sikerült.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; return 'Túl hosszú. ' + overChars + ' karakterrel több, mint kellene.'; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; return 'Túl rövid. Még ' + remainingChars + ' karakter hiányzik.'; }, loadingMore: function () { return 'Töltés…'; }, maximumSelected: function (args) { return 'Csak ' + args.maximum + ' elemet lehet kiválasztani.'; }, noResults: function () { return 'Nincs találat.'; }, searching: function () { return 'Keresés…'; }, removeAllItems: function () { return 'Távolítson el minden elemet'; } }; });
define(function () { // Hungarian return { errorLoading: function () { return 'Az eredmények betöltése nem sikerült.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; return 'Túl hosszú. ' + overChars + ' karakterrel több, mint kellene.'; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; return 'Túl rövid. Még ' + remainingChars + ' karakter hiányzik.'; }, loadingMore: function () { return 'Töltés…'; }, maximumSelected: function (args) { return 'Csak ' + args.maximum + ' elemet lehet kiválasztani.'; }, noResults: function () { return 'Nincs találat.'; }, searching: function () { return 'Keresés…'; }, removeAllItems: function () { return 'Távolítson el minden elemet'; }, removeItem: function () { return 'Elem eltávolítása'; }, search: function() { return 'Keresés'; } }; });
Update Hungarian translation for new strings
Update Hungarian translation for new strings Updated Hungarian translation.
JavaScript
mit
select2/select2,select2/select2
36a42af4fa6a02fa45c357020269ca52ca9e27d1
modules/udp.js
modules/udp.js
module.exports = { events: { udp: function (bot, msg, rinfo) { if (rinfo.address === bot.config.get('yakc.ip')) { bot.fireEvents('yakc', msg.toString(), rinfo) } else { bot.notice(bot.config.get('udp.channel'), msg.toString()) } } } }
module.exports = { events: { udp: function (bot, msg, rinfo) { if (rinfo.address === bot.config.get('yakc.ip')) { bot.fireEvents('yakc', msg.toString(), rinfo) } else { bot.notice(bot.config.get('udp.channel'), msg.toString()) // copy https://github.com/zuzak/twitter-irc-udp messages from verified users: if (msg.toString().includes('✓')) { bot.notice(bot.config.get('irc.control'), msg.toString()) } } } } }
Copy interesting tweets to control channel
Copy interesting tweets to control channel
JavaScript
isc
zuzakistan/civilservant,zuzakistan/civilservant
36c93b468c7957a5b793c4eacb1a739c61100ef3
src/Overview.js
src/Overview.js
/* global fetch */ import React from 'react'; import TotalWidget from './TotalWidget'; import NextTripWidget from './NextTripWidget'; import TripTable from './TripTable'; import Map from './Map'; import './scss/overview.scss'; class Overview extends React.Component { constructor() { super(); this.loading = true; this.state = { trips: [] }; } componentDidMount() { this.getData(); } getData() { fetch('http://localhost:4444/trips') .then((response) => { return response.json(); }) .then((trips) => { this.loading = false; this.setState({ trips }); }); } render() { return ( <div className="container"> { this.loading ? <span>Loading..</span> : <section> <div className="row"> <NextTripWidget color="light" nextTrip={this.state.trips.next} /> <TotalWidget color="medium" totals={this.state.trips.total} /> </div> <Map countries={this.state.trips.allCountries} selector="visitedMap" /> <TripTable trips={this.state.trips.visited} /> <h1>Wishlist</h1> <Map countries={this.state.trips.wishlist} selector="wishlistMap" /> </section> } </div> ); } } export default Overview;
/* global fetch document */ import React from 'react'; import TotalWidget from './TotalWidget'; import NextTripWidget from './NextTripWidget'; import TripTable from './TripTable'; import Map from './Map'; import './scss/overview.scss'; class Overview extends React.Component { constructor() { super(); this.loading = true; this.state = { trips: [] }; } componentDidMount() { this.getData(); } getData() { fetch(`${document.location.protocol}//${document.location.hostname}:4444/trips`) .then((response) => { return response.json(); }) .then((trips) => { this.loading = false; this.setState({ trips }); }); } render() { return ( <div className="container"> { this.loading ? <span>Loading..</span> : <section> <div className="row"> <NextTripWidget color="light" nextTrip={this.state.trips.next} /> <TotalWidget color="medium" totals={this.state.trips.total} /> </div> <Map countries={this.state.trips.allCountries} selector="visitedMap" /> <TripTable trips={this.state.trips.visited} /> <h1>Wishlist</h1> <Map countries={this.state.trips.wishlist} selector="wishlistMap" /> </section> } </div> ); } } export default Overview;
Make fetch URL less specific
Make fetch URL less specific
JavaScript
mpl-2.0
MichaelKohler/where,MichaelKohler/where
8b2d2153271eec59b4b2d43a75ba9a83ed432a5d
client/components/login.js
client/components/login.js
Accounts.ui.config({ requestPermissions: { github: ['user', 'repo', 'gist'] } }) // // Accounts.onLogin(function () { // Router.go('/profile') // }) Template.login.helpers({ currentUser: function () { return Meteor.user() } }) Template.login.events({ })
Accounts.ui.config({ requestPermissions: { github: ['user', 'public_gist'] } }) // // Accounts.onLogin(function () { // Router.go('/profile') // }) Template.login.helpers({ currentUser: function () { return Meteor.user() } }) Template.login.events({ })
Update access request for public gists
Update access request for public gists
JavaScript
isc
caalberts/code-hangout,caalberts/code-hangout
d25293f6af7ce9d646d64c681b59983d442eab42
js/main.js
js/main.js
$(document).ready(function(){ // Include common elements $("#footer").load("common/footer.html"); $("#header").load("common/header.html", function() { // Add current navigation class based on url locations = location.pathname.split("/"); $('#topnav a[href^="' + locations[locations.length - 1] + '"]').parent().addClass('current'); /** * Handles toggling the navigation menu for small screens. */ var button = document.getElementById( 'topnav' ).getElementsByTagName( 'div' )[0], menu = document.getElementById( 'topnav' ).getElementsByTagName( 'ul' )[0]; if ( undefined === button ) return false; if ( undefined === menu || ! menu.childNodes.length ) { button.style.display = 'none'; return false; } button.onclick = function() { if ( -1 == menu.className.indexOf( 'srt-menu' ) ) menu.className = 'srt-menu'; if ( -1 != button.className.indexOf( 'toggled-on' ) ) { button.className = button.className.replace( ' toggled-on', '' ); menu.className = menu.className.replace( ' toggled-on', '' ); } else { button.className += ' toggled-on'; menu.className += ' toggled-on'; } }; }); });
$(document).ready(function(){ // Include common elements $("#footer").load("common/footer.html"); $("#header").load("common/header.html", function() { // Add current navigation class based on url locations = location.pathname.split("/"); current = $('#topnav a[href^="' + locations[locations.length - 1] + '"]') if (current.length == 0) { current = $('#topnav a[href^="index.html"]'); } current.parent().addClass('current'); /** * Handles toggling the navigation menu for small screens. */ var button = document.getElementById( 'topnav' ).getElementsByTagName( 'div' )[0], menu = document.getElementById( 'topnav' ).getElementsByTagName( 'ul' )[0]; if ( undefined === button ) return false; if ( undefined === menu || ! menu.childNodes.length ) { button.style.display = 'none'; return false; } button.onclick = function() { if ( -1 == menu.className.indexOf( 'srt-menu' ) ) menu.className = 'srt-menu'; if ( -1 != button.className.indexOf( 'toggled-on' ) ) { button.className = button.className.replace( ' toggled-on', '' ); menu.className = menu.className.replace( ' toggled-on', '' ); } else { button.className += ' toggled-on'; menu.className += ' toggled-on'; } }; }); });
Select first nav li by default
Select first nav li by default
JavaScript
mit
mbdimitrova/bmi-fmi,mbdimitrova/bmi-fmi
b30d1d1e94b6c65babb2c9351cfe49153926d3b9
js/main.js
js/main.js
var updatePreviewTarget = function(data, status) { $('.spinner').hide(); $('#preview-target').html(data); renderLatexExpressions(); } var renderLatexExpressions = function() { $('.latex-container').each( function(index) { katex.render( this.textContent, this, { displayMode: $(this).data('displaymode') == 'block' } ); } ); } var main = function() { $('div code').each(function(i, block) { hljs.highlightBlock(block); }); $('button#preview').click( function() { $('#preview-target').html(''); $('.spinner').show(); $('h1.preview').text($('input[name=title]').val()) $.post('/note_preview', {text: $('#note-txt').val()}, updatePreviewTarget); } ); renderLatexExpressions(); }; function searchRedirect(event, searchpage) { var term = (arguments.length == 2) ? document.getElementById('mainsearch').value : document.getElementById('searchbox').value; window.location = '/search/' + term + '/'; event.preventDefault(event); } $(main);
var updatePreviewTarget = function(data, status) { $('.spinner').hide(); $('#preview-target').html(data); renderLatexExpressions(); } var renderLatexExpressions = function() { $('.latex-container').each( function(index) { katex.render( this.textContent, this, { displayMode: $(this).data('displaymode') == 'block' } ); } ); } var main = function() { $('div code').each(function(i, block) { hljs.highlightBlock(block); }); $('button#preview').click( function() { $('#preview-target').html(''); $('.spinner').show(); $('h1.preview').text($('input[name=title]').val()) $.post('/note_preview', {text: $('#note-txt').val()}, updatePreviewTarget); } ); renderLatexExpressions(); $("textarea[name='footnotes']").focusin(function(){ $(this).height($(this).height() + 300); }).focusout(function(){ $(this).height($(this).height() - 300); }); }; function searchRedirect(event, searchpage) { var term = (arguments.length == 2) ? document.getElementById('mainsearch').value : document.getElementById('searchbox').value; window.location = '/search/' + term + '/'; event.preventDefault(event); } $(main);
Make footnote textarea expand upon focus
Make footnote textarea expand upon focus
JavaScript
mit
erettsegik/erettsegik.hu,erettsegik/erettsegik.hu,erettsegik/erettsegik.hu
08229bff7728a349aa93eb0dc8db248106cbda97
scripts/export_map.js
scripts/export_map.js
var casper = require('casper').create(); // casper.on('remote.message', function(message) { // console.log(message); // }); var out_dir = 'static/tmp/'; var key = casper.cli.get(0); var url = casper.cli.get(1); var filepath = out_dir + key + '.png'; casper.start(); casper.viewport(1024, 650).thenOpen(url, function() { this.wait(1000); this.capture(filepath); casper.echo(filepath); }); casper.run();
var casper = require('casper').create(); // casper.on('remote.message', function(message) { // console.log(message); // }); var out_dir = 'static/tmp/'; var key = casper.cli.get(0); var url = casper.cli.get(1); var filepath = out_dir + key + '.png'; casper.start(); casper.viewport(1024, 650).thenOpen(url, function() { casper.then(function() { this.wait(2000, (function() { return function() { casper.capture(filepath); casper.echo(filepath); } })()) }); }); casper.run();
Use casper.wait to wait until image are loaded and transitioned
Use casper.wait to wait until image are loaded and transitioned
JavaScript
mit
AstunTechnology/NRW_FishMapMon,AstunTechnology/NRW_FishMapMon,AstunTechnology/NRW_FishMapMon,AstunTechnology/NRW_FishMapMon
b13fd8658d216732d4e54e40e029a8246e73202d
main.js
main.js
'use strict'; var app = require('app'); var dribbbleapi = require('./dribbbleapi'); var mainWindow = null; var dribbbleData = null; var menubar = require('menubar') var mb = menubar({ index: 'file://' + __dirname + '/app/index.html', icon: __dirname + '/app/assets/HotshotIcon.png', width: 400, height: 700, 'max-width': 440, 'min-height': 300, 'min-width': 300, preloadWindow: true }); app.on('window-all-closed', function() { app.quit(); }); mb.on('show', function(){ // mb.window.webContents.send('focus'); mb.window.openDevTools(); });
'use strict'; var app = require('app'); var mainWindow = null; var dribbbleData = null; var menubar = require('menubar') var mb = menubar({ index: 'file://' + __dirname + '/app/index.html', icon: __dirname + '/app/assets/HotshotIcon.png', width: 400, height: 700, 'max-width': 440, 'min-height': 300, 'min-width': 300, preloadWindow: true }); app.on('window-all-closed', function() { app.quit(); }); mb.on('show', function(){ // mb.window.webContents.send('focus'); mb.window.openDevTools(); });
Remove reference to deleted dribbbleApi.js
Remove reference to deleted dribbbleApi.js
JavaScript
cc0-1.0
andrewnaumann/hotshot,andrewnaumann/hotshot
21f7adb8f7e293f205c7b0813726c10a2a1224f1
tests/dummy/config/dependency-lint.js
tests/dummy/config/dependency-lint.js
/* eslint-env node */ 'use strict'; module.exports = { allowedVersions: { 'ember-in-element-polyfill': '*', 'ember-get-config': '0.3.0 || 0.4.0 || 0.5.0', '@embroider/util': '*', }, };
/* eslint-env node */ 'use strict'; module.exports = { allowedVersions: { 'ember-in-element-polyfill': '*', }, };
Remove unneeded dependency lint overrides
Remove unneeded dependency lint overrides
JavaScript
mit
ilios/common,ilios/common
14fb941b6db1aa53e7906a46e8cf7f6d4abb6d94
Rightmove_Enhancement_Suite.user.js
Rightmove_Enhancement_Suite.user.js
// ==UserScript== // @name Rightmove Enhancement Suite // @namespace https://github.com/chigley/ // @description Keyboard shortcuts // @include http://www.rightmove.co.uk/* // @version 1 // @grant GM_addStyle // @grant GM_getResourceText // @resource style style.css // ==/UserScript== var $ = unsafeWindow.jQuery; GM_addStyle(GM_getResourceText("style")); $("#summaries li").mouseenter(function () { $(this).addClass("hovered"); }); $("#summaries li").mouseleave(function () { $(this).removeClass("hovered"); });
// ==UserScript== // @name Rightmove Enhancement Suite // @namespace https://github.com/chigley/ // @description Keyboard shortcuts // @include http://www.rightmove.co.uk/* // @version 1 // @grant GM_addStyle // @grant GM_getResourceText // @resource style style.css // ==/UserScript== var $ = unsafeWindow.jQuery; GM_addStyle(GM_getResourceText("style")); $("[name=summary-list-item]").mouseenter(function () { $(this).addClass("hovered"); }); $("[name=summary-list-item]").mouseleave(function () { $(this).removeClass("hovered"); });
Fix selector to only match list items
Fix selector to only match list items
JavaScript
mit
chigley/rightmove-enhancement-suite
c2b47f8a3c1d3f844152127c9218d90dfa66bbf2
packages/storefront/app/routes/yebo/taxons/show.js
packages/storefront/app/routes/yebo/taxons/show.js
// Ember! import Ember from 'ember'; import SearchRoute from 'yebo-ember-storefront/mixins/search-route'; /** * Taxons show page * This page shows products related to the current taxon */ export default Ember.Route.extend(SearchRoute, { /** * Define the search rules */ searchRules(query, params) { // Create a new taxonomy rule let rule = new YeboSDK.Products.Rules.taxonomy([]); // Set its values rule.values = [params.taxon]; // Set it into the query query.and(rule); }, // Change the current controller setupController: function(controller, model) { // This is indispensable, if out, the model won't be passed to the view controller.set('model', model); // the component that requires current taxon and taxonomies is in application let appController = this.controllerFor('application'); // Define some values let taxon = model.taxon; let taxonomies = model.taxonomies; // Set the values to the application controller appController.set('currentTaxonomy', taxon.get('taxonomy')); appController.set('taxonomies', taxonomies); }, /** * This values will be returned into the route (with the route model) */ searchModel(params) { // Search all the taxonomies and the current taxon return { taxonomies: this.yebo.store.findAll('taxonomy'), taxon: this.yebo.store.find('taxon', params.taxon), }; } });
// Ember! import Ember from 'ember'; import SearchRoute from 'yebo-ember-storefront/mixins/search-route'; /** * Taxons show page * This page shows products related to the current taxon */ export default Ember.Route.extend(SearchRoute, { /** * Define the search rules */ searchRules(query, params) { // Create a new taxonomy rule let rule = new YeboSDK.Products.Rules.taxonomy([]); // Set its values rule.values = [params.taxon]; // Set it into the query query.and(rule); }, // Change the current controller setupController: function(controller, model) { // This is indispensable, if out, the model won't be passed to the view controller.set('model', model); // the component that requires current taxon and taxonomies is in application let appController = this.controllerFor('application'); // Define some values let taxon = model.taxon; let taxonomies = model.taxonomies; // Set the values to the application controller appController.set('currentTaxonomy', taxon.get('taxonomy')); appController.set('taxonomies', taxonomies); }, /** * This values will be returned into the route (with the route model) */ searchModel(params) { // Search all the taxonomies and the current taxon return Ember.RSVP.hash({ taxonomies: this.yebo.store.findAll('taxonomy'), taxon: this.yebo.store.find('taxon', params.taxon), }); } });
Return a promise in the searchModel method
Return a promise in the searchModel method
JavaScript
mit
yebo-ecommerce/ember,yebo-ecommerce/ember,yebo-ecommerce/ember
764743d6b08899286262a50203b11410d90f9694
cypress/support/commands.js
cypress/support/commands.js
// *********************************************** // This example commands.js shows you how to // create various custom commands and overwrite // existing commands. // // For more comprehensive examples of custom // commands please read more here: // https://on.cypress.io/custom-commands // *********************************************** // // // -- This is a parent command -- // Cypress.Commands.add("login", (email, password) => { ... }) // //mm // -- This is a child command -- // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) // // // -- This is a dual command -- // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) // // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) Cypress.Commands.add('setRadioInput', (selector, value) => { const selectorValue = value === 'Yes' ? '0' : '1' cy.get(`#${selector}-${selectorValue}`).check(); }) Cypress.Commands.add('setTextInput', (selector, value) => { cy.get(`#${selector}`).type(value); })
// *********************************************** // This example commands.js shows you how to // create various custom commands and overwrite // existing commands. // // For more comprehensive examples of custom // commands please read more here: // https://on.cypress.io/custom-commands // *********************************************** // // // -- This is a parent command -- // Cypress.Commands.add("login", (email, password) => { ... }) // //mm // -- This is a child command -- // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) // // // -- This is a dual command -- // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) // // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) Cypress.Commands.add('setRadioInput', (selector, value) => { const selectorValue = value === 'Yes' ? '0' : '1' cy.get(`#${selector}-${selectorValue}`).check(); }) Cypress.Commands.add('setTextInput', (selector, value) => { cy.get(`#${selector}`).type(value); }) Cypress.Commands.add('setCheckboxInput', (selector) => { cy.get(`#${selector}`).check(); })
Add functionality for filling in checkboxes
Add functionality for filling in checkboxes
JavaScript
mit
ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public
205535d3723b96163f74e4d18a3dd3a5fa84dcf9
screens/MemoriesScreen.js
screens/MemoriesScreen.js
import React from "react"; import { Text } from "react-native"; export default class MemoriesScreen extends React.Component { render() { return ( <Text>My memories</Text> ); } } MemoriesScreen.route = { navigationBar: { title: "My memories", } };
import React from "react"; import { Text } from "react-native"; var memory = { eventName: "Tree planting", eventDate: Date(), image: require("../static/content/images/memories/01.jpg") }; var userData = { name: "Sara", image: require("../static/content/images/people/users/01_sara_douglas.jpg"), memories: [] }; for (var i = 0; i < 10; i++) { userData.memories.push(memory); } export default class MemoriesScreen extends React.Component { render() { return ( <Text>My memories</Text> ); } } MemoriesScreen.route = { navigationBar: { title: "My memories", } };
Add sample data example to memories screen for UI dev
Add sample data example to memories screen for UI dev
JavaScript
mit
ottobonn/roots
8caa309f6a807555825f277e5f277007544b9957
js/end_game.js
js/end_game.js
var endGame = function(game){ if (game.player.lives > 0) { missBall(game.ball, game.player) } else if (game.player.lives <= 0 ){ gameOver() } } var missBall = function(ball, player){ if ( ball.bottomEdge().y == canvas.height){ return player.loseLife() } return false } function gameOver() { console.log('game over!') alert('Game Over!'); window.location.reload() }
var endGame = function(game){ if (game.player.lives > 0) { missBall(game.ball, game.player) } else if (game.player.lives <= 0 ){ gameOver() } if (stillBricks(game.bricks)) { winGame() } } var missBall = function(ball, player){ if ( ball.bottomEdge().y == canvas.height){ console.log("Lost Life") return player.loseLife() }; } function gameOver() { console.log('game over!') alert('Game Over!'); window.location.reload() } function winGame() { console.log("You Win!") alert("You are the Winner") window.location.reload() } var stillBricks = function (bricks) { var counter = 0 for (var layer in bricks){ bricks[layer].map(function(brick){ if (brick == null){ counter += 1; }; }); } if (counter == 16){ return true } }
Implement win game prompt after all bricks destroyed
Implement win game prompt after all bricks destroyed
JavaScript
mit
theomarkkuspaul/Brick-Breaker,theomarkkuspaul/Brick-Breaker
7388412cc4908793883e0de2348f8b44b72e2256
js/main.js
js/main.js
document.addEventListener('DOMContentLoaded', function() { var searchButton = document.getElementById('search'); searchButton.addEventListener('click', (function() { var query = document.getElementById('form').query.value; var engine = document.querySelector('input[name="engine"]:checked').value; var urls = { 'hackage': 'https://www.haskell.org/hoogle/?hoogle=', 'lts': 'https://www.stackage.org/lts/hoogle?q=', 'nightly': 'https://www.stackage.org/nightly/hoogle?q=' }; var url = urls[engine] + query; chrome.tabs.create({url: url}); })); });
document.addEventListener('DOMContentLoaded', function() { var searchButton = document.getElementById('search'); document.querySelector('input[name="engine"]:checked').focus(); searchButton.addEventListener('click', (function() { var query = document.getElementById('form').query.value; var engine = document.querySelector('input[name="engine"]:checked').value; var urls = { 'hackage': 'https://www.haskell.org/hoogle/?hoogle=', 'lts': 'https://www.stackage.org/lts/hoogle?q=', 'nightly': 'https://www.stackage.org/nightly/hoogle?q=' }; var url = urls[engine] + query; chrome.tabs.create({url: url}); })); });
Add focus on the first radio button
Add focus on the first radio button
JavaScript
mit
yu-i9/HoogleSwitcher,yu-i9/HoogleSwitcher
5641a9bc6a72b30572840e4067c9421ecd973f27
app/assets/javascripts/angular/main/register-controller.js
app/assets/javascripts/angular/main/register-controller.js
(function(){ 'use strict'; angular .module('secondLead') .controller('RegisterCtrl', [ 'Restangular', '$state', 'store', 'UserModel', function (Restangular, $state, store, UserModel) { var register = this; register.newUser = {}; register.onSubmit = function () { UserModel.register(register.newUser) .then(function(response){ if (response.errors){ register.error = response.errors[0]; } else { store.set('jwt',response.token); store.set('user',response.user); $state.go('user.lists', {userID: response.user.id}); register.reset(); } }); }; register.reset = function () { register.newUser = {}; }; }]) })();
(function(){ 'use strict'; angular .module('secondLead') .controller('RegisterCtrl', [ 'Restangular', '$state', 'store', 'UserModel', function (Restangular, $state, store, UserModel) { var register = this; register.newUser = {}; register.onSubmit = function () { UserModel.register(register.newUser) .then(function(response){ if (response.errors){ register.error = response.errors[0]; } else { UserModel.setLoggedIn(true); store.set('jwt',response.token); store.set('user',response.user); $state.go('user.lists', {userID: response.user.id}); register.reset(); } }); }; register.reset = function () { register.newUser = {}; }; }]) })();
Add update to usermodel upon signup with register controller
Add update to usermodel upon signup with register controller
JavaScript
mit
ac-adekunle/secondlead,ac-adekunle/secondlead,ac-adekunle/secondlead
917b47168540b27682825b50155aaf34ecef3b62
compassion.colleague/ua.js
compassion.colleague/ua.js
var cadence = require('cadence') var util = require('util') function UserAgent (ua) { this._ua = ua } UserAgent.prototype.send = cadence(function (async, properties, body) { var url = util.format('http://%s/kibitz', properties.location) this._ua.fetch({ url: url, post: { islandName: properties.islandName, colleagueId: properties.colleagueId, kibitz: body }, nullify: true }, async()) }) module.exports = UserAgent
var cadence = require('cadence') var util = require('util') function UserAgent (ua) { this._ua = ua } UserAgent.prototype.send = cadence(function (async, properties, body) { var url = util.format('http://%s/kibitz', properties.location) this._ua.fetch({ url: url, post: { key: '(' + properties.islandName + ')' + properties.colleagueId, post: { kibitz: body } }, nullify: true }, async()) }) module.exports = UserAgent
Adjust user agent for new keyed protocol.
Adjust user agent for new keyed protocol.
JavaScript
mit
bigeasy/compassion
4025d7a5b28d6b3b88af5d78b5b31c304d0afca6
assets/src/stories-editor/helpers/test/addAMPExtraProps.js
assets/src/stories-editor/helpers/test/addAMPExtraProps.js
/** * Internal dependencies */ import { addAMPExtraProps } from '../'; describe( 'addAMPExtraProps', () => { it( 'does not modify non-child blocks', () => { const props = addAMPExtraProps( {}, { name: 'foo/bar' }, {} ); expect( props ).toStrictEqual( {} ); } ); it( 'generates a unique ID', () => { const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, {} ); expect( props ).toHaveProperty( 'id' ); } ); it( 'uses the existing anchor attribute as the ID', () => { const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, { anchor: 'foo' } ); expect( props ).toStrictEqual( { id: 'foo' } ); } ); it( 'adds a font family attribute', () => { const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, { ampFontFamily: 'Roboto' } ); expect( props ).toMatchObject( { 'data-font-family': 'Roboto' } ); } ); it( 'adds inline CSS for rotation', () => { const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, { rotationAngle: 90.54321 } ); expect( props ).toMatchObject( { style: { transform: 'rotate(90deg)' } } ); } ); } );
/** * Internal dependencies */ import { addAMPExtraProps } from '../'; describe( 'addAMPExtraProps', () => { it( 'does not modify non-child blocks', () => { const props = addAMPExtraProps( {}, { name: 'foo/bar' }, {} ); expect( props ).toStrictEqual( {} ); } ); it( 'adds a font family attribute', () => { const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, { ampFontFamily: 'Roboto' } ); expect( props ).toMatchObject( { 'data-font-family': 'Roboto' } ); } ); it( 'adds inline CSS for rotation', () => { const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, { rotationAngle: 90.54321 } ); expect( props ).toMatchObject( { style: { transform: 'rotate(90deg)' } } ); } ); } );
Remove tests that are not relevant anymore.
Remove tests that are not relevant anymore.
JavaScript
apache-2.0
ampproject/amp-toolbox-php,ampproject/amp-toolbox-php
e5c906b30e793d73972b133cc3099f48a0a1a919
adapter.js
adapter.js
(function() { var global = this; var karma = global.__karma__; karma.start = function(runner) { var suites = global.__karma_benchmark_suites__; var hasTests = !!suites.length; var errors = []; if (!hasTests) { return complete(); } runNextSuite(); function logResult(event) { var suite = this; var result = event.target; karma.result({ id: result.id, description: suite.name+': '+result.name, suite: [], success: errors.length === 0, log: errors, skipped: false, time: result.stats.mean * 1000, benchmark: { suite: suite.name, name: result.name, stats: result.stats, count: result.count, cycles: result.cycles, error: result.error, hz: result.hz } }); } function logError(evt) { errors.push(evt.target.error); } function runNextSuite() { if (!suites.length) { return complete(); } suites.shift() .on('cycle', logResult) .on('abort error', logError) .on('complete', runNextSuite) .run({ async: true }); } function complete() { karma.complete({ coverage: global.__coverage__ }); } }; }).call(this);
(function() { var global = this; var karma = global.__karma__; karma.start = function(runner) { var suites = global.__karma_benchmark_suites__; var hasTests = !!suites.length; var errors = []; if (!hasTests) { return complete(); } runNextSuite(); function logResult(event) { var suite = this; var result = event.target; karma.result({ id: result.id, description: suite.name+': '+result.name, suite: [], success: errors.length === 0, log: errors, skipped: false, time: result.stats.mean * 1000, benchmark: { suite: suite.name, name: result.name, stats: result.stats, count: result.count, cycles: result.cycles, error: result.error, hz: result.hz } }); // Reset errors errors = []; } function logError(evt) { errors.push(evt.target.error.toString()); } function runNextSuite() { if (!suites.length) { return complete(); } suites.shift() .on('cycle', logResult) .on('abort error', logError) .on('complete', runNextSuite) .run({ async: true }); } function complete() { karma.complete({ coverage: global.__coverage__ }); } }; }).call(this);
Fix logging of errors, Karma expects a string. Reset errors after every cycle.
Fix logging of errors, Karma expects a string. Reset errors after every cycle.
JavaScript
mit
JamieMason/karma-benchmark,JamieMason/karma-benchmark
474fbf5b088004ad676fe71b15f3031755b02b74
src/index.js
src/index.js
import middleware from './internal/middleware' export default middleware export { runSaga } from './internal/runSaga' export { END, eventChannel, channel } from './internal/channel' export { buffers } from './internal/buffers' export { takeEvery, takeLatest } from './internal/sagaHelpers' import { CANCEL } from './internal/proc' import * as effects from './effects' import * as utils from './utils' export function delay(ms, val=true) { let timeoutId; const promise = new Promise((resolve) => { timeoutId = setTimeout(resolve, ms, val); }); promise[CANCEL] = () => clearTimeout(timeoutId); return promise; } export { CANCEL, effects, utils }
import middleware from './internal/middleware' export default middleware export { runSaga } from './internal/runSaga' export { END, eventChannel, channel } from './internal/channel' export { buffers } from './internal/buffers' export { takeEvery, takeLatest } from './internal/sagaHelpers' import { CANCEL } from './internal/proc' import * as effects from './effects' import * as utils from './utils' export function delay(ms, val=true) { let timeoutId; const promise = new Promise((resolve) => { timeoutId = setTimeout(() => resolve(val), ms); }); promise[CANCEL] = () => clearTimeout(timeoutId); return promise; } export { CANCEL, effects, utils }
Replace `setTimeout` call with 2-args version
Replace `setTimeout` call with 2-args version
JavaScript
mit
yelouafi/redux-saga,eiriklv/redux-saga,HansDP/redux-saga,baldwmic/redux-saga,redux-saga/redux-saga,yelouafi/redux-saga,redux-saga/redux-saga,HansDP/redux-saga,eiriklv/redux-saga,granmoe/redux-saga,baldwmic/redux-saga,ipluser/redux-saga,granmoe/redux-saga,ipluser/redux-saga
3a1caf79f987bfa48d53ae06e1a4156fd09a313a
js/models/geonames-data.js
js/models/geonames-data.js
(function(app) { 'use strict'; var dom = app.dom || require('../dom.js'); var GeoNamesData = function(url) { this._url = url; this._loadPromise = null; this._data = []; }; GeoNamesData.prototype.load = function() { if (!this._loadPromise) { this._loadPromise = dom.loadJSON(this._url).then(function(data) { this._data = data; }.bind(this)); } return this._loadPromise; }; if (typeof module !== 'undefined' && module.exports) { module.exports = GeoNamesData; } else { app.GeoNamesData = GeoNamesData; } })(this.app || (this.app = {}));
(function(app) { 'use strict'; var dom = app.dom || require('../dom.js'); var Events = app.Events || require('../base/events.js'); var GeoNamesData = function(url) { this._url = url; this._loadPromise = null; this._data = []; this._events = new Events(); }; GeoNamesData.prototype.on = function() { return Events.prototype.on.apply(this._events, arguments); }; GeoNamesData.prototype.load = function() { if (!this._loadPromise) { this._events.emit('loading'); this._loadPromise = dom.loadJSON(this._url).then(function(data) { this._data = data; this._events.emit('loaded'); }.bind(this)); } return this._loadPromise; }; if (typeof module !== 'undefined' && module.exports) { module.exports = GeoNamesData; } else { app.GeoNamesData = GeoNamesData; } })(this.app || (this.app = {}));
Make events of GeoNames data
Make events of GeoNames data
JavaScript
mit
ionstage/loclock,ionstage/loclock