Skip to content

Instantly share code, notes, and snippets.

View pmcfadin's full-sized avatar

Patrick McFadin pmcfadin

View GitHub Profile
@pmcfadin
pmcfadin / 0_reuse_code.js
Created July 3, 2014 14:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
require 'cassandra'
cluster = Cassandra.connect
#cluster.each_host do |host|
# puts "Host #{"127.0.0.1"}: id=#{"6123e2c1-e3ca-4d08-a544-1315b2f399f1"} datacenter=#{"datacenter1"} rack=#{"rack1"}"
#end
keyspace = 'demo'
session = cluster.connect(keyspace)
@pmcfadin
pmcfadin / active_orders.cql
Created October 30, 2014 04:46
Data model for storing active orders
CREATE TABLE event (
id uuid,
active text,
event_time timestamp,
event text,
PRIMARY KEY ((id), active, event_time)
);
SELECT id FROM event WHERE id=<uuid> AND acrive='Y';