Skip to content

Instantly share code, notes, and snippets.

View 19h's full-sized avatar
✔️
This account is verified.

Kenan Sulayman 19h

✔️
This account is verified.
View GitHub Profile
@19h
19h / Operators.js
Created August 7, 2012 09:31
Implementing trivial logic gates
xor = function (a, b) { return (a && !b || !a && b);}
not = function (a) { return !a; }
and = function (a, b) { return (a && b); }
or = function (a,b){ return (a || b); }
nand = function (a,b){ return !(a && b); }
nor = function (a,b) { return !( a || b ); }
xnor = function (a,b) { return !(a && !b || !a && b); }
@19h
19h / index.html
Created September 9, 2012 15:01
Streaming audio player animation using modern CSS animations, transforms etc.
<div class="wrapper">
<div class="tower">
<div class="signal">
<div class="rings circle animated"></div>
</div>
<div class="dot circle"></div>
<div class="triangle"></div>
</div>
@19h
19h / sha512.js
Created October 1, 2012 12:31
SHA512 Javascript
var b;
if (!(b = t)) {
var w = Math,
y = {}, B = y.p = {}, aa = function () {}, C = B.A = {
extend: function (a) {
aa.prototype = this;
var c = new aa;
a && c.u(a);
c.z = this;
return c
@19h
19h / reset.js
Created February 19, 2013 22:51
Node.js — Clear Terminal / Console. Reset to initial state.
console.reset = function () {
return process.stdout.write('\033c');
}
@19h
19h / scrypt.js
Created February 20, 2013 21:10
A compact V8-ECMAScript ("Javascript") implementation of the Scrypt-hashing algorithm.
var j = void 0,
k = require("crypto");
function m(a) {
for (var b = a.length, c = Array(b), f = 0; f < b; f++) c[f] = a.charCodeAt(f);
return c
}
var p, q, s;
function t() {
@19h
19h / date.js
Created February 20, 2013 21:24
An implementation of the ECMA-262 (sector 15.9) date specification and custom modification improving the overall algorithms' precision.
/*
_date
by Kenan Sulayman in 2013.
-is-browser-compatible-
*/
log = console.log;
@19h
19h / IDCF.js
Last active December 14, 2015 00:38
The intermediate data control format implements a non directly interpretable / evaluable intermediate language supposed for the delivery of data in an directly execution context. That is, every instance pushes arguments onto the function stack, the last entity of a lines' call is the function onto which the stack is being applied. The intermedia…
// The immediate data control format
l = console.log;
dcf = {
// settings:
reverse: false,
stringify: function ( a, b ) {
return (!(a instanceof Array) && (a=[a])),
(b && ("$"+(dcf.reverse?a.reverse():a).map(function(v){
@19h
19h / chandler.js
Last active December 15, 2015 15:28
Custom /require/ with exception handler for V8 (Node).
try {delete e;e;}catch(e){v8=e.stack!=void 0}finally{v8=v8||0}
var _$ = require;
require = function(k) {
try {
return _$(k);
} catch (e) {
if (v8) {
(_ = e.stack.split("\n"), __ = "");
@19h
19h / fib.js
Created April 10, 2013 14:37
Ultra High-Speed Fibonacci Generator. This is faster then the addition-increment approach in C or ASM.
fib = function (c) {
var b, a = [0, 1];
for (b = 0; b < c; ++b) a.push(a[0] + a[1]), a.shift();
return a[0]
};
@19h
19h / countrydata.js
Last active December 17, 2015 06:19
Google Public Data (Country-Data)
/*
Data from https://www.google.de/publicdata/query?session=nHLTBH5CFeM&jsq={"apiVersion":"1.0",+"queries":[{"qt":"conceptQuery",+"dsid":"d5bncppjof8f9_",+"id":"country",+"v":1181,+"locale":"de",+"filters":[{"pid":"region",+"v":"ECA"}]}]}
Generator:
v = data["results"][0].data;
for ( a in v ) p[v[a].displayName] = (function(v){ z = {}; z.id = v.id; v = v.pvals; z.location = { latitude: v.latitude, longitude: v.longitude }; z.region = v.region; if ( v.lending_type ) z.lending = v.lending_type; z.income = v.income_level; return z; })(v[a])
*/
{
Albanien: {