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
Django Serializer does not update many 2 many tables nicely with the using paramenter passed into its save. The object itself use the using database, but the many to many objects will not be saved using the using database. Instead it uses some other database. | |
How does it get that other database? | |
django/core/serializers/base.py:167: | |
django/db/models/fields/releated.py:824: |
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
shell-command("tail bar" #<buffer *eshell remote output*> #<buffer *eshell remote error*>) | |
eshell-remote-command("tail" ("bar")) <--- really look at this | |
eshell-external-command("tail" ("bar")) | |
eshell-plain-command("tail" ("bar")) | |
eshell-named-command("tail" ("bar")) | |
Also note tramp-sh-handle-file-local-copy |
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
> df -h | |
Filesystem Size Used Avail Use% Mounted on | |
udev 10M 244K 9.8M 3% /dev | |
/dev/disk/by-uuid/d7e4eb44-ba34-42a7-9cbe-1261536dacde | |
5.5G 5.1G 192M 97% / | |
shm 1.5G 0 1.5G 0% /dev/shm | |
/dev/sda4 119G 73M 112G 1% /boot <---- this line right here | |
^ | |
| | |
Do you see 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
class A(object): | |
x = 1 | |
def __init__(self): | |
print self.x | |
self.x = 2 | |
print self.x | |
a = A() | |
b = B() |
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 | |
""" | |
tug - twitter url generator | |
for now we only support atom feeds | |
""" | |
import urllib, urllib2 | |
import sys | |
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
= Ruby Packaging Standard | |
The aim of this document is two-fold. First, to specify a common | |
structure of how a Ruby package distributed as source (that is, but | |
not limited to, development directories, version-controlled | |
repositories, .tar.gz, Gems, ...) should conform to. | |
Second, to document common and proven ways to structure Ruby packages, | |
and to point out certain anti-patterns that sneaked into common use. | |
It is by intent not to innovate. |
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
Hosting Sphinx docs at GitHub | |
----------------------------- | |
Before: Run sphinx-quickstart in docs/ | |
1. Follow "Project Pages" instructions from http://pages.github.com/ to create a gh-pages branch | |
2. Add Sphinx html build dir as git submodule: | |
git checkout master | |
git submodule add -b gh-pages [email protected]:arthurk/django-disqus.git docs/_build/html |
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 CouchObject(object): | |
''' | |
Convert between a CouchDB document and Python object. | |
Create Python objects while maintaining a schema-free database. | |
Define object properties without storing null fields. | |
''' | |
@property | |
def id(self): | |
return self._id |
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
- simple | |
- public over private | |
- personal vanity | |
- internet is global | |
- permalinks | |
- one important item per page | |
- don't break the browser | |
- don't wanker in technology | |
- a medium is not a grande | |
- break convention for your users |
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
output = '' | |
for line in text.split('\n'): | |
while len(line) > 80: | |
pos = line[:80].rfind(' ') | |
output = output + line[:pos] + '\n' | |
line = line[pos+1:] | |
output = output + line + '\n' | |
print output |
NewerOlder