How do I “externalize” a file using SVN?

December 6, 2010 in Recipes, Subversion

This is the problem. Suppose you have a directory Paper under revision control and suppose you need to have inside this directory a file (call this file foo.bib for example)
…read more

Any good word completion tool for Emacs?

December 5, 2010 in Emacs and friends, Recipes

I really like pabbrev. Refer to this blog for a thorough discussion. This is the stuff I added in my configuration file: (require ‘pabbrev) (global-pabbrev-mode t) (setq pabbrev-read-only-error nil)

How do I integrate SVN with Emacs?

December 5, 2010 in Emacs and friends, Recipes, Subversion

So far, I found the package psvn quite useful. Refer to Anthorspace blog for how to set it up. This is the only stuff I added to my configuration file:
…read more

Where is the Aquamacs configuration file located?

December 5, 2010 in Emacs and friends, Recipes

Usually in the folder: /Users/user_name/Library/Preferences/Aquamacs Emacs Where user_name denotes the home folder of the user. Look for the file called Preferences.el

How do I remove the .svn hidden folders?

December 4, 2010 in Recipes, Shell, Subversion

If the command svn export is not suitable for you, then you may use this command: find . -name .svn -print0 | xargs -0 rm -rf as suggested here.

How do I look recursively for all the files containing a certain string?

December 4, 2010 in Recipes, Shell

To find all the occurrences of the string tabular in all the files hosted in the current directory use the command: grep -nir “tabular” * where n prints the line
…read more

How to tar and gzip a directory in one command?

December 4, 2010 in Recipes, Shell

This way (for the directory foo): tar -zcvf foo.tgz foo/

How to recursively replace a string inside all files contained in a directory (and its subdirectories)?

December 4, 2010 in Recipes, Shell

This command searches recursively all the cpp files and substitues the email address from zuliani@ece.ucsb.edu to marco.zuliani@gmail.com. find . -type f -name *.cpp | \ xargs -I {} sed -i
…read more

Where is the file hosting the settings for bash in Mac OS X?

December 4, 2010 in Recipes, Shell

Here: /Users/user_name/.profile

How do I search a list in Python?

December 4, 2010 in Coding, Python, Recipes

This code snippet will search the element that meets a certain condition in a list using generators. Use try/except and StopIteration to see if the list has been completely scanned.