Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Nikita Dudnik Nek

🎯
Focusing
View GitHub Profile
View test.js
function () {
alert("!!!");
}
@Nek
Nek / jade_stylus_sublime.md
Created Dec 6, 2011 — forked from csanz/jade_stylus_sublime.md
Getting Jade and Stylus working w/ Sublime Text 2
View jade_stylus_sublime.md

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

View playerSpec.js
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 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
View cors-nginx.conf
#
# 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
Animatron "I thought it would work" list
View broken_nostroke.js
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 Jun 19, 2012
Animatron player contains examples
View contains1.js
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 Jun 22, 2012
Useful fish shell functions for OS X Lion.
View pfdir.fish
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 Jun 22, 2012 — forked from soemarko/theme.html
embed github gist to tumblr
View theme.html
<!-- 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 Jun 29, 2012
Strange builder behaviour
View builderbug.js
return b()
.add(
b("thing")
.rect([0,0], [100,50])
.text([100,100], "Start Game", 26, "Arial"));
@Nek
Nek / EasyLambda.hx
Created Jul 16, 2012
Declare lambda functions easily (Haxe 2.10).
View EasyLambda.hx
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;
You can’t perform that action at this time.