Skip to content

Instantly share code, notes, and snippets.

View mediafinger's full-sized avatar
🏠
In Köln

Andreas Finger mediafinger

🏠
In Köln
View GitHub Profile
# The videos can be found at http://programme.scottishrubyconference.com/schedule
# Usage: ruby download_scotruby_videos.rb /path/to/directory
page = "http://video2012.scotlandonrails.com"
path = ARGV.first || '.'
[
[ "Continuous Delivery - A Better Software Deployment Strategy", "D1_GH_01-Ruby1280_b.mp4" ],
[ "The Rails View: The Junk Drawer Grows Up", "D1_GH_02-Ruby1280_b.mp4" ],
[ "Perfectionists Anonymous", "D1_GH_03-Ruby1280_b.mp4" ],
[ "ElasticSearch, AMQP and Ruby; or how I learned to stop spelunking and love the logs", "D1_GH_04-Ruby1280_b.mp4" ],
@javan
javan / screenshot.js
Created June 19, 2012 21:40
Create a screenshot of any URL using phantomjs (headless webkit)
//
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png
//
var system = require('system');
var url = system.args[1];
var filename = system.args[2];
var page = new WebPage();
page.open(url, function (status) {
@v1rtual
v1rtual / spotify_mute_ads.rb
Created June 14, 2012 10:28 — forked from raine/spotify_mute_ads.rb
Mute Spotify ads on OS X
# coding: utf-8
#!/usr/bin/env ruby
#
# Mutes Spotify ads by monitoring Growl's output in syslog, and changing the
# system-wide audio output to dummy output when an ad is detected.
#
# == Installation
#
# 1. Install Soundflower (http://code.google.com/p/soundflower/)
# 2. download gist
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@ordinaryzelig
ordinaryzelig / minitest_spec_expectations.md
Last active December 10, 2022 13:34
How to write MiniTest::Spec expectations

I'm a fan of MiniTest::Spec. It strikes a nice balance between the simplicity of TestUnit and the readable syntax of RSpec. When I first switched from RSpec to MiniTest::Spec, one thing I was worried I would miss was the ability to add matchers. (A note in terminology: "matchers" in MiniTest::Spec refer to something completely different than "matchers" in RSpec. I won't get into it, but from now on, let's use the proper term: "expectations").

Understanding MiniTest::Expectations

Let's take a look in the code (I'm specifically referring to the gem, not the standard library that's built into Ruby 1.9):

# minitest/spec.rb

module MiniTest::Expectations
@mediafinger
mediafinger / patch_ruby_1.9.3_for_rbfu.sh
Created February 14, 2012 22:15
There are some nice performance patches for Ruby 1.9.3-p0 and some scripts to install them for rbenv and rvm. As I am using rbfu (by @hmans), I adapted the rbenv script a bit.
VERSION="1.9.3-p0"
curl https://raw.github.com/gist/1688857/2-$VERSION-patched.sh > /tmp/$VERSION-patch
ruby-build /tmp/$VERSION-patch $HOME/.rbfu/rubies/1.9-patch
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@therubymug
therubymug / the_install.sh
Created November 5, 2011 18:48
Ruby development environment for OS X (Lion)
#!/usr/bin/env sh
# Title: Ruby development environment for OS X (Lion)
# Author: Rogelio J. Samour
# Warning:
# While it is unlikely any code below might damage your system,
# it’s always a good idea to back up everything that matters to you
# before running this script! Just in case. I am not responsible for
# anything that may result from running this script. Proceed at
# your own risk.