Menu and Hours

Blog posts are a poor substitute for the traditional white smoke, but I’m excited to announce that Menu and Hours for Android is finally available. I’ve been working on it for the past few months, and I’d like to think it’s pretty solid. Head on over to Michelle’s blog for more, or straight to the Play Store to buy it. Please enjoy.

Gister for Codea

Spent my Saturday morning playing with the latest Codea. This is the result: a simple (read: hackish) tool to load projects in and out of Codea via Github Gists.

It’s very quick and dirty; run it, punch in the name of a project, press the Gist button and you get a gist. Hold on to the Gist ID, and you can push to it the same way. You can also punch in someone else’s gist and get it as a project yourself.

I’ve tried to make install simple: create a Gister project and leave empty, then create a project to bootstrap, copy Bootstrap.lua into the project’s Main (note: don’t copy from Gist’s ‘raw’ view on an iPad, iSafari will helpfully escape out most of the syntax). Run the bootstrap project and Gister should be ready to go.

edit Feb 17: as of the original post you had to paste in json.lua as well, but now Bootstrap.lua is entirely self-bootstrapping. cheers!

Few notes:

1
curl -X POST -d '{"scopes": ["gist"], "note": "Codea Gister"}' https://api.github.com/authorizations
  • Warning: Gister does nothing to sanitize any secrets that might be in the code. Be careful not to gist Gister itself with your token in the code

  • Big limitation: Gist doesn’t maintain file order (consequence of the files being sent as JSON objects), and Codea relies on file order when it’s loading code (instead of traditional requires). You’ll have to handle this manually when importing a project in, including Gister itself. I’ve considered a few hacks around it (either numbering the files or adding a metadata file), I might fix this at some point (intended to keep my time on this today brief).

  • Also: nothing is checked to see if you’re pulling a valid Codea project, or if you’re about to plow over a project. Pull with caution.

  • Gister was entirely written within Codea on an iPad mini, as well as published as a Gist by itself. Less painful than you’d think.

Protip: Extracting Your SQLite Database From a Real Device

The Android emulator comes packed with sqlite3(1) for debugging your app’s database. Shipping devices don’t, so you need to jump through a few somewhat undocumented hoops first. Cue documents!:

  • You app needs to be compiled with debug keys

  • adb shell run-as your.package.name.goes.here cp databases/YourDatabaseFile.db /sdcard/

  • adb shell pull /sdcard/YourDatabaseFile.db

  • use sqlite3 on your local copy

Bonus protip: please, please, please do not upload your app to the market with debug keys.

Lambda Lifts: A Geeky Tower Sim

Starting on a new side project I’m calling “Lambda Lifts” (or λL, if you hate your fingers), a tower sim “game” built in the tradition of the legendary SimTower. Major bullet points:

  • The general structure (ducks) is somewhat based on SimTower, but λL isn’t a remake or clone.

  • It’s targeted at PCs first, but being built with potential tablet/mobile ports in mind

  • 2D. I don’t want the sim engine to be any more complex than it has to be.

  • The engine comes first; not even worrying about graphics until the sim is to my liking.

  • Every entity under your control in the tower (elevators, staff, HVAC, PA, etc) will be scriptable, and all entities will fire off events your scripts can react to.

  • By commercial release (if any), I’ll include a friendly UI for entity scripting; but a proper language (likely either Lua, Clojure, or Scheme) will be exposed to the player as well.

  • No (forced) social. No freemium. Any social features (in ancient times referred to as “multi-player”) will be totally optional. If I charge money, you’ll pay once and it’s yours.

Right now it’s not much more than a haphazard pile of notes in .md files; I’ll be posting here to document the development (and hopefully share dev builds).

Alfred Extension for Octopress

update 12/17: fixed the escaping in the Alfred config, and restored source to the post

I’ve hacked up a simple Alfred extension for making new posts in Octopress. You can grab it here.

Usage

  • The perl script takes a few args that you’ll probably want to modify:
    1. the full path to your Octopress directory
    2. your preferred editor command (default is mvim)
  • The cmd line in the Alfred extension assumes rbenv; if you use RVM or otherwise you’ll need to replace the rbenv init with whatever’s appropriate.
  • It’s also assuming you haven’t mucked with the Octopress defaults much as you can see, if you’ve done so make edits where necessary
  • Should be trivial to adapt to any similar site generator
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env perl
chdir($ARGV[0]);
my $doc = `rake new_post["$ARGV[2]"]`;
my $file;
my $pwd = `pwd`;
if ($doc =~ /(source\/_posts\/.*\.markdown)/) {
  $file = $pwd . "/" . $1;
  $file =~ s/\n//;
  system("$ARGV[1] $file");
}

My Setup

May as well get one of these out of the way…

Computer

2011 13” MacBook Air

Dare say it’s one of the best laptops ever made, alongside the classic Thinkpad. Even if you’re anti-Apple, definitely make sure your next machine has a SSD.

Happy Hacking Keyboard Pro 2

It’s expensive, even by clicky-keyboard standards.

It doesn’t have arrow keys.

The keys are in weird places.

If none of the above scare you off, this is a fine piece of keyboard.

Expert Mouse

Yep, I use a trackball. If you’re gaming with it, don’t set any of the two-button shortcuts unless you like input lag.

Asus VS229H-P 21”

Decently cheap IPS monitor. Long-winded classes have never looked so pretty.

Mobiles

Motorola Razr M

Not a Nexus, but pretty close, not a jumbo-phone, great battery life, no glass back (Kevlar!), and LTE. Pity about the resolution, but otherwise a solid device.

Asus/Google Nexus 7

One-handed tablet of choice.

Surface RT

Don’t take this as a declaration of iPad-killer status, because it isn’t one… yet. But it very easily could be once developers get going with it.

And despite my above-stated love of clicky keyboards, the Touch Cover is freaky good.

Software

note: this is all mainly general-use, I’m saving my dev-related toolbox for future posts

Alfred

Very slick way to get around OSX.

Vim

Have vi-keys, will hack (even in Emacs). Fellow OSX users, be sure to note macvim.

Sublime Text

If you don’t need the weight of an IDE yet don’t want to live at the shell or pick up oddball key bindings, this is you. Also cross-platform, and a very liberal trial (no limit, occasional nag-screens) if you’re not convinced to cough up $60 right away.

IntelliJ

Very usable, and faster than Eclipse (ha). Good vi-keys available as well. Free/OSS version is JVM-langs only, paid gets you Ruby/Python/JS support as well (complete with inspections and debuggers)

YoruFukurou

Preferred OSX Twitter client. Not the prettiest, but very powerful.

iTerm2

Split panes, multi-input, session rewinding(!), URL detection, regex-based triggers, etc…

Trello

Bug-trackers don’t have to be painful.

Hello-world

1
2
3
4
(ns sixlette.rs.hello-world-post)

(defn main []
  (println "Hello World!"))