This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires the 't' twitter gem | |
t timeline -n 1000 grimkim | \ # get the last 1k | |
grep -o 'http://.*' | \ # grab urls | |
cut -d " " -f 1 | \ # split | |
while read url; do | |
# resolve each stupid t.co url | |
curl -s -I $url | grep Location | cut -d " " -f 2 ; | |
done | grep bandcamp # filter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'blankslate' | |
class Proc | |
def self.comp(f, g) | |
lambda { |*args| f[g[*args]] } | |
end | |
def *(g) | |
Proc.comp(self, g) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e = loop | |
e # => #<Enumerator: main:loop> | |
e.next # => nil | |
e.next # => nil | |
e.peek # => nil | |
e.size # => Infinity | |
e.rewind | |
e.next # => nil |