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
import subprocess | |
from urlparse import urlparse | |
from pngquant import tiny | |
def webkit2png(name, site): | |
subprocess.call(['webkit2png', '-F', '-W', '1440', '-D', 'screenshots', '-o', name, site]) | |
sites = [] | |
for site in sites: |
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
{ | |
"id": 4567, | |
"date": "2010-10-04", | |
"title": "Christian Hedonism", | |
"description": "short description", | |
"type": "sermon", // sermon, article, book | |
"format": "audio", // audio, video, text | |
"file_url": "http://aws.amazon.com/john_piper/sermons/2010-10-04.mp3", | |
"tag_ids": [234, 456, 678], | |
"bookmarks": [ |
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
(0..6).each do |i| | |
day = Date.today.next_week + i | |
it "should have emails with send_at on weekdays when started on #{day.strftime('%A')}" do | |
Timecop.freeze(day) do | |
p Date.today | |
end | |
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
Finished in 0.05004 seconds | |
3 examples, 1 failure | |
1) PagesController GET 'about' should be successful | |
Failure/Error: get 'about' | |
No route matches {:controller=>"pages", :action=>"about"} | |
# /Users/taylorbrooks/.rvm/gems/ruby-1.8.7-p174/gems/actionpack-3.0.0.rc/lib/action_dispatch/routing/route_set.rb:407:in `generate' | |
# /Users/taylorbrooks/.rvm/gems/ruby-1.8.7-p174/gems/actionpack-3.0.0.rc/lib/action_dispatch/routing/route_set.rb:450:in `generate' | |
# /Users/taylorbrooks/.rvm/gems/ruby-1.8.7-p174/gems/actionpack-3.0.0.rc/lib/action_dispatch/routing/route_set.rb:446:in `generate_extras' | |
# /Users/taylorbrooks/.rvm/gems/ruby-1.8.7-p174/gems/actionpack-3.0.0.rc/lib/action_dispatch/routing/route_set.rb:442:in `extra_keys' |
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 'spec_helper' | |
describe PagesController do | |
render_views | |
describe "GET 'home'" do | |
it "should be successful" do | |
get 'home' | |
response.should be_success | |
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
SampleApp::Application.routes.draw do |map| | |
match "/home" => "pages#home" | |
match "/contact" => "pages#contact" | |
match "/about" => "pages#about" | |
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 'rubygems' | |
begin | |
gem 'i18n', "~> 0.4.0" | |
rescue LoadError | |
# no biggie, optional anyway | |
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
~/Documents/speakerwiki[taylor]$ rake ts:config | |
(in /Users/taylorbrooks/Documents/speakerwiki) | |
Sphinx cannot be found on your system. You may need to configure the following | |
settings in your config/sphinx.yml file: | |
* bin_path | |
* searchd_binary_name | |
* indexer_binary_name | |
For more information, read the documentation: |
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
alias rs="rails s" | |
alias rc="rails c" | |
alias gco="git checkout" | |
alias gpl="git pull" | |
alias gps="git push" | |
alias gcm="git commit -a -m" | |
alias cdup="cd ~/Documents/Upstream" | |
alias cdra="cd ~/Documents/Rails" | |
alias cdpow="cd ~/.pow" | |
alias start_redis="cd /usr/local/Cellar/redis/2.2.12/bin && ./redis-server" |
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 'rubygems' | |
require 'csv' | |
require 'json' | |
require 'net/http' | |
def scrape(username, tag) | |
url = "http://www.delicious.com/v2/json/#{username}/#{tag}?count=1000" | |
resp = Net::HTTP.get_response(URI.parse(url)) | |
data = resp.body |
OlderNewer