-
Install and run an AMQP server (RabbitMQ is a good choise)
-
Install amqp and ncurses-ruby gems
sudo gem install amqp ncurses-ruby
-
Run the client
ruby ./amqp-chat.rb
| // shortcut.m | |
| // | |
| // compile: | |
| // gcc shortcut.m -o shortcut.bundle -g -framework Foundation -framework Carbon -dynamiclib -fobjc-gc -arch i386 -arch x86_64 | |
| #import <Foundation/Foundation.h> | |
| #import <Cocoa/Cocoa.h> | |
| #import <Carbon/Carbon.h> | |
| @interface Shortcut : NSObject |
| require "rubygems" | |
| require "graphviz" | |
| g = GraphViz::new( "G", :type => "graph" ) | |
| n1 = g.add_node( "A" ) | |
| n2 = g.add_node( "B" ) | |
| n3 = g.add_node( "C" ) | |
| e1 = g.add_edge( n1, n2 ) | |
| e1[:dir] = 'forward' | |
| e2 = g.add_edge( n1, n3 ) |
| IoGraphViz | |
| gv := IoGraphViz clone with("G") | |
| hello := gv addNode("hello", nil) | |
| world := gv addNode("world", nil) | |
| gv addEdge(hello, world) | |
| options := Map clone do( |
| # 30 minutes Lisp in Ruby | |
| # Hong MinHee <http://dahlia.kr/> | |
| # | |
| # This Lisp implementation does not provide a s-expression reader. | |
| # Instead, it uses Ruby syntax like following code: | |
| # | |
| # [:def, :factorial, | |
| # [:lambda, [:n], | |
| # [:if, [:"=", :n, 1], | |
| # 1, |
| - (void)execute:(NSString *)cmd { | |
| NSString *appScript = [NSString stringWithFormat:@"do shell script \"%@\" with administrator privileges", cmd]; | |
| NSAppleScript *script = [[NSAppleScript alloc] initWithSource:appScript]; | |
| NSDictionary *errorInfo = nil; | |
| NSAppleEventDescriptor *data = [script executeAndReturnError:&errorInfo]; | |
| if( data == nil ) { | |
| // Hum... Something happend, dude! | |
| NSLog(@"ERROR : %@", [errorInfo objectForKey:NSAppleScriptErrorMessage]); | |
| } else { |
| O="Ook. ";o="Ook? ";k="Ook! ";_={">"=>O+o,"<"=>o+O,"+"=>O+O,"-"=>k+k,"."=>k+O,","=>O+k,"["=>k+o,"]"=>o+k};puts (ARGV[0]||"++++++++++[>++++++++>+++++++++++>+++<<<-]>-.>+.----.>+++.").split(//).map{|c|_[c]}.join |
| #!jruby | |
| unless RUBY_PLATFORM === "java" | |
| puts "jConsole only works with jRuby" | |
| puts "For more informations, see http://www.jruby.org/" | |
| exit 1 | |
| end | |
| require 'readline' | |
| require 'rubygems' |
| #!/bin/sh | |
| get_encoding() { | |
| FILE=$1 | |
| file --mime-encoding $FILE | awk '{print $2}' | |
| } | |
| get_type() { | |
| FILE=$1 | |
| file $FILE | awk '{print $2}' |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'open-uri' | |
| require 'nokogiri' | |
| require 'graphviz' | |
| require 'getoptlong' | |
| class Ant2Gv | |
| def initialize(build_file, gv_path) |