Toby de Havilland
-
2012-03-14
-
→
-
2010-12-16
log4cpp universal dylib on OS X
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.
$ ./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.dylibYou may or may not need to modify the library after running make, it depends how the library is bundled with your application.
-
→
Recommendation: z
z is an awesome bash script that stores a list of your frequently used directories.
Instead of typing:
cd ~/Work/ProjectsFolder/ProjectA/Something/Src/You can type:
z ProjectA <TAB>It’s utterly brilliant, check it out on GitHub: http://github.com/rupa/z/
Thanks to Ben Tappin for the tip.
-
→
Project specific .vimrc / How to modify the python path when working in Vim
In Vim I often find the need to add my python project to the PYTHONPATH so I can run external tools, code completion etc.
Try opening a Django project in Vim and importing a model:
:cd ~/Your/Project/Dir :!python >>> from yoursite.yourapp import modelsYou’ll get the following error:
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.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:
Add the following line to your vimrc:
" Read .vimproj in the working directory map <silent> <leader>P :source ./.vimproj<CR>Then create a file in your project root called .vimproj with the follwing contents:
" Mysite Specific Vimrc let $django_dir = getcwd()."/<your django folder name>" 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"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.
-
→
Recommendation: Inconsolata-dz
Inconsolata-dz is an excellent programming font, based on Inconsolata, that’s been modified to use straight single and double quotes.
