- http://railscasts.com/episodes/53-handling-exceptions-revised?view=asciicast
- http://code.tutsplus.com/articles/writing-robust-web-applications-the-lost-art-of-exception-handling--net-36395
- http://blog.siami.fr/diving-in-rails-exceptions-handling
- http://rubyjunky.com/never-check-for-an-error-you-dont-know-how-to-handle.html
- http://www.railsonmaui.com/blog/2013/05/08/strategies-for-rails-logging-and-error-handling/
- http://www.monkeyandcrow.com/blog/reading_rails_handling_exceptions/
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
| awful.key({ }, "XF86AudioPlay", function () awful.util.spawn_with_shell("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause") end), | |
| awful.key({ }, "XF86AudioNext", function () awful.util.spawn_with_shell("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next") end), | |
| awful.key({ }, "XF86AudioPrev", function () awful.util.spawn_with_shell("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous") 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
| (let* | |
| ((fish-path (shell-command-to-string "/opt/homebrew/bin/fish -i -c \"echo -n \\$PATH[1]; for val in \\$PATH[2..-1];echo -n \\\":\\$val\\\";end\"")) | |
| (full-path (append exec-path (split-string fish-path ":")))) | |
| (setenv "PATH" fish-path) | |
| (setq exec-path full-path)) |
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
| function! s:AddFocusTag() | |
| call s:Preserve("normal! ^ / do\<cr>C, focus: true do\<esc>") | |
| endfunction | |
| function! s:RemoveAllFocusTags() | |
| call s:Preserve("%s/, focus: true//e") | |
| endfunction | |
| command! -nargs=0 AddFocusTag call s:AddFocusTag() | |
| command! -nargs=0 RemoveAllFocusTags call s:RemoveAllFocusTags() |
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
| ## | |
| # Fazendo deploy com o capistrano de uma aplicação Rails | |
| # usando servidores da Amazon ec2 e unicorn como servidor | |
| # o versionamento do ruby no ambiente de produção foi feito | |
| # com o rbenv ( https://github.com/sstephenson/rbenv ), o SO | |
| # esta com o Centos 5.3 x64 | |
| # | |
| # Primeiramente é necessario instalar a gem com o comando: | |
| # gem install capistrano | |
| # ou adicione a linha: gem "capistrano", :group => :development |
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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
| # rbenv | |
| export PATH="$HOME/.rbenv/bin:$PATH" | |
| eval "$(rbenv init -)" | |
| source ~/.rbenv/completions/rbenv.bash | |
| # prompt with ruby version | |
| # rbenv version | sed -e 's/ .*//' | |
| __rbenv_ps1 () | |
| { | |
| rbenv_ruby_version=`rbenv version | sed -e 's/ .*//'` |
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
| <% [:notice, :error, :alert].each do |level| %> | |
| <% unless flash[level].blank? %> | |
| <div class="alert-message <%= flash_class(level) %>"> | |
| <a class="close" href="#">×</a> | |
| <%= content_tag :p, flash[level] %> | |
| </div> | |
| <% end %> | |
| <% end %> |