Archive for June, 2010

Corona SDK

It seems I can develop some games much, much faster with the Corona SDK. It will cost me $99, and it’s not as macho as mastering Objective-C, but I think I’ll end up saving hundreds of hours with this kit.

I think Corona is a great kit for writing games in general, especially arcade games and board games. There’s no built-in support yet for tiled maps, and it looks like Cocos2D will have that built-in first. But even with that disadvantage, developing on Lua is so much more productive than developing on Objective-C that I’ll still come out ahead.

Some apps aren’t a good fit, though:

  • those that extensively use the CocoaTouch UI controls. In Corona, you have to create your own buttons, text fields, etc. There’s the ui library, but it only covers a few controls.
  • those that access APIs that aren’t wrapped yet by Corona. For example, access to the address book seems to be missing.

There’s the worry that Corona SDK will violate section 3.3.1. Folks from Corona gave some reassuring messages, but of course, with Apple, you can’t have absolute uncertainty. My take is that even if Apple gives Corona the boot, Corona will become Android-only, and Corona SDK is worth $99 even as an Android

I’m taking the $99 plunge. If nothing else, I think Lua will give me a refreshing break from my day-to-day Ruby and Javascript coding.

, ,

No Comments

work.sh

From a cold boot, to start working on one of my Rails projects, I need to do the following:

      open Terminal, then Start MySQL or PostgreSQL

        in a separate Terminal tab: cd Documents/projects/ ; mate .

          (if applicable) in a separate Terminal tab: Start Solr or Ferret

            Start Firefox

              Start Evernote

That’s a lot of keystrokes and mouse actions. No wonder I end up playing games most of the time, because Age of Empires III takes just one click.

I can configure MySQL and PostgreSQL to run on startup, but that’s wasteful. That’ll slow down the machine’s startup time, and sometimes I use just MySQL, on other projects I use PostgreSQL, and on other projects I use neither but instead use MongoDB. And that will just take away one step in this 5-step process to get from cold bootup to work bliss.

Ideally, there’s a one-click work button, a sideproject1 button, a sideproject2 button, etc. Press the right button and the Mac will be transformed into a mode optimized for the work to be done: run the needed apps, close unneeded apps, play music from the “work playlist”, change the desktop background, etc.

I have decided to learn AppleScript to build those magic buttons. Here’s what I’ve come up with so far:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
 
# From: http://stackoverflow.com/questions/1589114/opening-a-new-terminal-tab-in-osxsnow-leopard-with-the-opening-terminal-windows/1590818#1590818
# (See answer by i0n that says "courtesy of Dan Benjamin" http://twitter.com/danbenjamin)
 
# Sets up my Infinitely terminal windows
 
# 1. Run MongoDB
# 2. Run redis in a new terminal tab
# 3. cd to the project
# 4. Launch Evernote
# 5. Launch Firefox
# 6. Launch GitX
 
 
# 1. Run MongoDB in a new terminal
/usr/bin/osascript <<mongo
activate application "Terminal"
tell application "System Events"
	keystroke "t" using {command down}
end tell
tell application "Terminal"
	repeat with win in windows
		try
			if get frontmost of win is true then
				do script "cd ~; ./mongo.sh" in (selected tab of win)
			end if
		end try
	end repeat
end tell
mongo
 
# 2. Run redis in a new terminal
/usr/bin/osascript <<redis
activate application "Terminal"
tell application "System Events"
	keystroke "t" using {command down}
end tell
tell application "Terminal"
	repeat with win in windows
		try
			if get frontmost of win is true then
				do script "cd ~; ./redis.sh" in (selected tab of win)
			end if
		end try
	end repeat
end tell
redis
 
# 3. cd to the workers project
/usr/bin/osascript <<workers
activate application "Terminal"
tell application "System Events"
	keystroke "t" using {command down}
end tell
tell application "Terminal"
	repeat with win in windows
		try
			if get frontmost of win is true then
				do script "cd ~/Documents/projects/infinitely/workers; mate ." in (selected tab of win)
			end if
		end try
	end repeat
end tell
workers
 
sleep 1
# 4. Launch Evernote
open /Applications/Evernote.app
 
# 5. Launch Firefox
open /Applications/Firefox.app
 
clear

There’s still no “Open iTunes and play songs in my ‘work’ playlist” section, but I’m working on it. And here’s something to make it more interesting: AppleScripting with Ruby!

This script borrowed heavily from the ideas of the people in this Stackoverflow thread.

, ,

2 Comments