• How to speak spanish like a colombian drug lord!


    I have been living in Puerto Rico for 4 years but two of those have been COVID and so I have not been able to practice Spanish as much as I would like. So to speed up my learning I have decided I want to watch a lot of spanish speaking television to start training my ears, but to do this I need a baseline of words I understand to be able to even know what they are saying!

    Learning throug...

  • Turning Vim into a modern Python IDE


    TL;DR:

    $ git clone https://github.com/sontek/dotfiles.git
    $ cd dotfiles
    $ ./install.sh vim
    

    Intro

    Back in 2008, I wrote the article Python with a modular IDE (Vim). Years later, I have people e-mailing me and commenting daily asking for more information, even though most of the information in i...

  • Caesar Cipher in Python


    I'm currently teaching my wife to code and one of the problems that we worked on to teach her some fundamental programming concepts was re-implementing the caesar cipher in python. It was fun not only to code but to also start sending each other "secret" messages!

    The caesar cipher is a rather simple encoding, you just shift the alphabet a certain amount of characters. For example, if yo...

  • Convert a string to an integer in Python


    A fun interview question some developers like to ask is to have you convert ascii characters to an integer without using built in methods like string.atoi or int().

    So using python the obvious ways to convert a string to an integer are these:

    ...
  • Tips and Tricks for the Python Interpreter


    I have seen a lot of people switch over to using ipython, bpython, etc to get auto-complete support without realizing that the standard interpreter does have this functionality.

    To enable auto-complete support in the python interpreter you need to create a python startup file that enables readline support. A python startup file is just a bunch of python code that gets executed at startup...

  • Writing tests for Pyramid and SQLAlchemy


    TL;DR: Putting it all together, the full code can be found here: https://gist.github.com/1420255

    Intro

    Pyramid's documentation doesn't cover the preferred way to test with SQLAlchemy, because Pyramid tries to stay out of your way and allow you to make your own decisions. However, I feel i'ts necessary to document what I think is the ...