Skip to content

Instantly share code, notes, and snippets.

import click
import os
import os.path
import pathlib as purepath
import shutil
@click.command(help="Clone the json files *only* out of a directory tree")
@click.argument('indir', type=click.STRING)
@click.argument('outdir', type=click.STRING)
@click.option('-X', '--exclude', type=click.STRING, help="Skip this file/directory", multiple=True)

So I find myself writing this match statement:

line.push(match ch {
    'a'..='z' => { (ch as u8) - ('a' as u8) }
    'S' => { start = Some(UVec2::new(line.len() as u32, match grid { None => 0, Some(ref grid) => grid.nrows() as u32 })); 0  }
    'E' => { end   = Some(UVec2::new(line.len() as u32, match grid { None => 0, Some(ref grid) => grid.nrows() as u32 })); 25 }
    _ => return invalid2()
})
@mcclure
mcclure / add-to-Stylus-to-flag-nfts.css
Last active January 21, 2022 09:34
Download the "Stylus" browser extension and add this for all Twitter NFT users to be unambiguously flagged as such. Not written by me.
[style^='clip-path: url("#hex-hw-shapeclip-clipconfig");']
{
background-color: black;
}
[style^='clip-path: url("#hex-hw-shapeclip-clipconfig");']::before
{
background-color: black;
color: white;
content: "NFT USER lmao";
// Helper program translates from decimal numbers to C99 "%a" format.
// Arguments:
// -r : Translate %a to decimal instead
// -d : Use doubles
// Then enter numbers you want to convert one line at a time
//
// To compile just do: gcc percenta.c
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
Here's a few thoughts— I'll put a rot13.com summary by each one
Felix Gilman - The Half-Made World
N jne va n zlfgrevbhf cynpr gung nccrnef gb or gur Nzrevpna pbyyrpgvir pbafpvbhfarff, orgjrra n ulcreohernhpengvp envyjnl yvar gung vf gur rzobqvzrag bs snfpvfz naq n enpr bs qrzba-cbffrffrq thaf gung cbffrff gurve orneref naq ghea gurz vagb zheqrebhf "urebrf"
Paolo Bacigalupi - The Wind-Up Girl
Znaxvaq gelvat gb shapgvba nsgre gur bvy ehaf bhg, V qba'g jnag gb tvir gbb zhpu njnl ohg guvf bar unf fb znal jrveq naq fzneg vqrnf nobhg jung jbhyq unccra naq jung crbcyr jbhyq inyhr vs grpuabybtl yrncrq sbejneq naq jnf gura sbepr gb penjy onpx

I'm assuming the core comes down to the different Scripts/Scenarios for instrumentality

  1. Yui's script— possibly benevolent
  2. SEELE's script — malevolent
  3. Gendo's script— malevolent, but results in Gendo reuniting his soul with Yui's
  4. Shinji's script — possibly benevolent, poorly thought out
  5. Misato/pirate script — NO INSTRUMENTALITY

In the TV series Gendo's script was followed to conclusion, the world's humans lost their bodies and individuality but Yui got to be immortal in Unit 01 in space. Gendo was unhappy because he didn't get to be with Yui. SEELE was happy even though they didn't get to be immortal because humanity became a hivemind so that was pretty close to their script.

In rebuild 2, Shinji goes Third Impact early and almost executes a feral script for instrumentality, but Kaworu halts him with a Spear so that it can be carried out later on SEELE's script. Time passes, SEELE has retracted into the monoliths so they can be immortal, Gendo is building EVA 13 so he can restart instrumental

mcc's Pac Man 99 guide

First things first: Read the reddit, this is the source for most of this information

TLDR: If you want the game to be "fun", start in Counter+Speed mode, and clear boards as quickly as possible until you hit 50%; then switch to Knockout and just try to eat ghosts and stay alive. When it hits 10% consider camping power pellets.

Mechanics

"Obvious" mechanics

Somebody asked my advice on writing an independent CLR (C#/.NET) VM implementation. Here's what I said.

Clarifications:

  • Download ECMA-334 + ECMA-335 PDFs first.
  • "Get" C# bytecode-compiler / disassembler means download them-- don't write your own.
  • Author of JSIL is @antumbral.

You want to get a c# -> bytecode compiler, and you want to get a bytecode disassembler

mono's is mcs and [thing i forget, but there is one], monodis?

Here are my steps for building and installing Magus firmware from scratch on a Windows 10 machine.

If you don't want to build a firmware, you just want to install one, you can download an official firmware from Github and then skip to step 12.

If you are planning to change the firmware code before building it, you may want to run the OPTIONAL, SCARY STEPS at the bottom of this guide first, for safety.

Steps:

  1. I installed Ubuntu for Linux for Windows.
/*
This short Typescript snippet works with:
"dependencies": {
"immutable": "^4.0.0-rc.12",
"preact": "^10.1.0",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3"
},
"devDependencies": {
"ts-loader": "^6.2.1",