October 23, 09

AS3 version of PHP's print_r

A very nice little utility nicked from here. Thanks Nate!

package
{
    public function print_r(obj:*, level:int = 0, output:String = ""):*
    {
        var tabs:String = "";
        for (var i:int = 0; i < level; i++, tabs += "\t");

        for (var child:* in obj)
        {
            output += tabs + "["+ child + "] => " + obj[child];

            var childOutput:String = print_r(obj[child], level + 1);
            if (childOutput != "") output += " {\n"+ childOutput + tabs + "}";

            output += "\n";
        }

        if (level > 20) return "";
        else if (level == 0) trace(output); else return output;
    }
}

/* USAGE:

// Save as print_r.as, change package name if needed

var obj:Object = {};
obj.var1 = "test";
obj.var2 = { var2a: "a", var2b: 10 };

print_r(obj);
print_r(("a,b,c").split(","));

*/
09:32 PM | | 0 Comments | Tags: ,
September 24, 09

Commodore C64 SIDs live

I am very pleased to announce that I will be playing a set at Tronic @ Merchant City Festival on a real vintage Commodore C64, with live retro visuals by Russell/These Are Ideals.

I will be bringing some best sounding tunes that have ever been composed on the C64, so better be there or be square!

Saturday, 26 Sept, around 6PM @ 13TH Note (upstairs), Glasgow

Tronic Festival

UPDATE: I am posting the playlist and the short video (above) from the gig. Thanks to all authors for their brilliant compositions!

  1. Holt Hein / Scott-Land B-Side
  2. DRAX / Space between Spaces
  3. TBB / Panimo
  4. Wacek / Snake Disco
  5. Wacek / Amphetamine
  6. Linus / Cauldron II Sinus Milieu Studie (featured in the video)
  7. AMJ / Problemchild part 7
  8. Kasmo / Nekenieh
  9. Holt Hein / Bootsys Club Tonic
  10. Morton Adam / Love For Smokin Weed
  11. Jeff / 12-speed tune
  12. DRAX / Hass
  13. DRAX / Svinestig
  14. Holt Hein / Trans Form
  15. Japmaster / Model 64
01:44 PM | | 1 Comment | Tags: , ,
June 05, 09

Using SWFAddress exclusively with jQuery

I've just spent an hour today trying to work out why SWFAddress was not picking up any events from the browser (i.e. back button click).

It turned out that by default it [SWFAddress] relies on SWFObject, UFO or AC_FL_RunContent but it's not supporting jQuery, which I was using to embed my SWF (precisely with jQuery Flash plugin).

I posted a comment on Asual's blog and I got a quick answer by Rostislav:

@Og2t
You just need to use SWFAddress.addId(flashObjectId) in order to use the library with any Flash embedding script.

Thanks a million! Again and over again, RTFM! SWFAddress is awesome, I am just a moron [*sighs].

Make sure you read this great article on how to use SWFAddress by Greg MacWilliam aka bigmac.

12:30 AM | | 2 Comments | Tags: , , ,
June 04, 09

Useful OS X terminal shortcuts

Create a file named .inputrc in your home directory and paste the following code:

# this makes the "delete" key work rather than 
# just entering a ~
"\e[3~": delete-char

# these allow you to use ctrl+left/right arrow keys
# to jump the cursor over words
"\e[5C": forward-word
"\e[5D": backward-word

# these allow you to start typing a command and 
# use the up/down arrow to auto complete from 
# commands in your history
"\e[B": history-search-forward
"\e[A": history-search-backward

# this lets you hit tab to auto-complete a file or
# directory name ignoring case
set completion-ignore-case On

# Two escapes clear command line
"\e\e": "\C-a\C-k"

It will add a few useful keyboard commands.

01:20 PM | | 1 Comment | Tags: ,
April 20, 09

Falling in love with Tweetie, betraying Nambu

NambuTweetie
Yay, yet another Twitter client for OS X Tweetie has been just released today. I've recently switched from Twitterific to Nambu and absolutely loved the translate option and the Mail like interface – and wasn't really keen of moving onto a different one again, but decided to give it a go. And... I absolutely fell in love with it. So I had to betray Nambu... well, we'll see, maybe it's just a Tweetie affair or a short romance?

Nambu

  • Translate any tweet to English
  • Built in option to hide from the dock
  • It's free
  • Decodes short links and replaces them in a tweet so you know what to expect
  • Growl integration (to break your concentration even more)
  • No global keyboard shortcut to show/hide

Tweetie

  • Lovely interface and motion tweens (eye candy)
  • Customisable shortcut to show/hide the app (as in Twitterific, I usually set it to ALT + ~)
  • Bookmarklet to easily tweet current browser's URL
  • No hide from the dock option (could be easily fixed by adding <key>NSUIElement</key><string>1</string> to the Info.plist file)
  • No Growl integration (Colin reckons it will be there soon)
  • It's free but you have to like ads and the startup nag, otherwise it's $19.99 $14.95 (promo till 4th of May)

Both Tweetie and Nambu have support for URL shortening services, marking read tweets and setting custom font sizes.

05:45 PM | | 1 Comment | Tags: ,
Next → Page 1 of 2