Skip to content

Instantly share code, notes, and snippets.

/**
Helper function for connecting React components with CSS Modules. The helper lets you
define new React components that just have the right "className" string (and also
the "style" value if you use CSS Variables).
Things that this takes care of:
- Some components will always have certain classNames.
- Some components will conditionally include classNames. (based on props)
### Keybase proof
I hereby claim:
* I am andyfischer on github.
* I am andyfischer (https://keybase.io/andyfischer) on keybase.
* I have a public key whose fingerprint is F58E 81EA 4462 630F C050 724D 7452 A415 A502 F57D
To claim this, I am signing this object:
@andyfischer
andyfischer / stdout
Created January 21, 2014 04:33
Sample code in latest Circa. Will be available in a public release soon
Original y = 15.0
Modified y = 15.05
dY/dX = 5.00002
@andyfischer
andyfischer / output
Created July 3, 2013 18:23
Perils of async and closures
Finished loading 3.txt!
Finished loading 3.txt!
Finished loading 3.txt!
@andyfischer
andyfischer / gist:5783757
Created June 14, 2013 17:31
valgrind is not happy
~/improv $ valgrind --dsymutil=yes build/improv_d
==16719== Memcheck, a memory error detector
==16719== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==16719== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==16719== Command: build/improv_d
==16719==
==16719== WARNING: Support on MacOS 10.8 is experimental and mostly broken.
==16719== WARNING: Expect incorrect results, assertions and crashes.
==16719== WARNING: In particular, Memcheck on 32-bit programs will fail to
==16719== WARNING: detect any errors associated with heap-allocated data.
one = 1
stack = capture_stack()
print('One is ', one)
if context(:you_are_a_clone) == null
stack.inject_context(:you_are_a_clone, true)
stack.set_active_value(term_ref(one), '2')
stack.run