Skip to content

Instantly share code, notes, and snippets.

View mabels's full-sized avatar
💭
Getting CloudNaive

Meno Abels mabels

💭
Getting CloudNaive
View GitHub Profile
@mabels
mabels / index.js
Last active July 13, 2022 16:09
Do not use @home
const md5 = require('md5');
const bs58 = require('bs58');
function doIt(...total) {
const tlds = ["de","com","at","net"];
let generation = md5([doIt.toString(), ...tlds].join("@"));
for (let g = 0; g < ~~(total[0]|10); ++g) {
for (let i = 0; i < tlds.length; ++i, generation = md5([g,i,generation].join("-"))) {
const firstFactor = bs58.encode(Buffer.from(generation.slice(0, 6)))
const secondFactor = bs58.encode(Buffer.from(md5([doIt.toString(), generation].join("@"))))
@mabels
mabels / build.sh
Created June 22, 2022 06:27
Whatsapp - Twillio
esbuild --bundle --minify --platform=node --target=node12 --outdir=build index.js
(cd ./build && zip -o lambda.zip index.js)
aws lambda update-function-code --function-name whats-blundstone --zip-file fileb://./build/lambda.zip
import { EventEmitter } from 'events';
function Source() {
let value = 0
const em = new EventEmitter()
em.on('next', (val: any) => {
console.log('next:', val)
em.emit('push', JSON.stringify({ value: value++ }))
if (value > 10000) {
em.emit('close')
@mabels
mabels / Nachlass.asc
Last active March 22, 2020 12:38
Nachlass
45463de77aa79cc02ff8bf0558e397b64082dddc3e0d5694c47df140778f3878 nachlass
-----BEGIN PGP MESSAGE-----
Comment: GPGTools - http://gpgtools.org
hQIMAz2FGl3wneucAQ//Uov7dRwInddDd+0C3V6SP/chvK/8Z9YtqVbfSq6etW4Q
YgcoXrHOiXfBphsRKYLl5Z5xM3QMsEWrHoddwWRe+SLJW1bjbb4QwVlEjMjDmWKh
gFMLa6dv/NH0pwjQSMkCAvek7kTPFrRCgfnRtBojeSNg3qOaOwuX9XHLp7s8ywYR
9N3ZXT5GfR7YBRCds4Hm/VbewI7DnNs6ngbktrPOXC3EqijsjQ7caQvo5GeoR0vk
4KvPDMd/CmaEit85Kv0UpEcscncg60+WmRxmyuthr+JvLxfV4Y8Cm+407Oh7wVPb
sw51Ge+B1I/DGVSPPLS7tRtZ2B3nkVWiZALDHj0F/Xilp4pRF7ec7pWZQCCtd8wc
<html>
<body>
<canvas id="osi" width="600" height="400"></canvas>
<canvas id="freq" width="600" height="400"></canvas>
<script>
const osi = document.getElementById('osi');
const osiCtx = osi.getContext('2d');
const freq = document.getElementById('freq');
const freqCtx = freq.getContext('2d');
module type IpAddress = sig
val x : int
end;;
module V4:IpAddress = struct
let x = 3
end;;
module V6:IpAddress = struct
mkdir ~/scan
adf=""
while [ ! \( "Q" = "$adf" -o "q" = "$adf" \) ]
do
echo -n "(D)uplex (S)implex (C)ontinue (Q)uit:"
read -n1 adf
if [ "C" = $adf -o "c" = $adf ]
then
echo "Continue: $serial"
serial=`expr $serial + 1`
import * as abstractRx from '../abstract-rx';
export class Subject<T> {
private subscribes: abstractRx.DataCallback[];
private completes: abstractRx.CompletesCallback[];
private errors: abstractRx.DataCallback[];
constructor() {
this.subscribes = [];
@mabels
mabels / token-scanner.ts
Last active September 7, 2017 07:01
FSM For Token Scanning
interface Step {
pos: number;
step: State;
}
abstract class State {
public next: State;
public match: string;
constructor(match: string) {
@mabels
mabels / d-hello-world.js
Last active July 4, 2017 08:32
Distributed Hello World
LetterReducer = function(letterReducers) {
return function() {
for (let letter of Array.from(arguments).filter((i) => i.letter)) {
let ridx = ~~(letter.idx/4)
let lr = [];
if (letterReducers.has(ridx)) {
lr = letterReducers.get(ridx);
} else {
letterReducers.set(ridx, lr);
}