Skip to content

Instantly share code, notes, and snippets.

View Artoria2e5's full-sized avatar
🌪️
Not liking the idea of sitting in front of a computer

Mingye Wang Artoria2e5

🌪️
Not liking the idea of sitting in front of a computer
View GitHub Profile
@Artoria2e5
Artoria2e5 / run_as_admin.vbs
Created March 18, 2020 12:19
Proxy script for running anything as an admin. Contains an CommandLineToArgvW escaper.
' 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) & " "
Next
UAC.ShellExecute "C:\Program Files\AutoHotkey\AutoHotkey.exe", Arguments, "", "runas", 1
@Artoria2e5
Artoria2e5 / nevertested.cc
Created October 9, 2019 11:16
perfect nums
#include <iostream>
#include <cstdint>
template<typename T>
class MerssenePerfect {
// A000043
static_assert(std::is_unsigned<T>::value,
"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;
@Artoria2e5
Artoria2e5 / CurlyFakePolyp.cpp
Created January 14, 2018 14:07
CurlyFakePolyp created by Artoria2e5 - https://repl.it/@Artoria2e5/CurlyFakePolyp
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
@Artoria2e5
Artoria2e5 / pref.json
Created September 19, 2017 14:24
vscode settings, zh-cn
{
"workbench.colorTheme": "Default Light+",
"editor.fontFamily": "'Inziu Iosevka SC', monospace",
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?《》?!()。【】;:“”‘’"
}
@Artoria2e5
Artoria2e5 / seeborg_zh.md
Last active July 4, 2017 04:57
quick notes for seeborg@zh

Adapting seeborg for Chinese

See https://github.com/hmage/seeborg/issues/25. 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
Artoria2e5 / devise.zh-CN.yml
Last active December 5, 2023 04:35
Devise 4.2.6 zh files
# Chinese (China) translations for Devise 4.2.1
# 4.2.0: By HealthGrid at https://gist.github.com/HealthGrid/2d702b38aa6ffe0233f27d3d5be9250f
# 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 https://github.com/plataformatec/devise/wiki/I18n
zh-CN:
devise:
@Artoria2e5
Artoria2e5 / bd_mercator.js
Last active July 14, 2021 08:14
Baidu's Twist on Web Mercator (as shown at https://github.com/GeeBar/coord/pull/3)
// Reference value:
// http://lbsyun.baidu.com/index.php?title=webapi/guide/changeposition
// type 5 (lon,lat) -> type 6 (x,y)
// js source, presumably same as ref?
// https://github.com/GeeBar/coord/blob/master/mercator.js
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.
@Artoria2e5
Artoria2e5 / README.md
Last active July 7, 2018 08:26
Make Linux your most "kawaii" ever. - tu[tuan]na.moe (tutuanna parody)

mirror tuna oldmirror_16_10

@Artoria2e5
Artoria2e5 / BYTES.md
Last active November 14, 2016 13:30
baseIdeo encoding

Byte-Orienated Procedures for baseIdeo Handling

o bbbbbbbb
----------
0 01234567
1 89ABCD
1       01
2 23456789
@Artoria2e5
Artoria2e5 / gccs-non-verifiable-remap.md
Last active October 3, 2016 16:18
Unicode mappings for GCCS "not verifiable" characters

This gist contains maps "not verifiable" GCCS characters documented in HKSCS-2004 Annex IV to Unihan or U-source records. The mapping for U-source characters should be mostly correct as their Adobe-CNS1 sources match the range of Adobe-CNS1-1, a supplement created for GCCS support.

This voluntary enrichment activity is followed by cake rewards. The mapping generated is released into public domain. For a more authoritive description of characters written in IDS, please refer to