Skip to content

Instantly share code, notes, and snippets.

View kylefritz's full-sized avatar

Kyle Fritz kylefritz

View GitHub Profile
@kylefritz
kylefritz / publishAmazonSnsMsg.py
Created October 18, 2010 22:06
publish a message to Amazon SNS using python or ruby
from time import strftime,gmtime,time
import urllib2
import hmac
import hashlib
import base64
import string
def publishAmazonSnsMsg(Subject,TopicArn,Message,AWSAccessKeyId,privatekey):
#http://docs.amazonwebservices.com/AWSSimpleQueueService/2008-01-01/SQSDeveloperGuide/
amzsnshost = 'sns.us-east-1.amazonaws.com'
@kylefritz
kylefritz / gist:1338845
Created November 4, 2011 07:21
minimum params to run a httperf test
$ httperf --num-conns 100 --rate 20 --uri / --server simplicitysignals.com
@kylefritz
kylefritz / replace.sh
Created December 4, 2011 02:46
replace all spaces with plus
$ echo "with spaces lots of spaces"|sed 's/ /\+/g'
with+spaces+lots+of+spaces
@kylefritz
kylefritz / how-about.cs
Created December 19, 2011 23:36
whaaaaaaaaaaat? this is not how you remove an item for a list
list.RemoveAt(index);
@kylefritz
kylefritz / gist:1523379
Created December 27, 2011 11:43
rest methods reminder
Action HTTP Verb Default Url Description
Index GET [controller] Gets a collection of resources
Show GET [controller]/[id] Gets a single resource identified by id
New GET [controller]/new Gets form to a create a new resource
Create POST [controller] Creates the new resource
Edit GET [controller]/[id]/edit Gets a form to edit a resource by id
@kylefritz
kylefritz / dynamodb-simple-ex.rb
Created January 21, 2012 21:20
dynamodb-simple-example
require 'aws-sdk'
config = AWS.config(YAML.load(File.read('config.yaml')))
session = AWS::STS.new.new_session(config)
dynamo = AWS::DynamoDB.new(session.credentials)
#create table w/ rate: 10 read/10 write
table_name='kks-table'
dynamo.tables.create(table_name,10,10,{hash_key:{:name=>:string}})
table=dynamo.tables[table_name]
@kylefritz
kylefritz / agile-the-good-parts.md
Created February 27, 2012 16:55
agile the good parts

#AGILE THE GOOD PARTS

  • Create a team, not a group of individuals
  • Context-switching should be avoided mercilessly
  • Try always to improve
  • If something is difficult or time-consuming, do it more often
  • Be merciless about achieving high quality
  • Do everything in tiny increments
  • Get customer Feedback Early and Often
@kylefritz
kylefritz / gist:2563866
Created May 1, 2012 00:10
Delete branches that have been merged into HEAD
#all local branches that are merged into HEAD
git branch -d `git branch --merged | grep -v '^*' | tr -d '\n'`
#Delete all remote branches that are merged into HEAD
#jump back to master
git co master
#get rid of all local branches not on origin
@kylefritz
kylefritz / gist:2763382
Created May 21, 2012 17:19
copy one s3 bucket to another
require 'right_aws'
#http://www.austinriba.com/2011/02/copy-contents-of-one-s3-bucket-to-another/
S3ID = "Your AWS ID Her"
S3KEY = "Your AWS secret key"
SRCBUCKET = "Source Bucket"
DESTBUCKET = "Destination Bucket"
@kylefritz
kylefritz / gist:2859517
Created June 2, 2012 18:31
curl cheatsheet

9 curl basics via httpkit

  • -v includes both request and response headers
  • -i include http response headers in output
  • -I http response headers only
  • -k ignore bad ssl cert