Skip to content

Instantly share code, notes, and snippets.

View max-mapper's full-sized avatar
🔰
✌( ͡ᵔ ͜ʖ ͡ᵔ )✌

Max max-mapper

🔰
✌( ͡ᵔ ͜ʖ ͡ᵔ )✌
View GitHub Profile
@max-mapper
max-mapper / index.js
Created December 26, 2025 12:39
IA Book Viewer Downloader
(function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error("could not download file")},d.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof windo
@max-mapper
max-mapper / index.js
Created December 26, 2025 04:12
hiragana/katakana to man'yougana converter
// js port of https://qiita.com/zakur00/items/0f5c6d03d565c1b2ae33
const MANYOU_RAW = `
あいうえお かきくけこ さしすせそ
安以宇衣於 加幾久計己 左之寸世曽
たちつてと なにぬねの はひふへほ
太知川天止 奈仁奴祢乃 波比不部保
まみむめも やゆよ らりるれろ
末美武女毛 也由与 良利留礼呂
わゐゑを ん
@max-mapper
max-mapper / readme.md
Created December 12, 2025 10:46
Grant android 16 device apps access to discover LAN devices

adb shell pm list packages adb shell am compat disable RESTRICT_LOCAL_NETWORK package:cc.popin.aladdin.assistant adb shell pm grant cc.popin.aladdin.assistant android.permission.NEARBY_WIFI_DEVICES

@max-mapper
max-mapper / convert.py
Last active May 5, 2025 21:02
convert pdf to mokuro batch cli
import sys
import os
import pyvips
def process_image(image_path):
"""
Processes a multi-page image, writing each page to a separate JPG file
in a subfolder named after the input image's basename.
Args:
@max-mapper
max-mapper / README.md
Last active September 26, 2023 20:51
Save Felt.com rendered map features to GeoJSON feature collection

Save bookmarklet.js as a bookmarklet and on any Felt map the currently rendered features will be saved as a file features.geojson (note: some features do not render at low zoom levels)

@max-mapper
max-mapper / analyse.sh
Last active May 17, 2023 06:07
birdnet laptop mode
#!/bin/bash
TIMEFORMAT='Elapsed Time: %0R seconds.'
time {
export YEAR=`date '+%Y'`
export MONTH=`date '+%m'`
export DAY=`date '+%d'`
export WEEK=`date '+%U'`
# kill `cat /home/max/tweet/recording.pid`
for f in `ls /home/max/tweet/samples/${YEAR}/${MONTH}/${DAY}/*.wav`
do
@max-mapper
max-mapper / index.html
Last active September 30, 2022 22:05
la county impervious surface assessor parcel map
<html>
<head>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"
/>
<link
rel="stylesheet"
href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css"
crossorigin=""
@max-mapper
max-mapper / readme.md
Created September 1, 2021 00:07
Metro Micro API (RideCo API)

i downloaded the metro micro APK, extracted it, and then unminified the ionic JS source code, then reverse engineered these calls using my own username/password

# get a token
curl -H "Accept: application/json; version=rccmtp-2.18.0" -X POST https://api.metro-micro.net/api-token-auth/ -F "username=youremail" -F "password=yourpass"

# get geocode results
curl -H "Accept: application/json; version=rccmtp-2.18.0" -X GET "https://api.metro-micro.net/rest/geo/places/autocomplete/?value=yourtexttogeocode&session_token=$MICRO" -H "Authorization: Token $MICRO"

# get a trip/ride id
@max-mapper
max-mapper / readme.md
Created February 19, 2021 17:17
Bitcoin Regtest Local Server Instructions
  1. Grab the latest bitcoin-core .tar.gz release and unpack it https://bitcoin.org/en/download
  2. Add the bin folder to your path
  3. Start the regtest server bitcoind -regtest
  4. Create a test wallet bitcoin-cli -regtest createwallet test
  5. Get a bcrt address for your wallet bitcoin-cli -regtest getnewaddress
  6. 'Mine' some regtest btc bitcoin-cli generatetoaddress 10 <address-from-previous-command>
  7. Make sure it worked `bitcoin-cli getblockcount
@max-mapper
max-mapper / index.js
Last active May 17, 2023 06:09
JavaScript Base-40 Class
// based on https://github.com/blockstack/blockstack-core/blob/ff86948ed2f720824cd5e6ece6a63aaaf2bf81ff/blockstack/lib/b40.py
class B40 {
constructor() {
this.B16_CHARS = '0123456789abcdef'
this.B40_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz-_.+'
}
divmod(x, y) {
const div = x / y
const rem = x % y