This file contains 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
Get Turbogears minor mode - like Rinari mode |
This file contains 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 | |
project_root = "/Users/will/projects/random" | |
server_script = File.join(project_root, 'script', 'server') | |
pid1 = Process.fork { | |
exec "#{server_script} start" | |
} | |
Process.detach(pid1) |
This file contains 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
This example shows how to setup an environment running Rails 3 beta under 1.9.1 with a 'rails3' gem set. | |
∴ rvm update --head | |
# ((Open a new shell)) or do 'rvm reload' | |
# If you do not already have the ruby interpreter installed, install it: | |
∴ rvm install 1.9.1 | |
# Switch to 1.9.1 and gemset rails3, create if it doesn't exist. | |
∴ rvm --create use 1.9.1@rails3 |
This file contains 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 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
messages = {} | |
first_run = true | |
loop do |
This file contains 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/env ruby | |
require 'rubygems' | |
require 'eventmachine' | |
def start_nodes(num_nodes, num_messages) | |
EM.run { | |
nodes = [] | |
num_nodes.times do | |
nodes << EM.spawn{|message| |
This file contains 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
(defmodule hello | |
(export (start 0) (len 1))) | |
(defun start () | |
(: io format '"Hello World!~n")) | |
(defun len (l) | |
(if (== l ()) 0 | |
(+ 1 (len (cdr l))))) |
This file contains 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
X = fun() -> | |
lists:foldl(fun(Pid, Acc) -> | |
case erlang:process_info(Pid,message_queue_len) of | |
undefined -> | |
Acc; | |
{_, Len} -> | |
if | |
Len > 3 -> | |
[{Len, process_info(Pid)} | Acc]; | |
true -> |
This file contains 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
function set_current_ssh_auth_sock { | |
current_ssh_auth_sock=${1:-~/.ssh/current_ssh_auth_sock} | |
if [ ! -e "$current_ssh_auth_sock" -o -h "$current_ssh_auth_sock" ] | |
then | |
if file -L "$current_ssh_auth_sock" >/dev/null | |
then | |
SSH_AUTH_SOCK="$current_ssh_auth_sock" | |
else | |
rm -f "$current_ssh_auth_sock" |
This file contains 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
class Room < ActiveRecord::Base | |
def full | |
false | |
end | |
def to_xml(options = {}) | |
options[:methods] = [:full] | |
super(options) | |
end | |
end |
This file contains 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
package main | |
import ( | |
"encoding/line" | |
"fmt" | |
"io" | |
"net" | |
"strings" | |
) |
OlderNewer