Skip to content

Instantly share code, notes, and snippets.

View stephencelis's full-sized avatar

Stephen Celis stephencelis

View GitHub Profile
@stephencelis
stephencelis / Gemfile
Created November 15, 2009 17:39
Rails 3.0.pre Gemfile
# Bare bones Gemfile for Rails 3.0.pre.
#
# Throw in a directory for a new application, `gem bundle && bin/rails . -s`.
gem "rails", "3.0.pre", :git => "git://github.com/rails/rails.git"
gem "arel", :git => "git://github.com/rails/arel.git"
gem "rack-mount", :git => "git://github.com/rails/rack-mount.git"
@stephencelis
stephencelis / open
Created April 26, 2009 20:01
`open' with stdin
#!/bin/sh
# A better open: with stdin.
if tty -s
then
/usr/bin/open $@
else
while read input
do
/usr/bin/open $input
done
svn co http://rubycocoa.svn.sourceforge.net/svnroot/rubycocoa/trunk/src
cd src
ruby install.rb config --build-universal=no
ruby install.rb setup
sudo ruby install.rb install
=== 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;
# App (http://github.com/stephencelis/app), a template for Rails:
#
# In existing projects:
# % rake rails:template LOCATION=http://gist.github.com/97629.txt
#
# For new projects:
# % rails newapp -m http://gist.github.com/97629.txt
unless File.read("config/environment.rb").include? "stephencelis-app"
gem "stephencelis-app", :lib => "app",
require "rubygems"
require "haddock"
Haddock::Password.generate # => "bowl9&bracky"
include Haddock # (Make things easier on our fingers...)
Password.generate(30) # => "Phlebotomus2473?nonconditioned"
Password.generate(8) # => "amy7@rax"
(0..9).map{rand(?z).chr[/[^_\W]/]||redo}*''
#import "SCListener.h" // Remember to link to AudioToolbox.framework.
// Start listening.
[[SCListener sharedListener] listen];
// Retrieve the average power.
[[SCListener sharedListener] averagePower];
// Retrieve the peak power.
[[SCListener sharedListener] peakPower];
# ~/.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)
# ~/.caprc
Dir["#{ENV['HOME']}/.recipes/*.rb"].each do |tasks|
load tasks
end