git (private server)
Alternative: github
Cashboard
namespace :tweets do | |
desc 'Send some tweets to a user' | |
task :send, [:username] => [:environment] do |t, args| | |
args.with_defaults(:username => 'cpytel') | |
Tweet.send(args[:username]) | |
end | |
end |
group :guard do | |
gem 'guard', '= 0.8.8' # works with my (old) version of growl | |
gem 'rb-fsevent', :require => false | |
gem 'growl_notify', :require => false | |
gem 'guard-coffeescript' | |
gem 'guard-sass' | |
end |
def reorder | |
redirect_to confirm_order_path and return if params[:reorder] == current_order.id.to_s | |
reorder = current_user.orders.find(params[:reorder]) | |
redirect_to favorites_order_path, :notice => 'The order is no longer available.' and return if reorder.nil? | |
redirect_to favorites_order_path, :notice => 'There are items in your cart. Please cancel your current order before reordering.' and return if (current_order.items.any?) | |
search_result = reorder.next_available_delivery |
query = MyModel.where("id = :id", :id => 21) | |
query = query.merge(MyModel.some_scope) | |
MyModel.connection.select_all(query.to_sql) |
new_order = reorder.xerox | |
new_order.save | |
current_order.destroy | |
current_order = new_order | |
current_order.status = 'open' | |
current_order.favorite = false | |
current_order.created_at = DateTime.now | |
current_order.updated_at = DateTime.now | |
current_order.mealsoft_response = nil | |
current_order.error_message = nil |
# From Dan Watsons Coding Zen | |
# http://www.dotnetguy.co.uk/post/2011/08/23/replace-the-rails-console-with-pry | |
MyApp::Application.configure do | |
silence_warnings do | |
begin | |
require 'pry' | |
IRB = Pry | |
rescue LoadError | |
end |
NOTICE: return type hstore is only a shell | |
NOTICE: argument type hstore is only a shell | |
WARNING: => is deprecated as an operator name | |
DETAIL: This name may be disallowed altogether in future versions of PostgreSQL. | |
NOTICE: return type ghstore is only a shell | |
NOTICE: argument type ghstore is only a shell |
var s=document.createElement('script');s.setAttribute('src', 'http://jquery.com/src/jquery-latest.js');document.getElementsByTagName('body')[0].appendChild(s);$j=jQuery.noConflict(); |
class QueryTracer < ActiveSupport::LogSubscriber | |
ACCEPT = %r{^(app|config|lib)}.freeze | |
FRAMES = 5 | |
THRESHOLD = 300 # In ms | |
def sql(event) | |
return unless event.duration > THRESHOLD | |
callers = Rails. | |
backtrace_cleaner. |