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.h | |
================================================================== | |
--- ruby.h (/trunk) (revision 16) | |
+++ ruby.h (/branches/thread-hooks) (revision 16) | |
@@ -724,6 +724,19 @@ | |
void ruby_native_thread_kill _((int)); | |
#endif | |
+ | |
+typedef unsigned int rb_threadswitch_event_t; |
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 'fileutils' | |
# Most Macs these days are dual-core machines. This should, maybe, default to 2. | |
print "How many cores does your system have? [1] " | |
cores = gets.chomp.to_i | |
cores = 1 if cores < 1 | |
config_opts = ["--with-jpeg=no", "--with-gif=no", "--with-tiff=no", "--with-ns"] | |
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_with_string_arg_and_hash_arg(<<-STRING, :key => value) | |
The string | |
can go | |
here | |
STRING |
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 ArticlesController < ActionController::Base | |
helper_method :articles, :article | |
# render index, show, new, edit | |
def create | |
article.save! | |
redirect_to articles_path | |
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
# ~/.zsh/config | |
export GEMPATH=`gem env gemdir` # we should cache this call | |
# ~/.zsh/functions/gemdoc | |
open $(echo $GEMPATH/doc/$1*(om[1]))/rdoc/index.html | |
# ~/.zsh/functions/_gemdoc | |
#compdef gemdoc | |
_files -W $GEMPATH/doc |
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
curl -O ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz | |
tar xzf readline-5.2.tar.gz | |
cd readline-5.2 | |
./configure && make && sudo make install |
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
# ~/.caprc | |
Dir["#{ENV['HOME']}/.recipes/*.rb"].each do |tasks| | |
load tasks | |
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
# ~/.recipes/growl.rb | |
set :stage, nil unless defined? stage | |
namespace :growl do | |
task :notify do | |
growl_send(ENV["GROWL_MESSAGE"] || "wants your attention") | |
end | |
task :alert do | |
growl_send(ENV["GROWL_MESSAGE"] || "needs your attention", 2) |
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
# config/environments/production.rb | |
config.action_controller.asset_host = Proc.new { |path| | |
'assets.example.com' if Time.at(path[/\d+$/].to_i) < 1.hour.ago | |
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
# ~/.bash_profile | |
export GEMDIR=`gem env gemdir` | |
gemdoc() { | |
local gems=($GEMDIR/doc/$1*/rdoc/index.html) | |
open ${gems[@]: -1} | |
} | |
complete -W '$(`which ls` $GEMDIR/doc)' gemdoc |
OlderNewer