Skip to content

Instantly share code, notes, and snippets.

View newtriks's full-sized avatar

Simon Bailey newtriks

View GitHub Profile
@newtriks
newtriks / flex.sublime-build
Created January 7, 2013 20:32
Sublime flex build file for mxmlc compilation
{
"cmd": [
"/Users/newtriks/Library/Developer/SDK/flex_sdk_4.6.0.23201B/bin/mxmlc",
"$file",
"-static-link-runtime-shared-libraries=false",
"-load-config+=${file_path}/../config.xml",
"-keep-as3-metadata+=Inject",
"-keep-as3-metadata+=PostConstruct",
"-allow-source-path-overlap=true",
"-locale=en_US",
@newtriks
newtriks / JavaScript.sublime-build
Created November 5, 2012 16:22
Sublime Build File for JavaScript using (OS X) JSC
{
"cmd": ["/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc","$file"],
"selector": "source.js"
}
@newtriks
newtriks / version.sh
Created October 18, 2012 12:46
Versioning a Rails app with Git and Heroku
#!/bin/bash
REVISION=$(heroku config:get REVISION)
echo " info: heroku REVISION: $REVISION"
function version_release
{
echo -e " info: writing: '\$tagged_release_version = \"$1\"' to version_helper.rb"
echo -e "\$tagged_release_version = \"$1\"" > config/initializers/version_helper.rb
git add config/initializers/version_helper.rb
git commit -am "Updating version_helper with latest tagged version $1"
echo " info: deployed version $REVISION is not yet tagged; tagging now as $1"
@newtriks
newtriks / actionscript.sublime-build
Created July 17, 2012 18:27
SublimeText2 MXMLC compile and run buildfile
{
"cmd": ["/Users/newtriks/Library/Plugins/sdks/flex_sdk_4.6.0.23201B/bin/mxmlc",
"$file",
"-static-link-runtime-shared-libraries=true"],
"file_regex": "(.*)[(](\\d+)[)]:(?: col: (?:\\d+))? *Error: (.*)",
"selector": "source.actionscript",
"variants": [
{ "cmd": ["open ${file_path}/${file_base_name}.swf"],
"shell": true,
"name": "Run"
<?xml version="1.0"?>
<!-- Simple example to demonstrate the List Control -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#ffffff" backgroundGradientColors="[#ffffff,#ffffff]" xmlns:local="*" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var selectedItem:Object;
package
{
import flash.display.DisplayObject;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Point;
import mx.controls.List;
import mx.controls.listClasses.ListRowInfo;
import mx.core.mx_internal;
<?xml version="1.0"?>
<!-- ======================================================================
Flex ANT Build Script
- Deletes build and template directory
- Creates build, assets and templates directories
- Compiles release and debug swf's
- Connects to svn (Adobe Flex Opensource)
- Svn checkout of latest Flex SDK > templates > SWFObject
- Creates html wrappers for release and debug using SWFObject template
######################################
## PROJECT INFORMATION
######################################
## Developer info
AUTHOR = Simon Bailey
PROJECT.OWNER = Newtriks
PROJECT.OWNER.URL = http://www.newtriks.com
PROJECT.FULLNAME = Flex Ant Tasks Example
PROJECT.VERSION = 1.0.0 alpha
/*
RemoteDelegate Class
Copyright (c) 2009 Simon Bailey <simon@newtriks.com>
Your reuse is governed by the Creative Commons Attribution 3.0 License
*/
package
{
import mx.rpc.AsyncToken;
import mx.rpc.IResponder;
import mx.rpc.remoting.RemoteObject;
@newtriks
newtriks / gist:1297937
Created October 19, 2011 10:37
PMVC Nested View Registration
public class ProfileDisplayMediatorsCommand extends SimpleCommand implements ICommand
{
override public function execute( note:INotification ):void
{
var profileDisplay:ProfileDisplay = note.getBody() as ProfileDisplay;
facade.registerMediator( new ProfileDisplayMediator( profileDisplay ) );
facade.registerMediator( new BalanceDisplayMediator( profileDisplay.balanceComponent ) );
}