Skip to content

Instantly share code, notes, and snippets.

task :copy_resque_web_assets do
resque_assets = "`bundle show resque`/lib/resque/server/public/*"
resque_release_path = "public/admin/resque"
queue! %{
echo "-----> Copying resque web assets" && (
#{echo_cmd "mkdir -p ./#{resque_release_path}"} &&
#{echo_cmd "cp #{resque_assets} ./#{resque_release_path}" }
)
}
task :link_resque_web_assets do
assets_path = "vendor/bundle/ruby/1.9.1/gems/resque-*/lib/resque/server/public"
resque_release_path = "public/admin/resque"
queue! %{
echo "-----> Linking resque-web assets" && (
#{echo_cmd "mkdir -p ./#{resque_release_path}"} &&
#{echo_cmd "ln -nfs ./#{assets_path}/* ./#{resque_release_path}"}
)
@smoil
smoil / account.rb
Last active March 2, 2020 00:32
Ajax select/multi select in Rails using Select2
class Account < ActiveRecord::Base
def self.search(name = nil)
# search logic
end
end
@smoil
smoil / gist:1383721
Created November 21, 2011 19:51
Ruby Golf Hole #1
def fizzbuzz(n)
n%3<1&&f="Fizz";n%5<1?"#{f}Buzz":f||n.to_s
end