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
rake --trace | |
(in /Users/jpinnix/.vim) | |
** Invoke default (first_time) | |
** Invoke ack.vim (first_time) | |
** Execute ack.vim | |
**************************************** | |
* Installing ack.vim * | |
**************************************** |
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
App details: | |
Rails 3.0.0 | |
Bundler 1.0 | |
http://github.com/challengepost/postmark-rails (fork for Rails 3) | |
Ran bundle install, everything installed correctly. Checked in Gemfile.lock and | |
added 'require "bundler/capistrano"' to deploy.rb. Works totally fine on local. | |
But on deploy it locks up when trying to init submodules: | |
No submodule mapping found in .gitmodules for path |
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
# Help nginx+passenger serve static index pages | |
# Site specific config | |
server { | |
listen 80; | |
server_name domain.com; | |
index index.html; | |
access_log logs/appname.access.log; | |
error_log logs/appname.error.log; |
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 Image < ActiveRecord::Base | |
before_create, :set_width_and_height | |
has_attached_file :img, | |
:url => "/system/images/:attachment/:id/:basename.:extension", | |
:path => "#{Rails.root}/public/system/images/:attachment/:id/:basename.:extension" | |
def set_width_and_height | |
# this next line is the magic line | |
geo = Paperclip::Geometry.from_file(img.to_file(:original)) |
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
#lib/tasks/download_twitter_feed.rake | |
desc "Download Twitter Feed" | |
task :download_twitter_feed do | |
require 'open-uri' | |
etag_cache = open( "#{RAILS_ROOT}/public/system/etag_cache.txt" ).read | |
begin |
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
<theme> | |
<!-- Window Style --> | |
<color id="foreground" red="1.0" green="0.776" blue="0.427" alpha="1.0" /> | |
<color id="background" red="0.255" green="0.255" blue="0.255" alpha="1.0" /> | |
<window foregroundColorID="foreground" backgroundColorID="background" shouldUseHUDScrollers="no" /> | |
<!-- Text View Style --> | |
<color id="tag" red="0.800" green="0.471" blue="0.200" alpha="1.0" /> | |
<color id="handle" extendsColorID="foreground" /> | |
<color id="insertionPoint" red="1.0" green="1.0" blue="1.0" alpha="1.0" /> |
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
// JQuery - Make all external links open in new tab/window | |
// Mashup of: | |
// http://travisroberts.tumblr.com/post/595428703/jquery-external-links-open-new-window | |
// http://snipplr.com/view.php?codeview&id=29949 | |
$(document).ready(function() { | |
$("a[href*='http://']:not([href*='"+location.hostname+"'])").click( function() { | |
window.open( $(this).attr('href') ); | |
return false; | |
}); |
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
formatted_time_accessor :occurs_at, :occurs_until |
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
# Lo-fi client for the Facebook API. E.g.: | |
# | |
# fb = FacebookClient.new(:api_key => 'api-key', :secret => 'secret') | |
# fb.call 'users.getInfo', :session_key => 'session-key', :uids => 'user-id', :fields => 'birthday' | |
# | |
class FacebookClient | |
def initialize(default_params={}) | |
@default_params = default_params.reverse_merge({ | |
:rest_server => 'http://api.new.facebook.com/restserver.php', | |
:format => 'JSON', |
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
# Back up your iTunes library to S3 | |
git clone git://github.com/sstephenson/mackerel.git | |
ruby -rubygems mackerel/examples/itunes_backup.rb amazon-s3://YOUR_ACCESS_KEY_ID:YOUR_SECRET_ACCESS_KEY@s3.amazonaws.com/YOUR_BUCKET_NAME/itunes.mackerel |