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
var DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
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
Note: UK People start here: http://twitter.com/timmeh/status/1351833678 | |
HOW TO ENABLE TETHERING ON YOUR 3.0 iPHONE | |
Step 1: Check if you own a 3G iPhone. If you're on EDGE (as I am): sorry. Tethering does not seem to work with EDGE phones. | |
Step 2: Check to see if AT&T is your carrier. If it is: sorry. AT&T will not let you tether. | |
Step 3: Navigate to ~/Library/iTunes/iPhone Carrier Support. Notice the spaces in that last folder name! If you're at the command line, use backslashes to escape the spaces, i.e. cd ~/Library/iTunes/iPhone\ Carrier\ Support. You will find a file with an ipcc extension. Copy that file: e.g. cp foo.ipcc foo.ipcc.original. This creates a backup for when you mess up. | |
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
class Robot | |
def self.rock! | |
system(%(osascript -e 'tell application "iTunes" to play track named "Robot Rock"')) | |
end | |
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
# ve a class that delegates functionality to a couple of objects that it | |
# constructs. I want to test this in isolation. I want to make sure that the | |
# objects are constructed with the right arguments. I also want to make sure | |
# that the results from the objects are handled correctly. | |
# | |
# I'm finding it hard to structure the code and test in a way that isn't | |
# cumbersome. What's below works, but it feels like a lot of stubbing and setup | |
# for something the should be simpler. | |
# | |
# Anyone got a better approach for this? |