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
# A simple example of using the simple wsgiproxy as a nudge fallback app. | |
# We used this to proxy unfinished requests from appengine, back to our | |
# ec2 app | |
from nudge.publisher import ServicePublisher | |
from wsgiproxy.app import WSGIProxyApp | |
PROTO = 'http' | |
FALLBACK_HOST = 'example.com' |
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
# POST a json body. | |
curl -v -H "Content-Type: application/json" -X POST \ | |
-d '{"action": "Say Hello"}' \ | |
http://example.com/say/hello |
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
def my_thread_func(comment_id): | |
# form url based on comment id so http://www.evite.com/services/<comment_id>/whatever | |
# send request | |
# check result, log error | |
from multiprocessing.pool import ThreadPool as Pool | |
def main(): | |
# Read file into a list of IDs | |
list_of_ids = [read from file] |
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 python | |
# This script is free software written by Warren Runk ([email protected]) | |
""" | |
This is a (hopefully) simple example of how to download your appengine logs to a normal | |
linux (non google or appengine) computer using remote api and logservice. | |
You can use appcfg.py to "request_logs" but that is not practical for real workloads | |
From here you can download smaller time slices of logs as necessary depending on your scale. |
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 python | |
# Written by Warren Runk | |
# This file is free software in the public domain. | |
import base64 | |
import uuid | |
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 python | |
# Written by Warren Runk | |
# This file is free software in the public domain. | |
import base64 | |
import random | |
import uuid |
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
/* This document is for quick ref while learning golang */ | |
// Allocating Slices | |
// Using slice literals | |
// Make a slice of strings | |
strs := []string{"aaa", "bbb", "ccc", "ddd"} | |
// Bytes | |
key := []byte("5e8487e6") | |
// Declaring a var my_slice for later makeage |
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
#!/bin/bash | |
# --------------------------------------------------------------------------- # | |
# These are git settings from: | |
# http://neverstopbuilding.net/gitpro/ | |
# --------------------------------------------------------------------------- # | |
#source ~/.git-completion.bash | |
#source ~/.git-prompt.sh | |
# | |
# Settings for python virtual envs and the python virtualenvwrapper |
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 multiprocessing.pool import ThreadPool as Pool | |
from multiprocessing import Queue as PQueue | |
import Queue | |
my_dict = { | |
'url1': 'url2', | |
'url3': 'url4', | |
} | |
my_q = PQueue() |
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" | |
"github.com/go-xorm/xorm" | |
_ "github.com/lib/pq" | |
"math/rand" | |
"time" | |
) |