Skip to content

Instantly share code, notes, and snippets.

View kristoferjoseph's full-sized avatar
🦇
What we do in the shadows

kj kristoferjoseph

🦇
What we do in the shadows
View GitHub Profile
#! /usr/bin/env ruby
# encoding: utf-8
require ENV['TM_SUPPORT_PATH'] + '/lib/ui'
skins_path = ENV['TM_FLEX_PATH'] + '/frameworks/projects/spark/src/spark/skins/spark'
file = TextMate::UI.request_file(:title => "Select Skin Class", :directory => skins_path)
contents = IO.read("#{file}")
File.open(ENV['TM_NEW_FILE'], 'w+') do |f|
f.write contents
def handle_project_path path
project_path = File.expand_path(path)
project_hash = MD5.digest(project_path)
project_cache = File.join(tmp, project_hash)
swcs = FileUtils["#{project_path}/**/*.swc"]
handled_swc_paths = []
@kristoferjoseph
kristoferjoseph / Air to Android Ant tasks
Created October 16, 2010 19:11
An example ant script used for developing Adobe AIR applications for Android
<?xml version="1.0"?>
<project name="Notes" default="debug-phone">
<property file="build.properties"/>
<property name="deploy.dir" value="deploy"/>
<property name="src.dir" value="src"/>
<property name="assets.dir" value="assets"/>
<property name="flex.mxmlc" value="${flex.sdk}/bin/mxmlc"/>
<property name="flex.compc" value="${flex.sdk}/bin/compc"/>
<property name="air.amxmlc" value="${flex.sdk}/bin/amxmlc"/>
<property name="air.adl" value="${flex.sdk}/bin/amxmlc"/>
@kristoferjoseph
kristoferjoseph / How to unit test Flex 4 skins
Created December 23, 2010 06:11
All the rigamarole needed to test a Flex 4 skin
//AS3///////////////////////////////////////////////////////////////////////////
//
// Copyright 2010 Kristofer Joseph.
//
////////////////////////////////////////////////////////////////////////////////
package com.developsigner.view.skins
{
import org.flexunit.Assert;
import org.flexunit.async.Async;
@kristoferjoseph
kristoferjoseph / MockServiceTest
Created March 13, 2011 22:28
Cheap way to test a mock service that only returns a success
Async.proceedOnEvent( this
, mockService.callSuccess()
, ResultEvent.RESULT
, 50
, function(event:Event=null):void
{
assertTrue(true);
});
@kristoferjoseph
kristoferjoseph / ProjectSprouts Rakefile touch
Created April 9, 2011 21:39
Had to add a touch to my rakefile in order for changes in child classes to be picked up consistently
##############################
# Debug
# Compile the debug swf
mxmlc "bin/Foo-debug.swf" do |t|
FileUtils.touch "src/Foo.as"
t.input = "src/Foo.as"
t.debug = true
end
@kristoferjoseph
kristoferjoseph / gist:1174512
Created August 26, 2011 21:49
It's SO easy to style a hyperlink in Flex
package flashx.textLayout.elements.examples {
import flash.display.Sprite;
import flash.text.engine.FontPosture;
import flash.text.engine.Kerning;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.edit.SelectionFormat;
import flashx.textLayout.edit.SelectionManager;
import flashx.textLayout.elements.Configuration;
import flashx.textLayout.elements.LinkElement;
@kristoferjoseph
kristoferjoseph / add to .vimrc
Created October 10, 2011 20:02
geting jslint to work in vim. Hint: install nodejs
" Use Node.js for JavaScript interpretation
let $JS_CMD='node'
@kristoferjoseph
kristoferjoseph / .vimrc.after
Created January 4, 2012 17:07
new vimrc for janus
nnoremap <leader><leader> :ZoomWin<CR>
@kristoferjoseph
kristoferjoseph / Hugger
Created March 3, 2012 19:30
War is overrated. A bookmarklet that replaces war with hugs. What could be better.
javascript:!function(){var%20regularExpression%20=%20/war/gi;document.body.innerHTML%20=%20document.body.innerHTML.replace(regularExpression,%20%27hugs%27,%20%27gi%27);}();