WordPress Tricks: Pretty Breadcrumbs for Theme Hybrid based Child Themes
I was bored with the default breadcrumbs that come with Theme Hybrid. Wanted something new. I looked up some tutorials for nice looking breadcrumbs. Found this one which I liked quite a lot and decided to implement it for Humbug. Usually, things are very simple with Theme Hybrid, but this one was slightly ugly. Here’s [...]
Find Duplicate Lines in a File
sort PATH_TO_FILE | uniq -d Continuously watch for duplicate lines as you work on a file watch “sort PATH_TO_FILE | uniq -d”
WordPress Error: The plugin generated 1 characters of unexpected output during activation
This happens when the plugin developer leaves whitespace before <?php or after ?>.
WordPress Plugin: Remove Author Column on Edit Posts Page
This wordpress plugin removes the author column on Edit Posts page (for custom post types as well). The author column doesn’t make sense on single author blogs. By removing it, you can save precious real estate and use other useful plugins like Simply Show Ids. Remove Author Column This is my first wordpress plugin. Just [...]
Bash Script to Batch Resize all Images in a Folder
A simple script which will recognize all image types in the PWD and reduce them by 50% and copy them to the resized folder under PWD. Good for bulk resizing of images. #!/bin/bash files=($(file -i * | awk -F ‘:’ ‘BEGIN {ORS=""} /^.*:[ \t]*image\/[a-z]*; charset=binary/ {for(i=1;i<NF-1;i++) {print $i":"} {print $(NF-1)"\n"} }’ | sed ‘s/ /:spacecharacter:/g’ [...]
Useful Bash Variables
Everytime I write a bash script, I have to look up one of these special bash variables and I always forget which one is which. Jotting it down so that I don’t have to google for them the next time. $@ – all arguments as a big string. $# – number of arguments passed in [...]
Javascript: missing } in XML expression
There are some issues which are almost impossible to debug, but when you spot whats wrong, you feel incredibly stupid. This was one of those errors. Got this error, when I copy-pasted javascript code from the <head> of an HTML document and spent close to half an hour figuring out what was wrong. So what [...]
Redirect / Log the Output of a Bash Shell Script from within the Script
It is a common practice to use 1>/dev/null 2>&1 after commands to suppress any kind of output completely. The same technique is also used to redirect the output to a text file for logging purposes instead of /dev/null. For eg. echo "hello" 1>/tmp/hellolog 2>&1 However if you are writing a rather long bash script, it [...]
Algorithm and Sample C Code to Check if a Number is a Palindrome – Without Reversing the Digits
A friend posted this question on my college mailing list. How do we find if a Number is a Palindrome? Note: No conversion to string. And also, no traditional method of dividing the number to construct the reversed number and then compare. Here is how you go about it. Lets say the number is 1987891 [...]
Add Copy-Paste Functionality to Xterm, Rxvt like Terminals
Xterm, Rxvt like terminals do not support the traditional Ctrl C Ctrl V kind of copy paste functionality. Does anybody need it? Well I guess not, because you can highlight text, and then use the middle-click to paste it wherever you want. However if anybody needs it, this is what you need to do. Go [...]

Recent Comments
(1 weeks ago)
(1 weeks ago)
(2 weeks ago)
(3 weeks ago)