To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
#!/bin/sh | |
# | |
# Too many crusty old git branches? Run this to find likely candidates for deletion | |
# It lists all the remote branches and sorts them by age. | |
# | |
# Folks at pivotal shared this with me | |
# | |
#$ . show-remote-branch-info.sh | |
# 2012-05-04 09:42:29 -0700 4 minutes ago Ted & Bill \torigin/hey_Bill |
To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
module BeforeMethodHook | |
def before(*names) | |
names.each do |name| | |
m = instance_method(name) | |
define_method(name) do |*args, &block| | |
yield self | |
m.bind(self).call(*args, &block) | |
end | |
end | |
end |
This is an example of creating a PNG from an SVG. (You should notice that you're able to right click on the last image and save it as a PNG image.) It has been Tested in Firefox and Chrome but doesn't work in Safari as of 2014-07-20.
Normally, you'll create your SVG in D3 but to make the example a bit more readable, the SVG is already placed in the document. There are a few important points. Namely:
<defs>
tags. (These styles should be escaped using the <![[CDATA[ ... ]]
tag.)Note: Portions of this demo where taken from The New York Times' excellent Crowbar SVG extractor.
/* fast floating point exp function | |
* must initialize table with buildexptable before using | |
Based on | |
A Fast, Compact Approximation of the Exponential Function | |
Nicol N. Schraudolph 1999 | |
Adapted to single precision to improve speed and added adjustment table to improve accuracy. | |
Alrecenk 2014 |
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |