Skip to content

Instantly share code, notes, and snippets.

View Nek's full-sized avatar
🏠
Working from home

Nikita Dudnik Nek

🏠
Working from home
View GitHub Profile
@Nek
Nek / test.js
Created August 24, 2011 22:00
test
function () {
alert("!!!");
}
@Nek
Nek / jade_stylus_sublime.md
Created December 6, 2011 04:02 — forked from csanz/jade_stylus_sublime.md
Getting Jade and Stylus working w/ Sublime Text 2

Git way

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus

Ye Old Way

Download Jade and Stylus bundles

@Nek
Nek / playerSpec.js
Created January 31, 2012 13:37
PlayerSpec
describe( "Player library", function () {
describe("Player", function() {
it("exists in a library namespace", function() {
expect(mediaITPro.Player).toBeDefined();
});
it("has an attachPlayer method", function() {
expect(mediaITPro.Player.attachPlayer).toBeDefined();
});
});
@Nek
Nek / cors-nginx.conf
Created May 23, 2012 17:42 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@Nek
Nek / broken_nostroke.js
Created May 30, 2012 18:40
Animatron "I thought it would work" list
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);
@Nek
Nek / contains1.js
Created June 19, 2012 19:59
Animatron player contains examples
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);
@Nek
Nek / pfdir.fish
Created June 22, 2012 16:52
Useful fish shell functions for OS X Lion.
function pfdir;
echo "tell application \"Finder\"
return POSIX path of (target of window 1 as alias)
end tell" | osascript ^/dev/null;
end;
@Nek
Nek / theme.html
Created June 22, 2012 17:09 — forked from soemarko/theme.html
embed github gist to tumblr
<!-- 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>
-->
@Nek
Nek / builderbug.js
Created June 29, 2012 07:51
Strange builder behaviour
return b()
.add(
b("thing")
.rect([0,0], [100,50])
.text([100,100], "Start Game", 26, "Arial"));
@Nek
Nek / EasyLambda.hx
Created July 16, 2012 21:48
Declare lambda functions easily (Haxe 2.10).
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;