This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# metatest | |
# | |
# Created by Paolo Bosetti on 2011-01-20. | |
# Copyright (c) 2011 University of Trento. All rights reserved. | |
# | |
def header(string) | |
border = "=" * string.length | |
puts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# untitled.rb | |
# Created by Paolo Bosetti on 2011-03-30. | |
# Copyright (c) 2011 University of Trento. All rights reserved. | |
require "zlib" | |
str = "" | |
100.times do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = Thread.current | |
Signal.trap("SIGINT") do | |
c.wakeup | |
end | |
while true | |
sleep | |
puts "wake" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# untitled.rb | |
# Created by Paolo Bosetti on 2011-04-20. | |
# Copyright (c) 2011 University of Trento. All rights reserved. | |
require "rubygems" | |
require 'ffi' | |
class Array | |
def mean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# untitled.rb | |
# Created by Paolo Bosetti on 2011-09-02. | |
# Copyright (c) 2011 University of Trento. All rights reserved. | |
require "socket" | |
module Charter | |
BASE_PORT = 2000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'ffi' | |
module Mouse | |
extend FFI::Library | |
ffi_lib '/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics' | |
class CGPoint < FFI::Struct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# stama.rb | |
# Created by Paolo Bosetti on 2011-10-07. | |
# Copyright (c) 2011 University of Trento. All rights reserved. | |
class State | |
attr_accessor :id, :next, :machine | |
def initialize(id, &action) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [[ $EUID -ne 0 ]]; then | |
echo 1>&2 | |
echo 1>&2 | |
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 1>&2 | |
echo "! This script must be run as root! !" 1>&2 | |
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 1>&2 | |
echo | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
echo | |
echo "Setting up environment" | |
echo "[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function" >> .bash_profile | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function | |
echo |