Skip to content

Instantly share code, notes, and snippets.

View kamykaze's full-sized avatar

Kam Kuo kamykaze

  • Cuker
  • San Diego, CA
View GitHub Profile
@kamykaze
kamykaze / copy_buckets_with_prefix.py
Last active August 29, 2015 14:00
syncs over subfolders in s3 buckets (using prefix replacement)
from boto.s3.connection import S3Connection as Connection
import sys,time,threading
### Example Usage:
# python copy_buckets.py MY_S3_KEY MY_S3_PWD mybucket1 mybucke2 devdemo demo
#
# This will copy https://mybucket1.s3.amazonaws.com/devdemo/* to https://mybucket2.s3.amazonaws.com/demo/*
#
# Note: the source and destination buckets can be the same bucket
@kamykaze
kamykaze / config.py
Last active December 30, 2015 10:29
Text Filter server for TextAid. To use it, put these files into a directory, then run python ~/some/path/to/pytextfilter/pytextfilter.py
#!/usr/bin/env python
# vim:ft=python
config = {
"server": {
# The port that the edit server listens at
"port": 8888
},
"environment": {
# An array stores the parameters that needed to launch your text editor.
@kamykaze
kamykaze / _vimrc_bare
Created June 10, 2013 22:18
My bare bones .vimrc file
" Bare bones vim settings
"=========================
" This file can be used on a remote server that you don't have a home directory.
" Simple do the following on the server:
"
"$ curl https://raw.github.com/kamykaze/dotfiles/master/_vimrc_bare -o /tmp/_vimrc
"
" This might work if you don't have a .vim/ or .viminfo in the current user's
" home directory
"
@kamykaze
kamykaze / compile_email.py
Created December 7, 2012 22:32
Script for processing an html email file (converts css to inline style and updates image paths)
#!/usr/bin/env python
import sys, getopt
from premailer import Premailer
#############################
# Compiles html email for delivery
# usage:
# python compile_email.py -i template.html -o compiled.html -b http://www.mydomain.com/static/
#