This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
TagTime daemon, in python. | |
Only trying to get to 'worksforme' here - the perl daemon just isn't | |
launching anything 3/4 of the time, and I have no idea how to debug | |
it. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/reader/views.py b/apps/reader/views.py | |
index 1d7a89d..13c0a77 100644 | |
--- a/apps/reader/views.py | |
+++ b/apps/reader/views.py | |
@@ -421,6 +421,10 @@ def load_single_feed(request, feed_id): | |
diff1, diff2, userstories_db and userstories_db.count() or '~SN0~SB', diff3)) | |
FeedLoadtime.objects.create(feed=feed, loadtime=timediff) | |
+ prefs = json.decode(user.profile.preferences) | |
+ if prefs.get("chronological_ordering", "descending") == "ascending": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.db.models.fields import CharField | |
class ModelField(CharField): | |
__metaclass__ = models.SubfieldBase | |
def __init__(self, **kwargs): | |
kwargs['blank'] = True | |
kwargs['max_length'] = 255 | |
super(ModelField, self).__init__(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
setup = """ | |
import sys as sys_module_level | |
def outer_test(): | |
return sys_module_level.version_info | |
def inner_test(): | |
import sys | |
return sys.version_info | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ du -sh srv/mysql-server | |
391M srv/mysql-server | |
$ # ^C the bzr branch lp:mysql-server | |
$ du -sh srv/mysql-server | |
84K srv/mysql-server | |
$ # ... for serious? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
find -xdev -regextype posix-egrep -regex ".*\.(py[co]|orig|old|rej|bak)$" -print0 \ | |
| xargs -0 rm -vf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
testobj_0 = MemoMethods('test0') | |
testobj_1 = MemoMethods('test1') | |
wrong0 = testobj_0.foo_borked | |
right0 = testobj_0.foo_fixed | |
wrong1 = testobj_1.foo_borked | |
right1 = testobj_1.foo_fixed | |
# this is the bug, wrong0's method is run with test1 as self |
OlderNewer