Skip to content

Instantly share code, notes, and snippets.

View taylorbrooks's full-sized avatar

Taylor Brooks taylorbrooks

  • Simple
  • Austin, TX
View GitHub Profile
@taylorbrooks
taylorbrooks / screenshot.py
Last active August 29, 2015 14:02
Screenshots
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:
{
"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": [
(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
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'
require 'spec_helper'
describe PagesController do
render_views
describe "GET 'home'" do
it "should be successful" do
get 'home'
response.should be_success
end
SampleApp::Application.routes.draw do |map|
match "/home" => "pages#home"
match "/contact" => "pages#contact"
match "/about" => "pages#about"
@taylorbrooks
taylorbrooks / gist:741375
Created December 14, 2010 23:55
config/preinitializer.rb
require 'rubygems'
begin
gem 'i18n', "~> 0.4.0"
rescue LoadError
# no biggie, optional anyway
end
~/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:
@taylorbrooks
taylorbrooks / .bash_profile
Created September 16, 2011 20:21
Bash Profile
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"
@taylorbrooks
taylorbrooks / DeliciousScraper.rb
Created April 12, 2012 07:21
Scrape a Delicious Feed and Save the data to a CSV
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