Skip to content

Instantly share code, notes, and snippets.

@MicahZoltu
MicahZoltu / ruling-english.md
Last active May 16, 2024 13:36
Alexey Court Ruling

Judgment

COURT OF EAST BRABANT
Location 's-Hertogenbosch
Criminal Law
Docket Number: 82.198261.22.
Date of judgment: May 14, 2024.
Judgment of the East Brabant court, multiple chamber for the handling of criminal cases, in the case against:

[defendant],

@MicahZoltu
MicahZoltu / standard-notes-proxy.js
Created March 11, 2024 03:04
Standard Notes CloudFlare Proxy
export default {
/**
* @param {Request} request
*/
async fetch(request) {
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS",
"Access-Control-Max-Age": "86400",
};
@MicahZoltu
MicahZoltu / faster.js
Created June 2, 2023 11:07
Faster Video Playback Bookmarklet
javascript:(() => { let speed = 2; let indicator; let indicatorTimeout; function createIndicator() { indicator = document.createElement("div"); indicator.setAttribute(`style`, ` position: fixed; left: 15px; top: 15px; background-color: black; color: white; font-size: 20px; padding: 10px; display: none; z-index: 99999999999999; `); document.body.appendChild(indicator); }; function show(text) { if (!indicator) createIndicator(); indicator.innerText = text; indicator.style.display = "block"; indicatorTimeout && clearTimeout(indicatorTimeout); indicatorTimeout = setTimeout(() => { indicator.style.display = "none"; }, 5000); } function round(value, precision) { const scalar = 10 ** precision; return Math.round(value * scalar) / scalar; }; function conformSpeed(value) { return Math.min(Math.max(value, 1 / 16), 16); }; function syncSpeed() { document.querySelectorAll("video").forEach(video => { video.playbackRate = speed; }); }; function changeSpeed(value) { speed = conformSpeed(value); show(round(speed, 2).t
@MicahZoltu
MicahZoltu / tornado-community-build.md
Last active July 18, 2023 22:00
Tornado Cash Community Build
@MicahZoltu
MicahZoltu / vitalik-mode.js
Last active June 14, 2023 08:54
vitalik-mode
(function () {
var request = async ({method, params}) => {
if (method === 'eth_requestAccounts') {
return ['0xd8da6bf26964af9d7eed9e03e53415d37aa96045']
}
else {
const response = await fetch('https://cloudflare-eth.com/v1/mainnet', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({jsonrpc:'2.0',id:1,method,params})})
if (!response.ok) throw new Error(`${response.status}: ${response.statusText}\n${await response.text()}`)
const json = await response.json()
if ('error' in json) throw new Error(json.error)
@MicahZoltu
MicahZoltu / zoom-fix-chat.js
Created July 15, 2022 14:43
Fix Zoom Chat Box Focus bug
(function () { const chatBox = document.querySelector('#wc-container-right > div.participants-section-container > div.chat-container > div > textarea'); chatBox.onblur = chatBox.focus })()
@MicahZoltu
MicahZoltu / script.bash
Last active March 18, 2024 14:46
Generate Ethereum Mnemonic & Address
mkdir temp
cd temp
cat >index.mjs <<'EOF'
import { ethereum, mnemonic, secp256k1, hdWallet } from '@zoltu/ethereum-crypto'
// necessary so @peculiar/webcrypto looks like browser WebCrypto, which @zoltu/ethereum-crypto needs
import webcrypto from '@peculiar/webcrypto'
globalThis.crypto = new webcrypto.Crypto()
export async function generateAccount() {
@MicahZoltu
MicahZoltu / github-widescreen-bookmarklet.js
Last active August 30, 2021 07:58
GitHub Widescreen Boookmarklet
javascript:(function(){ const style = document.createElement('style'); style.id = 'injected-css'; style.innerText = `.container-xl, #review-changes-modal .SelectMenu-modal, .inline-comment-form-container, .inline-comment-form, .comment-holder, #pull_request_review_body { max-height: none !important; max-width: none !important; } .js-resolvable-timeline-thread-container, .js-line-comments { max-width: calc(100vw - 100px); }`; document.head.appendChild(style); })();
@MicahZoltu
MicahZoltu / FoodToken.sol
Last active February 5, 2021 14:37
Testnet Tokens
pragma solidity >= 0.7.0;
contract FoodToken {
uint256 constant public totalSupply = 10_000_000 * 10**18;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
string constant public symbol = "FOOD";
uint8 constant public decimals = 18;
string constant public name = "Food Token";
@MicahZoltu
MicahZoltu / Dockerfile
Last active December 16, 2020 09:15
Augur ENS Verification
FROM node:14-alpine
WORKDIR /app
RUN npm install --save eth-ens-namehash content-hash @zoltu/ethereum-abi-encoder
RUN echo $'\n\
import Contenthash from "content-hash"\n\
import Namehash from "eth-ens-namehash"\n\
import AbiEncoder from "@zoltu/ethereum-abi-encoder"\n\
\n\
function stringToBytes(hex) {\n\
const match = /^(?:0x)?([a-fA-F0-9]*)$/.exec(hex)\n\