start new:
tmux
start new with session name:
tmux new -s myname
function count_code_booboos() { | |
GIT_DIR=$(git rev-parse --git-dir 2> /dev/null) || return | |
NOTES_PATTERN="FIXME|TODO|MAGIC" | |
NOTES_RES=$(echo $(ack -hi --ignore-dir="venv" --ignore-dir="build" \ | |
"\b$NOTES_PATTERN\b" "$(dirname $GIT_DIR)" 2>/dev/null)) | |
for NM in "FIXME" "MAGIC" "TODO" | |
do | |
num=$(echo $(echo $NOTES_RES | ack -i "\b$NM\b" | wc -l)) | |
if [ $num != 0 ] | |
then |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
// Alerts | |
@include alert-variant($background, $border, $text-color); | |
// Background Variant | |
@include bg-variant($parent, $color); | |
// Border Radius | |
@include border-top-radius($radius); | |
@include border-right-radius($radius); | |
@include border-bottom-radius($radius); |
import geoalchemy2, geoalchemy2.shape | |
import shapely.geometry | |
# Could use geomet rather than pushing this through shapely. | |
class Geometry(geoalchemy2.Geometry): | |
"""Deal in GeoJSON rather than WKB/WKT""" | |
def result_processor(self, dialect, coltype): | |
super_proc = super(Geometry, self).result_processor(dialect, coltype) | |
def process(v): | |
return v and shapely.geometry.mapping( |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
var keys = []; | |
var results = []; | |
var keyCount = 100; | |
var iterations = 10000; | |
//generate keys 0 to <keycount> | |
for (var i=0; i < keyCount; i++) { | |
keys.push(i); | |
results.push({ id: i }) | |
} |
This Gist provides some code examples of how to implement WebSocket stream handling using a Redux middleware. Please be aware that this is only provided as an example and that critical things like exception handling have not been implemented.
A more complete version has been packaged, tested, and is available on GitHub as redux-websocket. This library has also been published to npm at @giantmachines/redux-websocket
.
This module represents the foundation of the middleware and implements the ideas presented above. The exported function is used during the creation of the Redux store (see the following snippet).
This project is a tiny compiler for a very simple language consisting of boolean expression.
The language has two constants: 1
for true and 0
for false, and 4 logic gates:
!
(not), &
(and), |
(or), and ^
(xor).
It can also use parentheses to manage priorities.
Here is its grammar in BNF format:
expr ::= "0" | "1"