Skip to content

Instantly share code, notes, and snippets.

View phoet's full-sized avatar
:shipit:
Shippin Stuffs 🚀

Peter Schröder phoet

:shipit:
Shippin Stuffs 🚀
View GitHub Profile
@phoet
phoet / strange_operator_behavior.rb
Created April 20, 2011 13:43
<< vs. += execution in different context
class StrangeOperatorBehavior
def doit
some_array << [3,4] # ok
some_array += [6,7] # nil
end
def some_array
@some_array ||= []
end
end
@phoet
phoet / README
Created August 6, 2011 15:40
tci
ABOUT:
small build monitor using MacRuby and Growl
RUN:
macruby tci.rb
CONFIG:
@phoet
phoet / Gemfile
Created August 8, 2011 12:50
killing bundler
source :rubygems
gem "rails", "3.1.0.rc5"
gem "activeadmin", "0.2.2"
@phoet
phoet / Questions
Created August 10, 2011 12:22
Frozen Rails Give-away
Day job: Rails Freelancer in Hamburg Germany
Your Rails contributions (if any): Redis & File Caching Plugins, ActiveService Plugin
What's your Ruby/Rails experience?: Ruby since 2009, Rails since 2010
How do you use GitHub?: GitHub for Mac, Browsing Code on Web, Selective Watching and Forking
@phoet
phoet / bundleroutput.sh
Created August 11, 2011 10:26
double dependency fetching and incompatible versions on install
paule@phoet:~/Documents/ruby/faselcharts±master×$ bundle --version
Bundler version 1.1.pre.7
paule@phoet:~/Documents/ruby/faselcharts±master×$ bundle install
Fetching dependency information from the API at http://rubygems.org/........
Fetching dependency information from the API at http://rubygems.org/.
Using rake (0.9.2)
[...]
Installing activeadmin (0.2.2)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
@phoet
phoet / the.daily.weddig.sh
Created October 20, 2011 14:41
the.daily.weddig.sh
git log | grep -B2 "Sandra Weddig" | grep commit | cut -d" " -f2 | xargs git revert $1
@phoet
phoet / object.rb
Created October 21, 2011 13:09
self inspection via exception
class Object;def fail!;raise "#{self}";end;end
"i want to be raised".fail!
# object.rb:1:in `fail!': i want to be raised (RuntimeError)
# from object.rb:3
@phoet
phoet / char_converter.rb
Last active September 27, 2015 21:48
converting characters that blow up our app
# config/initializers/char_converter.rb
require 'uri'
module Support
class CharConverter
def initialize(app)
@app = app
end
@phoet
phoet / renderer.rb
Last active June 19, 2023 08:59
helps finding which partial to look at in rails4
if Rails.env.development?
module My
module PartialRenderer
def render(context, options, block)
msg = "rendering '#{options[:partial]}' with locals '#{(options[:locals] || {}).keys}'"
"<!-- start #{msg}-->\n#{super(context, options, block)}\n<!-- end #{msg}-->\n".html_safe
end
end
end
@phoet
phoet / import.sh
Created December 13, 2011 19:49
rubygems.org failing import
rake gemcutter:import:process /Users/paule/.rvm/gems/ruby-1.9.3-p0/cache/ --trace
** Invoke gemcutter:import:process (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gemcutter:import:process
Processing 94 gems...
Processing /Users/paule/.rvm/gems/ruby-1.9.3-p0/cache/yajl-ruby-1.1.0.gem
Processing /Users/paule/.rvm/gems/ruby-1.9.3-p0/cache/xpath-0.1.4.gem
Processing /Users/paule/.rvm/gems/ruby-1.9.3-p0/cache/xml-simple-1.1.1.gem
Processing /Users/paule/.rvm/gems/ruby-1.9.3-p0/cache/will_paginate-3.0.2.gem