Quick and easy way to inflate an archive using the fantastic ZipKit.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
Quick and easy way to inflate an archive using the fantastic ZipKit.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
Source: http://www.codekoala.com/blog/2009/aes-encryption-python-using-pycrypto/
As a follow-up to the last post, you can also use FileMerge to handle merges with Mercurial.
First, you need to write a script that will force opendiff to wait before returning during a merge. Name the script opendiff-w.
1 2 | |
Then you need to make it executable.
1
| |
Finally, put the script on your $PATH. I put mine in a folder called ~/development/scripts/path, and added this to my ~/.profile:
1
| |
Source the file and make sure you can execute the file you just created.
1 2 3 | |
opendiff-w for mergesEdit your ~/.hgrc file and add the following:
1 2 3 4 5 6 | |
Make sure your executable path includes the opendiff-w at the end. For example, mine is:
1
| |
You are good to go. Next time you do a hg merge, Mercurial will use FileMerge to let you manually fix the conflict.
Mercurial allows you to setup an external diff tool to handle viewing diffs. Here is how you can get Mercurial to use FileMerge (the merge tool that is installed with the OSX developer tools).
Download the scripts, unpack them, and install them.
1 2 3 4 5 | |
Edit your ~/.hgrc file and add the following:
1 2 3 4 5 | |
If you have a dirty working copy, you can now view the diff between it and the tip by using the following command:
1
| |
Of course, you can still use all the normal diff options. For example, to view the differences between two revisions, do this:
1
| |
Or for a single file:
1
| |
Or to see the difference between a revision and your working copy for a single file:
1
| |
Yay, Mercurial.
Create a ModelForm for a given model and list of fields.
1 2 3 4 5 6 7 | |
Now use it.
1 2 3 | |
Sources:
Download and install the latest version of graphviz.
Download and unpack the latest version of pygraphviz.
Update the library_path and include_path in setup.py.
1 2 | |
Install as usual:
1
| |
Test the install.
Important: Before you enter the python interpreter, make sure you leave the pygraphviz directory.
1 2 3 4 | |
Sources:
http://bradmontgomery.blogspot.com/2010/07/pygraphviz-on-os-x-sl-with-virtualenv.html
A handy way to create a list with the same value repeated.
1 2 3 | |
This trick is also nifty for plotting data, where you need all points on the y-axis without a value to be a given number (usually 0).
1 2 3 4 5 6 7 8 | |
You can sort groups in Xcode 3.x, but it’s not very intuitive. Select the group you want to sort, then do Edit->Sort->By Name. That will sort the group, but it doesn’t keep it sorted. Because sorting is in the menu, it’s very easy to assign a key binding (I did ctrl+alt+command+s).

SQLite’s alter table command only supports renaming the table and adding a column. If you need to alter a column (say, to change it’s length), the high-level process looks like this: export the data, drop the table, recreate the table with the updated column, then import the data. You can use SQLite’s dot commands to achieve that with minimal fuss.
1 2 3 4 5 6 7 8 | |
If you’re using Django, it’ll take care of creating the table for you. Just update your models.py to reflect your new changes, then the workflow looks like this:
1 2 3 4 5 6 7 8 9 | |
You could also consider looking at the South project which is billed as intelligent schema and data migrations for Django.
If you’re looking for RegexKitLite 3.3, it’s a little less than intuitive to find it. I eventually found it here after just grabbing the URL for the 4.0 release and changing it to 3.3.
Why would you want an older version? According this this post on the Cocoa Dev mailing list apps have been rejected for using RegexKitLite 4.0. You can either replace your 4.0 version with 3.3, or just add the -DRKL_BLOCKS=0 flag to your OTHER_CFLAGS build settings in Xcode (much simpler in my opinion).