Retreive your Latest Twitter Update (Tweet) using Python
I used to display my latest tweet using PHP code as part of my WordPress theme’s function.php. However that did not work reliably and used to slow down page loading a wee bit. Hence I decided to generate the html code for the latest tweet as a background/cron process and just read the generated data [...]
Find the Length of a String Variable in Bash
I forget this one all the time! so making a record $ STRING=”test” $ echo “${#STRING}” 4 $
Detect Mobile Browser using Server Side Includes (SSI)
There’s a website dedicated for open source code in various programming languages to detect mobile browsers. However they didn’t have any code to detect a mobile browser using SSI. Thats what I needed to make the HTML pages on my website mobile friendly. Using the <!–#if expr SSI conditional expression, I wrote up a small [...]
Indirectly reference bash variable
If you know the name of a variable which contains a value of interest, you need indirect referencing to retrieve the value, this is how you do it. #!/bin/bash j=1 #variable containg a value i=j #variable containing the name of the variable which holds the value eval k=\$$i #k now contains the value of j [...]
Bash based Busy Handler for Sqlite
Sqlite is a serverless database and hence doesn’t allow multiple synchronous write requests. Sqlite API for most programming languages have a busy handler functionality which lets you define a busy handler function or a timeout value, thus enabling your program to wait for a certain amount of time and then access the database again.
XSL template for Generating Per Page TOC for Docbook HTML Output
Sometime back I worked on this upcoming Ruby On Rails Book and helped the author convert his docbook to various formats like HTML, PDF, EPUB, Kindle etc. While working with the HTML output, I figured that the standard output spewed out by the Docbook XSL stylesheets is quite boring. So I improvised a lil, added [...]
Sample Bluetooth RFCOMM Client App in Python
I recently wrote a bluetooth rfcomm client app in C. However before I started writing the code in C, I prototyped it using python. The python code obviously is 50 times shorter than the C code and was very easy to write. Surprisingly it also feels snappier than its C counterpart. May be I screwed [...]
Sample Bluetooth RFCOMM Client App in C
I recently worked with a client who wanted a Bluetooth RFCOMM client-server application. The server would sit on an android phone, while the client will run on an embedded linux device. The rfcomm client portion was just sample code that he wanted to base his implementation on. I wrote a quick app for the same. [...]
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 [...]
Recent Comments
(1 weeks ago)
(1 weeks ago)
(1 weeks ago)
(1 weeks ago)