Skip to content

Instantly share code, notes, and snippets.

View harlantwood's full-sized avatar
💭
☀️

Harlan T Wood harlantwood

💭
☀️
View GitHub Profile
@harlantwood
harlantwood / .gitignore
Created October 28, 2009 00:43
bash_profile extensions
custom
@harlantwood
harlantwood / README.md
Created October 31, 2009 23:47
cheatsheets

Usage: in your ~/.bash_profile, include these two lines:

export CHEATS=~/path/to/cheats

. $CHEATS/load

@harlantwood
harlantwood / gist:229859
Created November 9, 2009 10:24
generate random n character strings, encoded in base 64, with completely URL-safe characters
url_safe_64_chars = ( 0..9 ).to_a + ( 'a'..'z' ).to_a + ( 'A'..'Z' ).to_a + %w[ - _ ]
random_hashcodes = 100.times.map{ |i| url_safe_64_chars[ rand * ( 64 + 1 ) ] }.join.scan( /.{10}/ )
# Returns (e.g.) => ["D6sccOU_tN", "jjwXK3_zxd", "395npb8lPg", "uYPpDkyIBE", "PBbiprpK7w", "KihPOuTTEu", "ztW8GAKRuG", "0Abw9T6-CG", "wlrPjnLUHf"]
# More info on base 64 encoding: http://en.wikipedia.org/wiki/Base64

Link the project keymap to the RubyMine dir

# if you have no keymaps already:
rm -rf ~/Library/Preferences/RubyMine[RUBYMINE_VERSION]/keymaps   
ln -s ~/tools/rubymine_keymaps ~/Library/Preferences/RubyMine[RUBYMINE_VERSION]/
git grep Person $(git rev-list --all)
@harlantwood
harlantwood / gist:854300
Created March 4, 2011 07:23
sha512 as 140-character node address
rb(main):057:0> sha512 = Digest::SHA512.hexdigest( "The quick brown fox jumps over the lazy dog" )
=> "07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6"
irb(main):058:0> location = 'nodemap.org/' + sha512
=> "nodemap.org/07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6"
irb(main):059:0> location.size
=> 140
@harlantwood
harlantwood / gist:981912
Created May 19, 2011 22:13
Print out invalid rails models
puts Node.all.map{|m| "#{m.id}: #{m.errors.inspect}" unless m.valid?}.compact
@harlantwood
harlantwood / .gitignore
Last active March 19, 2018 16:08
CoffeeScript->Javascript D3 Force-Directed Layout (Multiple Foci)
.idea
Cakefile.js
tmp/
@harlantwood
harlantwood / .gitignore
Last active September 8, 2018 17:45
CoffeeScript->Javascript D3 Force-Directed Graph
.idea
Cakefile.js
tmp/
@harlantwood
harlantwood / .gitignore
Created July 24, 2011 04:35
WikiNodes Mockup #1 -- Force Directed Graph, Transparency = Rating, Border Color = Category
.idea
Cakefile.js
tmp/