Skip to content

Instantly share code, notes, and snippets.

View skrat's full-sized avatar

Dušan Maliarik skrat

View GitHub Profile
@skrat
skrat / getnifs.py
Last active April 16, 2020 20:10 — forked from chadmiller/getnifs.py
#!/usr/bin/python
# Based on https://gist.github.com/provegard/1536682, which was
# Based on getifaddrs.py from pydlnadms [http://code.google.com/p/pydlnadms/].
# Only tested on Linux!
from socket import AF_INET, AF_INET6, inet_ntop
from ctypes import (
Structure, Union, POINTER,
pointer, get_errno, cast,
@skrat
skrat / test.cljs
Last active June 16, 2017 13:14 — forked from Frozenlock/test.cljs
;; some speed tests of functions to access nested properties in JS objects.
(def test-data (->> (into {} (for [k1 (range 10)]
[k1 (into {} (for [k2 (range 10)]
[k2 (into {} (for [k3 (range 10)]
[k3 k3]))]))]))
(clj->js)))
@skrat
skrat / .cljs
Last active June 8, 2017 10:01 — forked from anonymous/.cljs
(defn api-call-with-cb [api-call cb]
(go (let [resp (<! (api-call))]
(if (= 200 (:status resp))
[(:body resp) nil]
[nil resp]))))
(defn api-fetch
([api-call cb] (api-call-with-cb api-call cb))
([api-call] (api-call-without-cb api-call)))
@skrat
skrat / injector.js
Created August 31, 2012 11:17 — forked from jankuca/injector.js
Injector.js
/**
* @constructor
*/
function Injector() {
/**
* @type {!Object.<string, function(Injector=): !Object>}
*/
this.factories = {};
/**
* @type {!Object.<string, !Object>}