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 / talk.sh
Created August 24, 2010 14:19
using applescript for adium
#! /usr/bin/env ruby
users = {
:rubiii => 'daniel.harrington',
:tri => 'thilko.richter',
}
user = users[ARGV.shift.to_sym]
message = ARGV.join(' ')
@phoet
phoet / git_and_brew.sh
Created July 1, 2010 15:05
git and homebrew via curl
# thx to tobstarr
sudo mkdir -p /usr/local && sudo chown -R $USER /usr/local && curl -Lsf http://bit.ly/9H4NXH | tar xvz -C/usr/local --strip 1 && brew install git
@phoet
phoet / analytics.sh
Created April 29, 2010 11:28
open multiple google analytics accounts
#! /usr/bin/env ruby
[25021834, 18768647].each do |product_id|
url = "https://www.google.com/analytics/reporting/?reset=1&id=#{product_id}&pdr=#{(Time.now - (7 * 60 * 60 * 24)).strftime("%Y%m%d")}-#{Time.now.strftime("%Y%m%d")}"
`open "#{url}"`
end
@phoet
phoet / bindings.xml
Created April 29, 2010 10:13
jaxws definitions that work
<jaxws:bindings version="2.1" wsdlLocation="service.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://java.sun.com/xml/ns/jaxws" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb">
<enableWrapperStyle>false</enableWrapperStyle>
<jaxws:bindings
node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='http://authentication.integration.crowd.atlassian.com']">
<jxb:globalBindings generateElementProperty="false">
@phoet
phoet / i_dont_give_a_shit.rb
Created August 24, 2009 08:49
example of i don't give a shit gem
alias :method_missing_i_dont_give_a_shit :method_missing
def method_missing(sym,*args, &block)
puts "sym is #{sym}"
method_name = sym.to_s
if /.+\?$/ =~ method_name
puts "i dont care"
target_method = method_name[0..-2]
puts "target is #{target_method}"
puts self.class
@phoet
phoet / nil_or.rb
Created June 28, 2009 17:43
nil-or example
# Creates an object you can savely traverse without getting nil.
# This is very pleasant for deep data-structures.
# You can punch the duck until it should become a string:
# NilOr.new(nil).what.the.fuck?.to_s --> nil
class NilOr
def initialize(object, parent = nil)
@object = object
@call_stack = (parent || [])
puts "current stack #{@call_stack}"