This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = Builder._$, C = anm.C; | |
var fhsv = Builder.fhsv; | |
// canvas1 | |
var scene1 = b().circle([0, 0], 20) | |
.fill(fhsv(1, .5, .5, 1)) | |
.nostroke(); | |
createPlayer('gameScreen', {'mode':C.M_DYNAMIC}).load(scene1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var circleOne = b('c1').circle([0, 0], 30) | |
.trans([0, 3], [[0, 200], [400, 200]]); | |
var handler = function (evt) { | |
console.log("SCENE CLICKED"); | |
if (this.$.contains(evt.pos)) { | |
console.log("CIRCLE CLICKED"); | |
} | |
}; | |
circleOne.on(C.X_MCLICK, handler); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pfdir; | |
echo "tell application \"Finder\" | |
return POSIX path of (target of window 1 as alias) | |
end tell" | osascript ^/dev/null; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return b() | |
.add( | |
b("thing") | |
.rect([0,0], [100,50]) | |
.text([100,100], "Start Game", 26, "Arial")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.macro.Expr; | |
class EasyLambda { | |
@:macro public static function f(p:Expr, e:Expr) : Expr { | |
var res:Expr = macro function(a) {return $e;}; | |
var params = macro $p; | |
var pname = | |
switch (params.expr) { | |
case EConst(i):switch (i) { | |
case CIdent(v): v; | |
default: null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({ | |
cache: true | |
}); | |
var s1 = $.getScript('https://raw.github.com/Animatron/player/master/vendor/matrix.js'); | |
var s2 = $.getScript('https://raw.github.com/Animatron/player/master/anm.player.js'); | |
var s3 = $.getScript('https://raw.github.com/Animatron/player/master/anm.builder.js'); | |
//var s4 = $.getScript('https://raw.github.com/Animatron/player/master/anm.collisions.js'); | |
$.when( s1, s2, s3 ).then(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"); | |
var fs = require("fs"); | |
var path = require("path"); | |
var url = require("url"); | |
var mimeTypes = { | |
"html": "text/html", | |
"jpeg": "image/jpeg", | |
"jpg": "image/jpeg", | |
"png": "image/png", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Use lambda for anonymous functions | |
(font-lock-add-keywords | |
'js2-mode `(("\\(function\\) *(" | |
(0 (progn (compose-region (match-beginning 1) | |
(match-end 1) "\u0192") | |
nil))))) | |
;; Use right arrow for return in one-line functions | |
(font-lock-add-keywords | |
'js2-mode `(("function *([^)]*) *{ *\\(return\\) " |