Skip to content

Instantly share code, notes, and snippets.

testing titty tablets

Mingye Wang Artoria2e5

testing titty tablets
View GitHub Profile
View gist:1f63fe5826f6786d268edf035706a0ea
Artoria2e5 / sun_getopt.c
Last active Oct 5, 2020
getopt(3) in the Solaris way, as a wrapper around getopt_long(3)
View sun_getopt.c
* sun_getopt - Solaris-style getopt(3), as a wrapper around getopt_long(3).
* Written by Mingye Wang (Artoria2e5). Dedicated to the public domain under
* Creative Commons Zero.
* Untested. Like not even fed to a compiler once.
#include "sun_getopt.h"
Artoria2e5 /
Last active Jul 4, 2020
Copy a minecraft directory with some symlinks
# duplicate-minecraft-dir: copies a minecraft directory with some symlinks.
# Requires uname and GNU coreutils.
# Requires admin priv under Windows.
# Dedicated to the public domain under Creative Commons Zero. Do what the heck you wanna do with it.
die(){ printf '%s: %s\n' "$SELF" "$1">&2; exit "${2-2}"; }
log() { local level=$1; if ((VERBOSE >= level)); then printf '%s: %s\n' "$SELF" "$2">&2; fi; }
nolink=(config options\*.txt launcher_profiles.json servers.dat config baritone Impact mods)
Artoria2e5 / run_as_admin.vbs
Created Mar 18, 2020
Proxy script for running anything as an admin. Contains an CommandLineToArgvW escaper.
View run_as_admin.vbs
' Proxy script for running anything as an admin. In this case, AHK.
Set UAC = CreateObject("Shell.Application")
Dim Arguments
' Build arguments
Arguments = ""
For Each strArg in WScript.Arguments
Arguments = Arguments & Escape(strArg) & " "
UAC.ShellExecute "C:\Program Files\AutoHotkey\AutoHotkey.exe", Arguments, "", "runas", 1
#include <iostream>
#include <cstdint>
template<typename T>
class MerssenePerfect {
// A000043
"MerssenePerfect should use an unsigned type");
const static int_fast8_t primes[18] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61 };
ptrdiff_t offset;
View CurlyFakePolyp.cpp
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
Artoria2e5 / pref.json
Created Sep 19, 2017
vscode settings, zh-cn
View pref.json
"workbench.colorTheme": "Default Light+",
"editor.fontFamily": "'Inziu Iosevka SC', monospace",
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?《》?!()。【】;:“”‘’"
Artoria2e5 /
Last active Jul 4, 2017
quick notes for seeborg@zh

Adapting seeborg for Chinese

See We need to chew the received message for seeborg so it can properly assimilate it.

Inject the nanoprobes here, right?

Seeborg chews messages and tries to reply to it in SeeBorg::Reply. This applies to both the IRC and the console versions, so that should be deemed a good enough place to start with.

Artoria2e5 / devise.zh-CN.yml
Last active Aug 30, 2019
Devise 4.2.6 zh files
View devise.zh-CN.yml
# Chinese (China) translations for Devise 4.2.1
# 4.2.0: By HealthGrid at
# 4.2.1: By Artoria2e5 (this file)
# - Fixes pluralization problems (zh only takes "other")
# - Misc translation improvements, you know what these grammar things are.
# - Should be minor enough to claim CC0 for my changes.
# Additional translations at
Artoria2e5 / bd_mercator.js
Last active Feb 12, 2017
Baidu's Twist on Web Mercator (as shown at
View bd_mercator.js
// Reference value:
// type 5 (lon,lat) -> type 6 (x,y)
// js source, presumably same as ref?
var BD_EXTENT_LON = 20037726.372144807 // ? - lon only; lat goes less
var BD_EXTENT_LAT = 12474104.1741418
// Their js truncated at 74, but included taylor terms up to 75~90 (82.5).
// These terms are severly screwed thanks to their misunderstanding of taylor.
You can’t perform that action at this time.