subscribe via RSS


  • The New(ish) Facebook Authentication Process

    Categories: facebook, rails, ruby


  • Small Refactorings

    Categories: rails, ruby

    A common piece of advice for dealing with bad rails code is to avoid making huge rewrites all at once. Instead, make small fixes whenever you see a problem. An often-cited variant of this is the "boyscout rule" -- leave the code better than you found it.


    As with most good advice, this can still backfire. Ever seen an app with five different caching mechanisms and seven different event tracking approaches, all slightly different? This may have been a result of multiple developers going "this is horrible, I'll fix it". In the end, they created an even larger mess, despite their good intentions. How did this happen?

  • The "Back to School" idea

    Categories: education, talks

    OHM was a place full of amazing ideas and clever hacks. In this atmosphere, a friend and I started talking about our education system and the age-old promise of "multimedia" in the classroom. It's a popular topic these days, education. Startups like coursera are providing free online lessons, clever tools like geddit are trying to improve teacher-student interaction. What Vloo and me discussed was using presentation slides in class in order to improve engagement.

    Something like this is already in use in my home country of Bulgaria. There are specialized classrooms equipped with computers and projectors, and every once in a while, the students have an "interactive class", where they watch videos and perform quizzes. However, this is something that happens rarely and is considered a "special" lesson. I was more interested in turning any lesson into an actual lecture. Just as lecturers at tech conferences teach me about the latest, greatest web framework, it should be perfectly possible to use the same tools for a chemistry, or biology, or history lecture.

    As we were describing what a lesson would look like, we realized we could actually prepare one. We dubbed the event "Back to School" and I started working on a chemistry lecture to present at the local hackerspace, initLab.

  • OHM 2013

    Categories: conferences, vim

    I went to OHM (Observe, Hack, Make) this year, a hacker festival in the Netherlands. It was a fun week of camping, freedom talks, technology, retro-gaming and all sorts of other cool stuff. Since I was going there anyway, I decided to make a Vim event to spread word of the One True Editor.

  • Thoughts on "Half a Model"

    Categories: rails, ruby

    In ActiveRecord, you can use the select method to run the underlying database query with a SELECT for particular fields. As a result, the object simply doesn't have the rest of its attributes. Depending on the particular table and the use case, this could speed things up. Even without the performance argument, the idea to "get only the things you need" seems perfectly reasonable. This has never quite clicked with me, and I recently realized why. I've never encountered the problem viewed from this angle, so I figure it might be worth sharing.

  • Documentation

    Categories: documentation, talks

    I recently participated in RogueConf, a small Bulgarian conference. I talked about documentation, how and when to write it, how to write tools to help you out. The video is on youtube, and the slides are on speakerdeck, though it's all in Bulgarian. This post is the TL;DR of the talk. I'm going to run through my main points, skipping over the demos and most of the examples. Eventually, I'll extract some simple documentation tools from work in the dawanda/doctools repository, but there is still some effort needed to make them generally usable, I'm afraid.

  • Debugging git-all

    Categories: git, haskell

    An interesting tool I discovered recently is git-all. It shows you the status of all git repositories in the current directory that have changes or require pushing. This is pretty useful with my "projects" directory -- I could have forgotten to push some recent commits, or I might have started working on something and need a reminder to finish it.

    The program is written in haskell and I decided that it's small enough to use for haskell practice. My original intention was to add support for colors, but I found an odd bug that I ended up fixing instead. In the process, I learned one or two interesting things, so I'd like to explain them for someone else's benefit. If you have some haskell knowledge, but you're still in the "beginner" category, you might find the small nuggets of information useful.

    I'll start by covering several things about haskell I learned during the process. After that, I'll describe the actual problem and how I managed to solve it. Note that I'm very inexperienced in this area, so take my thoughts with a grain of salt.

  • Vimberlin: Lessons Learned from Building Splitjoin

    Categories: talks, vim

    At the November Vimberlin meetup, I talked about my exprience of building a plugin, what decisions I made and what lessons I took away from it all. My hope was that the attendees could use my ideas in their own code, and maybe become motivated to get coding themselves. Here's a short summary of the basic ideas I presented.

  • OpenFest 2012: Taking Over the World with Vim

    Categories: talks, vim

    This year, I did a talk at OpenFest about Vim. I tried to make a few interesting points about Vim and why it's awesome. In the end, it turned out to have too much talk and not enough mind-blowing plugin demos, which I should probably work on for next time.

    For now, I'd like to quickly go over the three main points that I hope people took away from the talk. The slides are uploaded to speakerdeck, though they're almost certainly useless without the demos and my explanations (not to mention they're in Bulgarian).

  • Manipulating Coffeescript With Vim, Part 2: Wrapping and Unwrapping

    Categories: coffeescript, vim

    In coffeescript, particularly when you're dealing with nodejs, code is often wrapped with lots and lots of callbacks. Since the indentation of the wrapping function calls varies, it's not very easy to move them around, delete them, or add new ones, because you need to adjust the indentation of the blocks of code they contain.

    In my previous post, I defined two mappings to operate on blocks of code. In this one, I'll define two that deal with the wrapping callbacks.