Skip to content

Instantly share code, notes, and snippets.

View pokstad's full-sized avatar

Paul Okstad pokstad

View GitHub Profile
@pokstad
pokstad / dirtocouch.py
Created December 17, 2013 00:54
Quick and dirty script for uploading the contents of a directory to a single CouchDB document
#!/usr/bin/python
'''
This script will upload the contents of a directory to a document in
CouchDB. It preserves all of the directory structures and is great
for uploading static websites to be served from CouchDB.
'''
import tkFileDialog
import couchdbkit
import os
import sys
@pokstad
pokstad / sslist.go
Created August 14, 2013 16:31
Singly Linked List in GO
package main
import "fmt"
type LLNode struct {
data string
next *LLNode
}
type LList struct {
@pokstad
pokstad / rediswebpy.py
Created September 7, 2011 23:02
Redis session store backend for web.py
import redis
import web
SESSION = 'SESSION:'
class RedisStore(web.session.Store):
"""Store for saving a session in redis:
import rediswebpy
session = web.session.Session(app, rediswebpy.RedisStore(), initializer={'count': 0})
@pokstad
pokstad / JsonPlistConverter.py
Created September 5, 2011 19:23
Convert between JSON and Plist Files
#!/usr/bin/env python
import plistlib
import json
import tkFileDialog
import re
import sys
file_to_open = tkFileDialog.askopenfilename(message="Select an existing plist or json file to convert.")
converted = None