<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Software developer in London, UK.

FlipcodeBitBucketHidden</description><title>Toby de Havilland</title><generator>Tumblr (3.0; @tobydehavilland)</generator><link>http://tobydehavilland.com/</link><item><title>log4cpp universal dylib on OS X</title><description>&lt;p&gt;Configure and make using GCC 4.0 for x86_64 i386 and ppc against the 10.5 sdk then modify the library using install_name_tool.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ./configure --disable-dependency-tracking
$ make CC="gcc-4.0 -arch x86_64 -arch i386 -arch ppc7400" CXX="g++ -arch x86_64 -arch i386 -arch ppc7400 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"

$ cd src/.libs/
$ rm liblog4cpp.dylib
$ cp liblog4cpp.4.0.6.dylib liblog4cpp.dylib
$ install_name_tool -id @executable_path/liblog4cpp.dylib liblog4cpp.dylib
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You may or may not need to modify the library after running make, it depends how the library is bundled with your application.&lt;/p&gt;</description><link>http://tobydehavilland.com/post/2337620012</link><guid>http://tobydehavilland.com/post/2337620012</guid><pubDate>Thu, 16 Dec 2010 11:55:00 -0500</pubDate><category>c++</category><category>howto</category><category>mac</category><category>os x</category><category>tips</category><category>programming</category></item><item><title>Recommendation: z</title><description>&lt;p&gt;z is an awesome bash script that stores a list of your frequently used directories.&lt;/p&gt;

&lt;p&gt;Instead of typing:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd ~/Work/ProjectsFolder/ProjectA/Something/Src/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can type:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;z ProjectA &lt;TAB&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It’s utterly brilliant, check it out on GitHub: &lt;a href="http://github.com/rupa/z/"&gt;&lt;a href="http://github.com/rupa/z/"&gt;http://github.com/rupa/z/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href="http://mrben.co.uk"&gt;Ben Tappin&lt;/a&gt; for the tip.&lt;/p&gt;</description><link>http://tobydehavilland.com/post/2337608544</link><guid>http://tobydehavilland.com/post/2337608544</guid><pubDate>Thu, 16 Dec 2010 11:53:36 -0500</pubDate><category>tips</category><category>productivity</category></item><item><title>Project specific .vimrc / How to modify the python path when working in Vim</title><description>&lt;p&gt;In Vim I often find the need to add my python project to the PYTHONPATH so I can run external tools, code completion etc.&lt;/p&gt;

&lt;p&gt;Try opening a Django project in Vim and importing a model:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;:cd ~/Your/Project/Dir
:!python
&gt;&gt;&gt; from yoursite.yourapp import models
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You’ll get the following error:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Which makes sense, your project source isn’t on the python path. Here’s my solution to applying project specific vim settings / updating the python path:&lt;/p&gt;

&lt;p&gt;Add the following line to your vimrc:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;" Read .vimproj in the working directory
map &lt;silent&gt; &lt;leader&gt;P :source ./.vimproj&lt;CR&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then create a file in your project root called .vimproj with the follwing contents:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;" Mysite Specific Vimrc

let $django_dir = getcwd()."/&lt;your django folder name&gt;"
let $lib_dir = getcwd()."/libs"
let $site_packages_dir = "/Library/Python/2.6/site-packages/"

if !exists("g:python_dirs_loaded")
let g:python_dirs_loaded = 1
let $PYTHONPATH = $django_dir.":".$lib_dir.":".$site_packages_dir
set path=$django_dir
set path+=$lib_dir
set path+=$site_packages_dir
endif

let $DJANGO_SETTINGS_MODULE = "settings"

echo "Mysite settings loaded"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When I open a project bookmark in NerdTree, I type cd to change the working directory to the project root, then hit ,P to load the project specific settings.&lt;/p&gt;</description><link>http://tobydehavilland.com/post/2337583547</link><guid>http://tobydehavilland.com/post/2337583547</guid><pubDate>Thu, 16 Dec 2010 11:50:15 -0500</pubDate><category>vim</category><category>programming</category><category>python</category><category>howto</category></item><item><title>Recommendation: Inconsolata-dz</title><description>&lt;p&gt;&lt;a href="http://nodnod.net/2009/feb/12/adding-straight-single-and-double-quotes-inconsola/"&gt;Inconsolata-dz&lt;/a&gt; is an excellent programming font, based on &lt;a href="http://www.levien.com/type/myfonts/inconsolata.html"&gt;Inconsolata&lt;/a&gt;, that’s been modified to use straight single and double quotes.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ldj5axb6Ev1qeid0l.gif" alt=""/&gt;&lt;/p&gt;</description><link>http://tobydehavilland.com/post/2337568311</link><guid>http://tobydehavilland.com/post/2337568311</guid><pubDate>Thu, 16 Dec 2010 11:48:12 -0500</pubDate><category>vim</category><category>programming</category><category>fonts</category></item></channel></rss>

