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
# Use builtin Image Events app in Mac OS X to resize images with Ruby | |
# Usage: | |
# require 'image_resizer' | |
# class Foo | |
# include ImageResizer | |
# def some_method | |
# resize('/absolute/path/to/an/image.jpg') | |
# resize('/absolute/path/to/an/image.jpg', :target_width => 500) | |
# 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
require 'hpricot' | |
require 'open-uri' | |
class AmazonMp3Music | |
ASSOCIATE_ID = 'enjoybeing-20' | |
AMAZON_INJECTED_STRINGS = [' (Amazon Exclusive)', ' [Explicit]'] | |
attr_accessor :asin, :artist, :album, :album_image, :referral_url, :processed | |
def initialize(url) | |
@url = url |
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
#!/usr/bin/env ruby | |
# The script that give you focus! | |
# Create a text file that contains sites you only want to give yourself | |
# access to during certain times of day. | |
# The file will look like this: | |
# 12 news.ycombinator.com | |
# 11-13,19-21 twitter.com | |
# | |
# In this case, I can visit hacker news only over the lunch hour, |
NewerOlder