Skip to content

Instantly share code, notes, and snippets.

View svenfuchs's full-sized avatar

Sven Fuchs svenfuchs

View GitHub Profile

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@svenfuchs
svenfuchs / gist:5364262
Last active December 16, 2015 02:39
Travis CI Office

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:

@mislav
mislav / fat-logfiles.sh
Last active December 22, 2018 19:56
Find "*.log" files in your home dir, sort them by fattest-first, and calculate the size of them all together.
find ~ -name '*.log' -print0 | xargs -0 -L1 stat -f'%z %N' | sort -rn | tee fat-logfiles.txt | head
awk '{ total += $1 } END { printf "total: %5.2f MiB\n", total/1024/1024 }' < fat-logfiles.txt
  • Strings
  • Arrays
  • Hashes
  • Classes
  • Conditionals (if)
  • Conditional (case)
  • Modules (for mixins)
  • Namespaces
  • requiring
  • Gems
@mislav
mislav / procs-vs-lambda.md
Last active March 26, 2021 18:34
Jim Weirich on the differences between procs and lambdas in Ruby

Jim Weirich:

This is how I explain it… Ruby has Procs and Lambdas. Procs are created with Proc.new { }, lambdas are created with lambda {} and ->() {}.

In Ruby 1.8, proc {} creates lambda, and Ruby 1.9 it creates procs (don't ask).

Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.

This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.

@dsc
dsc / jconsole-proxy.sh
Created August 7, 2012 01:15
jconsole via ssh proxy
#!/bin/bash
#/ jc -- jconsole via ssh proxy
#/
#/ Usage: jc [options] HOST JMX_PORT [PROXY_PORT=JMX_PORT] [JMX_HOST=HOST]
#/
#/ Starts a SOCKS proxy via ssh to connect to a
#/ JVM running on a remote and protected machine.
#/
#/ Arguments:

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
  • NBC
# Save this in an empty directory as Vagrantfile and run:
#
# gem install vagrant
# vagrant up
# vagrant ssh
#
# You need to have a recent VirtualBox installed.
Vagrant::Config.run do |config|
config.vm.box = "travis-ruby"
config.vm.box_url = "http://files.travis-ci.org/boxes/provisioned/travis-ruby.box"
@svenfuchs
svenfuchs / gist:2063855
Created March 17, 2012 18:27
Developing with dependent local gem repositories

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: