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
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"os/signal" | |
"time" | |
) |
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
def foobar(args={}) | |
@required = args.fetch(:required) # .fetch will throw exception if key doesn't exist in Hash | |
@optional = args[:optional] # simple access returns nil if key isn't set -- no exception raised | |
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
export LSCOLORS="Dxfxcxdxbxegedabagacad" | |
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' | |
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' | |
local git_branch='$(git_prompt_info)%{$reset_color%}' | |
PROMPT="╭─${user_host}${current_dir} ${git_branch} | |
╰─%B$%b " | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[magenta]%}‹" |
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
# The docs say that ARGV[0] should be the name of the Ruby executable. | |
# http://ruby-doc.org/core-2.2.3/Object.html#ARGV | |
# | |
# This is **NOT** how Ruby actually behaves: | |
─trevorrosen@Saramago ~ | |
╰─$ cat argv-test.rb | |
#!/usr/bin/env ruby |
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
╭─trevorrosen@Saramago ~ | |
╰─$ cat argv-test.py | |
#!/usr/bin/env python | |
from sys import argv | |
print argv | |
╭─trevorrosen@Saramago ~ | |
╰─$ ./argv-test.py | |
['./argv-test.py'] |
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 up a Go project for contribution. This setup gets around issues related to intra-package import paths | |
# $1 - the origin of the package, e.g. "github.com/spf13/hugo" | |
# $2 - the name of the package in the fork, e.g. "hugo" | |
# | |
export GITHUB_USERNAME="trevrosen" | |
gohack (){ | |
echo "[-] Getting package $1" | |
go get $1 | |
cd $GOPATH/src/$1 | |
echo "[-] Creating fork environment for $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
# Automatically insert closing parens, braces, etc | |
vim_plugin_task "autoclose", "git://github.com/Townk/vim-autoclose.git" | |
# Bunch of nice snippets for Snipmate | |
vim_plugin_task "scrooloose-snippets" do | |
snippet_dirs = %w(ruby-rspec javascript-jquery html haml) # dirs w/ snippets you want | |
storage_path = File.expand_path("~/.vim/extra_snippets", __FILE__) | |
snipmate_path = File.expand_path("~/.vim/snippets", __FILE__) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Colors</key> | |
<dict> | |
<key>Background</key> | |
<string>0.044 0.063 0.129</string> | |
<key>InsertionPoint</key> | |
<string>1.000 1.000 1.000</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
module WebEx | |
## Convenience methods | |
def self.filter_by_session_name(collection, name=nil) | |
return collection unless name | |
collection.collect{|session| | |
session if session['sessionName'].downcase.include?(name) | |
}.compact | |
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
## Provides a list of attendees based on meeting ID | |
get '/list-attendees/:meeting_id' do | |
w = WebEx::Request.new | |
attendees = w.lst_meeting_attendee(params[:meeting_id]) | |
if attendees[:response][:result] == "SUCCESS" | |
@attendees = attendees[:body] | |
erb :list_attendees, :layout => false | |
else | |
LOGGER.warn('Problem obtaining meeting information') | |
end |
NewerOlder