Skip to content

Instantly share code, notes, and snippets.

View DinkDev's full-sized avatar

Dale Thompson DinkDev

View GitHub Profile
@DinkDev
DinkDev / PSFileTransferByClipboard.ps1
Created October 4, 2021 21:10 — forked from ethzero/PSFileTransferByClipboard.ps1
Transferring binary content by way of clipboard via Powershell
## Powershell method of transfering small (< 1 MB) binary files via Clipboard
##
## NB: Unwise to attempt to encode binary files exceeding 1 MB due to excessive memory consumption
## Powershell 5.0>
# On the transmission end:
$Content = Get-Content -Encoding Byte -Path binaryfile.xxx
[System.Convert]::ToBase64String($Content) | Set-Clipboard
# On the receiving end
@DinkDev
DinkDev / levenshtein_algorithm.lua
Created September 23, 2021 01:59 — forked from Badgerati/levenshtein_algorithm.lua
An implementation of the Levenshtein distance algorithm in LUA.
-- Returns the Levenshtein distance between the two given strings
function string.levenshtein(str1, str2)
local len1 = string.len(str1)
local len2 = string.len(str2)
local matrix = {}
local cost = 0
-- quick cut-offs to save time
if (len1 == 0) then
return len2