Had gone to the Lal Bagh Republic Day flower show today along with Smitha. Had a nice time there for a few hours. Had mango juice, grape juice and cucumber (ಸೌತೆ ಕಾಯಿ) there, served by Hopcoms. We went by car from home, parked the car at Gandhi Bazaar (~2 km from Lal Bagh) since finding parking near Lal Bagh seems to be a tough task; took an auto from there to Lal Bagh. While coming back, we went to Roti Ghar at Lal Bagh. The original plan was to go to Vidyarthi Bhavan, but, since it was overcrowded, went to Roti Ghar.
Saturday, 26 January 2013
Thursday, 24 January 2013
Monday, 21 January 2013
Saturday, 19 January 2013
Monday, 14 January 2013
Sunday, 13 January 2013
Friday, 11 January 2013
Changing the author email for git commits
Say you had configured your email with a typo (say, as [email protected], instead of [email protected]), and want to now fix the email in the git logs, you can do this:
Remember that it is ok to do this if you have not yet shared your commits to the external world. However, if you have already shared it, it might not be appropriate to do this, since the filter-branch command creates new commit objects (with different SHA ids than the original commits).
Read more about the git filter-branch command at http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html.
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ];
then
export [email protected];
git commit-tree "$@";
else
shift;
while [ -n "$1" ];
do
shift;
map "$1";
shift;
done;
fi'
if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ];
then
export [email protected];
git commit-tree "$@";
else
shift;
while [ -n "$1" ];
do
shift;
map "$1";
shift;
done;
fi'
Remember that it is ok to do this if you have not yet shared your commits to the external world. However, if you have already shared it, it might not be appropriate to do this, since the filter-branch command creates new commit objects (with different SHA ids than the original commits).
Read more about the git filter-branch command at http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html.
Monday, 7 January 2013
Sunday, 6 January 2013
Thursday, 3 January 2013
Wednesday, 2 January 2013
Replace in vim with placeholders
vim allows you to match strings in a file using regexs and replace them.
For example, to replace all instances of "foo" with "bar" in the file, you do:
:%s/foo/bar/g
What's actually more useful, is that we can use \( and \) to capture the values that matched by the pattern and use \1, \2, \3 and so on to put the matched values in the expression to substitute.
So, to swap columns 1 and 3 of a comma-separated file with 3 columns, we can use:
:%s/\([^,]*\),\([^,]*\),\([^,]*\)/\3,\2,\1/
Subscribe to:
Posts
(
Atom
)