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 / 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 / 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 / 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 / Gemfile
Created August 8, 2011 12:50
killing bundler
source :rubygems
gem "rails", "3.1.0.rc5"
gem "activeadmin", "0.2.2"
@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 / 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 / dsl.rb
Created April 12, 2011 16:19
examples of dsl api stuff
# encoding utf-8
module DSL
link_to "Articles", { :controller => "articles" }, :id => "news", :class => "article"
def doit_with(some, parameters)
# does it
end
def doit_with(mandatory, optional=nil, parameters=nil)
@phoet
phoet / action_view_base.rb
Created April 6, 2011 07:42
initializer for helping to find partials in large applications
if development?
module ActionView
class Base
alias_method :rails_render, :render
# add debugging comments for partials to the rendered html
def render(options = {}, local_assigns = {}, &block)
output = rails_render(options, local_assigns, &block)
if options.respond_to?(:keys) && options[:partial] && (response.content_type.nil? || response.content_type =~ /html/)
@phoet
phoet / Gemfile.rb
Created January 30, 2011 14:57
Gemfile fuckup
source :gemcutter
gem "rails", "~> 3.0.3"
gem "rails_redis_cache", "~> 0.0.4"
gem "haml", "~> 3.0.25"
gem "hashie", "~> 1.0.0"
gem "asin", "~> 0.2.0" # hashie 1.0.0
gem "twitter", "~> 1.1.1" # hashie 0.4.0
gem "coderay", "~> 0.9.3"
@phoet
phoet / rails_admin_without_devise.rb
Created December 17, 2010 15:35
Using RailsAdmin without devise
# add RailsAdmin to the Gemfile
# do NOT add devise
gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"
# run Bundler
bundle
# run the generator for RailsAdmin
# looks like it's broken, but it just does not install devise
# you may also remove the app/config/locales/devise.en.yml