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 / gist:3568944
Created September 1, 2012 10:23
OS X you are annoying

once upon a time, OS X was a very usable piece of software...

  • spaces
    • switching between apps on different spaces does not bring focus to that app
    • modal dialogs get lost in a space
    • modal dialogs don't get focused with CMD+TAB
  • keys
    • function-keys and shortcuts are cluttered with MissionControl and other unusable stuff
    • keybord-navigation is broken in so many apps
  • mouse / trackpad
@phoet
phoet / readme.md
Created July 9, 2012 14:20
Señor Developer Competition at BaRuCo

Ever seen these T-Shirts?

Señor Developer T-Shirt

Want one?

Get one for free at BaRuCo!

If you are an attendee of BaRuCo 2012, you get the chance to win a FREE Señor Developer t-shirt.

@phoet
phoet / Gemfile
Created April 10, 2012 12:31
rails namespace issue
source 'https://rubygems.org'
gem 'rails', '3.2.3'
group :test do
gem "rspec-rails"
end
@phoet
phoet / links.html
Created March 5, 2012 09:48
munin graphs for wlw
@phoet
phoet / Gemfile
Created February 21, 2012 19:11
basic cassandra setup
# A sample Gemfile
source "http://rubygems.org"
# gem "rails"
gem 'cassandra'
gem 'thrift_client', '0.7.1'
@phoet
phoet / helper.sh
Created January 18, 2012 09:35
bash helper snippets
# find all unique %uXXXX in a log-file
grep "(err)" /var/log/appsse/production.log | grep "%u" | sed 's/.*\(%u.\{4\}\).*/\1/g' | sort | uniq
@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
@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 / 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 / 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