Blog

Book Notes: "Antifragile"

February 16, 2015

I read Nassim Nicolas Taleb's latest book, Antifragile: Things That Gain from Disorder, a few months ago and it easily became one of my favorite books. I liked the way he explained things and he covered many topics that are very relevant today. I'm actually re-reading parts of it right now. I figured I'll take this time to share my notes in a blog post.

Prologue

Less is more and usually more effective.

A …

Give your Django app more of a native mobile app feel with Chrome for Android's 'Add to Homescreen'

February 10, 2015

A user of one of my Django apps, GlucoseTracker, suggested this to me last week and I actually didn't even know this feature existed. I thought it was a really great idea and it turned out it can be done easily with about 3 lines of additional code:

# base.html

<!doctype html> 
<html>
   <head>
     <title>GlucoseTracker</title>

      <!-- Enables 'Add to Homescreen' for Android -->
      <meta name="viewport" content="width=device-width">
      <meta name="mobile-web-app-capable" content="yes">
      <link rel="icon" sizes="192x192" href="{% static …

Haystack with Solr: Indexing Tips

January 22, 2015

I was troubleshooting an issue a couple of weeks ago with some of our Django views taking too long to return a response. The issue was due to post_save and post_delete signals making a request to Solr to update the index with the 'commit' parameter set to 'true' (Haystack default). This basically tells Solr to do the indexing right away (hard commit) and it was taking a few seconds to finish.

Below are some tips …

Adding basic search to your Django site

January 17, 2015

While most people probably find content on your site through Google, it might still be a good idea to just add a basic search functionality to it. You can control which fields to search, how your results are displayed, and your readers won't have to leave your site. You may also have content that is not yet public that you want to be able to search, such as unpublished articles or blog posts.

For this …

Ubuntu: How to delete old kernels to free up space in the boot partition

January 15, 2015

This is at least the second time this has happened to me so I figured I'd make a note here for future reference.

Basically I was running the Software Update and it complained that there is "Not enough free disk space":

The upgrade needs a total of 81.7 M free space on disk '/boot'. Please free at least an additional 15.5 M of disk space on '/boot'. Empty your trash and remove temporary packages of …