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
exit() { | |
if [[ -z $TMUX ]]; then | |
builtin exit | |
else | |
tmux detach | |
fi | |
} | |
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
on changeKeyboardInput(language) | |
tell application "System Events" to tell process "SystemUIServer" | |
click (menu bar item 1 of menu bar 1 whose description is "text input") | |
#click menu item theInputSource of menu 1 of result | |
click menu item language of menu 1 of result | |
end tell | |
end changeKeyboardInput | |
on run argv | |
if item 1 of argv = "en" then |
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
"***************************************************************************** | |
"" NeoBundle core | |
"***************************************************************************** | |
if has('vim_starting') | |
set nocompatible " Be iMproved | |
" Required: | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
endif |
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
//http://stackoverflow.com/questions/6564558/wildcards-in-the-pattern-for-http-handlefunc | |
/* | |
The patterns for http.Handler and http.HandleFunc aren't regular expressions or globs. There isn't a way to specify wildcards. They're documented here. | |
That said, it's not too hard to create your own handler that can use regular expressions or any other kind of pattern you want. Here's one that uses regular expressions (compiled, but not tested): | |
*/ | |
type route struct { | |
pattern *regexp.Regexp |
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
func request_worker(http_response chan<- string, url string, r *http.Request) { | |
c := appengine.NewContext(r) | |
client := urlfetch.Client(c) | |
resp, err := client.Get(url) | |
if err != nil { | |
return | |
} | |
contents, err := ioutil.ReadAll(resp.Body) | |
if err != nil { | |
os.Exit(1) |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"time" | |
) |
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 python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
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
from boto.ec2.autoscale import AutoScaleConnection | |
groupname = '' | |
as_conn = AutoScaleConnection( | |
aws_access_key_id='', | |
aws_secret_access_key='' | |
) | |
group = as_conn.get_all_groups(names=[groupname])[0] |
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
from boto.ec2.autoscale import AutoScaleConnection | |
groupname = '' | |
as_conn = AutoScaleConnection( | |
aws_access_key_id='', | |
aws_secret_access_key='' | |
) | |
group = as_conn.get_all_groups(names=[groupname])[0] |
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
################################################################################# | |
# Import modules | |
################################################################################# | |
import os | |
import time | |
import sys | |
import socket | |
import string |