Christoph Olszowka colszowka

View heroku-shell
1 2 3 4 5 6 7 8 9
#!/usr/bin/env ruby
 
require "readline"
APP_NAME = ARGV[0]
 
unless APP_NAME
STDERR.puts "Usage: #{$0} HEROKU_APP_NAME"
exit 1
end
View cov.rb
1 2 3 4 5 6 7 8 9 10
# On "ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]", but should be the same on all 1.9+
require 'coverage'
Coverage.start
require './foo'
puts Coverage.result
# {"foo.rb"=>[1, 1, 0, nil, nil, 1, 0, nil, nil]}
 
Coverage.start
Foo.new.bar
puts Coverage.result
View 1-ruby_socket.rb
1 2 3 4 5 6 7 8 9 10
# Blocks while a client is connected, and does not time out automatically
require 'socket'
require 'etc'
 
Socket.unix_server_loop("/tmp/sock") do |socket|
begin
login = Etc.getpwuid(socket.getpeereid.first).name
puts "#{login} connected"
input = socket.gets.strip
puts "#{login} sent #{input}"
View gist:777923
1 2 3 4 5 6 7 8 9 10
# Works as expected
$ rvm use 1.9.2
Using /Users/colszowka/.rvm/gems/ruby-1.9.2-p136
~ 1.9.2-p136 $ irb
>> "1.9".respond_to?(:encoding)
=> true
>> 7.123.round
=> 7
>> 7.123.round(2)
=> 7.12
View redmine_svn_to_git_migrator.rb
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/ruby
 
#
# Migration Tool for Redmine issue and time entry comments from SVN revisions to Git (i.e. r1234 => commit:abcdef789)
# ==============================
# (c) 2009 Christoph Olszowka & Sebastian Georgi, Capita Unternehmensberatung
#
# We used this when we migrated two of our main repositories from svn to git (see http://gist.github.com/139478)
# and wanted to have our revision links in Redmine reflect that change, too.
#
View svn2git_migration.sh
1 2 3 4 5 6 7 8 9 10
#
# Migration tool from SVN to git
# ==============================
# (c) 2009 Christoph Olszowka, Capita Unternehmensberatung
#
# This is not meant for usage in an actual shell script - you're better off running
# each individual block (marked by the comments) separately and check the output to see if everything
# went right - this is more a writeup of the required steps so I can remember them rather than a
# shoot-and-forget-solution.
#
View gist:63948
1 2 3 4 5 6 7 8 9 10
#
# Will find the rdoc paths of your local gems and generate a html index frameset which will let you select
# the desired gem's rdoc from a dropdown navigation...
#
# Specify your local gems installation's doc directory and the desired html output path, open the generated index.html
# in the output path in your favorite browser and add a boomark.
# You might want to add the script into your path for easy access or put it in a cron job.
#
# Tested on Ubuntu 8.10, but really should work anywhere with proper gem install path set
#
Something went wrong with that request. Please try again.