Skip to content

Instantly share code, notes, and snippets.

@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 / base64-encode-decode.js
Created July 1, 2015 00:45
Perfect ATOB/BTOA alternatives (Base64 encoder/decoder) for JavaScript/Jscript.net Demo on http://jsfiddle.net/1okoy0r0/
function b2a(a) {
var c, d, e, f, g, h, i, j, o, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", k = 0, l = 0, m = "", n = [];
if (!a) return a;
do c = a.charCodeAt(k++), d = a.charCodeAt(k++), e = a.charCodeAt(k++), j = c << 16 | d << 8 | e,
f = 63 & j >> 18, g = 63 & j >> 12, h = 63 & j >> 6, i = 63 & j, n[l++] = b.charAt(f) + b.charAt(g) + b.charAt(h) + b.charAt(i); while (k < a.length);
return m = n.join(""), o = a.length % 3, (o ? m.slice(0, o - 3) :m) + "===".slice(o || 3);
}
function a2b(a) {
var b, c, d, e = {}, f = 0, g = 0, h = "", i = String.fromCharCode, j = a.length;
@JavaScript-Packer
JavaScript-Packer / (de)obfuscate-IP-address.js
Last active December 29, 2022 16:24
This simple JavaScript function set/utility provides the opportunity to obfuscate an IP address or decipher an obfuscated IP. Made by www.whak.ca
function ip2decimal(ip) {
ip = ip.split(".");
var e, w = 16777216, x = 65536, y = 256, a = eval(ip[0]), b = eval(ip[1]), c = eval(ip[2]), d = eval(ip[3]);
e = a * w + b * x + c * y + d;
return e;
}
function decimal2ip(ip) {
var w = 16777216, x = 65536, y = 256, e = eval(ip), a = e / w, z = e - (a - e % w / w) * w, b = z / x, q = z - (b - z % x / x) * x, c = q / y, d = q - (c - q % y / y) * y;
return parseInt(a) + "." + parseInt(b) + "." + parseInt(c) + "." + parseInt(d);
@JavaScript-Packer
JavaScript-Packer / bookmarklet-collection.txt
Created May 1, 2015 06:59
Largest collection of bookmarklet tools on the internet... A little of everything...
http://jsfiddle.net/nh8e22r4/show/ - 2,500 bookmarklets 
@JavaScript-Packer
JavaScript-Packer / triple-click-top-of-page.htm
Created April 1, 2016 09:42
Triple clicker JavaScript function, click 3 times fast! Adjust to higher like four or five clicks if you want!
<body>
<h1 onclick="window.scroll(0,7000)"><u style="color:blue">Click HERE to go to bottom!</u></h1>
<script>
window.addEventListener('click', function (x) {
if (x.detail === 3) {
window.scroll(0,0);
}
});
@JavaScript-Packer
JavaScript-Packer / for-the-gay-guys.js
Last active July 21, 2020 00:36
Gay related bookmarklets (best for Chrome or FireFox web browser). Hacks to get free large images on gay dating/hookup sites with a free membership account. Add a link too bookmarks, then edit URL to be the JavaScript code provided. Made by www.WHAK.com
/* Go to http://jsfiddle.net/5v5r8npk/ for drag & drop link marklets, easiest way to add to bookmarks! */
// BareBackRT.com
javascript:var _='',$=document,whaks = document.getElementsByTagName("img");for (var i = 0, whak; whak = whaks[i]; i++) {_+='<img src="'+whak.src.replace(/\x26\x73\x3d/g,"&s=1")+'"> ';};$.body.innerHTML=_+'<hr>Visit <a href="http://www.whak.com">www.WHAK.com</a><hr>'+$.body.innerHTML;void 0;
// Adam4Adam.com
javascript:var $=document;$.body.innerHTML='<img src=%22'+large_img+'%22><hr>Visit <a href=%22http://www.whak.com%22>www.WHAK.com</a><hr>'+$.body.innerHTML;void 0;
// Squirt.org
javascript:var _='',$=document,whaks = document.getElementsByTagName(%22img%22);for (var i = 0, whak; whak = whaks[i]; i++) {_+='<img src=%22'+whak.src.replace(/\x26\x70\x73\x3d/g,%22&ps=1&%22)+'%22> ';};$.body.innerHTML=_+'<hr>Visit <a href=%22http://www.whak.com%22>www.WHAK.com</a><hr>'+$.body.innerHTML;void 0;
@JavaScript-Packer
JavaScript-Packer / html.entity.safe.escape.js
Last active December 23, 2018 11:24
Turned/reversed the unpacker for WHAK compression algorithm and made it into a HTML entities encoder - http://www.whak.ca/packer/JavaScript.htm
var W,H,A,K;
H ="&amp; &lt; &gt; &#34; &#10; &#39;"[$="split"](" ");
A ="&<>\"\n'";W='<script>alert("www.WHAK.com");<\/script>';
K =0;for(K in A)W=W[$](A[K]).join(H[K]);alert(W);
@JavaScript-Packer
JavaScript-Packer / compare-lists-for-new-and-removed.htm
Last active April 3, 2016 07:45
Compare older list to a newer list to see changes (what is new and what is now gone). Working on a bookmarklet for FaceBook to find New Freinds and Friends that left (unfriended) you.
<html><head><title>Compare 2 Lists For Differences. Changes Added To List &amp; What Was Removed From Original List</title></head><body>
<script>
var s1 = 'Kvn Mrffy Brwn\n\
Lrran Brwn Lavall\n\
Rbrt Jsph\n\
Wayn Brstw\n\
Lrr Brwn Tschrwnsk\n\
Krs Oltn\n\
Paln Bckndal - Glnvw Park Scndary Schl\n\
@JavaScript-Packer
JavaScript-Packer / holy-bible-random-verse.js
Created March 25, 2016 02:07
Random Verse From Holy Bible. Made by www.BibleThumper.net
var randomverse=new Array();
var versetitle=' <font size="4"><b><a href="http://www.holybibleverse.com">Random Bible Verse</a></b><br /></font>';
// by www.BibleThumper.net
randomverse[1]='Set your affection on things above, not on things on the earth.<br/><b>Colossians 3:2</b>';
randomverse[2]='For all have sinned and come short of the glory of God<br/><b>Romans 3:23</b>';
randomverse[3]='Come unto me, all ye that labor and are heavy laden, and I will give you rest.<br/><b>Matthew 11:28</b>';
randomverse[4]='Not everyone that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my father which is in heaven.<br/><b>Matthew 7:21</b>';
randomverse[5]='For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.<br/><b>John 3:16</b>';
randomverse[6]='For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord<br/><b>Romans 6:23</b>';
randomverse[7]='Let t
@JavaScript-Packer
JavaScript-Packer / right-click-menu.htm
Created April 3, 2016 07:27
Replace the right click menu on your webpage using JavaScript!
<html><head><title>Right Click Context Menu JavaScript Replacement - WHAK.com</title></head><body bgcolor="silver"><h1>TOP</h1><h3>Right Click Menu In JavaScript</h3><hr size="7000" color="gray">
<script>
function a(b){c=document.all?event.clientX+document.body.scrollLeft:document.a?b.x+window.pageXOffset:b.clientX+window.pageXOffset;d=document.all?event.clientY+document.body.scrollTop:document.a?b.y+window.pageYOffset:b.clientY+window.pageYOffset}var e,f,g,c=0,d=0;void 0!=document.addEventListener?document.addEventListener("mousemove",a,!0):document.a&&document.captureEvents(Event.b|Event.c|Event.f);document.onmousemove=a;document.oncontextmenu=function(){return!1};document.onmousedown=function(b){3==b.which&&(document.getElementById("contextmenu").style.left=c+"px",document.getElementById("contextmenu").style.top=d+"px",document.getElementById("contextmenu").style.visibility="visible")};document.onmouseup=function(b){1==b.which&&(document.getElementById("contextmenu").style.visibility="hidden")};e=250,g=doc