Skip to content

TextMate command for generating ActionScript getter/setters

Based on this: http://www.nesium.com/blog/2006/08/04/actionscript-gettersetter-command-for-textmate/

I just changed the format of the code to match the existing code at work.

Command configuration:

Save: nothing
Input: Entire Document
Output: Insert as Snippet
Activation: Choose whatever you want, personally I prefer using “get” as a Tab Trigger
Scope Selector: source.actionscript

Command:

Ick. The formatting of this is horrible. Will fix soon.

#!/usr/bin/ruby
txt = STDIN.read
vars = txt.scan(/^\W*(private|public){0,1}\W*var\W*\_(\w*)\W*\:\W*(\w*)/)

ascript = <<-EOF
tell app "TextMate"
activate
choose from list { %s } with title "Variable auswaehlen" with prompt "Welche Variable als Basis benutzen?"
end tell
EOF

displayList = []
varList = []
vars.each_with_index do |x,i|
scope = x[0]
name = x[1]
type = x[2]
urStr = ""
if ( scope != nil )
urStr += "(" + scope.capitalize() + ") "
end
urStr += "_" + name
if ( type != nil )
urStr += " : " + type
end
displayList.push( urStr )
varList.push( { "name" => name, "type" => type } )
end

list = '"' + displayList.join( '", "' ) + '"'
ascript = ascript % list
params = "<< 'AS'\n #{ascript}\nAS"

cmd = open("|osascript" + params)
result = cmd.gets.chomp()
cmd.close

if ( result == "false" )
exit
end

index = displayList.index( result )
item = varList[ index ]

getter = <<-EOF
public function get %s():%s{
return this._%s;
}
EOF
getter = getter % [ item[ "name" ], item[ "type" ], item[ "name" ] ]

setter = <<-EOF
public function set %s(value:%s):void{
this._%s = value;
}
EOF
setter = setter % [ item[ "name" ], item[ "type" ], item[ "name" ] ]

snippet = getter + "\n" + setter
print snippet
as_getset_cmd

TeamCity notifications via Growl

I’ve written a custom notification plugin for TeamCity that will send build notifications via Growl or JGrowl.

You can get a copy here:
http://code.google.com/p/tcgrowl/

growlbuildlistener version 0.4

Just uploaded a new build of growlbuildlistener which fixed a problem with the build listener that caused it not to work.

Check it out:

http://growlbuildlistener.googlecode.com/files/growllistener-0.4.jar

Awesome e-book management, calibre (formerly known as libprs500)

If you’ve got a Sony Reader, and don’t like Sony’s book management app (or you don’t run Windows) you should definitely check out calibre. It lets you manage your ebook library, convert files to the Sony Reader format, tweak metadata about your books, manage the books on your Reader, preview the books. It will even download some newsfeeds and put them on your reader. It’s open source, written in Python and runs on Windows, Linux and Mac OS. It also contains command line apps to do format conversions and to transfer books to the Reader. It just plain kicks ass.

NOTE: libprs500 was recently renamed calibre. Different name, same awesome app.

Moved to Word Press…

I moved this blog from slimeslurp.net/drupal to blog.slimeslurp.net.  It is now running on Word Press.  Drupal was overkill for what I was using it for.  File links for some things are currently broken.

New version of growlbuildlistener released

Just released a minor update to growlbuildlistener. GrowlEcho now supports an optional sticky attribute to create “sticky” notifications. Also, GrowlListener looks for a build property called “gbl.endsticky” which, if set, will cause the Build Finished notification to be sticky.

Check it out:

http://growlbuildlistener.googlecode.com/files/growllistener-0.3.jar

Ant build notifications via Growl

I’ve created a custom BuildListener for Ant that provides Growl notifications when your builds start/stop. It uses the JGrowl library to send messages. JGrowl also provides a Growl like notification system for any Java platform. I’ve also created an Ant task similar to <echo> that lets you send messages to Growl during your builds.

You can get it here:

http://code.google.com/p/growlbuildlistener/

Upgraded to Drupal 5

Just upgraded to Drupal 5. Looking for a new theme.

Ant build file completion for Fish.

Here is a VERY basic completion for Ant build files for Fish. It was based on the Ant completion from Zsh. Save it to ~/.config/fish/completions/ant.fish.


function __fish_complete_targets -d "Print list of targets from build.xml"
if test -f build.xml
sed -n "s/ *<target name=[\"']\([^\"']*\)[\"'].*/\1/p" < build.xml
end
end

complete -x -c ant -a “(__fish_complete_targets)”
EDIT: This has been added to Fish version 1.22.2

Upgraded to 4.7.4

I just updated this drupal installation to 4.7.4.