Jammit

| No Comments | No TrackBacks

I wanted ta take a minute to highlight Jammit, one of the most useful (and best documented) plugins I’ve used lately. Jammit is a really easy way to get CSS and Javascript minification and bundling with really low development overhead.

After installing the gem, it’s as simple as setting up your bundles in an assets.yml that looks something like this:

From code, these bundles can be referred to with the include_stylesheets and include_javascripts methods. When using these functions in development mode, the unminified, unbundled assets are included. In production environments, I wrote a capistrano task to bundle these up using the jammit command provided by the gem:

This minifies, bundles, and gzips all the assets and dumps them in the public/ directory, making generating these bundles something we don’t ever need to think about again.

Way better than the manual bundling rake tasks we were using before.

InfoQ: Systems that Never Stop (and Erlang)

| No Comments | No TrackBacks

Joe Armstrong gave a great presentation on Erlang late last year. It’s definitely worth a watch. Erlang’s one of those languages I know would make some really complicated work much more simple, but I never got around to learning it well. Maybe this year?

New System

| No Comments | No TrackBacks

I got a new work laptop yesterday, and so I’m writing this down for my future reference. These are the things I install on any new Mac system.

  1. Xcode (from the snow leopard disk)
  2. Fink
  3. Binary Fink Packages
  4. Ruby/Rubygems/Rails (through fink)
  5. Imagemagick (through fink)
  6. Git (through fink)
  7. Mysql (through fink)
  8. Emacs (from the unofficial git repo at git://git.sv.gnu.org/emacs.git)
  9. My dotfiles and dotemacs repos (from a shared git repo)
  10. Adium - iChat doesn’t do MSN, which doesn’t work in an office of former Microsofties/Expedians
  11. Tweetie
  12. Skype
  13. Colloquy
  14. VMWare Fusion
  15. NetNewsWire - This is for both the iPhone and Mac, and is the best RSS reader I’ve found.

For pretty much anything else, I just use the built-in stuff.

Great Read

| No Comments | No TrackBacks

I finally got around to reading Brian Ford’s recent post, Improving the Rubinius Bytecode Compiler, today. It’s a really good post if you’re interested in compilers, bytecodes, and self-hosting languages, and definitely worth a read when you have the time. It manages to capture that happy medium between skimming the surface of a bunch of topics while still managing to go into a reasonable amount of depth. It makes me want to reread my copy of the blue book again, which is another sign of a great blog post — it makes me want to go out and do something as a direct result of reading it!

ChromeOS

| No Comments | No TrackBacks

I like the idea of a web-only OS, since almost everything I need and use on a computer on a daily basis is accessible through the web, but it’s still missing one of the most critical things, and it’s the same thing that keeps me from going iPhone-only on vacations and long weekend trips — a decent way to edit code. Maybe something like Bespin is the answer — I’ve never tried it out, but would have expected to hear more about it if it was really worth using. Until someone comes up with some kind of web or iPhone-based emacs-like code editor, preferably one that syncs through DAV or some kind of VCS to other computers, I think I’m stuck with traditional laptops and OSes. A shame, because although the keyboard on the iPhone would be worthless for long coding sessions, it’d be great for small corrections and simple edits.

Function declarations vs definition

| No Comments | No TrackBacks

Just wrote this for a friend who’s in the process of writing C… it’s been a while for me, but I think it’s mostly accurate:

So you have your function main().

main() calls a function called int foo(int x).

say you have a file that looks like this:

when the file is compiled, main has no idea what foo() is, if you’re even calling it right, etc. because it doesn’t know about foo() until after main is compiled. There are two ways you can fix this:

  1. Define foo before main, like this:

This works when you have functions that only need to be used in one file. But it won’t work if that function is called from functions in many different files.

2. Describe how foo() expects to be called before it is ever called, so main() can tell if it’s calling it right:

This lets you be more flexible, because the declaration int foo(int x); can exist in a bunch of different files that all need to call foo(), but you only need to repeat the first line and not the entire function. This way, anyone calling foo() doesn’t even need to care about what foo() does, just what they expect to shove into it and what they expect to get out of it.

Hope that helps.

iNethack

| No Comments | No TrackBacks

Just saw that this came out on the iPhone. Sweet! Maybe now I’ll play enough that I can keep from dying so much.

Pragmatic Programmer Thanksgiving Sale

| No Comments | No TrackBacks

The Pragmatic Programmer is one of the best books on software development I’ve ever read, and is definitely the #1 book I recommend to fellow programmers when asked. It’s no surprise, then, that I’m fond of nearly every book I’ve read that their company has published. Lucky me (and you), they’re doing a holiday sale — 40% off everything in the store. Here’s some of the better books of theirs that I’ve read:

  1. The Pragmatic Programmer - Not sure if this one is discounted, since it’s usually excluded, but like I said, it’s my #1 and I recommend every working developer read it.

  2. Programming Ruby - This and _why’s guide are the books that got me into the language I use to make my living, and the only programming language I’ve ever felt fit my mental model of how programming should be. These days the 1.9 version would be the one to pick up, but this is the one that got me started.

  3. Agile Web Development with Rails - The first edition of this book taught me Rails, and I’ve bought every edition since then. It’s still my go-to reference when I need to know something that’s not completely covered by the rdoc and I’m not willing to go source-diving for the answer.

  4. Prototype and script.aculo.us - This is the book that taught me to stop looking at javascript as an annoyance, and start looking at it as an opportunity.

  5. Programming Erlang - I’m going through this for the second time right now, and like all of the PragProg language books, it’s a great starting point. The language books of theirs I’ve read have done an amazing job of not only teaching the language, but making me excited to use it.

  6. Programming Clojure - Like the above book, this is another great PragProg language book. I’m still not 100% sure what I think about the language, but if I decide to use it for a project, I know this will be my reference.

College Basketball

| No Comments | No TrackBacks

Also known as, “Comcast did something right for a change”

I’m a sports fan (Bears, Illini, Cubs, Blackhawks — yeah, Chicago native) and my second favorite sport just kicked off: College Basketball. To commemorate this, ESPN’s been showing a 24-hour college basketball marathon on TV and ESPN360 all day. Luckily for me, Comcast apparently signed a deal to bring ESPN360 to everyone that pays them for internet access, no matter where they are — awesome!

Apart from some Snow Leopard issues, it’s like Christmas came a month early! (or maybe like a bunch of first round tournament games, four months early)

Scriptaculous dialog box

| No Comments | No TrackBacks

This javascript snippet to create an html dialog box came in really handy today, especially when I overrode the base Dialog.Box with

to make it modal.

I used it like this:

All that’s left is slapping some css on it!