Favourite Debugging Trick
Last week I wrote about some of my favourite debugging tools in Ruby. I forgot one trick that I find super useful! Today I was writing a script that would iterate through objects in an S3 bucket and group these objects by similar names. The naming structure looked like this: original.jpg tumb_original.jpg profile_original.jpg So all three of those images should get grouped together because they all come from orignal.jpg. But I got my name comparison muddled and something wasn’t working right.
Creating a tmux Colour Theme
I recently decided to use the Dracula in my coding environment. Love it or hate it, I’ve been working with Vim and tmux for the past two years and I inherited my Vim and tmux configurations from someone else. I dove head first into this environment and got used to it pretty quickly, but I never spent much time configuring it. When I switched Vim over to Dracula, I immediately realized that I needed to change my tmux colours too!
Debugging in Rails with Pry, `bundle open` and `puts`
This week I got to dig into some debugging that I really enjoyed. Well, if you had asked me in the middle of it I might not have been having fun, but I found a solution! I used a handful of tools to approach debugging and they all gave me a little bit more information to solve the problem that I didn’t have before. Here is a bit about each tool and what I find useful about it.
Concatenating MySQL Results with Group_concat and Concat_ws
Recently, I needed to build a query that would transform data in our database into a format that we posted to ElasticSearch. I’ll use the example of blog posts here since they’re easy for everyone to grasp. Imagine that each post can have many tags and you want one field on ElasticSearch with the tag ids and another field that has the tag names and description. Here’s what the database might look like:
Writing Super Fast Queries in Rails
At work this week I had to speed up a background job that was clogging up our queue. This job aggregates data on records and posts to our Elastic Search index. It was suffering from all kinds of extra database calls. I had lots of fun working on this query! It’s so satisfying to make things fast. Here’s a bit of what I learned about building SQL queries that can get tough with a typical ActiveRecord object.
How to Rewrite git History when Collaborating with Others
I was recently working on a new node project, and while I was first testing things out, I committed the contents of the dist directory to git. Later on, I was getting the project set up with Docker, and I realized I didn’t want the dist in the repo as it would increase the size of the Docker image. Removing files from git is a bit tricky. You can add it to the .
Toronto Sound Prints
A couple years back I collaborated with Sheraz Khan on a couple of art projects. For a while, we had a portfolio site exhibiting our artworks but that domain recently expired. One of the projects we worked on together was called Toronto Sound Prints. I really liked the end product for this project, so here’s a sample of what we worked on. We worked with Ryerson University’s SMART Lab to create visual interpretations of data they collected that correlated sound data with stress in human subjects.
Optimizing GIFS with FFMPEG
A few months back I was working on an iOS app that delivered GIFs to users. The idea was that someone would visit one of our 3D photo booths, and get an animated avatar created. We could then render animation frames to PNGs using our custom software. The problem was that some of our animations were rather long, so we needed to crunch the gifs down to the smallest possible size.
Video Glitch Art in Ruby
This is the text from a talk about my video glitch work on Fido’s Mobile Music Video. Credit for making this kind of work so fun goes to UCNV for creating the AviGlitch Gem. A few months ago I got to work on a music video with Vice Magazine and Fido. When I tell people about this contract, both developers and artists alike ask “How did you get that job?”
Developing with Kirby
A year or so ago, I taught myself PHP by way of WordPress. I didn’t consider myself a developer, but I knew how to make things happen. When I learned Ruby on Rails, I was thrilled to realize that I actually understood the basic concepts of programming, and I picked up Ruby really quickly. After learning Rails this winter, I was curious to see how much more I understood about PHP now that I had begun to work with Ruby, so I built a new site using Kirby.