Skip to content

Instantly share code, notes, and snippets.

/*
To avoid polluting the global namespace this uses an anonymous
function which is called with either the URL for an external
JavaScript file or a function. In either case jQuery will be loaded
from the Google CDN before your code is executed so it's free to
depend on jQuery without checking for it and can do things like
jQuery.getScript() to load other components (e.g. jQuery UI),
stylesheets, etc.
*/
(function (target, msg) {
# Steps, with commands, to move the swap file on MacOS X/10.5 (Leopard)
# Handy for us with very small drives like the 8GB SSD in Mini9s
# First, find the name of your "volume" -- it depends on what you named upon formatting but can be changed via the Finder without issue.
# get this name static since I am not sure if/howto utilize a udev/UUID mounting scheme on OSX, given its major differences.
# From seeing how to mount a drive prior to a user login (handy if you do have extra space and require this to be mounted upon boot so everything does not crash), an answer could be in the autofs stuff but this works.
# standard mkdir in terminal. use a dot dir so its "hidden" normally since seeing a swapfile in the finder is pointless
mkdir /Volumes/FlashMedia/.vm
# -*- coding: utf-8 -*-
# pyprowl.py - Post to Prowl (https://prowl.weks.net) from Python.
#
# Copyright (c) 2009 Zachary Voase
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# -*- coding: utf-8 -*-
# First stab at implementing graphs in Python.
# Horrifically undocumented.
import operator
import textwrap
class SimpleStruct(type):
# -*- coding: utf-8 -*-
"""
Example Usage
=============
>>> import datetime
>>> start = datetime.date(2009, 6, 21)
>>> g1 = daterange(start)
# -*- coding: utf-8 -*-
from decimal import Decimal
import random
def montecarlo(choices):
"""
It's easier for me to explain this with an example.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Zachary Voase <disturbyte@gmail.com>'
__version__ = '0.1'
"""
faceoff.py - A fun (non-serious) module for playing games.
Example:
*.pyc
To create a local branch that follows a remote branch (two ways):
First way (creates the branch that follows the remote branch "origin/master" and switches to it):
git checkout -b pull-watch origin/master
Second way (just creates the branch):
git branch pull-watch origin/master
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the