This file contains hidden or 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 hidden or 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
| # Get the drive identifier | |
| # returns something like sata0/0 | |
| $ cfgadm | grep c2t0d0 | |
| sata0/0::dsk/c2t0d0 disk connected configured ok | |
| # Power off | |
| # Pull old drive, replace in same position w/ new drive | |
| # Check that the new drive is configured | |
| $ cfgadm | grep c2t0d | |
| sata0/0::dsk/c2t0d0 disk connected configured ok |
This file contains hidden or 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
| args = require('system').args | |
| if args.length != 3 | |
| console.log 'Usage: phantomjs readernaut-export.coffee user pass > export.csv' | |
| phantom.exit() | |
| user = args[1] | |
| pass = args[2] | |
| loginPage = require('webpage').create() |
This file contains hidden or 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
| #!/usr/bin/ruby | |
| # gif-it | |
| if ARGV.length < 3 | |
| puts "usage: gif-it <filename> <start-time> <duration>" | |
| end | |
| fn = ARGV.shift | |
| start_time = ARGV.shift | |
| duration = ARGV.shift |
This file contains hidden or 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
| [12] pry(main)> class Fixnum | |
| [12] pry(main)* def in(l) | |
| [12] pry(main)* l.include? self | |
| [12] pry(main)* end | |
| [12] pry(main)* end | |
| => nil | |
| [13] pry(main)> 1.in [1,2,3] | |
| => true |
This file contains hidden or 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
| #!/bin/bash | |
| cdparanoia -B | |
| ls | while read fn; do lame $fn; done; | |
| mp3wrap -v album.mp3 *.mp3 | |
| mp3val album_MP3WRAP.mp3 -f -nb | |
| mv album_MP3WRAP.mp3 album.mp3 | |
| cp album.mp3 ~/Dropbox/Public/ |
This file contains hidden or 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
| #!/usr/local/bin/macruby | |
| framework "ScriptingBridge" | |
| safari = SBApplication.applicationWithBundleIdentifier("com.apple.Safari") | |
| safari.windows.each {|window| | |
| window.tabs.each { |tab| | |
| cmd = "open -a '/Applications/Google\ Chrome.app/' #{tab.URL}" | |
| `#{cmd}` | |
| } |
This file contains hidden or 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
| # returns seconds till next tuesday @ noon - 5 minutes | |
| exports.reckonTimeoutValue = ()-> | |
| # num days till next tuesday | |
| tuesOffset = | |
| 2 : 7 | |
| 3 : 6 | |
| 4 : 5 | |
| 5 : 4 | |
| 6 : 3 |
This file contains hidden or 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
| // I have some code that needs to use the following | |
| // construct repeatedly | |
| for(i=0;i<classes.length;i++){ | |
| var c = classes[i]; | |
| for(j=0;j<centers.length;j++){ | |
| var k = centers[k]; | |
| // do something with [c,k], like, | |
| // demand[[c,k]] = expression; |
This file contains hidden or 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
| # Bulk add a bunch of urls to your Instapaper account | |
| $ for link in `cat links.txt`; do curl --basic --user username:password --data url=$link http://www.instapaper.com/api/add; done |