Skip to content

Instantly share code, notes, and snippets.

View amorton's full-sized avatar

Aaron Morton amorton

View GitHub Profile
@amorton
amorton / gist:4020500
Created November 5, 2012 21:38
CQL 3 Question
# Create a table and add data in CQL 3
CREATE TABLE UserTweets
(
tweet_id bigint,
user_name text,
body text,
timestamp timestamp,
PRIMARY KEY (user_name, tweet_id)
);
@amorton
amorton / .gitignore
Created August 19, 2012 10:27
Sorting lists for humans with Cassandra
*.py[cod]
# C extensions
*.so
# Packages
*.egg
*.egg-info
dist
build
@amorton
amorton / gist:3029765
Created July 1, 2012 21:58
Airport Information
Hi Toula,
Hope you had a nice weekend.
Just wondering if you had any luck locating information about Stewart Duff Drive not being a public road ?
I was also wondering if the Airport could release some information on how it arrived at the "estimate" that 30% of the traffic flow was not airport traffic (as reported here http://www.stuff.co.nz/dominion-post/news/7175091/Airport-drop-and-dash-or-you-ll-pay-cash)
Thanks
Aaron
@amorton
amorton / first email
Created June 28, 2012 03:40
Email to Leonie Gill
From: aaron morton
Subject: Fwd: Wellington Airport Website feedback: Airport Service, Aaron Morton
Date: 28 June 2012 3:39:04 PM NZST
To: leonie.gill@wcc.govt.nz
Hi,
I understand you are the Councillor for the Eastern suburbs. I live in Miramar and received the following response from the airport in response to an enquiry about the proposed road changes.
I have asked them for evidence to support their claim that "Stewart Duff Dive is not a public road but part of the airport, ".
@amorton
amorton / gist:2697792
Created May 14, 2012 22:17
Hack to watch cassandra netstats
while true; do date; diff <(nodetool -h localhost netstats) <(sleep 5 && nodetool -h localhost netstats); done
@amorton
amorton / NanoTest.java
Created May 7, 2012 21:56
nanoTime() Test.
public class NanoTest
{
/**
* usage: NanoTest - run for 100ms and count unique results from System.nanoTest()
* NanoText x - run for x ms and count unique results from System.nanoTest()
* @param args
*/
public static void main(String[] args)
{
final long duration = (args.length > 0 ? Long.parseLong(args[0]) : 100);
aarons-MBP-2011:ReferenceLibrary aaron$ curl keys.gnupg.net
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Document has moved</title></head>
<body><h1>Document has moved</h1>
<p>This document has moved to <a href="http://mud.stack.nl/">http://mud.stack.nl/</a>.</p></body></html>
aarons-MBP-2011:ReferenceLibrary aaron$
Using
distribute==0.6.25
pip 1.0.2
Works in dev when using this in the pip requirements file (relative source reference)...
-e packages/mas_common
-e packages/mas_hooks
Fails when...
* building sdist for the packages
@amorton
amorton / gist:1380932
Created November 20, 2011 21:13
Convert string to ascii key for Cassandra
"".join("{0:x}".format(ord(c)) for c in "thekey")
#!/usr/bin/env python
# encoding: utf-8
"""
Changes the format specifier on SSTables **IN PLACE**
e.g. change
TwitterUserHistoricalValues-h-20983-Data.db
to be
TwitterUserHistoricalValues-g-20983-Data.db