This file contains hidden or 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
<%= content_for(:javascript) do %> | |
<%= javascript_tag "save_related_category_src(#{@category.categories.any?})"%> | |
<%- for category in @category.categories do %> | |
<%= javascript_tag "add_new_related_category(#{category.id})" %> | |
<% end %> | |
<% end %> |
This file contains hidden or 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 "config/environment.rb" | |
namespace :carrierwave do | |
task :destroy, :class, :mount_uploader, :version do |task,args| | |
desc "Destroy one image version" | |
eval(args[:class]).all.each do |r| | |
r.instance_eval(args[:mount_uploader].to_sym).instance_eval(args[:version].to_sym).remove! | |
end | |
end |
This file contains hidden or 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
# Drop this file in config/initializers to run your Rails project on Ruby 1.9. | |
# This is three separate monkey patches -- see comments in code below for the source of each. | |
# None of them are original to me, I just put them in one file for easily dropping into my Rails projects. | |
# Also see original sources for pros and cons of each patch. Most notably, the MySQL patch just assumes | |
# that everything in your database is stored as UTF-8. This was true for me, and there's a good chance it's | |
# true for you too, in which case this is a quick, practical solution to get you up and running on Ruby 1.9. | |
# | |
# Andre Lewis 1/2010 | |
# encoding: utf-8 |
This file contains hidden or 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
# Drop this file in config/initializers to run your Rails project on Ruby 1.9. | |
# This is three separate monkey patches -- see comments in code below for the source of each. | |
# None of them are original to me, I just put them in one file for easily dropping into my Rails projects. | |
# Also see original sources for pros and cons of each patch. Most notably, the MySQL patch just assumes | |
# that everything in your database is stored as UTF-8. This was true for me, and there's a good chance it's | |
# true for you too, in which case this is a quick, practical solution to get you up and running on Ruby 1.9. | |
# | |
# Andre Lewis 1/2010 | |
# encoding: utf-8 |
This file contains hidden or 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 WillPaginateHack | |
def self.included(base) | |
base.alias_method_chain :url, :hack | |
end | |
private | |
def url_with_hack(page) | |
if page > 1 | |
url_without_hack(page) | |
else |
This file contains hidden or 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
namespace :backup do | |
task :set_name do | |
set :backup_folder, "/tmp" | |
set :backup_name, "#{application}-#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S')}" | |
set :backup_path, "#{backup_folder}/#{backup_name}" | |
end | |
task :db do | |
yml = YAML.load_file("#{repository}/config/database.yml") |
This file contains hidden or 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
def index | |
client = TwitterOAuth::Client.new( :consumer_key => 'key', :consumer_secret => 'key') | |
if session['token'].blank? | |
session['token'] = client.request_token(:oauth_callback => 'http://127.0.0.1:8000') | |
end | |
request_token = session['token'] | |
if params['oauth_token'].blank? | |
redirect_to request_token.authorize_url |
This file contains hidden or 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
pt-BR: | |
activemodel: | |
attributes: | |
pag_seguro/order: | |
abandon_url: | |
address: Endereço | |
address_city: Cidade | |
address_complement: Complemento | |
address_district: Bairro | |
address_number: Número |
This file contains hidden or 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
# http://blog.philippklaus.de/2011/07/sshfs-on-mac-os-x-10-6-8-with-fuse4x/ | |
# http://www.unityisplural.com/2011/11/getting-fuse4x-installed-on-osx-lion.html | |
xcode-select --switch /Applications/Xcode.app | |
brew install fuse4x sshfs | |
sudo cp -rfX /usr/local/Cellar/fuse4x-kext/0.10.0/Library/Extensions/fuse4x.kext /Library/Extensions | |
sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x |
This file contains hidden or 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
find ./ -type f | grep .DS_Store | xargs rm |
OlderNewer