Skip to content

Instantly share code, notes, and snippets.

View avgerin0s's full-sized avatar

Aggelos Avgerinos avgerin0s

  • Skroutz S.A.
  • Athens, Greece
View GitHub Profile
require 'minitest/autorun'
class CaptureIoTest < MiniTest::Unit::TestCase
def test_puts
out, err = capture_io do
puts "hey"
end
assert_equal "hey\n", out
end
use core::io::println;
/* Ask the user for their name */
fn ask_name(prompt: ~str) -> ~str {
println(prompt);
return io::stdin().read_line();
}
fn main() {
let name = ask_name(~"What is your name?");
#!/home/agorf/.rbenv/shims/ruby
require 'json'
workspaces = JSON.load(`i3-msg -t get_workspaces`)
num = ((1..10).to_a - workspaces.map {|w| w['num'] }).min
exec "i3-msg workspace #{num}"
@avgerin0s
avgerin0s / 0-readme.md
Last active August 29, 2015 14:07 — forked from burke/0-readme.md

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.