Skip to content

Instantly share code, notes, and snippets.

View dannydb's full-sized avatar

Danny DeBelius dannydb

View GitHub Profile
irb(main):013:0> open("http://en.wikipedia.org/wiki/Steve_Jobs").read
OpenURI::HTTPError: 403 Forbidden
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:277:in `open_http'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:162:in `catch'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:518:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:30:in `open'
@dannydb
dannydb / ex1.rb
Created September 11, 2012 13:54
Spoof user agent with open-uri
rpage = open(remote_full_url,
"User-Agent" => "Mozilla/5.0 (...) Firefox/3.0.6").read
@dannydb
dannydb / Custom.css
Created December 14, 2012 20:43
Chrome Devtools Monokai Theme
/*
Chrome Developer Tools - Monokai Color Theme
Author: Béres Máté Csaba / bjmatt.com / @bjmatt / beres.mate@bjmatt.com
-----------------------------------------------------------------------------------------------------------
Installation:
1. Find your Chrome's user stylesheet's directory, for example in win7:
"c:\Users\***YOUR USERNAME***\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\"
@dannydb
dannydb / index
Last active December 24, 2015 08:39
<html>
<head>
<title>Open the nytimes app</title>
<meta http-equiv="refresh" content="0;URL=nytimes://" />
<link rel="apple-touch-icon-precomposed" href="http://graphics8.nytimes.com/webapps/skimmer/2.4/images/skmr_256.png"/>
</head>
</html>
@dannydb
dannydb / README.md
Last active December 28, 2015 03:49 — forked from mbostock/.block

A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk.

@dannydb
dannydb / README.md
Last active December 28, 2015 03:58 — forked from mbostock/.block

This variation of a stacked bar chart shows percentages rather than absolute numbers.

Keybase proof

I hereby claim:

  • I am dannydb on github.
  • I am dannydb (https://keybase.io/dannydb) on keybase.
  • I have a public key whose fingerprint is D3FE A983 0152 C28D A6A4 CA87 234D 2E3D 8611 6734

To claim this, I am signing this object:

Working Man
In The End
Bastille Day
2112 Overture
Closer To The Heart
The Trees
The Spirit Of Radio
YYZ
Subdivisions
Distant Early Warning
@dannydb
dannydb / Fine Rotate Left
Created September 5, 2014 13:48
powermate scripts
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) - 5
set size to {newWidth, item 2 of oldSize}
end tell
@dannydb
dannydb / gist:74399d474ed14da3637b
Created March 6, 2015 20:13
Dailygraphics iTerm
tell application "iTerm"
activate
tell the current terminal
activate current session
-- launch dailygraphics tab
launch session "Default Session"
tell the last session
set name to "1-dailygraphics"