Skip to content

Instantly share code, notes, and snippets.

View andrewvmail's full-sized avatar

momoterraw andrewvmail

View GitHub Profile

This guide was created using Microsoft Windows 11 Pro

Version 21H2 build 22000.194


System Updates:

  • Settings -> Windows Update
  • Install all updates

Powershell Execution Policy:

  • launch Windows Powershell as administrator and execute:
andrewvmail /
Created January 29, 2022 02:05 — forked from andymatuschak/
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

andrewvmail / Spacemacs on Windows
Created November 12, 2021 10:43 — forked from cdaven/Spacemacs on Windows
Setting up Spacemacs on Windows 10

Install Emacs First

Download emacs-w64 and extract somewhere, e.g. a tools or apps folder like C:\Users\<user>\tools\emacs.

Select Emacs' Home

Emacs and many other applications store its configuration in the user's "home" folder. Translated directly from the Unix world, that is %UserProfile% (C:\Users\<user>), but Windows prefers %AppData% instead (C:\Users\<user>\AppData\Roaming).

For simplicity's sake, override this by specifying the HOME environment variable explicitly. Emacs and some other applications (e.g. MinGW) lets this override the default.

### my-script — does one thing well
### Usage:
### my-script <input> <output>
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
andrewvmail /
Last active April 5, 2020 00:23 — forked from Kutkovsky/
The steps allowing to create macOS 10.15 Catalina VM on vSphere or ESXi
# Added after beta and doing it at a catalina machine.
# App Store > macOS Catalina > GET
# Steps to create the macOS Catalina (10.15) VM:
# login to or to download a tester's profile for your OS. Install it.
# Go to System Preferences > Software Update and start the update process
# When the Catalina Installer (few MBytes) is started, it downloads the remain part of installation.
andrewvmail / index.js
Created March 29, 2020 00:39 — forked from NoTimeForHero/index.js
NodeJS script to remove 1000 DNS records added by Cloudflare when used * (wildcard) A record
// Now if you adding a domain with wildcard A record, Cloudflare uses strange scan, which added a 1000 trash domains (like 1-100, some english words like "ai", "air", "android").
// There's no way to bulk delete it, you can delete it only using their API.
// So I write a script that can help you with this problem.
// Discussions about same problem:
const settings = {
email: 'your@email',
andrewvmail /
Created January 2, 2020 23:57 — forked from foozmeat/
A shell script to build openssl for iOS and Mac. It currently builds: Mac -> i386 & x86_64 // iOS -> armv7, arm64 // iOS Simulator -> i386 & x86_64.
# This script builds the iOS and Mac openSSL libraries
# Download openssl and place the tarball next to this script
# Credits:
andrewvmail / build.gradle
Created July 3, 2019 01:14 — forked from tprochazka/build.gradle
Smart versionName and versionCode for android Gradle build evaluation
* Will return version from properties file and replace -SNAPSHOT by GIT commit hash
* to recognize origin commit for the every build.
project.ext.evalVersionName = {
def ideBuild =['android.injected.invoked.from.ide']
if (ideBuild) {"IDE build");
return "dev"
} else if (project.VERSION.toUpperCase().contains("SNAPSHOT")) {
andrewvmail / interval.js
Created June 26, 2019 06:34 — forked from manast/interval.js
Accurate Javascript setInterval replacement
function interval(duration, fn){
this.baseline = undefined = function(){
if(this.baseline === undefined){
this.baseline = new Date().getTime()
var end = new Date().getTime()
this.baseline += duration
andrewvmail /
Created June 26, 2019 01:08 — forked from msrose/
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.