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 code snippet to apply a "* denotes required field" below the Django Admin page title, ex "Change [Model]" | |
* It also appends a "[field name]*" to all fields that are required. | |
* And finally it makes all the labels for required fields nice a red. | |
** Note: make sure to reference jquery in templates/admin/base_site.html <script type="text/javascript" src="{{ STATIC_URL }}js/jquery-latest.pack.js"></script> | |
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
# Bash snippet to open new shells in most recently visited dir. | |
# Useful if you want to open a new terminal tab at the present | |
# tab's location. | |
# | |
# Put this in your .bashrc or whatever. | |
pathed_cd () { | |
if [ "$1" == "" ]; then | |
cd | |
else |
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 | |
from datetime import datetime, timedelta | |
import httplib2 | |
from lxml import etree | |
import sys | |
import time | |
from urllib import urlencode | |
API_KEY = "api_key_goes_here" |
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 os | |
import shutil | |
import md5 | |
def find_duplicate_files(dirs): | |
all_files = {} | |
for dir in dirs: | |
for dirname, dirs, filenames in os.walk(dir): | |
if '.svn' in dirs: | |
dirs.remove('.svn') |
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 net_match ( $network , $ip ) { | |
$ip_arr = explode ( '/' , $network ); | |
$network_long = ip2long ( $ip_arr [ 0 ]); | |
$x = ip2long ( $ip_arr [ 1 ]); | |
$mask = long2ip ( $x ) == $ip_arr [ 1 ] ? $x : 0xffffffff << ( 32 - $ip_arr [ 1 ]); | |
$ip_long = ip2long ( $ip ); | |
return ( $ip_long & $mask ) == ( $network_long & $mask ); | |
} | |
function net() |
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
My problems with Lion: | |
Full screen apps suck on multiple monitors because the second monitor is blank and I can't do anything about it. On the other hand, on my MBA, fullscreen apps rock. | |
My MBA has crashed (kernel panics) a couple times. Could be Lion, could be hardware. | |
Initially, had issues with wifi reconnecting after waking up. Seems to be fixed now. | |
I use to use the three finger swipe to go back both in the browser and in the Twitter app. Now this swipe changes desktops. I could reset that but it annoys me. |
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 os.path import join | |
from fabric.api import env, require, run, cd | |
# Fabfile to deploy a Django app. To use run: | |
# | |
# fab staging deploy | |
# | |
# or | |
# | |
# fab prod deploy |
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 os, sys, site | |
# Adds the virtualenv library to the path | |
ENV_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) | |
site.addsitedir(os.path.join(ENV_PATH, 'lib','python2.6','site-packages')) | |
# Adds the project to the path | |
# Note that depending on the location of this file, PROJECT_PATH might change | |
PROJECT_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')) | |
sys.path.append(PROJECT_PATH) |
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
<VirtualHost *:80> | |
ServerAdmin admin@example.com | |
ServerName example.com | |
LogLevel warn | |
ErrorLog /path/to/logs/project_error.log | |
CustomLog /path/to/logs/project_access.log combined | |
# Ensures Apache servers static files | |
# These should match STATIC_ROOT and STATIC_URL |
This file has been truncated, but you can view the full file.
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
Sampling process 621 for 3 seconds with 1 millisecond of run time between samples | |
Sampling completed, processing symbols... | |
Analysis of sampling Adium (pid 621) every 1 millisecond | |
Process: Adium [621] | |
Path: /Applications/Adium.app/Contents/MacOS/Adium | |
Load Address: 0x100000000 | |
Identifier: com.adiumX.adiumX | |
Version: 1.5 (1.5) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [206] |
OlderNewer