Skip to content

Instantly share code, notes, and snippets.

View johanneslumpe's full-sized avatar

Johannes Lumpe johanneslumpe

View GitHub Profile

I would like to propose a lightning talk for the Reactive Conference demonstrating how you can interact with Arduino and/or Raspberry Pi GPIO's using React Native.

Here's is an example video where fellow speaker Brent Vatne controls my arduino device remotely using a sample react native app that can be found here

Thank you, @christopherdro

@tappleby
tappleby / 0_example.js
Created August 10, 2015 01:22
redux request middleware using superagent and es6 promises.
import { createStore, applyMiddleware, compose } from 'redux';
import request from 'superagent-es6-promise';
import thunkMiddlware from 'redux-thunk';
import promiseMiddleware from 'redux-promise';
import logMiddleware from './middleware/log';
import requestMiddleware from './middleware/request';
// Create request middleware with our execute logic, return promise.
const executeRequestMiddleware = requestMiddleware((req, getState) => {
const { session: { token } } = getState();
var Bar1 = base => class extends base {
componentWillMount(){
super.componentWillMount();
console.log('Bar1');
}
};
var Bar2 = base => class extends base {
componentWillMount(){
super.componentWillMount();
@gaearon
gaearon / observeStore.js
Last active May 19, 2022 10:55
Wait for some condition to become true on a Flux store, useful for react-router async transition hooks
// Usage example:
//
// willTransitionTo(transition, params, query, callback) {
// observeStore(DraftStore, s => s.isLoaded()).then(() => {
// if (DraftStore.isMissingTitle()) {
// transition.redirect('composeDraft', params);
// }
// }).finally(callback);
// }
@vermilion1
vermilion1 / gist:5525972
Last active December 17, 2015 01:09
Override Marionette route to have ability to pass different controllers to the single router
Marionette.AppRouter.prototype.processAppRoutes = function(controller, appRoutes) {
var routeNames = _.keys(appRoutes).reverse(); // Backbone requires reverted order of routes
_.each(routeNames, function(route) {
var methodName = appRoutes[route];
var params = methodName.split('#');
var ctrl = controller;
var method;
if (params.length > 1) {
@michaelcox
michaelcox / SpecRunner.js
Last active January 11, 2024 06:05
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'