commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
f099fc9c4142a64c3934a31bc15f1052ba183948
server/lib/bukkitToMcpr.js
server/lib/bukkitToMcpr.js
const slugify = require('./slug.js') const bukkitApi = require('./bukkitApi') function convertModel (bukkit) { return new Promise(function (resolve, reject) { let plugins = [] let itemsProcessed = 0 for (let i = 0; i < bukkit.length; i++) { ;(() => { let bukkitPlugin = bukkit[i] ret...
const slugify = require('./slug.js') const bukkitApi = require('./bukkitApi') const convertModel = async bukkitPlugins => { try { const processPlugins = bukkitPlugins.map(async bukkitPlugin => { const data = await Promise.all([ bukkitApi.getPlugin(bukkitPlugin.slug), bukkitApi.getPluginFile...
Refactor Bukkit to MCPR conversion so that it is readable
chore: Refactor Bukkit to MCPR conversion so that it is readable
JavaScript
mit
mcpr/mcpr,mcpr/mcpr
72d3ecefce7bb6dfd26a103349a0b952fe843770
client/src/index.js
client/src/index.js
import moment from 'moment'; import React from 'react'; import ReactDOM from 'react-dom'; import { AppContainer as HotAppContainer } from 'react-hot-loader'; import { applyMiddleware, createStore } from 'redux'; import IO from 'socket.io-client'; import createSocketIoMiddleware from 'redux-socket.io'; import logger fro...
import moment from 'moment'; import React from 'react'; import ReactDOM from 'react-dom'; import { AppContainer as HotAppContainer } from 'react-hot-loader'; import { applyMiddleware, createStore, compose } from 'redux'; import IO from 'socket.io-client'; import createSocketIoMiddleware from 'redux-socket.io'; import l...
Add support for Redux Devtools extension
Add support for Redux Devtools extension
JavaScript
mit
dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta
08ee48c0e97cb5f0b255d650033abf39e88757c3
test/variable-collection.spec.js
test/variable-collection.spec.js
'use strict'; var expect = require('chai').expect; var VariableCollection = require('../app/scripts/variable-collection'); var Variable = require('../app/scripts/variable'); describe('variable collection', function () { it('should initialize with list of variables', function () { var variables = new VariableCo...
'use strict'; var expect = require('chai').expect; var VariableCollection = require('../app/scripts/variable-collection'); var Variable = require('../app/scripts/variable'); describe('variable collection', function () { it('should initialize with list of variables', function () { var variables = new VariableCo...
Reformat one-line var collection test lists
Reformat one-line var collection test lists
JavaScript
mit
caleb531/truthy,caleb531/truthy
1ab7937420d88f86ae3aba6674044a4b28cfcd9e
backend/app/assets/javascripts/spree/backend/product_picker.js
backend/app/assets/javascripts/spree/backend/product_picker.js
$.fn.productAutocomplete = function (options) { 'use strict'; // Default options options = options || {}; var multiple = typeof(options.multiple) !== 'undefined' ? options.multiple : true; this.select2({ minimumInputLength: 3, multiple: multiple, initSelection: function (element, callback) { ...
$.fn.productAutocomplete = function (options) { 'use strict'; // Default options options = options || {}; var multiple = typeof(options.multiple) !== 'undefined' ? options.multiple : true; this.select2({ minimumInputLength: 3, multiple: multiple, initSelection: function (element, callback) { ...
Fix Product Picker to lookup SKU.
Fix Product Picker to lookup SKU. Before: Ransack was not finding sku on product, thereby it was not including it in the search. After: Sku is correctly looked up on the product master.
JavaScript
bsd-3-clause
yushine/spree,yushine/spree,yushine/spree,yushine/spree
406e8318d31f8f0631ee37ea9ee17fee8cdf00a5
components/about/index.js
components/about/index.js
const About = () => { return ( <header id="about" className="component"> <a href="/" id="about-mainPageButton">Gå til hovedsiden</a> <img className="about-header-logo" src="assets/images/online_logo.svg" alt="" /> <h1>Velkommen til Online, linjeforeningen for informatikkstudenter ved <a href="...
const About = () => { return ( <header id="about" className="component"> <a href="/" id="about-mainPageButton">Gå til hovedsiden</a> <img className="about-header-logo" src="assets/images/online_logo.svg" alt="" /> <h1>Velkommen til Online, linjeforeningen for informatikkstudenter ved <a href="...
Fix skip to program button markup
Fix skip to program button markup
JavaScript
mit
dotKom/glowing-fortnight,dotKom/glowing-fortnight
afd690df2d8fb8c49d5869ca17cc6c7482247c39
test/integration/content-type-test.js
test/integration/content-type-test.js
'use strict'; buster.testCase('Content Type', { prepare: function() { this.timeout = 30e3; }, 'can be read': function() { return client.contentType('cat').then(function(contentType) { assert.equals(contentType.name, 'Cat'); }); }, 'can be listed': function() { return client.contentTyp...
'use strict'; buster.testCase('Content Type', { prepare: function() { this.timeout = 30e3; }, 'can be read': function() { return client.contentType('cat').then(function(contentType) { assert.equals(contentType.name, 'Cat'); }); }, 'can be listed': function() { return client.contentTyp...
Fix content type integration test
Fix content type integration test
JavaScript
mit
contentful/contentful.js
f33844c7895c8cf72a020171ccc1b6de1c6c08fc
lib/utils.js
lib/utils.js
var utils = { // probably doesn't handle some cases correctly, but it works fine for what // we have now deepCopy: function(original) { var result; if (typeof original == 'object') { if (original === null) { result = null; } else { result = original.constructor === Array ? [] :...
var utils = { /* * Takes a dot-notation object string and call the function * that it points to with the correct value for 'this'. */ invokeCommandString: function(str, argArray) { var components = str.split('.'); var obj = window; for (var i = 0; i < components.length - 1; i++) obj = obj...
Remove util functions that the refactor has rendered unnecessary
Remove util functions that the refactor has rendered unnecessary
JavaScript
mit
philc/vimium,justalittlenoob/vimium,borgified/vimium,Robinson10240/vimium,wildeyes/vimium,Aleroniponi/vimium,justalittlenoob/vimium,smblott-github/vimium-smblott,hhsue/vimium,PickRelated/vimium,Aleroniponi/vimium,poacher2k/vimium,jb55/vimium-plus,shaung/vimium,tuchangwei/vimium,dimatter/vimium,PrestanceDesign/vimium,VP...
6e0b573aeca0eb6876af5c6d30be653bf3c43ccd
source/index.js
source/index.js
export {default as abstract} from "./abstract" export {default as isNewRecord} from "./isNewRecord" export {default as isPersisted} from "./isPersisted" export {default as isValid} from "./isValid"
export {default as abstract} from "./abstract" export {default as isNewRecord} from "./isNewRecord" export {default as isPersisted} from "./isPersisted" export {default as isValid} from "./isValid" export {boolean} from "./schema" export {date} from "./schema" export {json} from "./schema" export {number} from "./schem...
Make all these top level
Make all these top level
JavaScript
isc
krainboltgreene/abstraction.js
fe189fbc1bace207a115821012765bbcc79d1e87
typeServices/volume/ambiguous.js
typeServices/volume/ambiguous.js
define(function() { 'use strict'; function NO_OP(){} function split(segment, entries) { var maybeHFS = segment.getBytes(512 * 2, 2).then(function(sigBytes) { var sig = String.fromCharCode(sigBytes[0], sigBytes[1]); if (sig === 'BD') { entries.add(segment.getSegment('volume/hfs'))...
define(function() { 'use strict'; function RFALSE(){ return false; } function split(segment, entries, noRecurse) { var maybeHFS = segment.getBytes(512 * 2, 2).then(function(sigBytes) { var sig = String.fromCharCode(sigBytes[0], sigBytes[1]); if (sig === 'BD') { entries.add(segmen...
Support DiskCopy 4.2 header shift
Support DiskCopy 4.2 header shift
JavaScript
mit
radishengine/drowsy,radishengine/drowsy
c75217e44811a52ded3ae87b9980685376f92ae2
www/AppUpdate.js
www/AppUpdate.js
var exec = require('cordova/exec'); exports.checkAppUpdate = function(success, error, updateUrl, options) { updateUrl = updateUrl ? updateUrl : ''; options = options ? options : {}; exec(success, error, "AppUpdate", "checkAppUpdate", [updateUrl, options]); };
var exec = require('cordova/exec'); /** * Check if there is an update to the App. * * This function can be called in three ways: * 1. checkAppUpdate(updateUrl) * 2. checkAppUpdate(updateUrl, options) * 3. checkAppUpdate(sucessCallback, errorCallback, updateUrl, options) * * @param successOrUrl The success ca...
Allow plugin to be called without callback functions
Allow plugin to be called without callback functions
JavaScript
mit
vaenow/cordova-plugin-app-update,vaenow/cordova-plugin-app-update,vaenow/cordova-plugin-app-update
4f9b72381b1517a0002034bc432afe4bf8834835
client/services/httpServices.js
client/services/httpServices.js
angular.module('sparrow') .service('httpService', function ($http) {   this.getData = function (url, callback) { $http.get(url) .then( function (res) { callback(res.data); }) .catch( function (res) { console.log('GET Error Occured :', res); });   }; this.sendData = function (url, d...
angular.module('sparrow') .service('httpService', function ($http) {   this.getData = function (url, callback) { $http.get(url) .then( function (res) { callback(res.data); }) .catch( function (res) { console.log('GET Error Occured :', res); });   }; this.sendData = function (url, d...
Modify httpService for handling a case if callback is not provided
Modify httpService for handling a case if callback is not provided
JavaScript
mit
TeamSparrows/sparrow,TeamSparrows/sparrow,Ankit09osr/sparrow,Ankit09osr/sparrow
3868f9c1d12aa0083ed9ac3459cddf53fb9c01de
src/scenes/App/components/AppSearch/components/AppSearchInput/index.js
src/scenes/App/components/AppSearch/components/AppSearchInput/index.js
import React from 'react' import P from 'prop-types' export default class AppSearchInput extends React.Component { constructor(props) { super(props) this.state = {searchValue: null} } startTimeout() { this.clearTimeout() this.timeoutID = window.setTimeout(this.triggerLoad.bind(this), 400) } ...
import React from 'react' import P from 'prop-types' export default class AppSearchInput extends React.Component { constructor(props) { super(props) this.state = {searchValue: null} } startTimeout() { this.clearTimeout() this.timeoutID = window.setTimeout(this.triggerLoad.bind(this), 400) } ...
Select search input on focus instead of click.
Select search input on focus instead of click.
JavaScript
mit
jsza/tempus-website,jsza/tempus-website
f03958eae7116e59efd55a9c941acd1e44efdcf7
src/util.js
src/util.js
export function findNearestView(view, selector, predicate) { if (!view || !selector || view.matches("[data-jsua-app]")) return null; var matching = view.querySelector(selector); if (!matching) return findNearestView(view.parentElement, selector, predicate); if (predicate) { if (predicate(matching)) re...
export function findNearestView(view, selector, predicate) { if (!view || !selector || view.matches("[data-jsua-app]")) return null; var matching = view.querySelector(selector); if (!matching) return findNearestView(view.parentElement, selector, predicate); if (predicate) { if (predicate(matching)) re...
Exclude Containers From Form Data Set
Exclude Containers From Form Data Set
JavaScript
mit
lynx-json/jsua-lynx
277e54e9ff64fcd8a8911af77f9dc872da0ee667
src/util.js
src/util.js
'use strict'; module.exports = { digestDefinitionFnOutput: function digestDefinitionFnOutput(output) { var vtree$; var onMount; var dispose; var customEvents; if (output && output.hasOwnProperty('view') && typeof output.view.subscribe === 'function') { vtree$ = output.view; ...
'use strict'; function LifecycleSubjects(createEventSubject) { // Expose observables like properties this.componentWillMount = createEventSubject(); this.componentDidMount = createEventSubject(); this.componentWillReceiveProps = createEventSubject(); this.componentWillUpdate = createEventSubject(); this.co...
Make constructor for lifecycle subjects
Make constructor for lifecycle subjects
JavaScript
mit
pH200/cycle-react
3bf681ca3d25f2eb0f8ac4c9a17f34c5fe05c9f4
src/scripts/workbench/sample-stations.js
src/scripts/workbench/sample-stations.js
window.sampleStations = [{ id: "1", name: "Kluane Lake Research Station", shortName: "KLRS", _links: { aina_info: { description: "AINA: KLRS", href: "http://arctic.ucalgary.ca/kluane-lake-research-station" }, interact_info: { description: "INTER-ACT: KLRS", href: "http://www....
window.sampleStations = [{ id: "1", name: "Kluane Lake Research Station", shortName: "KLRS", _embedded: { sensors: { id: "f0c7c1f25692b615614fb584c532fd16", name: "Burwash Airport Meteo", _links: { self: { href: "/sensors/f0c7c1f25692b615614fb584c532fd16?api_key=798192d6c...
Add link to dummy meteo data
Add link to dummy meteo data
JavaScript
mit
GeoSensorWebLab/asw-workbench,GeoSensorWebLab/Arctic-Scholar-Portal,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/Arctic-Scholar-Portal
daba5abb5f53494102434ae07730c2cafbe5dfa2
src/server/services/chatService/cache.js
src/server/services/chatService/cache.js
import cacheManager from 'cache-manager' import getChannelList from './getChannelList' import getUserList from './getUserList' import {usernameFor} from './util' const memoryCache = cacheManager.caching({ store: 'memory', ttl: 5 * 60, // seconds }) export async function getUserId(userHandle) { const userIdMap ...
import cacheManager from 'cache-manager' import Promise from 'bluebird' import getChannelList from './getChannelList' import getUserList from './getUserList' import {usernameFor} from './util' const memoryCache = cacheManager.caching({ store: 'memory', ttl: 5 * 60, // seconds }) const USER_KEY = 'user_' const CHA...
Fix channel topics not being set after channel creation.
Fix channel topics not being set after channel creation.
JavaScript
mit
sdweber422/echo,LearnersGuild/echo
f945f54148a53968a5181af0f4c46e1a7480084e
native/components/safe-area-view.react.js
native/components/safe-area-view.react.js
// @flow import type { ViewStyle } from '../types/styles'; import * as React from 'react'; import { View } from 'react-native'; import { useSafeArea } from 'react-native-safe-area-context'; type Props = {| style?: ViewStyle, children?: React.Node, |}; function InsetSafeAreaView(props: Props) { const insets = u...
// @flow import * as React from 'react'; import { View } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; const edges = ['top']; function InsetSafeAreaView(props: React.ElementProps<typeof View>) { return <SafeAreaView edges={edges} {...props} />; } export default InsetSafeAreaV...
Use SafeAreaView instead of useSafeArea
[native] Use SafeAreaView instead of useSafeArea Guaranteed synchronous instead of JS-thread asynchronous
JavaScript
bsd-3-clause
Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal
372aee49ef2366c350ce55259d7da823867d5e6f
core/pwa/shared/packages/build/reducers/index.js
core/pwa/shared/packages/build/reducers/index.js
import { combineReducers } from 'redux'; import { omit, find } from 'lodash'; import * as types from '../types'; export const extensions = (state = [], action) => { if (action.type === types.BUILD_UPDATED && action.packages) return omit(action.packages, ['theme']); return state; }; export const theme = (state...
import { combineReducers } from 'redux'; import * as types from '../types'; const packages = (state = {}, action) => { if (action.type === types.BUILD_UPDATED && action.packages) return action.packages; return state; } const siteId = (state = null, action) => { if (action.type === types.BUILD_UPDATED && act...
Switch to packages instead of extensions and theme
Switch to packages instead of extensions and theme
JavaScript
mit
wp-pwa/wp-pwa
bfc60f253b020198dbf05bb94ac3be8b3c8852e9
gulp/postcss.config.js
gulp/postcss.config.js
module.exports = { plugins: [ require('autoprefixer'), require('cssnano')({ preset: 'default' }), ] };
module.exports = { plugins: [ require('autoprefixer'), require('cssnano')({ preset: 'default', reduceIdents: false }) ] };
Remove semantic altering postcss transformation
Remove semantic altering postcss transformation
JavaScript
mit
maxbucknell/module-gulp,maxbucknell/module-gulp
f9a1dc6dfb27d653623d54bff8d95b5481c3f718
src/__tests__/main-test.js
src/__tests__/main-test.js
/* global describe, it, expect */ import { Tab, Tabs, TabList, TabPanel } from '../main'; import TabComponent from '../components/Tab'; import TabListComponent from '../components/TabList'; import TabsComponent from '../components/Tabs'; import TabPanelComponent from '../components/TabPanel'; describe('<TabList />', (...
/* global describe, it, expect */ import ReactTabs, { Tab, Tabs, TabList, TabPanel } from '../main'; import TabComponent from '../components/Tab'; import TabListComponent from '../components/TabList'; import TabsComponent from '../components/Tabs'; import TabPanelComponent from '../components/TabPanel'; describe('main...
Add tests for main export
Add tests for main export
JavaScript
mit
mzabriskie/react-tabs,neeharv/react-tabs,reactjs/react-tabs,rackt/react-tabs,reactjs/react-tabs
df48a1871ca8645a8bbffb9a82a31b7237e9525d
src/angulartics-mixpanel.js
src/angulartics-mixpanel.js
/** * @license Angulartics v0.14.15 * (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics * Contributed by http://github.com/L42y * License: MIT */ (function(angular) { 'use strict'; /** * @ngdoc overview * @name angulartics.mixpanel * Enables analytics support for Mixpanel (http://mixpanel.com) */...
/** * @license Angulartics v0.14.15 * (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics * Contributed by http://github.com/L42y * License: MIT */ (function(angular) { 'use strict'; /** * @ngdoc overview * @name angulartics.mixpanel * Enables analytics support for Mixpanel (http://mixpanel.com) */...
Make sure mixpanel is fully loaded by checking not only the object but also the relevant field in the mixpanel global
Make sure mixpanel is fully loaded by checking not only the object but also the relevant field in the mixpanel global
JavaScript
mit
mushkab/angulartics,abhilashsajeev/angulartics,dy2288/angulartics,indiegogo/angulartics,geordie--/angulartics,trolleycrash/angulartics,marcin-wosinek/angulartics,cwill747/angulartics,aheuermann/angulartics,WoodWing/angulartics,iamakimmer/angulartics,TallyFox/angulartics,jung01080/angulartics,angulartics/angulartics,log...
23c893cc72231c9eed135b91e5cb0f206d11df0a
app/assets/javascripts/user_email_time_of_day.js
app/assets/javascripts/user_email_time_of_day.js
// Display options in select box in local time $(document).ready(function(){ $("#user_email_time_of_day option") .toArray() .forEach(function(element) { var time = new Date(element.value); element.text = LocalTime.strftime(time, "%H:%M %Z"); }) });
// Display options in select box in local time $(document).ready(function(){ $("#user_email_time_of_day option") .toArray() .forEach(function(element) { var time = new Date(element.value); element.text = LocalTime.strftime(time, "%H:%M %Z"); }) $("#user_email_time_of_day").html($("#user_e...
Sort the select options after converting to local time
Sort the select options after converting to local time The current implentation leaves the original order (UTC) but just changes the labels so it appears out of order to the user. The proposed change is not amazing code, but seem effective to order based on the user's local time. Advantages: quick, easy, effective Di...
JavaScript
mit
codetriage/codetriage,codetriage/codetriage,codetriage/codetriage
c24c4dac393d58a3826b88345063c26716de5bb8
src/components/file-hash.js
src/components/file-hash.js
import React from 'react' import Clipboard from 'clipboard' import clippy from '../assets/clippy.svg' export class FileHash extends React.PureComponent { constructor(props) { super(props) new Clipboard('#btn') } render() { const { hash } = this.props return ( <div className='mt4'> ...
import React, { useEffect } from 'react' import Clipboard from 'clipboard' import clippy from '../assets/clippy.svg' export const FileHash = ({ hash }) => { useEffect(() => { const clipboard = new Clipboard('#btn') return () => clipboard.destroy() }, []) return ( <div className='mt4'> <label ...
Use functional component and effect hook
Use functional component and effect hook
JavaScript
mit
joelgeorgev/file-hash-verifier,joelgeorgev/file-hash-verifier
c5606928ae65e308dcf66b3da831a06360f260ce
app_server/public/js/modules/components/itemscount.js
app_server/public/js/modules/components/itemscount.js
/*global $*/ const m = require('mithril'); const ItemsCount = module.exports = {}; ItemsCount.view = function (ctrl, args) { const ITEMS_PER_PAGE = args.possibleItemsPerPage; let getItemsCountSelect = function () { let selectConfig = { config: () => { $('select').material_select(); }, // for materializ...
/*global $*/ const m = require('mithril'); const ItemsCount = module.exports = {}; ItemsCount.view = function (ctrl, args) { const ITEMS_PER_PAGE = args.possibleItemsPerPage; let currentItemsPerPage = parseInt(args.itemsPerPage()); let getItemsCountSelect = function () { let selectConfig = { config: ...
Fix bug involving datatype mixup
Fix bug involving datatype mixup
JavaScript
mit
nus-mtp/worldscope,nus-mtp/worldscope,nus-mtp/worldscope,nus-mtp/worldscope
78d11be17891950e71f4d20af53f91be5849ccfb
src/lib/util.js
src/lib/util.js
export const isValidJsonString = (str) => { try { JSON.parse(str); } catch (e) { return false; } return true; };
export const isValidJsonString = (str) => { try { JSON.parse(str); } catch (e) { return false; } return true; }; export const Box = x => ({ map: f => Box(f(x)), fold: f => f(x), inspect: () => `Box(${x})` });
Add the Box type to make some ori type can use composition.
Add the Box type to make some ori type can use composition.
JavaScript
mit
ens-bid/ens-bid-dapp,PhyrexTsai/ens-bid-dapp,chochinlu/ens-bid-dapp,chochinlu/ens-bid-dapp,PhyrexTsai/ens-bid-dapp,ens-bid/ens-bid-dapp
4cab4697914c967f5776d9005b0e0df6e050d8d1
src/components/Footer.js
src/components/Footer.js
import React from "react"; export default function Footer({ siteTitle }) { return ( <footer> <p> © {new Date().getFullYear()}, Built with <a href="https://www.gatsbyjs.org">Gatsby</a>, Source on <a href="https://github.com/mythmon/mythmon.com">Github</a>. </p> <p> Last g...
import React from "react"; export default function Footer({ siteTitle }) { return ( <footer> <p> © {new Date().getFullYear()}, Built with <a href="https://www.gatsbyjs.org">Gatsby</a>, Source on <a href="https://github.com/mythmon/mythmon.com">Github</a>. </p> <iframe st...
Remove last generated, it's a lie anyways
Remove last generated, it's a lie anyways
JavaScript
mit
mythmon/mythmon.com,mythmon/mythmon.com
4f06b5c92e049915419e5a718ab44c08b7c75f58
telechan.js
telechan.js
const TeleBot = require('telebot'); const config = require('./config'); const bot = new TeleBot({ token: config.token, // Add telegram token bot here. sleep: 1000, // Optional. How often check updates (in ms). timeout: 0, // Optional. Update pulling timeout (0 - short polling). limit: 100, // Optional. Limits ...
const TeleBot = require('telebot'); const config = require('./config'); const bot = new TeleBot({ token: config.token, // Add telegram token bot here. sleep: 1000, // Optional. How often check updates (in ms). timeout: 0, // Optional. Update pulling timeout (0 - short polling). limit: 100, // Optional. Limits ...
Send msg from bot to channel
Send msg from bot to channel
JavaScript
mit
nunnoXYZ/Telechan,nunnoXYZ/Telechan
da4b5cd1c6326331d1e3842993c41cd845eb99de
examples/babel/destructuring-assignment/index.js
examples/babel/destructuring-assignment/index.js
#!/usr/bin/env babel-node import assert from 'assert'; // // 分割代入内で代入ができる // function getObj() { return { x: 2, y: 3 }; } let { x, y, z = 6 } = getObj(); assert.strictEqual(x, 2); assert.strictEqual(y, 3); assert.strictEqual(z, 6); // // 別変数名で展開できる // function stringifyObj({ x: xVar, y: yVar })...
#!/usr/bin/env babel-node import assert from 'assert'; // // 分割代入内で代入ができる // function getObj() { return { x: 2, y: 3 }; } let { x, y, z = 6 } = getObj(); assert.strictEqual(x, 2); assert.strictEqual(y, 3); assert.strictEqual(z, 6); // // 別変数名で展開できる // function stringifyObj({ x: xVar, y: yVar })...
Add a sample of babel
Add a sample of babel
JavaScript
mit
kjirou/nodejs-codes
c4fec181f9e343e97a348628d2f198eb18acaa3a
src/client/js/storychat.js
src/client/js/storychat.js
/* -*- js2-basic-offset: 2; indent-tabs-mode: nil; -*- */ /* vim: set ft=javascript ts=2 et sw=2 tw=80; */ "use strict"; let $ = require("jquery"), {SocketConn} = require("./lib/socketConn"), {ChatOutput} = require("./controls/chatOutput"), {ChatInput} = require("./controls/chatInput"), {Chatlog} = req...
/* -*- js2-basic-offset: 2; indent-tabs-mode: nil; -*- */ /* vim: set ft=javascript ts=2 et sw=2 tw=80; */ "use strict"; let $ = require("jquery"), {SocketConn} = require("./lib/socketConn"), {ChatOutput} = require("./controls/chatOutput"), {ChatInput} = require("./controls/chatInput"), {Chatlog} = req...
Stop hardcoding the url, just reconnect to the origin
Stop hardcoding the url, just reconnect to the origin
JavaScript
agpl-3.0
zkat/storychat
0c840419f981d14ff86d11e8b14870b8b2a13a23
src/tags/Tag.js
src/tags/Tag.js
import React from 'react'; import numeral from 'numeral'; import { Link } from 'react-router'; import FavoriteCategoryButton from '../favorites/FavoriteCategoryButton'; import Icon from '../widgets/Icon'; const Tag = ({ tag, removeCategoryFavorite, addCategoryFavorite, isFavorited }) => <div className="page"...
import React from 'react'; import numeral from 'numeral'; import { Link } from 'react-router'; import FavoriteCategoryButton from '../favorites/FavoriteCategoryButton'; import Icon from '../widgets/Icon'; const Tag = ({ tag, removeCategoryFavorite, addCategoryFavorite, isFavorited }) => <div className="page"...
Move favorite button inside h1 tag
Move favorite button inside h1 tag
JavaScript
mit
ryanbaer/busy,Sekhmet/busy,busyorg/busy,Sekhmet/busy,ryanbaer/busy,busyorg/busy
6ad522fb385b6841091ed5a520826f6a374929dc
lib/orbit/transform-log.js
lib/orbit/transform-log.js
import { Class } from 'orbit/lib/objects'; import { TransformNotLoggedException } from 'orbit/lib/exceptions'; export default Class.extend({ init() { this._log = []; }, append(transformId) { this._log.push(transformId); }, head() { return this._log[this._log.length - 1]; }, entries() { ...
import { TransformNotLoggedException } from 'orbit/lib/exceptions'; export default class TransformLog { constructor() { this._log = []; } append(transformId) { this._log.push(transformId); } head() { return this._log[this._log.length - 1]; } entries() { return this._log; } length(...
Convert TransformLog to ES class.
Convert TransformLog to ES class.
JavaScript
mit
jpvanhal/orbit.js,jpvanhal/orbit.js,SmuliS/orbit.js,SmuliS/orbit.js,orbitjs/orbit-core,orbitjs/orbit.js,jpvanhal/orbit-core,jpvanhal/orbit-core,orbitjs/orbit.js
ba3afb9bb595c1fa99a1712fc4365a006ae5f9cd
js/app/models/wants.js
js/app/models/wants.js
define(['jquery', 'underscore', 'backbone', 'model_want', 'utils'], function($, _, Backbone, Models, Utils) { Models.Wants = Backbone.Collection.extend({ model: Models.Want, initialize: function() { this.fetch({ dataType: 'json', success: function(model, response, options) { console.log(response); ...
define(['jquery', 'underscore', 'backbone', 'model_want', 'utils'], function($, _, Backbone, Models, Utils) { Models.Wants = Backbone.Collection.extend({ model: Models.Want, initialize: function() { this.fetch({ dataType: 'json', success: function(model, response, options) { }, error: func...
Remove console logging of response.
Remove console logging of response.
JavaScript
mit
burnflare/CrowdBuy,burnflare/CrowdBuy
09ecdcf2cb4d9c9bd7a44aa6a6eeb30b1d876c46
fixmove.js
fixmove.js
var _ = require('lodash') var transform = require('./transform.js') function Fixmove(data) { if (!data) data = {} this.speed = data.speed || {position: 1, angle: 10} } Fixmove.prototype.compute = function(current, target) { return this.delta(current, target) } Fixmove.prototype.delta = function(current, target...
var _ = require('lodash') var transform = require('./transform.js') function Fixmove(data) { if (!data) data = {} this.speed = data.speed || {position: 1, angle: 10} } Fixmove.prototype.compute = function(current, target) { return this.delta(current, target) } Fixmove.prototype.delta = function(current, target...
Make forward speed same during turns
Make forward speed same during turns
JavaScript
mit
hexaworld/hexaworld,hexaworld/hexaworld-renderer-3d,hexaworld/hexaworld,hexaworld/hexaworld-renderer-3d
bd5d01538cd3e0a44ca723a4317b37000def3138
forum-web-app/src/app.js
forum-web-app/src/app.js
"use strict"; // src/app.js import { Post } from "./post"; import { ui } from "./ui"; Post.findAll() .then(ui.renderPosts) .catch( (error) => { console.error("Error: ", error); }); User.findRecent() .then(ui.renderUsers) .catch( (error) => { console.error("Error: ", error); });
"use strict"; // src/app.js import { Post } from "./post"; import { User } from "./user"; import { ui } from "./ui"; Post.findAll() .then(ui.renderPosts) .catch( (error) => { console.error("Error: ", error); }); User.findRecent() .then(ui.renderUsers) .catch( (error) => { console.error("Error: ", ...
Add import { User } from "./user";
Add import { User } from "./user";
JavaScript
mit
var-bin/reactjs-training,var-bin/reactjs-training,var-bin/reactjs-training
53a1bcb6c6c2ada3b6fc4a9277c86a3f46e3cddd
examples/logstash/.bitbundler.js
examples/logstash/.bitbundler.js
var loggers = require("bit-bundler/loggers"); var loaderFilter = require("bit-bundler/loggers/loaderFilter"); var JSONStream = require("JSONStream"); module.exports = { log: loggers.sequence(loaderFilter(), JSONStream.stringify(false), process.stdout), src: "src/main.js", dest: "dist/out.js" };
const loggers = require("bit-bundler/loggers"); const loaderFilter = require("bit-bundler/loggers/loaderFilter"); const JSONStream = require("JSONStream"); const net = require("net"); // TCP client to write to logstash with. const client = net.createConnection({ port: 9400 }); module.exports = { log: loggers.sequen...
Adjust the bit-bundler config file to pipe data to a TCP connection logstash is listening on
Adjust the bit-bundler config file to pipe data to a TCP connection logstash is listening on
JavaScript
mit
MiguelCastillo/bit-bundler
71db389061e1b9b1caa3c94399802cf5e98cadc7
src/plugins/control-flow.js
src/plugins/control-flow.js
import _ from 'lodash'; import BPromise from 'bluebird'; export function parallel(...validators) { return function(context) { return BPromise.all(_.map(validators, (validator) => validator(context))); }; } export function series(...validators) { return function(context) { return BPromise.mapSeries(valid...
import _ from 'lodash'; import BPromise from 'bluebird'; import { resolve } from '../utils'; export function parallel(...validators) { return function(context) { return BPromise.all(_.map(validators, (validator) => validator(context))); }; } export function series(...validators) { return function(context) {...
Fix bug where a validator chain was called as a promise instead of a function
Fix bug where a validator chain was called as a promise instead of a function
JavaScript
mit
AlphaHydrae/valdsl
070c286c549533ed0546b4883c3fdff8af4dd5e9
src/ol/imageurlfunction.js
src/ol/imageurlfunction.js
goog.provide('ol.ImageUrlFunction'); goog.provide('ol.ImageUrlFunctionType'); goog.require('ol.Size'); /** * @typedef {function(this:ol.source.Source, ol.Extent, ol.Size, ol.Projection): * (string|undefined)} */ ol.ImageUrlFunctionType; /** * @param {string} baseUrl Base URL (may have query data). * @para...
goog.provide('ol.ImageUrlFunction'); goog.provide('ol.ImageUrlFunctionType'); goog.require('ol.Size'); /** * @typedef {function(this:ol.source.Source, ol.Extent, ol.Size, ol.Projection): * (string|undefined)} */ ol.ImageUrlFunctionType; /** * @param {string} baseUrl Base URL (may have query data). * @para...
Improve type checking in ol.ImageUrlFunction
Improve type checking in ol.ImageUrlFunction
JavaScript
bsd-2-clause
itayod/ol3,elemoine/ol3,planetlabs/ol3,alvinlindstam/ol3,freylis/ol3,geekdenz/openlayers,ahocevar/openlayers,thhomas/ol3,ahocevar/ol3,epointal/ol3,thhomas/ol3,planetlabs/ol3,fblackburn/ol3,Distem/ol3,das-peter/ol3,fredj/ol3,mzur/ol3,pmlrsg/ol3,landonb/ol3,alvinlindstam/ol3,bjornharrtell/ol3,antonio83moura/ol3,wlerner/o...
da35f398c4b89c98ff0b0569f92494c28ec69bd7
src/bin/aunty.js
src/bin/aunty.js
#!/usr/bin/env node if (!require('import-local')(__filename)) { (async () => { const { createErrorLogo } = require('../utils/branding'); const { error, log } = require('../utils/logging'); const { cli } = require('../cli'); function exit(err) { if (err) { log(createErrorLogo()); ...
#!/usr/bin/env node if (!require('import-local')(__filename)) { (async () => { const importLazy = require('import-lazy')(require); const { cli } = require('../cli'); const { createErrorLogo } = importLazy('../utils/branding'); const { error, log } = importLazy('../utils/logging'); function exit(...
Use lazy imports in binary entry-point, so logging is deferred until completion/erroring
Use lazy imports in binary entry-point, so logging is deferred until completion/erroring
JavaScript
mit
abcnews/aunty,abcnews/aunty,abcnews/aunty
78df32a0a02e92a8911f01b9711deee3f64ca4af
dar/loadManifest.js
dar/loadManifest.js
import { Configurator, EditorSession } from '../ui' import { registerSchema, XMLDocumentImporter } from '../xml' import ManifestSchema from './ManifestSchema' import ManifestDocument from './ManifestDocument' export default function loadManifest(xmlStr) { let configurator = new Configurator() registerSchema(config...
import { Configurator, EditorSession } from '../ui' import { registerSchema, XMLDocumentImporter } from '../xml' import ManifestSchema from './ManifestSchema' import ManifestDocument from './ManifestDocument' export default function loadManifest(xmlStr) { let configurator = new Configurator() registerSchema(config...
Use same interface as for other loaders, returning an editorSession.
Use same interface as for other loaders, returning an editorSession.
JavaScript
mit
substance/substance,michael/substance-1,michael/substance-1,substance/substance
333cf9ff650df5871aef0da4ba35b0deed2845bc
generators/base/index.js
generators/base/index.js
var generators = require('yeoman-generator'); module.exports = generators.Base.extend({ prompting: function() { return this.prompt([{ type : 'input', name : 'appName', message : 'Your react native app directory name', default : 'example', }]).then(function (answers) { this...
const Base = require('yeoman-generator').Base; var generators = require('yeoman-generator'); class BaseGenerator extends Base { prompting() { return this.prompt([{ type : 'input', name : 'appName', message : 'Your react native app directory name', default : 'example', }]).then((...
Switch base generator to es6
Switch base generator to es6
JavaScript
mit
bamlab/generator-rn-toolbox,bamlab/generator-rn-toolbox,bamlab/generator-rn-toolbox
8a7061a6edcbf14d0cc3db3bea7ea9d9e30e301a
app/scripts/directives/fielddrop.js
app/scripts/directives/fielddrop.js
'use strict'; angular.module('vleApp') .directive('fieldDrop', function (Dataset) { return { templateUrl: 'templates/fielddrop.html', restrict: 'E', scope: { fieldDef: '=', types: '=' }, controller: function ($scope) { $scope.removeField = function() { ...
'use strict'; angular.module('vleApp') .directive('fieldDrop', function (Dataset) { return { templateUrl: 'templates/fielddrop.html', restrict: 'E', scope: { fieldDef: '=', types: '=' }, controller: function ($scope) { $scope.removeField = function() { ...
Fix problem with dropping Q on enc that only supports O (for example)
Fix problem with dropping Q on enc that only supports O (for example)
JavaScript
bsd-3-clause
sandbox/polestar,uwdata/polestar,vivekratnavel/polestar,jsanch/polestar,smartpcr/polestar,pallavkul/polestar,hortonworks/polestar,pallavkul/polestar,dennari/hack-n-hackers-polestar,zegang/polestar,dennari/hack-n-hackers-polestar,zegang/polestar,hortonworks/polestar,dennari/hack-n-hackers-polestar,vivekratnavel/polestar...
49df9e25fb9eb19a251c0c696ffa0dd9dc469ef4
tests/runner.js
tests/runner.js
if (window.location.search === "?test") { document.write( '<div id="qunit"></div>' + '<div id="qunit-fixture"></div>' + '<div id="ember-testing-container">' + ' <div id="ember-testing"></div>' + '</div>' + '<link rel="stylesheet" href="tests/runner.css">' + '<link rel="stylesheet" href="t...
if (window.location.search.indexOf("?test") !== -1) { document.write( '<div id="qunit"></div>' + '<div id="qunit-fixture"></div>' + '<div id="ember-testing-container">' + ' <div id="ember-testing"></div>' + '</div>' + '<link rel="stylesheet" href="tests/runner.css">' + '<link rel="stylesh...
Allow other query params to be used when testing.
Allow other query params to be used when testing. Resolves https://github.com/emberjs/ember.js/issues/3873.
JavaScript
mit
miguelcoba/ember-intro-code,miguelcoba/ember-intro-code
1df848c9402585f829f14dc4c9ce6abbfa5f21f4
src/scripts/menu-toggle.js
src/scripts/menu-toggle.js
$(document).ready(function() { $('.toggle').click(function(event) { event.stopPropagation(); event.preventDefault(); $('.menu-wrapper').toggleClass('visible'); }); $(document).click(function() { $('.menu-wrapper').removeClass('visible'); }); });
$(document).ready(function() { $('.menu-title .toggle').click(function(event) { event.stopPropagation(); event.preventDefault(); $('.menu-wrapper').toggleClass('visible'); }); $(document).click(function() { $('.menu-wrapper').removeClass('visible'); }); });
Fix menu conflict with share
Fix menu conflict with share
JavaScript
bsd-3-clause
flipside-org/penny-harvest
a6ec8caa475d929508ba3624cc10146519f917a6
src/simplestyle_factory.js
src/simplestyle_factory.js
function simplestyle_factory(feature) { var sizes = { small: [20, 50], medium: [30, 70], large: [35, 90] }; var fp = feature.properties || {}; var size = fp['marker-size'] || 'medium'; var symbol = (fp['marker-symbol']) ? '-' + fp['marker-symbol'] : ''; var color = fp['marke...
function simplestyle_factory(feature) { var sizes = { small: [20, 50], medium: [30, 70], large: [35, 90] }; var fp = feature.properties || {}; var size = fp['marker-size'] || 'medium'; var symbol = (fp['marker-symbol']) ? '-' + fp['marker-symbol'] : ''; var color = fp['marke...
Set cursor to hand when over simplestyle points.
Set cursor to hand when over simplestyle points.
JavaScript
bsd-3-clause
mapbox/markers.js
aa283b54bbc1c86bf53ab12d8f0b0e40cc7e9144
babel-defaults.js
babel-defaults.js
/* eslint-disable object-shorthand */ module.exports = { // We need to make sure that the transpiler hit the linoleum source since we are // not building to npm or simliar. ignore: function(filename) { return ((/node_modules/.test(filename)) && !(/linoleum(-[^/]*)?\/(electron|src|tasks|Gulpfile)/.test...
/* eslint-disable object-shorthand */ module.exports = { // We need to make sure that the transpiler hit the linoleum source since we are // not building to npm or simliar. ignore: function(filename) { return ((/node_modules/.test(filename)) && !(/linoleum(-[^/]*)?\/(electron|src|tasks|Gulpfile)/.test...
Make aux comments opt in
Make aux comments opt in
JavaScript
mit
kpdecker/linoleum
61d8c049a9e91ff90f8665ed12ca40ae5bc94c4f
src/styles/Icons/_Sprite.js
src/styles/Icons/_Sprite.js
import React from "react"; import PropTypes from "prop-types"; import SVG from "./assets/_sprite.svg"; import s4e from "svg4everybody"; export default class Sprite extends React.Component { static loaded = false; static propTypes = { id: PropTypes.string, viewBox: PropTypes.string }; state = { re...
import React from "react"; import PropTypes from "prop-types"; import SVG from "./assets/_sprite.svg"; import s4e from "svg4everybody"; export default class Sprite extends React.Component { static loaded = false; static propTypes = { id: PropTypes.string, viewBox: PropTypes.string }; state = { re...
Add viewbox to empty svg
Add viewbox to empty svg
JavaScript
mit
tutti-ch/react-styleguide,tutti-ch/react-styleguide
143bb39a56b75dbfc33040759d7034c9bbcb170e
backbone/models/all_items_folder.js
backbone/models/all_items_folder.js
var AllItemsFolder = Backbone.Model.extend({ initialize: function() { this.items = new ItemCollection(); this.items.url = '/item'; this.set({ name: LANG.all_items_folder, route: 'item', iconclass: 'icon-asterisk' }); }, getNextInList: function() { return folders.first(); }, getPreviousInList...
var AllItemsFolder = Backbone.Model.extend({ initialize: function() { this.items = new ItemCollection(); this.items.url = '/item'; this.listenTo(this.items, 'itemRead', this.itemRead); this.listenTo(this.items, 'itemUnread', this.itemUnread); this.set({ name: LANG.all_items_folder, route: 'item', i...
Add code to update the read count when reading items in the "all items" folder
Add code to update the read count when reading items in the "all items" folder
JavaScript
bsd-3-clause
fcapovilla/caporss,fcapovilla/caporss,fcapovilla/caporss
d0f28f80921c97843181ab4bdabea7440b5c5c20
src/spritesheet.js
src/spritesheet.js
'use strict'; import Sprite from './sprite'; export default class SpriteSheet { constructor(texture, width, height) { this.texture = texture; this.width = width; this.height = height; this.spriteCoordinates = {}; } register(name, x, y, width, height) { this.spriteCoordinates[name] = { x: ...
'use strict'; import Sprite from './sprite'; export default class SpriteSheet { constructor(texture, width, height) { this.texture = texture; this.width = width; this.height = height; this.spriteCoordinates = {}; } register(name, x, y, width, height) { this.spriteCoordinates[name] = { x: ...
Add setSpriteTexture to the SpriteSheet class
Add setSpriteTexture to the SpriteSheet class
JavaScript
mit
paul-maxime/yaje.js
85b32b861ed2f6463ef640a4c4bd1ffb9e55783c
src/state-store.js
src/state-store.js
'use strict' module.exports = class StateStore { constructor () { this.dbPromise = new Promise((resolve, reject) => { let dbOpenRequest = indexedDB.open('AtomEnvironments', 1) dbOpenRequest.onupgradeneeded = (event) => { let db = event.target.result db.createObjectStore('states') ...
'use strict' module.exports = class StateStore { constructor () { this.dbPromise = new Promise((resolve, reject) => { let dbOpenRequest = indexedDB.open('AtomEnvironments', 1) dbOpenRequest.onupgradeneeded = (event) => { let db = event.target.result db.createObjectStore('states') ...
Add storedAt date for serialized environment state
Add storedAt date for serialized environment state
JavaScript
mit
Ingramz/atom,bolinfest/atom,me-benni/atom,ashneo76/atom,brettle/atom,wiggzz/atom,florianb/atom,tjkr/atom,helber/atom,bolinfest/atom,decaffeinate-examples/atom,helber/atom,ashneo76/atom,t9md/atom,rlugojr/atom,bsmr-x-script/atom,PKRoma/atom,ardeshirj/atom,brumm/atom,gontadu/atom,bj7/atom,rlugojr/atom,Austen-G/BlockBuilde...
50f348d399395f5e28bbe0aef16e8325c28728c7
lib/animations-manager.js
lib/animations-manager.js
'use strict' module.exports = function (animations) { let index = 0 let running = false const api = { set index (i) { console.log(animations[i].name) index = i }, next: () => { api.index = ++index % animations.length }, previous: () => { api.index = index > 0 ? index - 1 : animation...
'use strict' module.exports = function (animations) { let index = 0 let running = false const api = { set index (i) { console.log(animations[i].name) index = i }, next: () => { api.index = ++index % animations.length }, previous: () => { api.index = index > 0 ? index - 1 : animation...
Throw a ReferenceError on animations.select(unregisterName)
Throw a ReferenceError on animations.select(unregisterName)
JavaScript
mit
chevalvert/stratum,chevalvert/stratum
c863dd32752b674efb7d9c45a5d1da79ae96221b
lib/cb.middleware/main.js
lib/cb.middleware/main.js
// Requires var _ = require('underscore'); var express = require('express'); function setup(options, imports, register) { // Import var app = imports.server.app; var workspace = imports.workspace; // Apply middlewares app.use(express.cookieParser()); app.use(express.cookieSession({ k...
// Requires var _ = require('underscore'); var express = require('express'); function setup(options, imports, register) { // Import var app = imports.server.app; var workspace = imports.workspace; // Apply middlewares app.use(express.cookieParser()); app.use(express.cookieSession({ k...
Fix req stream race condition due to middleware
Fix req stream race condition due to middleware
JavaScript
apache-2.0
rajthilakmca/codebox,lcamilo15/codebox,indykish/codebox,fly19890211/codebox,rodrigues-daniel/codebox,kustomzone/codebox,quietdog/codebox,lcamilo15/codebox,blubrackets/codebox,nobutakaoshiro/codebox,ahmadassaf/Codebox,rajthilakmca/codebox,code-box/codebox,CodeboxIDE/codebox,LogeshEswar/codebox,LogeshEswar/codebox,rodrig...
427844be9177be6108363c793c745b483739d226
main/app/server/methods/sapB1integration.js
main/app/server/methods/sapB1integration.js
import _ from 'underscore'; import { HTTP } from 'meteor/http' /** * SAP B1 Integration Methods */ Meteor.methods({ 'sapB1integration/testConnectionToWindowsService': (sapServerIpAddress) => { if (!this.userId && Core.hasPayrollAccess(this.userId)) { throw new Meteor.Error(401, "Unauthorized...
import _ from 'underscore'; import { HTTP } from 'meteor/http' /** * SAP B1 Integration Methods */ Meteor.methods({ 'sapB1integration/testConnectionToWindowsService': (sapServerIpAddress) => { if (!this.userId && Core.hasPayrollAccess(this.userId)) { throw new Meteor.Error(401, "Unauthorized...
Fix typo bug in sap b1 http POST to sap
Fix typo bug in sap b1 http POST to sap
JavaScript
mit
c2gconsulting/bp-core,c2gconsulting/bp-core,c2gconsulting/bp-core,c2gconsulting/bp-core,c2gconsulting/bp-core
a89b22e960745dfc76dff7becfabb04281bfe11d
.eslintrc.js
.eslintrc.js
module.exports = { extends: "airbnb", globals: { Urls: true }, env: { browser: true }, rules: { "react/jsx-filename-extension": [ 1, { extensions: [ ".js", ".jsx" ] } ] }, settings: { "import/resolver": { webpack: { ...
module.exports = { extends: "airbnb", globals: { Urls: true }, env: { browser: true, jest: true }, rules: { "react/jsx-filename-extension": [ 1, { extensions: [ ".js", ".jsx" ] } ] }, settings: { "import/resolver": { web...
Add jest to eslint env
Add jest to eslint env
JavaScript
mit
dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4
a373b9b0c6925e46d4a2d281ab1851ec4747a0d2
spec/javascripts/browser-unsupported-bar_spec.js
spec/javascripts/browser-unsupported-bar_spec.js
describe("Alert unsupported browser: ", function(){ beforeEach(function(){ loadFixtures('browser-unsupported-bar_fixture.html'); }); describe("When userAgent is MSIE", function(){ it("should add .ls-browser-unsupported class on <html>", function(){ $.cookie = function (arg) { return false; ...
describe("Alert unsupported browser: ", function(){ beforeEach(function(){ loadFixtures('browser-unsupported-bar_fixture.html'); }); describe("When userAgent is MSIE", function(){ it("should add .ls-browser-unsupported class on <html>", function(){ $.cookie = function (arg) { return false; ...
Create test when click to close alert browser unsupported.
Create test when click to close alert browser unsupported.
JavaScript
mit
kemelzaidan/locawebstyle,locaweb/locawebstyle,diegoeis/locawebstyle,locaweb/locawebstyle,MaizerGomes/locawebstyle,kemelzaidan/locawebstyle,EveraldoReis/locawebstyle,EveraldoReis/locawebstyle,EveraldoReis/locawebstyle,locaweb/locawebstyle,deividmarques/locawebstyle,deividmarques/locawebstyle,diegoeis/locawebstyle,diegoe...
0be832ae1883a07a5d76bb39ba3dc027596b7964
static/js/fluff.js
static/js/fluff.js
payex.hostedView.consumer({ container: 'checkout', culture: 'nb-NO', onConsumerIdentified: function(consumerIdentifiedEvent) { var request = new XMLHttpRequest(); request.addEventListener('load', function() { response = JSON.parse(this.responseText); var script = doc...
payex.hostedView.consumer({ container: 'checkout', culture: 'nb-NO', onConsumerIdentified: function (consumerIdentifiedEvent) { var request = new XMLHttpRequest(); request.addEventListener('load', function () { response = JSON.parse(this.responseText); var script = d...
Remove consumer hosted view before initializing payment menu
Remove consumer hosted view before initializing payment menu
JavaScript
mit
asbjornu/flufforama,asbjornu/flufforama
7fae533609f6233f9bf71690d7619ec393909537
injectChrome.js
injectChrome.js
(function() { window.stop(); document.documentElement.innerHTML = null; const IS_LOCAL = false, URL_REMOTE = "https://rawgit.com/ultratype/UltraTypeBot/master/OUT/OUT.js", URL_OUT = IS_LOCAL ? chrome.extension.getURL('OUT/OUT.js') : URL_REMOTE, SCRIPT_OUT = "<script src='" + ...
(function() { window.stop(); document.documentElement.innerHTML = null; const IS_LOCAL = !!(localStorage["ultratypedev"]), URL_REMOTE = "https://rawgit.com/ultratype/UltraTypeBot/master/OUT/OUT.js", URL_OUT = IS_LOCAL ? chrome.extension.getURL('OUT/OUT.js') : URL_REMOTE, SCRI...
Load locally based on localStorage value
Load locally based on localStorage value
JavaScript
mit
ultratype/UltraTypeBot,ultratype/UltraTypeBot,ultratype/UltraTypeBot
c55f9fe08fa33e28f4a82de700658984e4ccd824
app/javascript/app/providers/geolocation-provider/geolocation-provider.js
app/javascript/app/providers/geolocation-provider/geolocation-provider.js
import { PureComponent } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import actions from './geolocation-provider-actions'; import reducers, { initialState } from './geolocation-provider-reducers'; class GeolocationProvider extends PureComponent { componentDidMount() { ...
import { PureComponent } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import actions from './geolocation-provider-actions'; import reducers, { initialState } from './geolocation-provider-reducers'; const { IPSTACK_GEOLOCATION_API_KEY } = process.env; class GeolocationProvi...
Update geolocation provider to follow new API
Update geolocation provider to follow new API
JavaScript
mit
Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch
f011d4bf188ac33dd7fcb8c5d87f70456117e303
backend/app/assets/javascripts/spree/backend/components/sortable_table.js
backend/app/assets/javascripts/spree/backend/components/sortable_table.js
Spree.ready(function() { // Fix sortable helper var fixHelper = function(e, ui) { ui.children().each(function() { $(this).width($(this).width()); }); return ui; }; var td_count = $(this).find('tbody tr:first-child td').length $('table.sortable tbody').sortable({ handle: '.hand...
//= require solidus_admin/Sortable Spree.ready(function() { var sortable_tables = document.querySelectorAll('table.sortable'); _.each(sortable_tables, function(table) { var url = table.getAttribute('data-sortable-link'); var tbody = table.querySelector('tbody'); var sortable = Sortable.create(tbody,{ ...
Convert sortable tables to Sortable.js
Convert sortable tables to Sortable.js
JavaScript
bsd-3-clause
pervino/solidus,pervino/solidus,pervino/solidus,pervino/solidus
faf6ac311b14219a96c331a4dd7733c5dfa0e318
src/util/pointProjector.js
src/util/pointProjector.js
var cornerstoneTools = (function ($, cornerstone, cornerstoneTools) { "use strict"; if(cornerstoneTools === undefined) { cornerstoneTools = {}; } if(cornerstoneTools.referenceLines === undefined) { cornerstoneTools.referenceLines = {}; } // projects a patient point to an image...
var cornerstoneTools = (function ($, cornerstone, cornerstoneTools) { "use strict"; if(cornerstoneTools === undefined) { cornerstoneTools = {}; } if(cornerstoneTools.referenceLines === undefined) { cornerstoneTools.referenceLines = {}; } // projects a patient point to an image...
Revert my previous 'fix' for point projection
Revert my previous 'fix' for point projection
JavaScript
mit
leonardorame/cornerstoneTools,chafey/cornerstoneTools,google/cornerstoneTools,google/cornerstoneTools,cornerstonejs/cornerstoneTools,leonardorame/cornerstoneTools,swederik/cornerstoneTools,HorizonPlatform/cornerstoneTools,cornerstonejs/cornerstoneTools,HorizonPlatform/cornerstoneTools,cornerstonejs/cornerstoneTools,swe...
d62e0f222f492fe2c88be3e656133ac56089544d
grunt/browser-sync.js
grunt/browser-sync.js
// Local web server running on port 9001 with livereload functionality module.exports = function(grunt) { grunt.config('browserSync', { options: { watchTask: true, server: { baseDir: './' } }, bsFiles: { src: [ '...
// Local web server running on port 9001 with livereload functionality module.exports = function(grunt) { grunt.config('browserSync', { options: { watchTask: true, tunnel: '<%= pkg.name %>', server: { baseDir: './' } }, bsFiles:...
Add localtunnel option to browserSync
Add localtunnel option to browserSync
JavaScript
mit
yellowled/yl-bp,yellowled/yl-bp
f6e13275ac7d39cf2a3784437f5096d523f642ad
src/client/react/user/views/Instructions/InstructionCollapse.js
src/client/react/user/views/Instructions/InstructionCollapse.js
import React from 'react'; import autobind from 'core-decorators/es/autobind'; import { Button, Intent, Collapse } from '@blueprintjs/core'; import MarkdownRenderer from '../../../../../../lib/react/components/MarkdownRenderer'; import '../../scss/components/_instruction-panel.scss'; @autobind class InstructionColla...
import React from 'react'; import autobind from 'core-decorators/es/autobind'; import { Button, Intent, Collapse } from '@blueprintjs/core'; import MarkdownRenderer from '../../../../../../lib/react/components/MarkdownRenderer'; import '../../scss/components/_instruction-panel.scss'; @autobind class InstructionColla...
Change the icon on instructions view to chevrons
[ADD] Change the icon on instructions view to chevrons
JavaScript
mit
bwyap/ptc-amazing-g-race,bwyap/ptc-amazing-g-race
c0ccc5dd0a8216a75dea1c224fec140500373801
gulp/tasks/default.js
gulp/tasks/default.js
var gulp = require('gulp'); var config = require('../config'); gulp.task('watch', function() { gulp.watch(config.css.watch, ['css']); gulp.watch(config.coffeelint.watch, ['coffeelint']); gulp.watch(config.browserify.app.watch, ['browserify-app']); gulp.watch(config.browserify...
var gulp = require('gulp'); var config = require('../config'); gulp.task('watch', function() { gulp.watch(config.css.watch, ['css']); gulp.watch(config.coffeelint.watch, ['coffeelint']); gulp.watch(config.browserify.app.watch, ['browserify-app']); gulp.watch(config.browserify...
Fix some leftover issues from renaming browserify-dataset-sync-wrapper
Fix some leftover issues from renaming browserify-dataset-sync-wrapper
JavaScript
mit
concord-consortium/lara-interactive-api,concord-consortium/lara-interactive-api,concord-consortium/lara-interactive-api
46ce93ca90fe958ef82358e38b00c183aea9ff03
hof.min.js
hof.min.js
(function(e){e.fn.hugeOnFacebook=function(t){var n={linkClass:"",addData:!1,minLikes:10,hugeLikes:50,popClass:"popular",hugeClass:"hugeonfacebook",likesVisible:!1,likesVisibleClass:"likesVisible"},r=e.extend({},n,t);if(this.attr("id"))var i="#"+this.attr("id")+" ";else if(this.attr("class"))var s="."+this.attr("class")...
!function(a){a.fn.hugeOnFacebook=function(b){var c={linkClass:"",addData:!1,minLikes:10,hugeLikes:50,popClass:"popular",hugeClass:"hugeonfacebook",likesVisible:!1,likesVisibleClass:"likesVisible"},d=a.extend({},c,b);if(this.attr("id"))var e="#"+this.attr("id")+" ";else if(this.attr("class"))var f="."+this.attr("class")...
Upgrade to 1.3.1, add Zepto support
Upgrade to 1.3.1, add Zepto support
JavaScript
mit
gfscott/Huge-On-Facebook,gfscott/Huge-On-Facebook
f31ebdc08f832230e5fd5e89f50fe838e2c8d95e
routes/index.js
routes/index.js
var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.status(200).send('This is the Journey app.'); }); module.exports = router;
var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.status(200).json({ success: true, message: 'This is the Journey API.' }); }); module.exports = router;
Update default response on root API endpoint
Update default response on root API endpoint
JavaScript
mit
heymanhn/journey-backend
8b4d82b2ceda5d5b09f5f25a4af366e757481b82
packages/ember-runtime/lib/system/object.js
packages/ember-runtime/lib/system/object.js
// ========================================================================== // Project: Ember Runtime // Copyright: ©2011 Strobe Inc. and contributors. // License: Licensed under MIT license (see license.js) // ========================================================================== require('ember-runtime/mixin...
// ========================================================================== // Project: Ember Runtime // Copyright: ©2011 Strobe Inc. and contributors. // License: Licensed under MIT license (see license.js) // ========================================================================== require('ember-runtime/mixin...
Add brief documentation for Ember.Object
Add brief documentation for Ember.Object
JavaScript
mit
nvoron23/ember.js,kublaj/ember.js,HeroicEric/ember.js,brzpegasus/ember.js,nathanhammond/ember.js,nathanhammond/ember.js,okuryu/ember.js,okuryu/ember.js,jaswilli/ember.js,VictorChaun/ember.js,cbou/ember.js,Vassi/ember.js,alexdiliberto/ember.js,johanneswuerbach/ember.js,tianxiangbing/ember.js,max-konin/ember.js,zenefits/...
55db6a94a2f69c4bcbe142678beaf955034bdfaa
assets/js/modules/analytics-4/index.js
assets/js/modules/analytics-4/index.js
/** * Analytics-4 module initialization. * * Site Kit by Google, Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LIC...
/** * Analytics-4 module initialization. * * Site Kit by Google, Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LIC...
Remove non existent filter from Analytics.
Remove non existent filter from Analytics.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
1b8ae834e663252c170fb0eed2a643d5482a55fe
lib/components/TenDay.js
lib/components/TenDay.js
import React from 'react'; import WeatherIcons from '../weather_icons/WeatherIcons'; const TenDay = ({ tenDayForecast }) => { if(!tenDayForecast) { return( <div></div> ) } const forecastArray = tenDayForecast.simpleforecast.forecastday; const icons = new WeatherIcons(); return( <article> ...
import React from 'react'; import WeatherIcons from '../weather_icons/WeatherIcons'; const TenDay = ({ tenDayForecast }) => { if(!tenDayForecast) { return( <div></div> ) } const forecastArray = tenDayForecast.simpleforecast.forecastday; const icons = new WeatherIcons(); return( <section> ...
Add class to render for ten day.
Add class to render for ten day.
JavaScript
mit
thatPamIAm/weathrly,thatPamIAm/weathrly
04fef684ef7c7c508a132e60a31ed18cc0a034e4
assets/js/util/escape-uri.js
assets/js/util/escape-uri.js
/** * Escape URI components utility. * * Site Kit by Google, Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE...
/** * Escape URI components utility. * * Site Kit by Google, Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE...
Add @since for escapeURI function.
Add @since for escapeURI function. Co-authored-by: Evan Mattson <04b4a59aa52dbba0fe4139b6afe8885fd3fa41ec@10up.com>
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
d58c62f7d2ab1d1c884e45bc9d3e2a11b9d3474c
frontend/app/scripts/controllers/questionlist.js
frontend/app/scripts/controllers/questionlist.js
'use strict'; /** * @ngdoc function * @name conferenceAppApp.controller:QuestionlistCtrl * @description * # QuestionlistCtrl * Controller of the conferenceAppApp */ angular.module('meanDemoApp') .controller('QuestionlistCtrl', function ($scope, Question) { Question.query(null, function(questions) { ...
'use strict'; /** * @ngdoc function * @name conferenceAppApp.controller:QuestionlistCtrl * @description * # QuestionlistCtrl * Controller of the conferenceAppApp */ angular.module('meanDemoApp') .controller('QuestionlistCtrl', function ($scope, $timeout, Question) { var pollInterval = 20000; // in millise...
Add polling for new questions
Add polling for new questions
JavaScript
mit
emgeee/mean-stack-SFHTML5,emgeee/mean-stack-SFHTML5
a81bb4917fea2a4320d9e3e254fe7e217b016887
src/lib/utils.js
src/lib/utils.js
module.exports = { getViewPortInfo: function getViewPort () { var e = document.documentElement var g = document.getElementsByTagName('body')[0] var x = window.innerWidth || e.clientWidth || g.clientWidth var y = window.innerHeight || e.clientHeight || g.clientHeight return { width: x, ...
module.exports = { getViewPortInfo: function getViewPort () { var e = document.documentElement var g = document.getElementsByTagName('body')[0] var x = window.innerWidth || e.clientWidth || g.clientWidth var y = window.innerHeight || e.clientHeight || g.clientHeight return { width: x, ...
Add utility method to getCurrentScript
Add utility method to getCurrentScript
JavaScript
mit
jahtalab/opbeat-js,jahtalab/opbeat-js,opbeat/opbeat-angular,opbeat/opbeat-angular,opbeat/opbeat-react,opbeat/opbeat-js-core,jahtalab/opbeat-js,opbeat/opbeat-react,opbeat/opbeat-angular,opbeat/opbeat-react,opbeat/opbeat-js-core
0c4304fbe544200d4b634a67a9e5753ff826ec24
public/javascripts/main.js
public/javascripts/main.js
var socket = io.connect(window.location.href); $(document).ready(function() { });
var socket = io.connect(window.location.href); $(document).ready(function() { $('#song-count').text($('.track').length + ' tracks') // Get total time var total = 0; $('.time').each(function(index) { total += $(this).data('time'); }); var time = moment.duration({s: total }); var hours = ' hours '; ...
Update song count and total track play time
Update song count and total track play time
JavaScript
mit
nagyistoce/angelbeats,sahat/angelbeats,nagyistoce/angelbeats
62aea105261ae5e4b5026ba457bd99cf39706ab0
lib/global/log4js-layout-json.js
lib/global/log4js-layout-json.js
var _ = require('underscore'); var layouts = require('log4js').layouts; var sprintf = require("sprintf-js").sprintf; var stringify = require('json-stringify-safe'); var NestedError = require('nested-error-stacks'); var isPlainObject = require('is-plain-object'); var Log4jsJsonLayout = { process: function(logEvent) {...
var _ = require('underscore'); var layouts = require('log4js').layouts; var sprintf = require("sprintf-js").sprintf; var stringify = require('json-stringify-safe'); var NestedError = require('nested-error-stacks'); var isPlainObject = require('is-plain-object'); var Log4jsJsonLayout = { process: function(logEvent) {...
Move extra log params under 'janus' namespace
Move extra log params under 'janus' namespace
JavaScript
mit
cargomedia/cm-janus,vogdb/cm-janus,cargomedia/cm-janus,vogdb/cm-janus
b625f6534d2a0df0a5bacce1f6bb740a5e59eac3
lib/helpers/getDomNodeProfile.js
lib/helpers/getDomNodeProfile.js
import { getDomNodePath } from './getDomNodePath'; export function getDomNodeProfile(el) { return { action: el.action, class: el.className, href: getElementProps(el, 'href'), id: getElementProps(el, 'id'), method: el.method, name: el.name, node_name: el.nodeName, selector: getDomNodeP...
import { getDomNodePath } from './getDomNodePath'; export function getDomNodeProfile(el) { return { action: el.action, class: el.className, href: getElementProps(el, 'href'), id: getElementProps(el, 'id'), event_key: getElementProps(el, 'data-event-key'), method: el.method, name: el.name,...
Add support for data-event-key attribute to avoid polluting standard attributes and be more explicit
Add support for data-event-key attribute to avoid polluting standard attributes and be more explicit
JavaScript
mit
keen/keen-tracking.js,keen/keen-tracking.js
59c7b0cb13f78ec3e2a774dbd08919523fc958fb
.eslintrc.js
.eslintrc.js
module.exports = { "parser": "babel-eslint", "env": { "browser": true, "jest": true, "node": true, "es6": true }, "extends": ["eslint:recommended", "plugin:react/recommended"], "parserOptions": { "ecmaFeatures": { "experimentalObjectRestSpread": true, "jsx": true }, "so...
module.exports = { "parser": "babel-eslint", "env": { "browser": true, "jest": true, "node": true, "es6": true }, "extends": ["eslint:recommended", "plugin:react/recommended"], "parserOptions": { "ecmaFeatures": { "experimentalObjectRestSpread": true, "jsx": true }, "so...
Allow { unused, ...rest } in ESLint rules
Allow { unused, ...rest } in ESLint rules
JavaScript
mit
StreakYC/react-smooth-collapse,StreakYC/react-smooth-collapse
dbc6c1d6e5057840aabc5df402a0dd8312a0c312
src/utils/chooseBestUrl.js
src/utils/chooseBestUrl.js
// utils -> chooseBestURL import { slugify, } from 'bellajs'; import stringComparision from 'string-comparison'; import { error, } from './logger'; export default (candidates = [], title) => { let theBest = candidates.reduce((prev, curr) => { return curr.length < prev.length ? curr : prev; }, candidate...
// utils -> chooseBestURL import { slugify, } from 'bellajs'; import stringComparision from 'string-comparison'; import {getParserOptions} from '../config'; import { error, } from './logger'; export default (candidates = [], title) => { let theBest = candidates.reduce((prev, curr) => { return curr.lengt...
Load string comparison algorithm from config
Load string comparison algorithm from config
JavaScript
mit
ndaidong/article-parser,ndaidong/article-parser
4574647639409bf9f51bc47577b42632118eff2a
app/src/js/modules/fields/relationship.js
app/src/js/modules/fields/relationship.js
/** * Handling of relationship input fields. * * @mixin * @namespace Bolt.fields.relationship * * @param {Object} bolt - The Bolt module. * @param {Object} $ - jQuery. */ (function (bolt, $) { /** * Bolt.fields.relationship mixin container. * * @private * @type {Object} */ var ...
/** * Handling of relationship input fields. * * @mixin * @namespace Bolt.fields.relationship * * @param {Object} bolt - The Bolt module. * @param {Object} $ - jQuery. */ (function (bolt, $) { /** * Bolt.fields.relationship mixin container. * * @private * @type {Object} */ var ...
Change how templateSelection is build
Change how templateSelection is build
JavaScript
mit
kendoctor/bolt,nikgo/bolt,Intendit/bolt,marcin-piela/bolt,nikgo/bolt,Raistlfiren/bolt,nantunes/bolt,pygillier/bolt,joshuan/bolt,richardhinkamp/bolt,pygillier/bolt,rarila/bolt,romulo1984/bolt,richardhinkamp/bolt,kendoctor/bolt,hannesl/bolt,joshuan/bolt,Eiskis/bolt-base,Intendit/bolt,winiceo/bolt,Calinou/bolt,xeddmc/bolt...
9faf65462b6f6b58de3fd8d65406f3af150c50d8
jquery.placeholder.js
jquery.placeholder.js
(function( $ ){ $.fn.placeholder = function(restoreOverride, removeOverride){ return $(this).each(function(){ var $this = $(this) original_color = $this.css('color') function remove(){ $this.css('color', original_color) ...
(function( $ ){ $.fn.placeholder = function(restoreOverride, removeOverride){ return $(this).each(function(){ var $this = $(this) original_color = $this.css('color') function remove(){ $this.css('color', original_color) ...
Fix a bug that caused improper initialization with overrides
Fix a bug that caused improper initialization with overrides
JavaScript
mit
jgorset/jquery-placeholder
c5bb277f6e914cabedaadb9b5a3ded848b06243d
packages/workflow/ember-cli-build.js
packages/workflow/ember-cli-build.js
/* eslint-env node */ 'use strict'; const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { let app = new EmberAddon(defaults, { // Add options here }); /* This build file specifies the options for the dummy test app of this addon, located in `/tests/...
/* eslint-env node */ 'use strict'; const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { let app = new EmberAddon(defaults, { 'ember-cli-babel': { includePolyfill: true } }); /* This build file specifies the options for the dummy test app of ...
Make async functions work in workflow package
Make async functions work in workflow package
JavaScript
mit
cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack
761943784197f95c367af19c5a4f7e3d4a6e5c65
sencha-workspace/SlateAdmin/app/model/person/ProgressReport.js
sencha-workspace/SlateAdmin/app/model/person/ProgressReport.js
/*jslint browser: true, undef: true, white: false, laxbreak: true *//*global Ext,Slate*/ Ext.define('SlateAdmin.model.person.ProgressReport', { extend: 'Ext.data.Model', fields: [ 'AuthorUsername', 'Subject', { name: 'ID', type: 'integer', useNull: tru...
/*jslint browser: true, undef: true, white: false, laxbreak: true *//*global Ext,Slate*/ Ext.define('SlateAdmin.model.person.ProgressReport', { extend: 'Ext.data.Model', fields: [ 'AuthorUsername', 'Subject', { name: 'ID', type: 'integer', useNull: tru...
Reconfigure progress report record type calculation
Reconfigure progress report record type calculation
JavaScript
mit
SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate-admin,SlateFoundation/slate-admin,SlateFoundation/slate-admin,SlateFoundation/slate-admin,SlateFoundation/slate,SlateFoundation/slate-admin,SlateFoundation/slate
4bf7538d02d415fd570ba30ffddb3c077de85cc8
src/components/ChatForm.js
src/components/ChatForm.js
import React from 'react/addons'; export class ChatForm extends React.Component { static propTypes = { onSend: React.PropTypes.func.isRequired } constructor(props) { super(props); this.state = {text: ''}; } handleSubmit = (e) => { this.props.onSend(this.state.text)...
import React from 'react/addons'; export class ChatForm extends React.Component { static propTypes = { onSend: React.PropTypes.func.isRequired } constructor(props) { super(props); this.state = {text: ''}; } handleSubmit = (e) => { this.props.onSend(this.state.text)...
Enable send button when user enters text.
Enable send button when user enters text.
JavaScript
mit
zsiciarz/isthisachat,zsiciarz/isthisachat
2d99dc1571c797ce30ee9c50ee51f67cd05ab445
lib/compilers/ispc.js
lib/compilers/ispc.js
var Compile = require('../base-compiler'); function compileISPC(info, env) { var compiler = new Compile(info, env); compiler.optionsForFilter = function (filters, outputFilename) { return ['--emit-asm', '-g', '-o', this.filename(outputFilename)]; }; return compiler.initialise(); } module.expor...
var Compile = require('../base-compiler'); function compileISPC(info, env) { var compiler = new Compile(info, env); compiler.optionsForFilter = function (filters, outputFilename) { return ['--target=sse2-i32x4', '--emit-asm', '-g', '-o', this.filename(outputFilename)]; }; return compiler.initia...
Make ISPC default to SSE2 if no target is specified
Make ISPC default to SSE2 if no target is specified
JavaScript
bsd-2-clause
mattgodbolt/compiler-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,mattgodbolt/gcc-explorer,dkm/gcc-explorer,mattgodbolt/gcc-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,mattgodbolt/gcc-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,mattgodbolt/gcc-explorer,dkm/gcc-explorer,dkm/gcc-explore...
adfdf2b1072c91aaf170de946c1d1a7d4e10a8bf
src/components/videos/VideoPreviewCard.js
src/components/videos/VideoPreviewCard.js
import * as _ from 'lodash' import React from 'react' import {connect} from 'react-redux' import {compose} from 'recompose' import {withDatabaseSubscribe} from '../hocs' import {refreshVideo} from '../../actions/videos' const mapStateToProps = ({videos}) => ({ videos }) const enhance = compose( connect(mapState...
import * as _ from 'lodash' import React from 'react' import {connect} from 'react-redux' import {Link} from 'react-router-dom' import {compose} from 'recompose' import {refreshVideo} from '../../actions/videos' import {withDatabaseSubscribe} from '../hocs' const mapStateToProps = ({videos}) => ({ videos }) const...
Make video card a link
Make video card a link
JavaScript
mit
mg4tv/mg4tv-web,mg4tv/mg4tv-web
951b6a541971bab3dc067fe8510c48ad8d02090d
src/frontend/components/AdminDashboard.js
src/frontend/components/AdminDashboard.js
import React from 'react'; import Relay from 'react-relay'; import {Styles} from 'material-ui'; import MuiThemeProvider from 'material-ui/lib/MuiThemeProvider'; import TopNav from './TopNav'; import {BernieTheme} from './styles/bernie-theme'; import {BernieColors} from './styles/bernie-css'; class AdminDashboard exten...
import React from 'react'; import Relay from 'react-relay'; import {Styles} from 'material-ui'; import MuiThemeProvider from 'material-ui/lib/MuiThemeProvider'; import TopNav from './TopNav'; import {BernieTheme} from './styles/bernie-theme'; import {BernieColors} from './styles/bernie-css'; class AdminDashboard exten...
Add constituent lookup tab, shorten tab labels
Add constituent lookup tab, shorten tab labels
JavaScript
agpl-3.0
Bernie-2016/ground-control,Bernie-2016/ground-control,Bernie-2016/ground-control,Bernie-2016/ground-control
ae3dd65478f5331af46449366eea9873eb82c87a
src/tree/binary-tree-inorder-traversal.js
src/tree/binary-tree-inorder-traversal.js
/** * Given a binary tree, return the inorder traversal of its nodes' values. * * For example: * Given binary tree [1,null,2,3], * 1 * \ * 2 * / * 3 * return [1,3,2]. * * Note: Recursive solution is trivial, could you do it iteratively? */ const inorderTraversal = root => { const res...
/** * Given a binary tree, return the inorder traversal of its nodes' values. * * For example: * Given binary tree [1,null,2,3], * 1 * \ * 2 * / * 3 * return [1,3,2]. * * Note: Recursive solution is trivial, could you do it iteratively? */ const inorderTraversal = root => { const res...
Use iterative way to solve inorder traversal.
Use iterative way to solve inorder traversal.
JavaScript
mit
jeantimex/javascript-problems-and-solutions
f76300ee4c666b1ccf2da1949d9e586dfa228e71
VotingApplication/VotingApplication.Web/Scripts/Directives/TruncatedText.js
VotingApplication/VotingApplication.Web/Scripts/Directives/TruncatedText.js
(function () { 'use strict'; angular .module('GVA.Common') .directive('truncatedText', truncatedText); truncatedText.$inject = ['$parse']; function truncatedText() { function truncateText(text, limit) { var words = text.split(' '); var truncatedtext...
(function () { 'use strict'; angular .module('GVA.Common') .directive('truncatedText', truncatedText); truncatedText.$inject = ['$parse']; function truncatedText() { function truncateText(text, limit) { var words = text.split(' '); var truncatedtext...
Fix for truncated text 'see more' click triggering text click events.
Fix for truncated text 'see more' click triggering text click events.
JavaScript
apache-2.0
stevenhillcox/voting-application,stevenhillcox/voting-application,tpkelly/voting-application,JDawes-ScottLogic/voting-application,Generic-Voting-Application/voting-application,JDawes-ScottLogic/voting-application,Generic-Voting-Application/voting-application,Generic-Voting-Application/voting-application,tpkelly/voting-...
f7517107b23760cfea5f7bd47a2128b3bf309131
static/script.js
static/script.js
var default_opacity = 0.2; var animate_time = 1000; var num_images = 152; function fix_resolutions() { var img = $('#imgloader').get(0); var img_ratio = img.naturalWidth / img.naturalHeight; var wnd_ratio = window.innerWidth / window.innerHeight; $("#back").css("background-size", img_ratio > wnd_ratio ? "auto ...
var default_opacity = 0.2; var animate_time = 0; var default_animate_time = 1000; var num_images = 152; function fix_resolutions() { var img = $('#imgloader').get(0); var img_ratio = img.naturalWidth / img.naturalHeight; var wnd_ratio = window.innerWidth / window.innerHeight; $("#back").css("background-size", ...
Load background faster first time
Load background faster first time
JavaScript
cc0-1.0
gareins/gareins.github.io,gareins/gareins.github.io,gareins/gareins.github.io
1b11e513aa559dc823a48bb68cc8e3e5ddc23242
src/createSanity.js
src/createSanity.js
function createSanity({roles}) { return { getRole(roleName) { return roles[roleName] } } } export default createSanity
function createSanity({roles}) { return { getRole(roleName) { const fulfiller = roles[roleName] if (!fulfiller) { return null } return fulfiller.module.__esModule && fulfiller.module.default ? fulfiller.module.default : fulfiller.module }, getPluginForRole...
Add support for ES5/ES6 module styles in role getter
Add support for ES5/ES6 module styles in role getter
JavaScript
mit
sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity
cd9841b8d9aeb6f79f4d62822f7fcd97333b8476
verify-package-settings.js
verify-package-settings.js
"use strict"; const expect = require('chai').expect const packageSettings = require('./package.json') const Up = require('./' + packageSettings.main) describe('The `main` field in package.json', () => { it('points to the entry point of the library', () => { expect(Up.toHtml('It *actually* worked?')).to.equal(...
"use strict"; const expect = require('chai').expect const packageSettings = require('./package.json') const Up = require('./' + packageSettings.main) describe('The `main` field in package.json', () => { it('points to the entry point of the library', () => { expect(Up.parseAndRender('It *actually* worked?')).t...
Fix reference to previous function name
Fix reference to previous function name
JavaScript
mit
start/up,start/up
e4149c565250b0aba69ab6ff0625fb2d8ae396a6
web/src/main.js
web/src/main.js
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue'; import App from './App'; import router from './router'; Vue.config.productionTip = false; /* eslint-disable no-new */ new Vue({ el: '#app', router, t...
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import VueMaterial from 'vue-material'; import 'vue-material/dist/vue-material.min.css'; import 'vue-material/dist/theme/default-dark.css'; import Vue from 'vue'; import App from...
Configure VuewJS to use Material Design.
Configure VuewJS to use Material Design.
JavaScript
mit
homoluden/fukami,homoluden/fukami,homoluden/fukami
de49cc89e58a48117f94e0c9ec8ad0243620f31c
src/js/components/modal.js
src/js/components/modal.js
import { addClass, addId, button, div, h1, i, p, section, text, ul } from '../builders'; import { $ } from '../helpers'; import modalItem from './modalItem'; export default function modal(store, items = []) { const close = addId(addClass(i(), 'fa', 'fa-times', 'close'), 'close'); const title = addClass(h1(text('Ca...
import { addClass, addId, button, div, h1, i, p, section, text, ul } from '../builders'; import { $ } from '../helpers'; import modalItem from './modalItem'; export default function modal(store) { const close = addId(addClass(i(), 'fa', 'fa-times', 'close'), 'close'); const title = addClass(h1(text('Cart')), 'titl...
Add items to cart UI on ITEM_ADDED
Add items to cart UI on ITEM_ADDED
JavaScript
mit
searsaw/interactive-menu,searsaw/interactive-menu
41ca2ece672fa0837ac9d05f7b1c08b9bb9b9cb6
server/api/controllers/time/index.js
server/api/controllers/time/index.js
'use strict'; function getTimeInList(actions) { actions.reverse(); var duration = []; var listBefore = {}; var listAfter = {}; actions.forEach(function(action) { // get date and listAfter listAfter = { date: action.date, list: action.data.listAfter }; // if isset list before get...
'use strict'; function getTimeInList(actions) { actions.reverse(); var duration = []; var listBefore = {}; var listAfter = {}; var i = 1; actions.forEach(function(action) { var diff = 0; listAfter = { date: action.date, list: action.data.listAfter }; if (listBefore.date) { ...
Add last action time calc.
Add last action time calc.
JavaScript
mit
safv12/trello-metrics,safv12/trello-metrics
e6cbe3a26938ca8d88d44bacc6c40ba09f5f1fd1
plugins/Meteor/meteorupdater.js
plugins/Meteor/meteorupdater.js
// Update the local timeline from a Meteor server // XXX: If @a is subscribed to @b, @a should get @b's notices in @a's Personal timeline. // Do Replies timeline. var MeteorUpdater = function() { return { init: function(server, port, timeline) { Meteor.callbacks["process"] = funct...
// Update the local timeline from a Meteor server // XXX: If @a is subscribed to @b, @a should get @b's notices in @a's Personal timeline. // Do Replies timeline. var MeteorUpdater = function() { return { init: function(server, port, timeline) { Meteor.callbacks["process"] = funct...
Revert "Added a check for any URL param. If found, strips them out before"
Revert "Added a check for any URL param. If found, strips them out before" This reverts commit 13de845e95da9ea579516c4480789819c9a26edd.
JavaScript
agpl-3.0
faulteh/gnu-social,sikevux/bsk-social,studio666/gnu-social,shashi/StatusNet,Piratas/tortuga,zcopley/StatusNet,csarven/statusnet,d3vgru/StatusNet,shashi/StatusNet,faulteh/gnu-social,sikevux/bsk-social,charnimda/lgbtpzn-social,eXcomm/gnu-social,chimo/social,minmb/statusnet,brion/StatusNet,Piratas/tortuga,faulteh/gnu-soci...
b8e352145c9e3662dc0ec8e32944848186494de3
app/assets/javascripts/legislation_admin.js
app/assets/javascripts/legislation_admin.js
(function() { "use strict"; App.LegislationAdmin = { initialize: function() { $(".legislation-process-form").find("[name$='enabled]'],[name$='[published]']").on({ change: function() { var checkbox; checkbox = $(this); checkbox.closest("fieldset").find("input[type='da...
(function() { "use strict"; App.LegislationAdmin = { initialize: function() { $(".legislation-process-form").find("[name$='enabled]'],[name$='[published]']").on({ change: function() { var checkbox; checkbox = $(this); checkbox.closest("fieldset").find("input[type='da...
Use prop() instead of removeAttr()
Use prop() instead of removeAttr() According to the jQuery upgrade guide: > It is almost always a mistake to use .removeAttr("checked") on a DOM > element. The only time it might be useful is if the DOM is later going > to be serialized back to an HTML string. In all other cases, > .prop("checked", false) should be u...
JavaScript
agpl-3.0
consul/consul,consul/consul,consul/consul,consul/consul,consul/consul
cce1850a791b69ef1f71238cb6673fad84b69cfd
indexing/transformations/split-tags.js
indexing/transformations/split-tags.js
'use strict'; const fields = [ 'tags', 'tags_vision' ] module.exports = function(state, metadata) { fields.forEach(field => { if(typeof(metadata[field]) === 'string') { metadata[field] = metadata[field].split(','); } }); return metadata; };
'use strict'; const fields = [ 'tags', 'tags_vision' ] module.exports = function(state, metadata) { fields.forEach(field => { const value = metadata[field]; console.log('value', value); if(typeof(value) === 'string' && value !== '') { metadata[field] = value.split(','); } else { meta...
Split the tags or an empty list if field is empty
Split the tags or an empty list if field is empty
JavaScript
mit
CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder
4685ecda40d8ef471490845f1559282339ef9f4d
src/database/DataTypes/InsuranceProvider.js
src/database/DataTypes/InsuranceProvider.js
import Realm from 'realm'; export class InsuranceProvider extends Realm.Object {} InsuranceProvider.schema = { name: 'InsuranceProvider', primaryKey: 'id', properties: { id: 'string', name: 'string', comment: 'string?', validityDays: 'int', isActive: 'bool', }, }; export default Insurance...
import Realm from 'realm'; export class InsuranceProvider extends Realm.Object {} InsuranceProvider.schema = { name: 'InsuranceProvider', primaryKey: 'id', properties: { id: 'string', name: 'string', comment: 'string?', validityDays: 'int', isActive: 'bool', policies: { type: 'link...
Add use of linking object
Add use of linking object
JavaScript
mit
sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile
0ba4d3dc4c4aecac1cb4f2f5b9e5f78500c298b4
config/webpack/production.js
config/webpack/production.js
process.env.NODE_ENV = process.env.NODE_ENV || 'production' const environment = require('./environment') module.exports = environment.toWebpackConfig()
process.env.NODE_ENV = process.env.NODE_ENV || 'production' const environment = require('./environment') // https://github.com/rails/webpacker/issues/1235 environment.config.optimization.minimizer[0].options.uglifyOptions.ecma = 5; // for IE 11 support environment.config.optimization.minimizer[0].options.uglifyOption...
Fix IE/Safari 10 uglify ecma option
Fix IE/Safari 10 uglify ecma option
JavaScript
agpl-3.0
sgmap/tps,sgmap/tps,sgmap/tps
c3d23f2d46e663f53b2f2bfe8015cabf21651809
packages/tslint/index.js
packages/tslint/index.js
/** * Tslint webpack block. * * @see https://github.com/wbuchwalter/tslint-loader */ module.exports = tslint /** * @param {object} [options] See https://github.com/wbuchwalter/tslint-loader#usage * @return {Function} */ function tslint (options) { options = options || {} const loader = ...
/** * Tslint webpack block. * * @see https://github.com/wbuchwalter/tslint-loader */ module.exports = tslint /** * @param {object} [options] See https://github.com/wbuchwalter/tslint-loader#usage * @return {Function} */ function tslint (options) { options = options || {} const loader = ...
Remove webpack version check in tslint
Remove webpack version check in tslint
JavaScript
mit
andywer/webpack-blocks,andywer/webpack-blocks,andywer/webpack-blocks
8997f57d21a21aaafd036b990ecfd11a6dc5e509
app/assets/javascripts/new_design/toggle_chart.js
app/assets/javascripts/new_design/toggle_chart.js
var TPS = TPS || {}; TPS.toggleChart = function(event, chartClass) { var nextSelectorItem = $(event.target), nextChart = $(chartClass), nextChartId = nextChart.children().first().attr("id"), currentSelectorItem = nextSelectorItem.parent().find(".segmented-control-item-active"), currentChart =...
TPS.toggleChart = function(event, chartClass) { var nextSelectorItem = $(event.target), nextChart = $(chartClass), nextChartId = nextChart.children().first().attr("id"), currentSelectorItem = nextSelectorItem.parent().find(".segmented-control-item-active"), currentChart = nextSelectorItem.pare...
Remove a now useless JS statement
Remove a now useless JS statement This is now done in init.js
JavaScript
agpl-3.0
sgmap/tps,sgmap/tps,sgmap/tps
03ccc7c6cbb66df07580b772acc6a746d73993cd
test-projects/multi-page-test-project/gulpfile.js
test-projects/multi-page-test-project/gulpfile.js
var gulp = require('gulp'); var defs = [ { title: 'Test Index Title', path: '', description: 'Test index description', twitterImage: '20euro.png', openGraphImage: '50euro.png', schemaImage: '100euro.png' }, { path: '/subpage', title: 'Test Subpage Title', description: 'Test s...
var gulp = require('gulp'); var defs = [ { title: 'Test Index Title', path: '', description: 'Test index description', twitterImage: '20euro.png', openGraphImage: '50euro.png', schemaImage: '100euro.png' }, { path: '/subpage', title: 'Test Subpage Title', description: 'Test s...
Set no embed-codes option for multi-page-test-project
Set no embed-codes option for multi-page-test-project
JavaScript
mit
lucified/lucify-component-builder,lucified/lucify-component-builder,lucified/lucify-component-builder
aba2088d590753a9fb74afbfbad19d47198d1b42
assets/js/app/authentication/logout_controller.js
assets/js/app/authentication/logout_controller.js
'use strict'; function LogoutController(AuthService) { AuthService.logout(); } module.exports = LogoutController;
'use strict'; /**@ngInject*/ function LogoutController(AuthService) { AuthService.logout(); } module.exports = LogoutController;
Make sure AuthService is injected
Make sure AuthService is injected
JavaScript
apache-2.0
projectjellyfish/api,boozallen/projectjellyfish,sonejah21/api,projectjellyfish/api,mafernando/api,dcallner/project-jellyfish-api,sreekantch/JellyFish,dcallner/project-jellyfish-api,sreekantch/JellyFish,projectjellyfish/api,adderall/api,mafernando/api,AllenBW/api,stackus/api,normalfaults/ux,AllenBW/api,boozallen/project...