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 / water.js
Created July 18, 2012 08:19 — forked from anonymous/water.js
created for livecoding - http://livecoding.gabrielflor.it
$.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() {
@Nek
Nek / serv.js
Created July 26, 2012 20:20
Simple server on node.js
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",
@Nek
Nek / snippet.el
Created July 27, 2012 14:50
keywords replacement in emacs
;; 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\\) "
@Nek
Nek / painter.html
Created August 1, 2012 06:37
Simple canvas painting using flapjax.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="http://www.flapjax-lang.org/download/flapjax-2.1.js"></script>
<script type="text/javascript">
function loader() {
aCanvas = document.getElementById("canv");
mouseMovesAndOversE = mergeE(changes(mouseB(aCanvas)), $E(aCanvas,"mouseover"));
@Nek
Nek / level.hx
Created August 26, 2013 08:43
My neat level description format.
screens = [
Hint(["01mouse", "spike"],"aumloop"),
Level([HeadSpikes(.2,100,0)], 10), // 1
Level([HeadSpikes(.2,150,10)], 10), // 1
Level([HeadSpikes(.2,150,20)], 10), // 1
Hint(["csaw"],"aumloop"),
Level([CenterSaws(.4,100,5)],8.0), // 2
Level([CenterSaws(.3,100,5)],8.0), // 3
Level([SmartSaws(.3,100,10)],8.0), // 4
@Nek
Nek / gist.html
Created September 27, 2013 17:34
Inject github gist after window load event.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='//code.jquery.com/jquery-2.0.2.js'></script>
<script type='text/javascript' src="//rawgithub.com/krux/postscribe/master/dist/postscribe.min.js"></script>
</head>
@Nek
Nek / error1.md
Last active December 27, 2015 23:09
Title: A 2012 blog post
Date: 2012-01-01T00:00:00
Tags: foo, bar, tag with spaces, baz
(defn a 5)