Skip to content

Instantly share code, notes, and snippets.

View MasFlam's full-sized avatar
🦽
universitting

MasFlam MasFlam

🦽
universitting
View GitHub Profile
@MasFlam
MasFlam / monero-address-regex.md
Last active March 25, 2024 02:22
Regular expressions for matching monero addresses

Tip

See the XmrAddr libraries.

Monero Address Regex

This is a collection of best-you-can-do regular expressions matching Monero addresses of each kind and network type. Keep in mind to actually verify an address you should validate the checksum, so use these only for preliminary filtering of data, UI validation, etc. where false positives won't hurt. Also, I semi-purposefully didn't include regex for integrated addresses, which are nowadays considered deprecated by many, including myself.

@MasFlam
MasFlam / SatoriSigma.user.js
Created June 10, 2022 23:43
Tampermonkey/whatever else userscript for satori sigma grinders
// ==UserScript==
// @name Satori Sigma
// @namespace https://masflam.com
// @version 21.37
// @description satori grind
// @author MasFlam
// @match *://satori.tcs.uj.edu.pl/*
// @icon https://satori.tcs.uj.edu.pl/files/satori_logo.png
// @grant none
// ==/UserScript==
@MasFlam
MasFlam / randomutf8.jl
Created October 2, 2020 12:52
Script outputting n random valid UTF-8 characters
#!/usr/bin/env julia
function main(outlen:: Integer)
chars = Vector{Char}(undef, outlen)
for i in 1:outlen
chars[i] = rand(Char)
end
print(String(chars))
end
@MasFlam
MasFlam / colortest.jl
Created October 2, 2020 08:10
Julia script for testing the color capability of a terminal emulator
#!/usr/bin/env julia
function test3b()
println("3-bit color")
for i in 0:7
ch = "AAA"
print("\e[$(30 + i)m$ch")
end
@MasFlam
MasFlam / run-psql.ps1
Created August 14, 2020 15:05
PowerShell script to run psql prompting for connection details
Write-Host "Enter connection details:"
$server = "localhost"
$server_maybe = (Read-Host -Prompt "Server [$server]")
If($server_maybe -ne "") {
$server = $server_maybe
}
$db = "postgres"
@MasFlam
MasFlam / latToRus.js
Last active August 6, 2020 14:19
latin to cyrillic pseudo-translator
const RUS = ["А","Б","Ц","Д","Э","Ф","Г","Х","И","Й","К","ЛЬ","М","Н","О","П","Q","Р","С","Т","У","V","В","X","Ы","З","а","б","ц","д","э","ф","г","х","и","й","к","ль","м","н","о","п","q","р","с","т","у","v","в","x","ы","з",",","<",".",">","/","?",";",":","'","\"","\\","|","[","{","]","}","-","=","_","+","1","2","3","4","5","6","7","8","9","0","!","@","#","$","%","^","&","*","(",")","`","~"," "];
const LAT = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",",","<",".",">","/","?",";",":","'","\"","\\","|","[","{","]","}","-","=","_","+","1","2","3","4","5","6","7","8","9","0","!","@","#","$","%","^","&","*","(",")","`","~"," "];
const latToRus = (str) =>
str.split("")
.map(ch => RUS[LAT.indexOf(ch)])
.map(ch => ch == undefined ? '‽' : ch)
.reduce((a, b) => a + b);
@MasFlam
MasFlam / ForkSort.java
Last active August 21, 2020 13:59
ForkBombSort or ForkSort is a version of MergeSort, where on every recursion, two new threads are created.
public final class ForkSort {
private ForkSort() {}
public static <T> List<T> forkSort(List<T> list, Comparator<T> comp) {
int len = list.size();
int mid = len / 2;
List<T> one = new ArrayList<>(mid);
List<T> two = new ArrayList<>(len - mid);