Skip to content

Instantly share code, notes, and snippets.

Josh Chernoff joshchernoff

Block or report user

Report or block joshchernoff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yctay
yctay / figaro-capistrano.rb
Created Apr 30, 2013
Capistrano recipe for deploying figaro's application.yml
View figaro-capistrano.rb
namespace :figaro do
desc "SCP transfer figaro configuration to the shared folder"
task :setup do
transfer :up, "config/application.yml", "#{shared_path}/application.yml", :via => :scp
end
desc "Symlink application.yml to the release path"
task :finalize do
run "ln -sf #{shared_path}/application.yml #{release_path}/config/application.yml"
end
@linjunpop
linjunpop / Change-Default-Date-Format-In-Rails.md
Last active Dec 10, 2015
Change default date format in Rails
View Change-Default-Date-Format-In-Rails.md

http://www.ruby-forum.com/topic/57923#47371

ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(
  :default => '%m/%d/%Y'
)
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
  :default => '%m/%d/%Y %I:%M %p',
  :date_time12 => "%m/%d/%Y %I:%M %p",
  :date_time24 => "%m/%d/%Y %H:%M"
@linjunpop
linjunpop / README.md
Created Aug 21, 2012
Rails flash messages with AJAX requests
View README.md
@jjhageman
jjhageman / item_image.rb
Created Jun 3, 2011
Extracting Geolocation Image Data with Carrierwave and RMagick on Heroku
View item_image.rb
class ItemImage < ActiveRecord::Base
belongs_to :item
mount_uploader :image, ImageUploader
before_save :extract_geolocation
def extract_geolocation
img = Magick::Image.read(image)[0] rescue nil
You can’t perform that action at this time.