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
# Stupid dirty trick to return a HTTP status code 500 when testing a Rails app | |
class ApplicationController < ActionController::Base | |
if Rails.env == 'test' | |
rescue_from 'ActionView::TemplateError' do |exception| | |
render :text => exception, :status => 500 | |
end | |
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
1.9.2@opera changa:~/webdev/projets/opera/code develop! $ ruby-prof -m 1 /home/drr/.rvm/gems/ruby-1.9.2-p136@opera/bin/rspec spec | |
No examples were matched by {:focus=>true}, running all | |
..................................**.... | |
Pending: | |
Article add some examples to (or delete) /home/drr/webdev/projets/opera/code/spec/models/article_spec.rb | |
# Not Yet Implemented | |
# ./spec/models/article_spec.rb:4 | |
ArticlesHelper add some examples to (or delete) /home/drr/webdev/projets/opera/code/spec/helpers/articles_helper_spec.rb | |
# Not Yet Implemented |
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
# ~/.Xdefaults | |
# Shamelessly stolen from https://github.com/tpope/tpope/blob/master/.Xresources | |
# and http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod | |
# This will automatically put "+line_number file_name" in the clipboard when clicking on a Ruby backtrace | |
URxvt.perl-lib: /usr/lib64/urxvt/perl # YMMV | |
URxvt.perl-ext-common: default,selection-autotransform,selection-pastebin,remote-clipboard | |
URxvt.selection-autotransform.0: if(/\\n\\[?\\d\\d(\\d\\d-|:)\\d\\d/) { s{^\\[?[\\d:_-]+\\]? +}{}; s/\\s*\\n\\[?[\\d:_-]{5,}\\]? +/ || /g; s/^\\s+/ /mg; s/( ?) \*\\n( ?)/($1||$2)/eg; s{ $}{}; }; |
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
# .vimrc | |
" Add default utf-8 encoding to ruby files | |
:autocmd BufNewFile *.rb,*.rake 0r ~/.vim/skeletons/skeleton.rb | |
$ cat ~/.vim/skeletons/skeleton.rb | |
# encoding: utf-8 | |
$ |
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
/home/drr/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:553:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension ext/jasmine-webkit-specrunner/extconf.rb. (#<ArgumentError: invalid byte sequence in UTF-8>) (Gem::Installer::ExtensionBuildError) | |
/home/drr/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:20:in `gsub' | |
/home/drr/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:20:in `make' | |
/home/drr/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/ext/ext_conf_builder.rb:18:in `build' | |
/home/drr/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:532:in `block (2 levels) in build_extensions' | |
/home/drr/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:531:in `chdir' | |
/home/drr/.rvm/rubies/ruby-1.9.2-p180-patched/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:531:in `block in build_extensions' | |
/ |
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
1.9.2@global|drr@drr-x201:~/.rvm/gems/ruby-1.9.2-p180-patched@ftv/gems/jasmine-headless-webkit-0.7.1 $ ldd ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner | |
linux-vdso.so.1 => (0x00007ffff97ff000) | |
libQtWebKit.so.4 => /usr/lib/libQtWebKit.so.4 (0x00007fcf562f5000) | |
libQtGui.so.4 => /usr/lib/libQtGui.so.4 (0x00007fcf55615000) | |
libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0x00007fcf552d4000) | |
libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x00007fcf54e2f000) | |
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fcf54c13000) | |
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcf54908000) | |
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcf54686000) | |
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcf54470000) |
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
# vim: se ft=ruby : | |
# https://github.com/carlhuda/bundler/issues/183#issuecomment-1149953 | |
if defined?(::Bundler) || File.exists?('Gemfile') | |
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first | |
if global_gemset | |
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*") | |
all_global_gem_paths.each do |p| | |
gem_path = "#{p}/lib" | |
$LOAD_PATH << gem_path |
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
# vim: se ft=gitconfig : | |
[diff] | |
color = true | |
[alias] | |
; shortcuts | |
st = status | |
a = add | |
ap = add -p |
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
# vim: se ft=ruby : | |
# ${HOME}/.pryrc | |
# https://github.com/carlhuda/bundler/issues/183#issuecomment-1149953 | |
if defined?(::Bundler) || File.exists?('Gemfile') | |
global_gemset = ENV['GEM_PATH'].split(':').grep(%r{ruby.*@global|gemsets/global}).first | |
if global_gemset | |
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*") | |
all_global_gem_paths.each do |p| |
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
-- Taken from http://wiki.postgresql.org/wiki/Lock_Monitoring | |
-- (PostgreSQL < 9.2 version) | |
SELECT bl.pid AS blocked_pid, | |
a.usename AS blocked_user, | |
ka.current_query AS blocking_statement, | |
now() - ka.query_start AS blocking_duration, | |
kl.pid AS blocking_pid, | |
ka.usename AS blocking_user, | |
a.current_query AS blocked_statement, | |
now() - a.query_start AS blocked_duration |
OlderNewer