Skip to content

Instantly share code, notes, and snippets.

View jakemmarsh's full-sized avatar

Jake Marsh jakemmarsh

View GitHub Profile
@jakemmarsh
jakemmarsh / header-switcher.js
Created February 12, 2014 22:15
AngularJS Directive for looping through and displaying multiple headers
directives.directive('headerSwitcher', function() {
return {
restrict: 'A',
scope: {
elementType: '='
},
link: function(scope, element, attrs) {
var headers = $(element).children(scope.elementType),
headerIndex = -1;
@jakemmarsh
jakemmarsh / timeKeystore.py
Last active August 29, 2015 13:56
a simple keystore system in Python. Multiple values can be stored in a single key, and are retrieved based on time of creation.
import time
class keyStore:
def __init__(self):
self.storage = {}
def put(self, key, value):
# create array if it doesn't exist
if key not in self.storage:
self.storage[key] = []