Skip to content

Instantly share code, notes, and snippets.

@JavaScript-Packer
JavaScript-Packer / cursor.js
Last active November 26, 2015 00:24
This is a 3,180 byte cursor (penis.cur) of a penis compressed (encoded Base64) to 1,600 bytes, it also has JavaScript code to inject it as CSS to the page.
var WHAK_com = function(u) {
var a, s, c, n = {}, t = (u + "").split(""), e = t[0], r = e, i = [ e ], o = 256;
for (s = 1; s < t.length; s++) c = t[s].charCodeAt(0), a = 256 > c ? t[s] :n[c] ? n[c] :r + e,
i.push(a), e = a.charAt(0), n[o] = r + e, o++, r = a;
return i.join("");
}(decodeURIComponent(escape(function(a) {
var b, c, d, e = {}, f = 0, g = 0, h = "", i = String.fromCharCode, j = a.length;
for (b = 0; 64 > b; b++) e["WHAK.com/paCker NOT^2~BIG_[JS-RULEZ] (@$%,#&X;){MDPV!*9405+1638}=".charAt(b)] = b;
for (c = 0; j > c; c++) for (b = e[a.charAt(c)], f = (f << 6) + b, g += 6; g >= 8; ) ((d = 255 & f >>> (g -= 8)) || j - 2 > c) && (h += i(d));
return h;
var W,H,A,K,com;for(W='̲͖͈̯͕̺͉͈͓̭͈̰͉͇̘̺͕̱̎͗͑̎̀\n͙̭͓͚̱̮͔̺͕̱͔͈̱͚͓͓̭̙̘̘̜̗̘̙̙̙̠͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̞̯͉͇̎̎̔̎̎ͤ͗͑̒̈́̇̎ͫͬ̎ͬ̎͆̎͋̎ͦ͆̾̾ͨ͛̎ͨ̎̇̈́͊̎̔̎͒̏̈́̈́̓ͫͤͮ̓͒̕̚\n̛͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̺̮̱̙̹͖͇͍̱͓͈̱͕͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̙͓͉̺̱̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚͉̺̮̱͔̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̭̼̱̱͇̱̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚͉͉̮̘̺̳͈͔̯͉͇͋̎̔̎̅̏̈́̈́̓ͥ̓̅̒͌̎̔̎̅̏̈́̈́̓̓̅̒̃̎̔̎̅̏̈́̈́̓ͫ͂ͥ̓̅̒̂̎̔̎̅̏̈́̈́̓̾͂ͤ͂̾̓̅̒̌̎̔̎͒̏̈́̈́̓ͥ̓͒̕ͅͅͅͅͅ\n͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̘̱̱̼͓̱̭̼̯͉͇͐̎̔̎̅̏̈́̈́̓ͩ̓̅\n̙̘̘̜̗̙̙̠̈́̈́̎ͫͬ̎ͬ̎͆̎͌͛ͧ̎ͦ͆̾̾ͨ͛̎ͨ̚\ǹ͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚͔̱͓̼̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚͉̺̮̱̝̱͓͔̱̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚͉̺̮̱̘̱̭͓̯̹̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̘̺͓̘̱̱̼̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̙̟̙̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̱͓̰̲͖̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̭͈̘̺̳͈̱͈̱͓̭͕͉͓̯͉͇̎̔̎̅̏̈́̈́̓ͬ͂ͤ͂ͭ̓̅̒́̎̔̎̅̏̈́̈́̓ͫͥ̓̅̒̋̎̔̎̅̏̈́̈́̓ͫͥ̓̅̒͋͊̎̔̎̅̏̈́̈́̓̓̅̒͋͋̎̔̎̅̏̈́̈́̓͌ͬͦ̓̅̒͋͌̎̔̎̅̏̈́̈́̓͋̃ͮͪ̓̅̒͋̃̎̔̎̅̏̈́̈́̓͛̓̅̒͋̂̎̔̎̅̏̈́̈́̓ͩͪ̓̅̒̈́̇̕̕̚ͅͅͅͅͅ\n̙̘̘̜̗ͫͬ̎ͬ̎͆\ñ̗̙ͧ̎ͦ͆̾̾ͨ͛\n̙̠ͨ̚\ṅ͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚͉̺̮̱͔͉͓̳͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̝̺͓͕͖̭͉̺̮̱̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚̘̯͓̺͍͕͉͇͍͓̱͔͔̯͉͇̈́͋̌̎̔̎̅̏̈́̈́̓ͫ͂ͥ̓̅̒͋͐̎̔̎̅̏̈́̈́̓ͫͥ̓̅̒͋̀̎̔̎̅̏̈́̈́̓ͦ̓̅̕̕ͅͅͅͅͅ\n͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚͉̺̮̱͔̯͉͇͚̱̮͔̺͕̱͔̥̩̹͕͕͍͚͚͚͋́̎̔̎̅̏̈́̈́̓ͫ͂ͥ̓̅̒͋̋̎̔̎̅̏̈́̈́̓̾̕ͅͅ
@JavaScript-Packer
JavaScript-Packer / character-counter.htm
Created December 18, 2015 10:22
Character counter I threw together so I can see exactly how many chars are used in a chunk of text data
<head><title>Character Counter</title></head><body onclick="whak();">
<h1><a href="http://www.whak.ca">WHAK.ca</a>'s Character Counter</h1>
<textarea onkeyup="whak();" oninput="whak();" onchange="whak();" onfocus="whak();" onscroll="whak();" onclick="whak();" onkeydown="whak();"
id="whak" width="728" height="450" ondblclick="whak();" style="width:728px;height:300px"
placeholder="Type here to find out how many characters are used.&#10;&#10;You can also paste a clump of text in this box.&#10;&#10;www.ScriptCompress.com"
onmouseover="whak();this.select()"></textarea>
<h1 id="count"></h1>
<script>
function whak() {
function n(n) {
@JavaScript-Packer
JavaScript-Packer / HTML-character-code-encoder.htm
Created December 23, 2015 23:53
See the HTML coding used to hide all the JavaScript code, titles, and other data in this simple HTML code? Well it is the code to run to encode your own text to HTML code.
<textarea title="&#69;&#110;&#99;&#111;&#100;&#101;&#32;&#101;&#109;&#97;&#105;&#108;&#47;&#108;&#105;&#110;&#107;&#115;&#32;&#40;&#104;&#101;&#114;&#101;&#41;&#32;&#98;&#101;&#102;&#111;&#114;&#101;&#32;&#112;&#111;&#115;&#116;&#105;&#110;&#103;&#44;&#32;&#98;&#105;&#112;&#97;&#115;&#115;&#32;&#115;&#101;&#99;&#117;&#114;&#105;&#116;&#121;&#32;&#99;&#104;&#101;&#99;&#107;&#115;&#32;&#111;&#110;&#32;&#109;&#111;&#115;&#116;&#32;&#100;&#97;&#116;&#105;&#110;&#103;&#32;&#115;&#105;&#116;&#101;&#115;&#32;&#116;&#111;&#32;&#97;&#108;&#108;&#111;&#119;&#32;&#121;&#111;&#117;&#32;&#116;&#111;&#32;&#112;&#111;&#115;&#116;&#32;&#108;&#105;&#110;&#107;&#115;&#32;&#97;&#110;&#100;&#32;&#101;&#109;&#97;&#105;&#108;&#32;&#97;&#100;&#100;&#114;&#101;&#115;&#115;&#32;&#116;&#111;&#32;&#108;&#105;&#118;&#101;&#32;&#99;&#104;&#97;&#116;&#115;&#44;&#32;&#112;&#114;&#111;&#102;&#105;&#108;&#101;&#115;&#32;&#97;&#110;&#100;&#32;&#109;&#101;&#115;&#115;&#97;&#103;&#105;&#110;&#103;&#32;&#115;&#101;&#114;&#118;&#105;&#99;&#101;&#
@JavaScript-Packer
JavaScript-Packer / HTML-minify-cleaner.js
Created January 1, 2016 04:08
Minify HTML, it can be harsh, so test the results.
function minhtm(r, R) {
R = "replace";
return r[R](/>(\n| | )*</g, "><")[R](/[a-z-]+=""/g, "")[R](/"([^ ]*)"/g, "$1")[R](/<\/li>/, "");
}
var minifyHtml = function() {
var r = /<(pre|style|script(?![^>]*?src))[^>]*>[\s\S]*?<\/\1>/gi, e = /("|')(?:\\\1|[^\1])*?\1/g, n = /__str(\d+)__/g, t = /<preserved>/g, c = /<!--(?!\s*?\[\s*?if)[\s\S]*?-->/gi, s = "", i = /(?:\s+=|=\s+)(?=[^<]*>)/g, p = "=", a = /\s*>/g, l = ">", u = /\s+(?=[^<]*>)/g, g = " ", o = />\s+</g, f = "><", _ = /(<\w+ )([^>]*)/g, v = function(r, e, n) {
return e + n.split(" ").sort().join(" ");
}, m = /<.*?class=("|')([^\1]*)\1/gi, h = function(r, e, n, R) {
var t = n.split(/\s\s*/g).sort().join(" ");
@JavaScript-Packer
JavaScript-Packer / javascript-escape.js
Created January 1, 2016 04:13
Simple and effective escaper function for JavaScript new lines, quotes, etc
function kleen(e, r) {
r = "replace";
return e[r](/\\/g, "\\\\")[r](/\r/gm, "\n")[r](/\n{2,}/gm, "\n")[r](/\n/g, "\\n")[r](/\'/g, "\\'"[r](/\"/g, '\\"'));
}
@JavaScript-Packer
JavaScript-Packer / parse-between.js
Last active January 5, 2016 18:27
www.whak.ca/between-parser.htm Parse a string for variables found between 2 smaller strings. Good for parsing all data from all the data say held between quotes or brackets.
function parseBetween(s, b, b2, j) {
var x = [];
var a = s.split(b);
for (var i = 1; i < a.length; i++) if (true == function(z) {
return z % 2;
}(i)) x.push(a[i].split(b2));
if ("" == j) return x; else return x.join(j);
}
var str = 'hello, my website is "www.WHAK.ca", my friend\'s site is "www.BibleHunter.com". what\'s yours?';
document.writeln(parseBetween(str, '"', '"', "<hr>"));
@JavaScript-Packer
JavaScript-Packer / lzw.jz
Created January 9, 2016 23:28
JavaScript LZW Compression (encode and decode functions). Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lempel and Ziv in 1978. The algorithm is simple to implement,…
function en(c) {
var x = "charCodeAt", b, e = {}, f = c.split(""), d = [], a = f[0], g = 256;
for (b = 1; b < f.length; b++) c = f[b], null != e[a + c] ? a += c :(d.push(1 < a.length ? e[a] :a[x](0)),
e[a + c] = g, g++, a = c);
d.push(1 < a.length ? e[a] :a[x](0));
for (b = 0; b < d.length; b++) d[b] = String.fromCharCode(d[b]);
return d.join("");
}
function de(b) {
@JavaScript-Packer
JavaScript-Packer / swappie.js
Created January 11, 2016 17:58
JavaScript function to swap 2 sets of strings with each other. Switch double quotes with single quotes for example. www.WHAK.ca
function swap_str(e, r, t) {//function to swap 2 sets of strings with each other
return e = e.split(r).join("WHAK_a_SWAP"), e = e.split(t).join("WHAK_b_SWAP"), e = e.split("WHAK_a_SWAP").join(t),
e = e.split("WHAK_b_SWAP").join(r);
}
//test 1
var str = 'this is "test" of a \'test\' of swapping strings';
var manipulated = swap_str(str,"'",'"');
document.writeln(manipulated)
//test 2
manipulated = swap_str(manipulated,"'",'"');
@JavaScript-Packer
JavaScript-Packer / codepoints.js
Created January 14, 2016 09:25
UTF-8 to character code points array, bot encode and decode functions
var toCharCode = function(x) {
var o, e = x.split(""), t = [];
for (o in e) t.push(e[o].charCodeAt(0));
return t;
};
var unCharCode = function(x) {
return this["eval"]("String.fromCharCode(" + x + ")");
};