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
In [1]: u = User(username="foo") | |
In [2]: u.save() | |
In [3]: from myapp.models import * | |
In [4]: my_form = StudentProfileForm({"name": "Foo", "website": "http://foo.com"}) | |
In [5]: my_form.is | |
my_form.is_bound my_form.is_multipart my_form.is_valid |
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
function sendIdToPopupOpener(win, chosenId) { | |
var name = windowname_to_id(win.name); | |
var elem = window.opener.document.getElementById(name); | |
if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { | |
elem.value += ',' + chosenId; | |
} else { | |
window.opener.document.getElementById(name).value = chosenId; | |
} | |
} |
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
export PGDATAOLD="/Users/ustun/Library/Application Support/Postgres/var" | |
export PGDATANEW="/Users/ustun/Library/Application Support/Postgres93/var" | |
export PGBINOLD="/Applications/Postgres.app/Contents/MacOS/bin" | |
export PGBINNEW="/Applications/Postgres93.app/Contents/MacOS/bin" | |
pg_upgrade |
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
javascript:(function(){readStyle='style-novel';readSize='size-large';readMargin='margin-medium';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.getElementsByTagName('head')[0].appendChild(_readability_css);_readability_print_css=document.createElement('LINK');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css |
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 | |
import urllib | |
from datetime import datetime | |
response = urllib.urlopen("http://www.bilkent.edu.tr/~kafemud/monu_tr.html") | |
headers = response.info() | |
lastchangedDate = datetime.strptime(headers["date"],"%a, %d %b %Y %H:%M:%S %Z") | |
today = datetime.today() | |
dayDifference = abs((today-lastchangedDate).days) | |
if dayDifference > 2: |
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
(global-set-key (kbd "S-M-<right>") 'other-frame) | |
(global-set-key (kbd "S-M-<left>") 'other-frame) |
NewerOlder