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
Environment: | |
Request Method: GET | |
Request URL: http://127.0.0.1:8000/list/item/add/ | |
Django Version: 1.4.2 | |
Python Version: 2.6.5 | |
Installed Applications: | |
('django.contrib.auth', |
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
#!/usr/bin/env bash | |
# ~/bin/home | |
# toggles source control on my home directory | |
# idea from [http://rhodesmill.org/brandon/2012/home-directory-vc/] | |
# colorized output | |
function cinfo() { | |
echo -e "\x1b[32m$1\x1b[0m" # green | |
} | |
function cwarn() { |
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" | |
type Vehicle struct{} | |
func (v Vehicle) Move() { | |
fmt.Println("vehicle moving") | |
} |
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" | |
type Vehicle struct{} | |
func (v Vehicle) Move() { | |
fmt.Println("vehicle moving") | |
} |
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" | |
type Quacker interface { | |
Quack() | |
} | |
type Duck struct{} |
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 | |
func work(id int, done chan int) { | |
println("processing top secret document:", id) | |
done <- id | |
} | |
func main() { | |
done := make(chan int, 5) | |
for i := 0; i < 5; i++ { |
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
import argparse | |
import fileinput | |
def find_alliteration(line, smallest_seq): | |
# print("examining line: "+line) | |
seq = 1 | |
words = line.split() | |
letter = words[0][0] | |
# print("looking for: "+letter) | |
for word in words[1:]: |
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
import os | |
from requestbin import app | |
from requestbin.storage.memory import MemoryStorage | |
app.config['bind_address'] = ('0.0.0.0', int(os.environ.get("PORT", 5000))) | |
app.config['ignore_headers'] = """ | |
X-Varnish | |
X-Forwarded-For | |
X-Heroku-Dynos-In-Use | |
X-Request-Start |
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 ( | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
func main() { |
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 authorized_for(user, op): | |
if user[1] == 'admin': | |
return True | |
else: | |
return False | |
def forbidden(): | |
print('forbidden!') | |
def check_authorized(operation): |
OlderNewer