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 / Closure.txt
Created January 21, 2012 21:20
Closure Compiler HELP
--accept_const_keyword : Allows usage of const keyword.
--charset VAL : Input and output charset for all files
. By default, we accept UTF-8 as input
and output US_ASCII
--closure_entry_point VAL : Entry points to the program. Must be g
oog.provide'd symbols. Any goog.provid
e'd symbols that are not a transitive
dependency of the entry points will be
removed. Files without goog.provides,
and their dependencies, will always b
@19h
19h / BigInFact.java
Created January 24, 2012 01:41
BigInFact Æsthetics Codename Edna
import java.math.BigInteger;
import java.text.NumberFormat;
/**
*
* @author Kenan Sulayman
* @version Æsthetics Codename Edna
*/
/*
@19h
19h / HPBPnDSPh.js
Created February 7, 2012 20:28
HPBPnDSP Header
var sys = require("sys"),
http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs");
var assert = function () {
return console.log(arguments[0]);
};
global.x = {};
assert(typeof filecache == "object");
@19h
19h / IntHea.java
Created February 7, 2012 23:00
IntroHeap
public interface Sorter {
void sort(Sortable[] f, int from, int to);
/**
* Ascendingly sorts the array from from to to,
* where from is included and to is not.
**/
void sort(Sortable[] f);
}
public interface Sortable {
boolean smaller(Sortable ob);
@19h
19h / Relay.js
Created February 19, 2012 20:33
Relayed Interfix
function f(e) {
return e % 4294967296
}
function h(e, a) {
e = f(e);
a = f(a);
return 0 <= e - 2147483648 ? (e % 2147483648 >> a) + (1073741824 >> a - 1) : e >> a
}
function k(e, a) {
for (e = f(e), a = f(a), b = 0; b < a; b++) c = e, c %= 2147483648, c & 1 ? (c -= 1073741824, c *= 2, c += 2147483648) : c *= 2, e = c;
@19h
19h / bls.js
Created February 23, 2012 02:10
bla
a = [123, 345, 657, 234, 534, 567867, 234, 123, -132, -799, -243, 543, 234, 5768, 5234, 678, 1, 345, 2, 7, 9, -4, 3456, 324];
// Das unsortierte Array
var print = print || console.log;
var b = a.length, // Die Länge
c = a, // Eine Kopie des Arrays..
d, e, f, g, h; // bla, bla.
@19h
19h / rec.tar.gz.pl
Created February 24, 2012 22:10
Recover .tar(.gz) Headers
#!/usr/bin/perl -w
use strict;
my $tarfile;
my $c;
my $hit;
my $header;
my@src = (ord('u'), ord('s'), ord('t'), ord('a'), ord('r'), ord(" "), ord(" "), 0);#my@src = (ord('u'), ord('s'), ord('t'), ord('a'), ord('r'), 0, ord('0'), ord('0'));
die "No tar given"
if $#ARGV != 0;
@19h
19h / fireevent.js
Created April 16, 2012 01:27
Automated Eventfiring HTML5 Javascript fireEvent Titanium NODE.JS-Compatbile
fire = function (b, d, e) {
if ("undefined" !== typeof module && module.exports) {
if (b instanceof require("events").EventEmitter) {
// Note for me (Array.prototype.reverse.apply(arguments)).pop() // remove first argument, give rest, arguments instanceof Object!
// NOTE: As Node.js's emit takes a name and an array, q should be typeof Array.. so we're fixing it here.
for (var c = 0, f = []; c < e.length; ++c) void 0 !== f[c] && (e[c] = f[c]);
return b.emit(d, f)
}
return !1
}
@19h
19h / Vernam.js
Created July 3, 2012 23:03
Vernam Cipher JS
xin = "Kenan";
treshold = 150;
c = {
0: [], // input encoded
1: [], // key encoded
2: [], // cipher encoded
3: [] // decoded encoded
};
@19h
19h / TiYoutube.js
Last active November 11, 2015 16:24
Titanium Mobile SDK iPhone / Android: Extract Youtube Video URL / URI from video-id / identification / name and play mp4 file. (Workaround for the recent change of security in Youtube)
Titanium.App.addEventListener("playvideo", function (e) {
var win11 = Titanium.UI.createWindow({
orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT],
title: "Video",
zIndex: 222222
});
var activeMovie = Titanium.Media.createVideoPlayer({
fullscreen: !0,
autoplay: !0,