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
sudo su - zimbra | |
for i in `zmprov -l gaa` ; do echo $i; zmmailbox -z -m $i gms ; done |
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 Project | |
attr_reader :supervisor | |
def initialize(supervisor = NullSupervisor.new) | |
@supervisor = supervisor | |
end | |
end | |
Supervisor = Struct.new(:first_name, :last_name, :email) do | |
def display_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
Supervisor = Struct.new(:first_name, :last_name, :email) | |
class Supervisor | |
attr_accessor :first_name, :last_name, :email | |
def initialize(first_name, last_name, email) | |
@first_name = first_name | |
@last_name = last_name | |
@email = email | |
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
# https://github.com/tpope/gem-ctags | |
gem install gem-ctags | |
gem ctags | |
# install bundler.vim plugin (I use git submodules and pathogen.vim) | |
cd ~/.vim | |
git submodule add git://github.com/tpope/vim-bundler.git bundle/bundler | |
# That's IT! Now you can jump directly to tags from gems. |
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 'tmpdir' | |
Dir.mktmpdir('prefix','tmp') {|dir| puts dir} | |
Dir.mktmpdir(['prefix','tmp']) {|dir| puts dir} | |
Dir.mktmpdir(['prefix','suffix'],'tmp') {|dir| puts dir} | |
# Output: | |
# /Users/rjackson/tmp/prefix20121019-49710-y4w7ag | |
# /var/folders/16/t1n7l6qj36z5ws4zz_6c9yww0000gn/T/prefix20121019-49710-o0ohsdtmp | |
# /Users/rjackson/tmp/prefix20121019-49710-1g4yxexsuffix |
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 'forwardable' | |
class Supervisor | |
def email | |
'blah' | |
end | |
def first_name | |
'Jon' | |
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
tell application "System Preferences" | |
activate | |
reveal anchor "displaysArrangementTab" of pane id "com.apple.preference.displays" | |
tell application "System Events" | |
tell application process "System Preferences" | |
tell window 1 | |
tell tab group 1 | |
click radio button "Arrangement" | |
click checkbox "Mirror Displays" | |
click radio button "Display" |
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
# From http://blog.tropo.com/2010/12/17/human-vs-answering-machine-detection | |
call 'tel:+14805551212' | |
starttime = Time.new | |
record ".", { | |
:beep => false, | |
:timeout => 10, | |
:silenceTimeout => 1, | |
:maxTime => 10 |
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 'restclient' | |
RestClient.get 'https://api.tropo.com/1.0/sessions', {:params => { | |
:action => 'create', | |
:token => 'YOUR TROPO TOKEN HERE', | |
:number => "13525557567", | |
:client_name => "Joe Bob's Anesthesia", | |
:account_number => '539181', | |
:first_name => 'Robert', | |
:balance => 1345.12, |
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
set project_directory to do shell script "find ~/ ~/Source ~/Source/ruby ~/Source/ruby/webapps -maxdepth 1 -type d -name " & q & " | head -1" | |
on pathexists(path) | |
try | |
path as alias | |
return true | |
on error | |
return false | |
end try | |
end pathexists |