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
smtp: | |
address: smtp.server.com | |
port: 25 | |
user_name: [email protected] | |
password: your_password | |
authentication: plain | |
twitter: | |
user: your_user | |
password: your_password | |
start: 2008-05-10 |
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 Asset < ActiveRecord::Base | |
has_attached_file :local, | |
:styles => { :thumb => "100x100>" } | |
has_attached_file :remote, :styles => { :thumbnail => "100x100>" }, | |
:storage => :s3, :s3_credentials => RAILS_ROOT + "/config/s3.yml", | |
:bucket => "make-up-your-own-test-bucket", :path => ":class/:attachment/:id/:style.:extension" | |
validates_attachment_size :local, :in => 1.byte..10.megabyte | |
validates_attachment_presence :local |
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
module ParameterableFlash #ugly name | |
def self.included(base) | |
base.prepend_before_filter :catch_flash_from_params | |
end | |
def catch_flash_from_params | |
detected_flash_message = false | |
params.each do |key, value| | |
key = key.to_s |
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
/*tumblr css*/ | |
div.regular { | |
background-image: url(http://img187.imageshack.us/img187/6671/picture2ce0.png); | |
} | |
div.link { | |
background-image: url(http://img366.imageshack.us/img366/8091/picture4yf6.png); | |
} | |
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
#to delete posts on tumblr | |
require 'tumblr' #gem ruby-tumblr | |
Tumblr::API.read("bt1.tumblr.com") do |pager| | |
data = pager.page(0) | |
data.posts.each do |article| | |
Net::HTTP.post_form(URI.parse('http://www.tumblr.com/api/delete'), "post-id" => article.postid,:email => '[email protected]', :password => 'tumb3') | |
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
#!/usr/bin/perl -w | |
use Time::HiRes qw(time); | |
use Data::Random::WordList; | |
my $word_list = new Data::Random::WordList(wordlist => '/usr/share/dict/words'); | |
my @targets = $word_list->get_words(5); | |
$start_time = $jam_count = $errors_count = 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
== Install the Developer Tools from the Snow Leopard DVD | |
I mostly follow HiveLogic except for paths. I use the Mac OS X way of setting paths. I also compile everything into it's own folder for easy upgrading. | |
mate /etc/paths | |
[ Add the following to the TOP ] | |
--------------------------------------- | |
~/bin | |
/usr/local/bin | |
/usr/local/ruby/bin |
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 ArticlesController < ApplicationController | |
before_filter :load_temp_upload, :only => ["create", "update"] | |
def update | |
if params[:ajaxupload] | |
if @article.update_attributes(:picture => params[:article][:picture]) | |
render(:text => {:response => 'success', :url => @article.picture.url(:thumb)}.to_json) | |
else | |
render(:text => {:response => 'failure', :message => @article.errors.full_messages.join('\n')}.to_json) | |
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
[core] | |
excludesfile = /Users/roberto/.gitignore | |
editor = vim | |
whitespace = trailing-space,space-before-tab | |
[apply] | |
whitespace = fix | |
[color] | |
ui = true ;doesnt work for some reason ... |
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
# you should use this branch until related pull request has been accepted | |
# https://github.com/blowmage/minitest-rails/pull/19 | |
group :development, :test do | |
gem 'minitest-rails', git: "[email protected]:rawongithub/minitest-rails.git", branch: "gemspec" | |
end | |
group :test do | |
gem 'capybara' | |
gem 'capybara_minitest_spec' | |
gem 'turn' |
OlderNewer