Andrew's blog

Just another programming blog with an uninspired title

The “Back to School” Idea

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

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”

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

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

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

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

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

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.

Manipulating Coffeescript With Vim, Part 1: Text Objects

I recently started to write a lot of coffeescript at work, so I bumped into an issue that I’ve been avoiding for some time: manipulating indent-based languages. Theoretically, it should be easier (no “ends” or closing braces, right?), but I have a lot of tools to move code around, wrap it in blocks, or view it nicely, that just don’t work with semantic indentation. So, I had to experiment to come up with some vimscript to make it more comfortable. It’s all a work in progress, but it’s been rather useful for me so far.

Originally, I intended to write a single post, but I started off rather verbosely, so I decided to make it a series instead and explain the code in more detail along the way. To begin with, I’ll describe the process of writing two simple text objects that might be useful in day-to-day coffeescript development.

If you’re unfamiliar with text objects in Vim, you could get a good explanation from the help files with :help text-objects. Another nice introduction is Chapter 15 from “Learn Vimscript the Hard Way” by Steve Losh. It’s rather short, so I recommend you skip through it in any case.

Customizing the NERDTree’s Filesystem Menu

For quite a while, the NERDTree has had some simple scripting capabilities. At some point, I decided to use these to override the basic filesystem menu it provides to something a bit weirder. My problem with the default menu was its lack of vim keybindings. Being in command mode is usually not an issue, since it’s fairly rare, but I got really used to moving and renaming files through the tree, so it was time to improve the experience a bit.