Your friends at Viget present Extend, a Code & Technology Blog

8 Insanely Useful ActiveAdmin Customizations

Here at Viget, we've successfully used ActiveAdmin on a number of custom CMS projects. ActiveAdmin is a great help in providing a sensible set of features out-of-the-box, while still allowing heavy customization for great justice. It also has a very opinionated way of doing things, which can make customization a bit tricky (eg. layouts via Arbre, Custom Pages, etc.)

After working with ActiveAdmin for a couple of years, here are 8 customizations that I find myself using often:


Gulp + Browserify: The Everything Post

Getting Started

One weekend, I decided to really immerse myself in Grunt and RequireJS. Gotta stay up on these things right? Done. Then Monday rolls around, “and just like that Grunt and RequireJS are out, it’s all about Gulp and Browserify now.”

(╯°□°)╯︵ ┻━┻

When I was done flipping tables, I set aside my newly acquired Grunt + RequireJS skills, and started over again with Gulp and Browserify to see what all the fuss was about.

You guys. The internet was right. To save you some googling, doc crawling, and trial and error I went through, I've assembled some resources and information I think you'll find helpful in getting started.

 ┬─┬ノ( º _ ºノ) 


Teaching Kids Programming with Khan Academy

Like many other programmers with children I'm interested in passing my skills on to them. If you've ever had the opportunity to work with me, this may or may not be a horrifying proposition — I'll let you be the judge.

My two oldest (9 and 7) are now at a good age to start learning the basics, so I've been spending every Wednesday morning before work teaching them with the help of Khan Academy. Since I'm new to this, there's definitely a lot of trial and error to figure out the intersection between their interests and capabilities. In the process I've discovered a few things that work and a few that don't. These lessons are specific to me, but you may find them helpful.


How Arduinos Helped Me Fix My Car Horn

There seems to be a common issue with 2002 Mitsubishi Montero Sports* where the horn will suddenly turn on if it’s cold out, and have no intentions of turning itself off. I discovered this first hand with my own Montero Sport earlier this winter on a particularly chilly night. The quick fix was to disconnect the battery, plug it back in when I wanted to drive, and then remember to unplug it again overnight (did not always go well). Unrelated, I have been experimenting with Arduinos here and there, and this is the story of how working with Arduinos let me (pretty much) fix my car horn.


C Games in Ncurses: Using Multiple Windows

You've got an ice cold Tab sitting next to you as you hack away on your Pong clone while blasting Wham! on your Walkman. You finally got a ball bouncing back and forth across your terminal window (see my previous post) and you're wondering "what's next?"

Let's split our Pong game into two parts: the playing field and the score display. We'll plan for the playing field to be at the top portion of the screen, and the player's current score will be displayed at the bottom. This makes sense, but how do we do it?

A simple implementation might be to just move the current drawing position to a location on the bottom of the screen and print out the current score value (using mvwprintw), but that would require you to bounce the ball before it overlaps the score display. While that would work, it's less than ideal for a couple of reasons:

  • You can't update the score display independently from the main playing field. Each time the playing field needs to be redrawn you need to also redraw the score display, even if it hasn't changed.

  • More importantly, your code is now littered with confusing collision detection logic. No longer are you checking if y >= max_y, you now need to see if (y + score_height) >= max_y.

Fortunately, ncurses provides the ability to split these two concerns into separate windows, each updated independently. It might be a little more work to manage multiple windows in your program, but it's the right thing to do. In the end, you envision splitting the windows into something like this:

Let's see how we would implement that.