Skip to content

Instantly share code, notes, and snippets.

View jdonaldson's full-sized avatar

Justin Donaldson jdonaldson

  • Mercer Island, Washington
  • 01:32 (UTC -07:00)
View GitHub Profile
{
"name": "flare",
"children": [
{
"name": "vis",
"children": [
{
"name": "events",
"children": [
{"name": "DataEvent", "size": 2200,
@jdonaldson
jdonaldson / nginx.rb
Created September 27, 2012 23:32 — forked from mranallo/nginx.rb
Homebrew recipe for nginx with upload modules.
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.2.3.tar.gz'
sha1 '98059ae08ebbfaaead868128f7b66ebce16be9af'
devel do
url 'http://nginx.org/download/nginx-1.3.5.tar.gz'
sha1 'ce0245295f23a54f10d916eb6b7b34469d0618a1'
@jdonaldson
jdonaldson / Escape.hx
Created October 31, 2012 19:49
Extended Html escape/unescape methods
class Escape{
/**
Escape HTML special characters of the string.
&, <, >, ", ', `, , !, @, $, %, (, ), =, +, {, }, [, and ]
**/
public static function htmlEscape( s : String ) : String {
return s.split("&").join("&amp;")
.split("<").join("&lt;")
.split(">").join("&gt;")
.split('"').join("&quot;")
@jdonaldson
jdonaldson / index.html
Created December 14, 2012 20:44
Force directed network of WebKit class dependencies (no Event/EventListener)
<!DOCTYPE html>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://raw.github.com/bigmlcom/tipsy/master/src/javascripts/jquery.tipsy.js" type="text/javascript" charset="utf-8"></script>
<style>
.tipsy { font-size: 10px; position: absolute; padding: 5px; z-index: 100000; }
.tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; }
/* Rounded corners */
.tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
@jdonaldson
jdonaldson / Test.hx
Last active December 13, 2015 20:58
class Test {
static function main() {
var f:Escaped = '<div>foo</div>';
var k:Foo = {k:'<div>blah!</div>'};
trace(f); // not escaped, simple trace
trace(k); // not escaped, simple trace
trace(f + ' some other string'); // escaped!
trace(k.k + ' extra'); // escaped as field access!
import haxe.macro.Expr;
import haxe.macro.Context;
using Lambda;
@:autoBuild(AbstractClassBuilder.build())
interface AbstractClass {}
class AbstractClassBuilder {
static var abstractFields:Hash<Array<String>> = new Hash();
@jdonaldson
jdonaldson / scss.vim
Created March 21, 2013 16:36
scss autowrite for vim
if !exists('*SCSStocss')
function! SCSStocss()
let src = tempname()
let dst = substitute( bufname('%'),'.scss','.css','g' )
echo 'writing css to ' . dst
execute "w ! sass --scss -s " . dst
w
endfunction
endif
@jdonaldson
jdonaldson / hxn.sh
Last active December 15, 2015 11:49
Simple bash script for switching between haxe nightly and stable
export OLDPATH=$PATH
export HAXE_NIGHTLY=$HOME/bin/haxe_nightly
hxn(){
if [ -z "$USE_HAXE_NIGHTLY" ] || $USE_HAXE_NIGHTLY; then
echo "Changing to Haxe stable version"
export HAXE_STD_PATH=$OLD_HAXE_STD
export PATH=$OLDPATH
export USE_HAXE_NIGHTLY=false
else
echo "Changing to Haxe nightly at: $HAXE_NIGHTLY"
@jdonaldson
jdonaldson / update_haxe.sh
Created March 29, 2013 21:26
Haxe update script
#!/bin/sh
# installhaxe.sh
#
# Build the haxe compiler
# =====================
# - download 'install.ml' and execute it (compiles the haxe compiler)
# - copy the executables and modify the evironment variables
cd tmp
if [ ! -d haxesrc ]
then mkdir haxesrc
package ;
using TestX.Eqs;
// consider the following interfaces
interface Compare<T> {
public function compare(b:T):Int;
}
interface Eq<T> {