This file contains hidden or 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 -w | |
#--- | |
# Excerpted from "TextMate" | |
# We make no guarantees that this code is fit for any purpose. | |
# Visit http://www.pragmaticprogrammer.com/titles/textmate for more book information. | |
#--- | |
$LOAD_PATH << "#{ENV["TM_SUPPORT_PATH"]}/lib" | |
require "exit_codes" | |
require "web_preview" |
This file contains hidden or 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
export LSCOLORS=gxfxcxdxbxegedabagacad | |
if [[ $OS == 'Linux' ]]; then | |
alias ls='ls --color=auto' | |
else | |
alias ls='ls -G' | |
fi | |
alias ll='ls -l' | |
alias lls='ll -S' | |
alias lt='ll -t' | |
alias ltr='ls -ltr' |
This file contains hidden or 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
# in ~/.irbrc | |
if ENV['RAILS_ENV'] | |
load '~/.railsrc' | |
end | |
# in ~/.railsrc | |
def sql(query) | |
ActiveRecord::Base.connection.select_all(query) | |
end | |
This file contains hidden or 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/ruby | |
require 'osx/cocoa' | |
include OSX | |
class Foo < NSObject | |
def applicationDidFinishLaunching(sender) | |
puts "yo" | |
end | |
end |
This file contains hidden or 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 Thread support: | |
Ruby implements threads by using setjmp/longjmp to switch between separate | |
C stacks within one native thread. | |
This confuses Objective C because NSThread stores a per-native-thread stack | |
of autorelease pools and exception handlers. When the C stack changes, an | |
error message like this is likely to appear: | |
Exception handlers were not properly removed. Some code has jumped or |
This file contains hidden or 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
Test |
NewerOlder