Tutorials :: Programming


Python and Unicode
Aug. 20, 2014, 9:36 p.m. by Nathan Osman

As one of the programmers who maintains the source code for the 2buntu website, I am pleased to announce an upcoming milestone - Python 3 support. We're not quite there yet, but we're very close. You can keep track of our progress as we near the finish line on this page. I thought it might be worth taking a few ...


Squashing git commits with interactive rebase
March 29, 2014, 5:04 a.m. by Nitin Venkatesh

Sometimes you want to make a gazillion little commits to keep track of your project and then later on you wish you could combine them into a single commit. This comes in especially handy when you are working on code in a public repository. You don't want to see every little change you make reflected in the logs, it's just ...


Reverting to an old commit & Grabbing changes from another branch : git checkout
March 21, 2014, 11:47 a.m. by Nitin Venkatesh

You might have seen me blogging regularly the last three weeks. That's thanks to James Clear's advice on forming new habits. I am trying to keep the "blog every saturday morning" habit this week with a short post on things I learnt to do with Git's Checkout command. So here we go! Reverting to an old commit To revert back ...


Keeping your forked repo synced with the upstream source
March 14, 2014, 11:45 a.m. by Nitin Venkatesh

We code, we fork, we code again, submit pull requests and the cycle goes on and on. Welcome to the world of Open Source. You fork a project to add some upgrade or feature and submit a pull request. However, when you're new like me, one big question that arises is - how do we keep the forked repo up-to-date ...


Making cross-domain AJAX possible with your PHP backend
March 7, 2014, 6:42 p.m. by Nitin Venkatesh

Generally, browsers will not allow you to make AJAX calls to your scripts that reside on another domain because of the Same-Origin Security policy present by default. This can be circumvented by using JSONP and stuff, but what if your script only returned text as output? You could tweak your script to wrap the text output in JSON which would ...


Installing Django and MongoDB in your virtualenv
Feb. 20, 2014, 1:09 a.m. by Nitin Venkatesh

This post is another in the series where I experiment with Django being a total newbie. Things got a little messy when I wanted to try and use MongoDB in Django, (things tend to get messy when you are a complete noob, I know :P ). Anyways, here is the error I encountered when I tried installing django-mongodb-engine: ImportError: Could ...


Virtualenv, Virtualenvwrapper and Pip - A python newbie's best friends
Feb. 16, 2014, 9:51 a.m. by Nitin Venkatesh

Sometimes installing the specific packages and then discovering you require another set of packages for one application you're developing(or trying to develop, atleast) can all be a bit overwhelming, especially for a Python newbie. I recently discovered Virtualenv, Virtualenvwrapper and pip which have made my life much, much easier. Yes, I know these have been the Python developer's tools for ...


Accessing Bootstrap docs offline + Installing Jekyll on Ubuntu 13.10
Feb. 1, 2014, 9:52 a.m. by Nitin Venkatesh

Yesterday night, my internet crapped out on me and I was offline the whole night without any access to the Bootstrap documentation online. It's easy if you Jekyll installed on your machine properly, so let's deal with installing it on Ubuntu 13.10 first. Installing Jekyll on Ubuntu 13.10: The jekyll package present by default in the Ubuntu repositories is a ...


Understanding Looping
Jan. 5, 2014, 12:09 a.m. by Nitin Venkatesh

What is a loop? A loop is a control structure that allows for a piece of code to be repeated continually. In other words, the piece of code present inside a loop is executed until a preset condition is not met. For example, let's write an algorithm for a cookie monster: until no cookie in jar: eat cookie; The first ...


Running a High Performance Website
Oct. 25, 2013, 3:57 p.m. by Nathan Osman

Here at 2buntu, we are always looking for ways to make our website more efficient. We recently published a brief article on some new changes we made to our architecture. Today, I would like to go into a bit more detail on what exactly we've done. Note: this is not a one-size-fits-all solution for making your own website faster. Your ...


Create your virtual development environments with virtualenv
Sept. 14, 2013, 10:31 a.m. by Bharath Thiruveedula

Whenever we create a project or downloaded from GitHub, installing the required dependencies will create a lot of problems, because the versions of same software will conflict sometimes or if you want to test the new Python module which is not trusted may create serious problems. So, instead of installing as standard library install it in some sandbox like thing ...


An Introduction to Django - Part 4
Sept. 7, 2013, 8:41 a.m. by Nathan Osman

This is the fourth and final article in my Django series. We will be completing our "Track Me" web application, although I strongly encourage you not to stop here. At the end of the article, I will suggest some improvements that could be made. Reworking the Navigation Bar Our navigation bar doesn't really behave in the way that most users ...


← Older