Skip to content

Instantly share code, notes, and snippets.

lost in the woods

Tim Branyen tbranyen

lost in the woods
Block or report user

Report or block tbranyen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tbranyen / hooks-theme-and-refs.js
Last active Jun 5, 2017
HRT: Hooks, theme, and refs! Consistent re-usable component schema.
View hooks-theme-and-refs.js
import React, { Component, PropTypes } from 'react';
import htr from 'hooks-theme-refs';
export class Chip extends Component {
render() {
const { label, hooks, theme, refs, children, } = htr(this);
return (
<div {} className={theme.chip} onClick={hooks.onClick} ref={refs.chip}>
javivelasco /
Last active Jul 24, 2019
Proposal for lightning talk at Reactive Conf 2016

Please star ⭐️ the gist to help! This is a proposal for a ⚡️ talk at Reactive Conference.

Styling Components in React Toolbox 2

I wrote react-toolbox and presented it almost a year ago in lighning talk at Reactive Conf 2015 in Bratislava. At first it was just a proof of concept of a component library styled with CSS Modules and SASS. Now the project has grown quite a bit, and during this year there has been tons of changes and lessons learned.

Theming and customization is one of the most difficult and interesting problems to solve. For the first version we needed a custom Webpack loader to generate themes and doing simple style overrides was very painful. Today I'm working on a new playground that will allow you try CSS Modules live, and to create React Toolbox themes on the f

lawnsea /
Last active Dec 16, 2018
A discussion of the challenges I anticipate we will face creating a widely useful system based on a virtual DOM running in a web worker

I have been watching the current discussions about running a virtual DOM in a web worker with a great deal of interest. In 2011, I built a research project, [Treehouse][] ([USENIX Talk][] ([DOMTRIS][] demo at 20:25), [paper][]), which ran a hacked-up version of jsdom in a worker. My goal was fine-grained containment of untrusted scripts, while still providing access to browser APIs that existing code expected.

Treehouse achieved a small amount of influence in academic circles, but it had problems and was ultimately unsuccessful. Virtual DOMs were not a widespread or well-understood idea at the time, so the advantages of running one in a worker

View browserify_for_webpack_users.markdown

browserify for webpack users

There's been a strange explosion in misinformation about browserify recently, particularly in comparisons to webpack.

Generally speaking, most of this confusion stems from how webpack is more willing to pull features into its core to ease discoverability while browserify is more likely to push features out to userland instead.

I think that longer-term, separability has more benefits from a maintenance and

chrisdickinson /
Last active Dec 26, 2015
examples of how to use my various js-git repos


make sure to clone this gist! then npm install it then run node example.js

if it doesn't work ping me on twitter (@isntitvacant) or irc (chrisdickinson in #pdxnode on

jrburke / build.js
Last active Dec 22, 2015
Building a file with external dependencies that could be from AMD, node, or globals.
View build.js
//run in node to do the build
var requirejs = require('requirejs'),
fs = require('fs'),
depsRegExp = /\/\*DEPENDENCIES\*\//,
globalMapRegExp = /\/\*GLOBALMAP\*\//,
shimmer = fs.readFileSync('shimmer.js', 'utf8'),
wrapStart = fs.readFileSync('wrap.start', 'utf8');
// You could generate these with code if you want a dynamic build script
eliperelman / BarnDoorTracker.ino
Created Oct 24, 2012
Barn Door Tracker - Arduino
View BarnDoorTracker.ino
#include <AFMotor.h>
const float rpm = 6.999999;
const int stepsPerRevolution = 200;
const int shieldPort = 1;
AF_Stepper motor(stepsPerRevolution, shieldPort);
void setup() {
// set up Serial library at 9600 bps
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

tbranyen / canvas.js
Created Feb 2, 2012
Lightweight canvas wrapper.
View canvas.js
// Basic Usage:
// var main = new Canvas({ elem: "canvas" }, function(options) {
// // Instantiate anything specific here...
// // Main draw loop
// this.draw = function() {
// };
// });
jamiew / google_twunter_lol
Created Jul 28, 2011
All the dirty words from Google's "what do you love" project:
View google_twunter_lol
You can’t perform that action at this time.