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
Verifying my Blockstack ID is secured with the address 1E8A2cbd1sPbPwhj6Js7xyMctkNGxaPWUm https://explorer.blockstack.org/address/1E8A2cbd1sPbPwhj6Js7xyMctkNGxaPWUm |
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 TestModel(models.Model): | |
my_field = models.CharField(max_length=20) | |
tm = TestModel.objects.create(my_field='test') | |
tm.foo = 'bar' # how do I make this fail? |
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 Tester(): | |
def a(self): | |
print 'a' | |
def b(self): | |
print '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
Visualizing Twitter Search Results with Protovis and/or Graphviz is this easy: | |
$ easy_install twitter # See https://github.com/sixohsix/twitter and http://pypi.python.org/pypi/setuptools | |
$ git clone https://github.com/ptwobrussell/Mining-the-Social-Web.git | |
$ cd Mining-the-Social-Web/python_code | |
$ python introduction__retweet_visualization.py TeaParty # or whatever you want to search for | |
Your browser should pop open and display the results as a force directed graph, but also check your console for some useful output. | |
You can create an image file from the DOT language output with a command like the following: |
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 rcalc(w): | |
plates = [ 45, 35, 25, 10, 5, 2.5 ] | |
if w < plates[-1] * 2: | |
return (False, []) | |
for i in plates: | |
rem = w - (i * 2) | |
if rem > 0: |
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
if [ "`echo $0 | grep bash`" != "" ] ; then | |
if [ -f /etc/bash_completion ] ; then | |
. /etc/bash_completion | |
export PS1='${IP} ${debian_chroot:+($debian_chroot)}\u@\h:$(__git_ps1) \w\$ ' | |
fi | |
fi |