Skip to content

Instantly share code, notes, and snippets.

View Artoria2e5's full-sized avatar
🌪️
not focusing!

Mingye Wang Artoria2e5

🌪️
not focusing!
View GitHub Profile
@Artoria2e5
Artoria2e5 / kiprsh.cpp
Last active September 22, 2016 18:45
KIPR Remote Control Shell
// kiprsh -- the Kipr Idiot's Private Remote Shell (the Heck?)
// Copyright (C) Mikumo Kagurazaka "Artoria2e5" <arthur2e5@aosc.xyz>
//
// compile with:
// g++ -std=gnu++11 -lwallaby -lm -ljpeg -lpthread -lopencv_core -lopencv_imgproc -lrt -lz
//
// Dual-Licensed under the MIT/Expat License and the DBAD License. ABSOLUTELY NO WARRANTY.
//
// Port to https://github.com/Svalorzen/cpp-readline for command history, or use Python...
//
@Artoria2e5
Artoria2e5 / file
Created May 6, 2016 15:43
freedom_public
{"0.6885607641198614":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEaywdMQhVdr+UYijAdz7VnDa/LOD4Nh0T\r\nLySh3BcPnNVyxayijzkVV1/Ud/sFExmemTx+Ls6i0o4x5kLViMO1wM3/AAAACDxn\r\naXRodWI+wv8AAACNBBATCAA//wAAAAWCVyy7lv8AAAACiwn/AAAACZBUY8c0yscK\r\nAP8AAAAFlQgJCgv/AAAAA5YBAv8AAAACmwP/AAAAAp4BAAAr3AEAinjg+nasykSJ\r\neXMHbiSBHDZJwVn38LKKyjfimdcvIqYBAI1AuJ7snnrM6hDLp2uvfO4uqiD6JLWX\r\nAIawwr0ySgnEzv8AAABWBAAAAAASCCqGSM49AwEHAgME2FOMpve1BxifhKJxzyV3\r\nnbcmTV6wI9faL5S5uefiOa0RzSBSOKpm7uBHoDY5yW7PVzNCDno8pqQV1b0lkPAU\r\n1AMBCAfC/wAAAG0EGBMIAB//AAAABYJXLLuW/wAAAAmQVGPHNMrHCgD/AAAAApsM\r\nAADB7gEAlfXxn8do/UV9Vu+t2ibod1nA3dQzet55a5Lt8ytsVP0BAO0Q2iys+iHP\r\neMuQKpEGOyy1bvLgss3BChk9uGtF523y\r\n=RXCd\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n"}
@Artoria2e5
Artoria2e5 / l10n_CAT_and_Smuggle_zh_CN.mediawiki
Last active May 1, 2016 09:24
Beginner's Guide to CAT Systems and String Smuggling

计算机辅助翻译及字符串走私入门指南

活儿太多?你有电脑啊。
翻不过来?看看别人啊。

Copyright © 2016 Mingye Wang arthur2e5@aosc.io
Released under CC0.

警告:本教程非常不适合心理承受能力不足,以至于容易受蛊惑走火入魔的新手观看。请保证您已至少阅读了简中翻译指南或类似文档。

@Artoria2e5
Artoria2e5 / mkfontsconf.sh
Last active June 5, 2016 03:07
Fontconfig ConfGen
#!/bin/bash
# My brain is not feeling well so I will be doing a wizard instead.
# It should hopefully be self-explainatory then.
# ref: https://fedoraproject.org/wiki/Fontconfig_packaging_tips
fc_head='<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
<fontconfig>'
fc_tail='</fontconfig>'
declare -A fc_segment
#!/bin/bash
declare -A completion_cmd completion_pat completion_pre completion_suf completion_opt
# the good old (i) => `'${i.replace("'","'\\''")}'` rule
# good for Shlex
posix_quote(){
printf " '%s'" "${@//"'"/"'\\''"}"
# If we want a string ret, we will need IFS=' ' and the good old join..
}
@Artoria2e5
Artoria2e5 / train_leaving.js
Last active July 11, 2016 16:52
it works..?
// ==UserScript==
// @name Train leaving
// @namespace https://gist.github.com/Artoria2e5/8394259c4000f81f9e28
// @updateURL https://gist.githubusercontent.com/Artoria2e5/8394259c4000f81f9e28/raw/train_leaving.js
// @version 0.3.0
// @description wuuuuuuuuuuuuuu
// @author You
// @match *://www.gtbyxx.com/wxg/station/jyx_station.jsp?code=*
// @match *://www.gtbyxx.com/wxg/station/crh_station.jsp?code=*
// @match *://218.29.99.82/WTINFOS/hccx.mor?method=list&station=*
@Artoria2e5
Artoria2e5 / FontMapper-bitfield.txt
Created March 18, 2016 01:35
Guesses about HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontMapper bits
Name MVal Feat Pos Bit
---------------|-------|-------|-------|----------------|
@MS Gothic a080 @ bit15 1xxxxxxxxxxxxxxx
MS Gothic 8080
@MS PGothic 2080 Mono bit13 xx1xxxxxxxxxxxxx
MS PGothic 0080 CJK? bit06 xxxxxxxxx1xxxxxx
@NSimSun a086
NSimSun 8086
@SimSun 2086
SimSun 0086 Ming? bit02 xxxxxxxxxxxxx1xx
#!/usr/bin/env python
from __future__ import division, print_function, unicode_literals
from textwrap import dedent
import itertools
from mido2create import *
import operator
def mido_c(it, slot=15):
_br = True
yield '/** BEGIN GENERATED SONG */'
@Artoria2e5
Artoria2e5 / white-albot.py
Last active March 7, 2016 05:25
white-album bot
from __future__ import division, print_function, unicode_literals
import random
import string
import pangu
import re
def w_expand(lst):
return sum([a[1] for i in range(a[0])] for a in lst)
sentences = w_expand([
@Artoria2e5
Artoria2e5 / Progress.md
Last active February 19, 2016 21:23
wx, gtk, and ~~perhaps~~ certainly more

I don't know if it works. Perhaps I should try Hyper-V'ing ArchLinux?

  • We should use the big full wxWidget tarball
  • We should make everything in one PKGBUILD, so qt, gtk2/3, xft...
  • fill in the blanks
    • some makedepends
    • all these packages should 'provide' to a virtual package called wxWidgets or so
    • some pkgdep
      • wxbase =-synced version
  • pkgdesc