Skip to content

Instantly share code, notes, and snippets.

View simongregory's full-sized avatar

Simon Gregory simongregory

View GitHub Profile
#! /usr/bin/env ruby
# encoding: utf-8
require ENV['TM_SUPPORT_PATH'] + '/lib/ui'
require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes'
regexp = ENV['TM_SCOPE'] =~ /source.actionscript.3/ ? /(.+)\.as$/ : /(.+)\.mxml$/
skins_path = ENV['TM_FLEX_PATH'] + '/frameworks/projects/spark/src/spark/skins/spark'
skins = []
package
{
import flash.display.Sprite;
import flash.events.TimerEvent;
import flash.text.TextField;
import flash.utils.Timer;
import flash.utils.getTimer;
public class TimerTest extends Sprite
@simongregory
simongregory / melomel_runner.rb
Created April 4, 2011 14:02
Utility class to help run melomel on Windows XP and OSX
module Project
class << self
def on_windows?
RbConfig::CONFIG['host_os'] =~ /mswin|windows|cygwin/i
end
def adl
tool = "#{ENV['FLEX_HOME']}/bin/adl"
@simongregory
simongregory / Badge-config.xml
Created September 4, 2011 20:33
Example flex compiler config file
<flex-config>
<benchmark>false</benchmark>
<default-background-color>#FFFFFF</default-background-color>
<use-network>true</use-network>
<default-frame-rate>20</default-frame-rate>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<link-report>../report/link/Badge-link-report.xml</link-report>
@simongregory
simongregory / .gitconfig
Created November 2, 2011 12:40
Git aliases
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
dt = difftool
pu = pull
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
@simongregory
simongregory / .tm_properties
Created December 16, 2011 13:29
Example TextMate 2 project properties
excludeInFileChooser = "{$excludeInFileChooser,*.tmproj,bin,*.mp4,*.jpg,*.png,*.swf,*.swc}"
excludeInBrowser = "{$excludeInBrowser,*.tmproj,bin}"
excludeInFolderSearch = "{$excludeInFolderSearch,*.tmproj,*.mp4,*.jpg,*.png,*.swf}"
@simongregory
simongregory / .tm_properties
Created January 3, 2012 13:42
home ~/.tm_properties settings
fontName = "Andale Mono"
fontSize = 12
spellingLanguage = 'en_GB'
[ .git/COMMIT_EDITMSG ]
spellChecking = true
spellingLanguage = 'en_GB'
[ *.{icns,ico,jpg,jpeg,m4v,nib,pdf,png,psd,pyc,rtf,tif,tiff,xib,giff,mp4,swf,fla} ]
@simongregory
simongregory / SignalGuard
Created April 27, 2012 08:40
fluidly building a signal guard
package bbc.core.guard
{
public class SignalGuard
{
public function fire(signal:ISignal):SignalGuard
{
_destination = signal
return build()
}
@simongregory
simongregory / tm2_rvm_as3.md
Created August 16, 2012 10:30
TextMate 2, rvm, and the ActionScript 3 bundle playing together

Get TextMate 2, the ActionScript 3 bundle and RVM playing together

For full completion functionality - where swcs are included when searching for the completions results - you need to have the 'nokogiri' and 'rubyzip' gems installed. The default ruby shipping on OS X is 1.8.7 so the easiest solution is to switch to the system default ruby and install the nokogiri and rubyzip gems there.

However the following should also work....

Assuming that

TextMate 2, rvm (with ruby 1.9.3 installed) and the AS3 bundle are installed on your machine and when you try to autocomplete an error gets thrown.

@simongregory
simongregory / gist:3859469
Created October 9, 2012 15:18
yielding a mock to a block
should "configure the Application with a consumer key and secret" do
credentials = {'consumer_key' => 'skeleton', 'consumer_secret' => 'closet'}
config = mock()
config.expects(:consumer_key=).with('skeleton').once
config.expects(:consumer_secret=).with('closet').once
service = mock()
service.stubs(:configure).yields(config)