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
ruby % rvm use 1.9.2 | |
Using /Users/qrush/.rvm/gems/ruby-1.9.2-p136 | |
ruby % irb | |
ruby-1.9.2-p136 :001 > a = [] | |
=> [] | |
ruby-1.9.2-p136 :002 > a.push(3,) | |
=> [3] | |
ruby % rvm use ree |
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
require 'java' | |
require 'jruby/core_ext' | |
module WS | |
class WebService | |
def test() | |
puts "Call received at #{Time.new}" | |
# x = Result.new | |
# x.name = "asdf" | |
# return x |
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/sh | |
rvm_current=`rvm current` | |
echo "Installing ruby-debug with $rvm_current ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem | |
gem install linecache19-0.5.13.gem ruby-debug-base19-0.11.26.gem ruby-debug19 -- --with-ruby-include=$rvm_path/src/$rvm_current |
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 ProjectsController < ApplicationController | |
stream | |
def index | |
# rest of controller code | |
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
#!/usr/bin/env ruby | |
def usage | |
puts "./pair [name]: pair two people" | |
puts "./pair : switch to just steve" | |
exit | |
end | |
def set_config(name, email) | |
`git config user.name "#{name}"` |
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
source 'http://rubygems.org' | |
gem 'sunzi' | |
gem 'rake' | |
gem 'fog' |
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 jruby | |
# | |
# | |
require 'rubygems' | |
require 'spoon' | |
EXEC = '/tmp/exec.rb' | |
PID_PATH = '/tmp/exec.pid' | |
WORK_PATH = '/tmp/' |
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
require 'addressable/uri' | |
# Source: http://gist.github.com/bf4/5320847 | |
# Accepts options[:message] and options[:allowed_protocols] | |
# spec/validators/uri_validator_spec.rb | |
class UriValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
uri = parse_uri(value) | |
if !uri |
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
# http://www.mono-project.com/Compiling_Mono_on_OSX | |
require 'formula' | |
class Mono < Formula | |
#url 'http://download.mono-project.com/sources/mono/mono-3.0.6.tar.bz2' | |
#sha1 'e2187f80366fcd65c55a1ab946f8d3b39e81be77' | |
url 'http://download.mono-project.com/sources/mono/mono-2.10.9.tar.bz2' | |
sha1 '1a6e8c5a0c3d88d87982259aa04402e028a283de' | |
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
#define STRING char * | |
#define IF if( | |
#define THEN ){ | |
#define ELSE } else { | |
#define FI ;} | |
#define WHILE while ( | |
#define DO ){ | |
#define OD ;} | |
#define INT int | |
#define BEGIN { |
OlderNewer