Skip to content

Instantly share code, notes, and snippets.

Sven Fuchs svenfuchs

Block or report user

Report or block svenfuchs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View optparse-template.rb
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
View keybase.md

Keybase proof

I hereby claim:

  • I am svenfuchs on github.
  • I am svenfuchs (https://keybase.io/svenfuchs) on keybase.
  • I have a public key whose fingerprint is FEB0 A93F B199 EB4C CE1C B79B 60B8 9DF8 875A 4114

To claim this, I am signing this object:

@svenfuchs
svenfuchs / csv2md
Last active Aug 29, 2015
convert csv to markdown
View csv2md
#!/usr/bin/env ruby
require 'csv'
filename = ARGV.shift
def format(questions, answers)
answers.map.with_index do |answer, ix|
"##### #{questions[ix]}\n\n#{answer}\n\n"
end
View gist:95270b8d9522438367ef
Some notes on remote debugging mac builds on Travisci. It's hard to tell when something hangs what the cause it. Trial and error via commits is tedious. And on Mac , sometimes it's the gui asking for input. So I worked my around to get the access I needed for faster debugging a build.
#################################################
# Enable remote ssh access to travisci build for debugging
#################################################
# Add a key so we can login to travisci vm
- cat ssh/travisci.pub >> ~/.ssh/authorized_keys
- chmod 600 ssh/travisci
# Install netcat
@svenfuchs
svenfuchs / _readme.md
Last active Jan 3, 2018
tmux-vim integration to transparently switch between tmux panes and vim split windows tmux based version that does not require a vim plugin
View _readme.md

Based on Mislav's gist and vim-tmux-navigator.

Since tmux hosts vim I disliked that I had to install a vim plugin for this. Instead I think it's cleaner to control vim from tmux.

My actual goal was to achive the following behaviour though (I have a default setup similar to the one Mislav shows in the gist. Two vertically split tmux panes, where the left one hosts vim, which has two vertically split windows):

  • On the leftmost window in vim: when I hit C-h (do not wrap to the rightmost tmux pane, but) zoom the left tmux pane.
  • On the rightmost tmux pane: when I hit C-l (do not wrap to the leftmost tmux pane, but) zoom the right tmux pane.
  • All other navigation: work as given in Mislav's gist
View ruby_confs_2013.md
@svenfuchs
svenfuchs / gist:5364262
Last active Dec 16, 2015
Travis CI Office
View gist:5364262

The Travis CI office

How to get to the Travis CI office: http://goo.gl/maps/vmidH

The address is Prinzessinnenstrasse 20, on the left driveway:

@svenfuchs
svenfuchs / README.md
Created Mar 19, 2012
minimal activerecord standalone migrations
View README.md

In your Gemfile add:

group :development, :test do
  gem 'micro_migrations', :git => 'git@gist.github.com:33e9f92c229eb808a4fa.git'
end

You might want to add something like this to the Rakefile of apps that use a gem that uses micro_migrations:

ENV['SCHEMA'] = "#{Gem.loaded_specs['your-gem-name'].full_gem_path}/db/schema.rb"
@svenfuchs
svenfuchs / gist:2063855
Created Mar 17, 2012
Developing with dependent local gem repositories
View gist:2063855

When developing an application where you have split out shared functionality to multiple dependent gem repositories can get cumbersome when you

  • need to edit the Gemfile in order to swap local :path sources with :git or just plain Rubygems sources,
  • then forget to bundle update,
  • wonder why your git repository is dirty and it's just the modified Gemfile and Gemfile.lock,
  • accidentally commit the Gemfile.lock with local :path sources bundled etc. etc.

So what about this strategy:

A. Create a file .Gemfile.local containing:

View gist:1313104

Travis CI consists of two main parts right now:

  • the web app which is a regular rails app
  • workers which execute the tests

As we are moving to AMQP for communication between app and workers we want to split up the web app into

  • a rather "dumb" asset-delivery and api service and
  • a message hub that schedules jobs for the workers and consumes all the messages that come back from them (currently misleadingly called "consumer", as it consumes but also publishes)
You can’t perform that action at this time.