I hereby claim:
- I am sdsykes on github.
- I am sdsykes (https://keybase.io/sdsykes) on keybase.
- I have a public key whose fingerprint is 8083 1053 7ED3 36B7 4B12 A80B 90A5 BAEA 6D05 D980
To claim this, I am signing this object:
Here's what I do: | |
This is Rails 2 | |
pid = fork do | |
%x{RAILS_ENV=#{Rails.env} #{RAILS_ROOT + "/script/runner"} '#{script}'} | |
exit! | |
end | |
Process.detach pid |
$ sudo easy_install --upgrade twisted | |
Password: | |
install_dir /Library/Python/2.6/site-packages/ | |
Searching for twisted | |
Reading http://pypi.python.org/simple/twisted/ | |
Reading http://twistedmatrix.com/ | |
Reading http://tmrc.mit.edu/mirror/twisted/Twisted/10.0/ | |
Reading http://www.twistedmatrix.com | |
Reading http://twistedmatrix.com/products/download | |
Reading http://tmrc.mit.edu/mirror/twisted/Twisted/8.2/ |
on run argv | |
set space_number to item 1 of argv | |
tell application "System Events" | |
keystroke space_number using {control down} | |
end tell | |
end run |
def four_char_code(s) | |
(s[0].ord << 24) + (s[1].ord << 16) + (s[2].ord << 8) + s[3].ord | |
end | |
system = SBApplication.applicationWithBundleIdentifier("com.apple.SystemEvents") | |
system.send(:"keystroke:using:", space_number.to_s, four_char_code('Kctl')) |
# initializers/mongoid.rb | |
# for when files in lib depend on or inherit from other files in lib | |
def do_require(file) | |
begin | |
require file | |
rescue NameError => e | |
e.message =~ /constant (\w+::)*(\w+)$/ | |
if $2 | |
do_require($2.underscore) |
I hereby claim:
To claim this, I am signing this object:
$size = ARGV[0].to_i | |
if $size <= 0 | |
puts "Supply numeric level (grid size) as an argument" | |
exit | |
end | |
def show(placement) | |
0.upto($size - 1) do |x| |
/// header | |
id CGSCopyManagedDisplaySpaces(int conn); | |
int _CGSDefaultConnection(); | |
id CGSCopyWindowsWithOptionsAndTags(int conn, unsigned owner, NSArray *spids, unsigned options, unsigned long long *setTags, unsigned long long *clearTags); | |
// code | |
int spaceNumber = 0; // the space you want to get the windows for. numbering starts at 0. |
require 'totalspaces2' | |
TotalSpaces2.move_to_space(ARGV[0].to_i) |
require 'totalspaces2' | |
current = TotalSpaces2.current_space | |
spaces = TotalSpaces2.number_of_spaces | |
columns = TotalSpaces2.grid_columns | |
new_space = current + columns | |
if new_space <= spaces | |
TotalSpaces2.move_to_space(new_space) | |
end |