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 ActiveStorage | |
class Attached | |
def perform_attachment(attachables) | |
return yield unless record.class.respond_to?(:attachment_callbacks) | |
callbacks = record.class.attachment_callbacks[name.to_sym] | |
return yield unless callbacks | |
[callbacks[:before]].flatten.each { |cb| record.send(cb, self, [attachables].flatten) if cb } | |
yield | |
[callbacks[:after]].flatten.each { |cb| record.send(cb, self, [attachables].flatten) if cb } | |
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
set :assets_roles, :assets | |
after :compile_assets, :copy_manifest | |
task :copy_manifest do | |
on roles(:assets) do | |
within(shared_path) do | |
set(:manifest_path, capture(:ls, '-t', 'public/assets/.sprockets-*.json', '|', 'head', '-n1')) | |
set(:manifest_filename, fetch(:manifest_path).split('/').last) | |
download!(fetch(:manifest_path), "tmp/#{fetch(:manifest_filename)}") |
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
after "deploy:assets:precompile", "download_asset_manifest" | |
after "download_asset_manifest", "upload_asset_manifest" | |
desc "Download the compiled asset manifest .json file" | |
task :download_asset_manifest, roles: :admin do | |
set(:manifest_json, capture("ls #{ release_path }/public/assets/manifest*json").strip.split("/").last) | |
download "#{ release_path }/public/assets/#{ manifest_json }", "/tmp/#{ manifest_json }" | |
end | |
desc "Upload the asset manifest file" |
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
Keats once bought a small pub in London and one day he was visited by Dr Watson, confrère of the famous Baker Street sleuth. Watson came late in the evening accompanied by a friend and the pair of them took to hard drinking in the back snug. When closing time came, Keats shouted out the usual slogans of urgent valediction such as 'Time now please!', 'Time gents!', 'The Licence gents!', 'Fresh air now gents!' and "Come now all together!' But Dr Watson and his friend took no notice. Eventually Keats put his head into the snug and roared 'Come on now gents, have yez no Holmes to go to!' | |
The two topers then left in that lofty vehicle, highdudgeon. | |
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
DUBLIN MADE ME | |
Dublin made me and no little town | |
With the country closing in on its streets | |
The cattle walking proudly on its pavements | |
The jobbers, the gombeenmen and the cheats | |
Devouring the fair-day between them | |
A public house to half a hundred men | |
And the teacher, the solicitor and the bank-clerk |
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
rm -rf /Volumes/Kindle/system/.assets/ | |
touch /Volumes/Kindle/system/.assets |
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
Bens-MacBook-Air:phorent benwalsh$ ps auxw | grep unicorn | |
root 9326 0.0 0.1 2482260 5724 ?? S 2:09PM 0:00.01 unicorn_rails master -p 81 -D | |
benwalsh 9358 0.0 0.0 2432768 592 s000 R+ 2:12PM 0:00.00 grep unicorn | |
root 9327 0.0 1.6 2561432 131228 ?? S 2:09PM 0:06.49 unicorn_rails worker[0] -p 81 -D |
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
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.singular 'BillingAddress', 'BillingAddress' | |
inflect.plural 'billing_address', 'billing_addresses' | |
inflect.singular 'billing_addresses', 'billing_address' | |
inflect.singular 'billing_address', 'billing_address' | |
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
rvmsudo passenger stop -p 81 | |
rvmsudo passenger start -p 81 --user=username |