Skip to content

Instantly share code, notes, and snippets.

View operator-DD3's full-sized avatar
:octocat:
solo artist

Jacob Gardner operator-DD3

:octocat:
solo artist
  • banishing dirgist
View GitHub Profile
@operator-DD3
operator-DD3 / editor.html
Created August 11, 2015 03:21
A simple DATA:URI editor
<html> <head> <style> h1 { background-color: black; color: white; } </style> <script> function myfunc() { document.getElementById("myP").innerHTML = "<A HREF=data:text/html;charset=utf-8," + encodeURI(document.getElementById("text1").value) + ">output</a>" } </script> </head> <h1><center>Data:URI Editor</center></h1> <textarea id="text1" cols="80" rows="12"></textarea> <br> <button type="button" onclick="myfunc()">Create URI</button> <p id="myP"></p> </html>
@operator-DD3
operator-DD3 / spritz.lua
Created December 12, 2017 06:45
Spritz Encryption Routines
S = {}
i,j,k,z,a,v=0,0,0,0,0,0
w=1
N=2^9 --2^8 or 8bits
D=math.ceil(math.sqrt(N))
print("N:",N)
print("D:",D)
function InitializeState(N)
@operator-DD3
operator-DD3 / block.lua
Created November 29, 2017 08:54
New Hash
function log2 (x) return math.log(x) / math.log(2) end
function entropy (X)
local N, count, sum, i = X:len(), {}, 0
for char = 1, N do
i = X:sub(char, char)
if count[i] then
count[i] = count[i] + 1
else
count[i] = 1
@operator-DD3
operator-DD3 / MARSclock.lua
Created August 6, 2016 01:28
A simple function to calculate the Mars Sol Date (MSD) and the Coordinated Mars Time (MTC) from the current number of seconds since the UNIX epoch.
function mars_time()
local ms = os.time()*1000
local JDut = 2440587.5 + (ms /86400000)
local JDtt = JDut + (35 + 32.184) / 86400
local J2000 = JDtt - 2451545.0
local MSD = ((J2000 - 4.5)/1.027491252) + 44796 - 0.00096
local MTC = (24 * MSD) % 24
local h = math.floor(MTC)
local m = math.floor((MTC - h)*60)
local s = math.floor((MTC - h - (m/60))*60*60)
@operator-DD3
operator-DD3 / antivirus.lua
Last active August 4, 2016 22:17
A simple antivirus script that generates the md5 hash of a file and sends the hash to the malware hash database at cymru.com This depends on 'openssl'
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end
@operator-DD3
operator-DD3 / 5-3.lua
Last active March 10, 2016 19:17
A concatenative programming language inspired by FORTH and implemented in Lua.
pc=1 --program counter
program = {} --array of words in program
dict = {} --dictionary of user defined words
prim = {} --language keywords
stack= {} --working stack
rstack = {} --2nd stack
mem = {} --memory
mode = "interpret"
alive = true --used for halting and error
c_word = ""
@operator-DD3
operator-DD3 / keybase.md
Created October 5, 2015 20:19
keybase proof

Keybase proof

I hereby claim:

  • I am operator-dd3 on github.
  • I am operatordd3 (https://keybase.io/operatordd3) on keybase.
  • I have a public key whose fingerprint is B606 50B2 AADE 7DB0 FE0A 840F F2A7 2DC0 2E8A 66CB

To claim this, I am signing this object:

@operator-DD3
operator-DD3 / noise.html
Created September 28, 2015 07:22
Noisy Television Screen Simulation. Tested on mobile.
<style type="text/css">
html, body, canvas {
height: 100%;
width: 100%;
border-radius: 16px;
}
body {
display: flex;
background: black;
}
@operator-DD3
operator-DD3 / xsadb.lua
Last active August 29, 2015 14:27
[Lua] XSA Database v1.0
-- XSA DATABASE (XSADB)
-- Copyright 2015
-- XOUT SECURITY AGENCY (XSA)
function wrap(str, limit, indent, indent1) indent = indent or "" indent1 = indent1 or indent limit = limit or 72 local here = 1-#indent1 return indent1..str:gsub("(%s+)()(%S+)()", function(sp, st, word, fi) if fi-here > limit then here = st - #indent return "\n"..indent..word end end) end
function uuid()
my_uuid = ""
t = {[0] = '0', [1] = '1', [2] = '2', [3] = '3', [4] = '4', [5] = '5', [6] = '6', [7] = '7', [8] = '8', [9] = '9', [10] = 'a', [11] = 'b', [12] = 'c', [13] = 'd', [14] = 'e', [15] = 'f'}
for i = 1, 32 do
@operator-DD3
operator-DD3 / stackVM.lua
Created August 11, 2015 03:04
A stack machine emulator created in Lua.
local txt="0 33 100 108 114 111 87 32 44 111 108 108 101 72 debug if outputascii fi"
io.write("Welcome to SuperStack!\nEnter your 'name':")
user = io.read()
io.write("\n" .. user .. "@superstack: ")
local txt = io.read()
--program=program.." "
txt=txt.." "