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
a268e8b37be31c39e33cace27341fbc63406c0a0 |
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
http://disco.readthedocs.org/en/0.4.5/start/download.html | |
> deb http://discoproject.org/debian / | |
$ sudo apt-get update -q | |
[snip] | |
W: Failed to fetch http://discoproject.org/debian/Packages 404 Not Found | |
?:( |
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
% python2 | |
Python 2.7.4 (default, Apr 19 2013, 18:28:01) | |
[GCC 4.7.3] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import cgi | |
>>> data = 'next=/contact/200/106260296&next=/contact/200/106260296&next=/contact/200/106260296&next=/contact/200/106260296&' | |
>>> x = cgi.parse_qs(data) | |
>>> next_list = x['next'] | |
>>> print next_list | |
['/contact/200/106260296', '/contact/200/106260296', '/contact/200/106260296', '/contact/200/106260296'] |
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 |
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
$ 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
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
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
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
#!/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. | |
""" |
NewerOlder