git diff --no-prefix > [path file name]
patch -p0 < [path file name]
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then | |
// use window.btoa' step. According to my tests, this appears to be a faster approach: | |
// http://jsperf.com/encoding-xhr-image-data/5 | |
/* | |
MIT LICENSE | |
Copyright 2011 Jon Leighton | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
/** | |
* Type-level Tower of Hanoi | |
* by Travis Brown | |
* | |
* Note: not optimal, and probably won't work for some valid inputs. | |
* Tested with Scala 2.9.2 and Shapeless 1.2.3. | |
*/ | |
import shapeless._, Nat._ |
git stash show -p stash@{0} > Stash0.patch |
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/sh | |
# | |
# This pre-commit hook looks for `fdescribe`, `fcontext`, `fit`, `fspecify` and `fexample` in the | |
# staged files and exits with an error code of 1 if there are such changes. | |
# | |
STATUS=0 | |
DESCRIBEFILES=$(git diff --staged -G"^\s*fdescribe\(" --name-only | wc -l) | |
if [ $DESCRIBEFILES -gt 0 ] |
Movement: | |
j, k down, up | |
h, l left, right (in some contexts) | |
space page down | |
pg up/down page up/down | |
arrows up, down, left, right |
<!doctype html> | |
<html><head><script src="app.js"></script></head><body></body></html> |