Skip to content

Instantly share code, notes, and snippets.

View AdamG's full-sized avatar

Adam Gomaa AdamG

  • San Francisco, CA
View GitHub Profile
;; modified version of zap-to-char from emacs CVS
;;
;; http://cvs.savannah.gnu.org/viewvc/emacs/emacs/lisp/simple.el?revision=1.1&view=markup
;;
;; Uncomment one line to get up-to-char behavior, as referenced in
;;
;; http://www.emacswiki.org/emacs/ZapToCharUsage#toc4
(defun zap-up-to-char (arg char)
"Kill up to ARG'th occurrence of CHAR.
@AdamG
AdamG / state.py
Created March 7, 2011 17:31
useless brainstorming
"""
Just some brainstorming. I don't really have a good repo for this.
So I've been thinking about state. The total state of an application
consists of the code, the data, and that's about it. There's external
state too. But everything, I dunno... should be *managed*, I guess. At
one level, that's the job of an OS. On the other hand, we're talking
potentially many machines.
This sounds like something plan9 would have already solved. That's OK.
class SitesPage(object):
def __init__(self, site, path):
self.site = site
self.path = path
self.load_data()
def load_data(self):
import gdata.sites.client
self.client = gdata.sites.client.SitesClient(
source="sitestest-v1", site=self.site)