Skip to content

Instantly share code, notes, and snippets.

View pokstad's full-sized avatar

Paul Okstad pokstad

View GitHub Profile
@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
@pokstad
pokstad / gaereverseproxy.go
Last active October 24, 2021 09:35
Google App Engine reverse proxy in Golang
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// HTTP reverse proxy handler
package goengine
import (
"io"
@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 / anything_test.go
Created April 10, 2017 04:20
A Go test that demonstrates how to marshal and unmarshal a Protobuf any.Any type
package anything_test
//go:generate protoc --go_out=. anything.proto
import (
"reflect"
"testing"
proto "github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
@pokstad
pokstad / anything.proto
Created April 10, 2017 04:04
A protobuf defintion to demonstrate any.Any
syntax = "proto3";
package anything;
import "google/protobuf/any.proto";
message AnythingForYou {
google.protobuf.Any anything = 1;
}
@pokstad
pokstad / anything.pb.go
Last active April 10, 2017 04:03
Protobuf and generate Go code for protobuf definition demonstrating any.Any usage
// Code generated by protoc-gen-go.
// source: anything.proto
// DO NOT EDIT!
/*
Package anything is a generated protocol buffer package.
It is generated from these files:
anything.proto
@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 / app.yaml
Last active August 29, 2015 14:23
Google App Engine Sandbox Module for Dispatch Demo
# make sure to replace "projectid" below with the project ID configured in the Google Developer Console
application: projectid
version: 1
runtime: go
api_version: go1
module: module2
handlers:
- url: /.*
script: _go_app
@pokstad
pokstad / Dockerfile
Last active August 29, 2015 14:23
Sample App for Google's Managed VM service
# Dockerfile extending the generic Go image with application files for a
# single application.
FROM gcr.io/google_appengine/golang
COPY . /go/src/app
RUN go-wrapper download
RUN go-wrapper install -tags appenginevm