Skip to content

Instantly share code, notes, and snippets.

View mulka's full-sized avatar

Kyle Mulka mulka

View GitHub Profile
--
-- Database: `infmos`
--
-- --------------------------------------------------------
--
-- Table structure for table `infmos`
--
@mulka
mulka / gist:2563719
Created April 30, 2012 23:49
boto batch write requests
import boto
conn = boto.connect_dynamodb()
def put_items(items_to_put):
for table, puts in items_to_put.iteritems():
while(len(puts) > 0):
unprocessed_items = []
for i in xrange(0, len(puts), 25):
batch_list = conn.new_batch_write_list()
class Shitty(AdProvider):
source = 'shitty'
def get_data(self):
raise Exception('This ad provider is shitty... it always throws an exception')
@mulka
mulka / update_throughput.py
Created May 7, 2013 19:46
Here's a little script I wrote to increase the throughput of a DynamoDB table by doubling it, then waiting, then doubling, until it gets to where you want it to be.
#!/usr/bin/env python
import sys
import time
import boto
conn = boto.connect_dynamodb()
table = conn.get_table('table_name')
@mulka
mulka / gist:5784212
Created June 14, 2013 18:38
identical git commits having different hashes?
This doesn't make any sense to me. I thought two identical diffs would have identical commit ids in git. But, this does not appear to be the case, as I have made two commits which are otherwise the same. I did this by rebasing two branches off the same branch. I feel like the intermediate commits should have been the same, but then I saw a fork in my tree. See below:
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git show 6d5aaae49d6 > 1
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git show 79a47534655 > 2
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ diff 1 2
1c1
< commit 6d5aaae49d66d9cfa95c5340ef8562f876694758
---
> commit 79a47534655e4afbfebbcb354adeb59943ca7edc
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git cat-file -p 6d5aaae49d6 > 3
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ git cat-file -p 79a47534655 > 4
(venv)Kyle-Mulkas-MacBook-Pro:tchat.io mulka$ diff 3 4
1,2c1,2
< tree 55288e6604870867c94081896f6a1f5f54a841ac
< parent 832a0a889c65d8e13fac67c9a585f9c1d7e48bcb
---
> tree d6004320c1781da6bbdd0fe154ead4457eab53c2
> parent c4a69a4a60aed89af38e4864b47763489342e131
4c4
@mulka
mulka / itunes.html
Last active December 22, 2015 16:58 — forked from mike-ward/README.md
Found a directive called ngSrc. http://docs.angularjs.org/api/ng.directive:ngSrc
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.1/pure-min.css">
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<style type="text/css">
{
"id": "01cabc1c56598004",
"url": "https://api.twitter.com/1.1/geo/id/01cabc1c56598004.json",
"place_type": "city",
"name": "Springfield",
"full_name": "Springfield, MO",
"country_code": "US",
"country": "United States",
"contained_within": [
{
{
"id": "149da10c51d8fe05",
"url": "https://api.twitter.com/1.1/geo/id/149da10c51d8fe05.json",
"place_type": "city",
"name": "Albany",
"full_name": "Albany, GA",
"country_code": "US",
"country": "United States",
"contained_within": [
{
{
"id": "012609e600de68c2",
"url": "https://api.twitter.com/1.1/geo/id/012609e600de68c2.json",
"place_type": "city",
"name": "Lexington",
"full_name": "Lexington, KY",
"country_code": "US",
"country": "United States",
"contained_within": [
{