Skip to content

Instantly share code, notes, and snippets.

View PragTob's full-sized avatar
💔
Close friend just died. Limited availability.

Tobias Pfeiffer PragTob

💔
Close friend just died. Limited availability.
View GitHub Profile
@PragTob
PragTob / console_console_log
Created March 19, 2013 20:12
Rails Girls Berlin Project group Thursdays tryruby console log
Interactive ruby ready.
> help
> 2 + 6
=> 8
Success!
> 4 *10
=> 40
> 4*10
=> 40
> 4 * 10
@PragTob
PragTob / error_require_tmpdir
Created August 24, 2012 17:54
error rquiring tmpdir with jruby-head and simplecov
tobi@speedy ~/github/shoes4 $ rake spec
jruby --debug --1.9 -Ispec -S ./bin/rspec --tty spec/shoes/list_box_spec.rb spec/shoes/sound_spec.rb spec/shoes/flow_spec.rb spec/shoes/border_spec.rb spec/shoes/app_spec.rb spec/shoes/button_spec.rb spec/shoes/edit_box_spec.rb spec/shoes/check_spec.rb spec/shoes/shape_spec.rb spec/shoes/animation_spec.rb spec/shoes/text_block_spec.rb spec/shoes/line_spec.rb spec/shoes/radio_spec.rb spec/shoes/framework_learning_spec.rb spec/shoes/progress_spec.rb spec/shoes/image_spec.rb spec/shoes/configuration_spec.rb spec/shoes/color_spec.rb spec/shoes/edit_line_spec.rb spec/shoes/logger_spec.rb spec/shoes/oval_spec.rb spec/shoes/background_spec.rb spec/shoes/logger/log4j_spec.rb spec/shoes/logger/ruby_spec.rb
LoadError: load error: tmpdir -- java.lang.ArrayIndexOutOfBoundsException: -1
require at org/jruby/RubyKernel.java:1009
require at org/jruby/RubyKernel.java:1018
(root) at /home/tobi/.rvm/gems/jruby-head@shoes/gems/pry-0.9.10-java/lib/pry/default_commands/input_and_o
@PragTob
PragTob / jruby-head_simplecov
Created August 24, 2012 17:46
Error with jruby-head and simplecov on shoes4
tobi@speedy ~/github/shoes4 $ rake spec
jruby --debug --1.9 -Ispec -S ./bin/rspec --tty spec/shoes/list_box_spec.rb spec/shoes/sound_spec.rb spec/shoes/flow_spec.rb spec/shoes/border_spec.rb spec/shoes/app_spec.rb spec/shoes/button_spec.rb spec/shoes/edit_box_spec.rb spec/shoes/check_spec.rb spec/shoes/shape_spec.rb spec/shoes/animation_spec.rb spec/shoes/text_block_spec.rb spec/shoes/line_spec.rb spec/shoes/radio_spec.rb spec/shoes/framework_learning_spec.rb spec/shoes/progress_spec.rb spec/shoes/image_spec.rb spec/shoes/configuration_spec.rb spec/shoes/color_spec.rb spec/shoes/edit_line_spec.rb spec/shoes/logger_spec.rb spec/shoes/oval_spec.rb spec/shoes/background_spec.rb spec/shoes/logger/log4j_spec.rb spec/shoes/logger/ruby_spec.rb
LoadError: load error: pp -- java.lang.ArrayIndexOutOfBoundsException: -1
require at org/jruby/RubyKernel.java:1018
(root) at /home/tobi/.rvm/gems/jruby-head@shoes/gems/rspec-expectations-2.11.2/lib/rspec/expectations/differ.rb:3
require at org/jruby/RubyKernel.java:
@PragTob
PragTob / RBP 1.9.2
Created February 26, 2012 11:05
1.9.2 Rails best practices TracketyTrack
tobi@business ~/github/TracketyTrack $ rails_best_practices .
Source Codes: 100% |ooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:01
./app/views/comments/_comment_entry.html.erb:8 - law of demeter
./app/controllers/sprints_controller.rb:13,21,38,48 - use before_filter for show,edit,update,destroy
./app/controllers/users_controller.rb:16,24,40,62,70 - use before_filter for show,edit,update,accept_user,reject_user
./app/controllers/projects_controller.rb:4,12,27,38 - use before_filter for show,edit,update,destroy
./app/controllers/user_stories_controller.rb:54,64,87,104,112,120,128,140,147,153 - use before_filter for show,edit,update,destroy,resurrect,start,pause,complete,request_feedback,stop_requesting_feedback
./app/views/sprints/current_sprint_overview.html.erb:16 - simplify render in views
./app/helpers/comments_helper.rb:1 - remove empty helpers
./config/routes.rb:4 - restrict auto-generated routes (:only => [:create, :destroy])
@PragTob
PragTob / RBP unused methods false positives
Created February 26, 2012 01:44
Rails best practices on TracketyTrack with positives removed for unused methods
tobi@business ~/github/TracketyTrack $ rails_best_practices -v
1.8.0
tobi@business ~/github/TracketyTrack $ rails_best_practices .
Source Codes: 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:01
./app/controllers/sprints_controller.rb:13,21,38,48 - use before_filter for show,edit,update,destroy
./app/controllers/users_controller.rb:16,24,40,62,70 - use before_filter for show,edit,update,accept_user,reject_user
./app/controllers/projects_controller.rb:4,12,27,38 - use before_filter for show,edit,update,destroy
./app/controllers/user_stories_controller.rb:54,64,87,104,112,120,128,140,147,153 - use before_filter for show,edit,update,destroy,resurrect,start,pause,complete,request_feedback,stop_requesting_feedback
./app/views/sprints/current_sprint_overview.html.erb:16 - simplify render in views
./app/helpers/comments_helper.rb:1 - remove empty helpers
@PragTob
PragTob / tbp-unused_methods
Created February 25, 2012 12:33
rails best practices still to many used unused methods
tobi@business ~/github/TracketyTrack $ rails_best_practices .
Source Codes: 100% |ooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:01
./app/controllers/sprints_controller.rb:13,21,38,48 - use before_filter for show,edit,update,destroy
./app/controllers/users_controller.rb:16,24,40,62,70 - use before_filter for show,edit,update,accept_user,reject_user
./app/controllers/projects_controller.rb:4,12,27,38 - use before_filter for show,edit,update,destroy
./app/controllers/user_stories_controller.rb:54,64,87,104,112,120,128,140,147,153 - use before_filter for show,edit,update,destroy,resurrect,start,pause,complete,request_feedback,stop_requesting_feedback
./app/views/sprints/current_sprint_overview.html.erb:16 - simplify render in views
./app/helpers/comments_helper.rb:1 - remove empty helpers
./config/routes.rb:4 - restrict auto-generated routes (:only => [:create, :destroy])
./config/routes.rb:50 - restrict auto-generated routes (:only => [:show, :new, :create, :edit, :update, :destroy])
@PragTob
PragTob / RBP - false positive
Created February 19, 2012 01:00
Rails best practices - too many remove unused methods
./app/models/user.rb:75 - remove unused methods (User#make_salt)
./app/models/project.rb:69 - remove unused methods (Project#completed_story_points_per_sprint)
./app/models/sprint.rb:14 - remove unused methods (SprintDatesValidator#check_start_before_end)
./app/models/sprint.rb:65 - remove unused methods (Sprint#user_stories_completed)
./app/models/sprint.rb:93 - remove unused methods (Sprint#expired?)
./app/models/sprint.rb:103 - remove unused methods (Sprint#completed_story_points_per_day)
./app/models/sprint.rb:133 - remove unused methods (Sprint#all_story_points_per_day)
./app/models/user_story.rb:70 - remove unused methods (UserStory#set_new_work_effort)
./app/controllers/sprints_controller.rb:56 - remove unused methods (SprintsController#stop)
./app/controllers/users_controller.rb:62 - remove unused methods (UsersController#accept_user)
@PragTob
PragTob / bloopsaphone Linux error
Created February 15, 2012 12:20
bloopsaphone gem not working (Linux)
tobi@business ~/github/green_shoes/samples $ ruby sample33.rb
/home/tobi/.rvm/gems/ruby-1.9.3-p0@greenS/gems/green_shoes-1.1.354/lib/ext/bloops.rb:1:in `require_relative': /home/tobi/.rvm/gems/ruby-1.9.3-p0@greenS/gems/green_shoes-1.1.354/lib/ext/bloops/bloops.so: invalid ELF header - /home/tobi/.rvm/gems/ruby-1.9.3-p0@greenS/gems/green_shoes-1.1.354/lib/ext/bloops/bloops.so
from /home/tobi/.rvm/gems/ruby-1.9.3-p0@greenS/gems/green_shoes-1.1.354/lib/ext/bloops.rb:1:in `<top (required)>'
from /home/tobi/.rvm/gems/ruby-1.9.3-p0@greenS/gems/green_shoes-1.1.354/lib/ext/bloops/songs/simpsons_theme_song_by_why.rb:2:in `<top (required)>'
from sample33.rb:16:in `load'
from sample33.rb:16:in `block (3 levels) in <main>'
from /home/tobi/.rvm/gems/ruby-1.9.3-p0@greenS/gems/green_shoes-1.1.354/lib/shoes/helper_methods.rb:280:in `call'
from /home/tobi/.rvm/gems/ruby-1.9.3-p0@greenS/gems/green_shoes-1.1.354/lib/shoes/helper_methods.rb:280:in `block in mouse_link_control'
from /home/tobi/.rvm/gems/ruby-1.9.3-
@PragTob
PragTob / .travis.yml
Created February 1, 2012 17:31
.travis.yml for PostgreSQL
postgres:
adapter: postgresql
database: myapp_test
username: postgres
before_script:
- "psql -c 'create database myapp_test;' -U postgres"
- "rake db:migrate"
@PragTob
PragTob / shoes_c_to_ruby_linux
Created January 11, 2012 16:39
shoes c_to_ruby still failing on Linux
tobi@business ~/github/shoes $ rake
/home/tobi/github/shoes/Rakefile:63: Use RbConfig instead of obsolete and deprecated Config.
gcc -I. -c -o shoes/effects.o -Wall -I/usr/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1 -pthread -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/tobi/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-linux -I/home/tobi/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I/home/tobi/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/x86_64-linux -O -DRUBY_1_9 -DSHOES_GTK -fPIC -pthread -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1 shoes/effe