Skip to content

Instantly share code, notes, and snippets.

View medicalwei's full-sized avatar

Yao Wei medicalwei

View GitHub Profile
@medicalwei
medicalwei / fontgen.py
Last active February 6, 2016 03:28
fontgen.py with faux bold and height adjustment code
#!/usr/bin/env python
import argparse
import freetype
import os
import re
import struct
import sys
import itertools
import json
@medicalwei
medicalwei / genlist.py
Created July 4, 2015 07:43
Pebble Font Glyph List Generator
#!/usr/bin/python3
import fileinput
print('{"codepoints":[')
print(",".join(map(lambda x: str(ord(x)), fileinput.input().next().decode('utf-8'))))
print("]}")

Keybase proof

I hereby claim:

  • I am medicalwei on github.
  • I am mwei (https://keybase.io/mwei) on keybase.
  • I have a public key whose fingerprint is FED5 4348 4528 7DF2 6293 1489 CFBB FCE0 B74F 1B14

To claim this, I am signing this object:

@medicalwei
medicalwei / gist:bc8dd0649fff525c1c95
Created November 26, 2014 09:07
Error building m7g5yay5r5anrvc8ack4v2kq5v564rl7-gnutar-1.27.1
areadlinkat.c:44:53: error: use of undeclared identifier 'readlinkat'; did you mean 'areadlinkat'?
return careadlinkat (fd, filename, NULL, 0, NULL, readlinkat);
^~~~~~~~~~
areadlinkat
areadlinkat.c:42:1: note: 'areadlinkat' declared here
areadlinkat (int fd, char const *filename)
^
areadlinkat.c:44:53: warning: incompatible pointer types passing 'char *(int, const char *)' to parameter of type 'ssize_t (*)(int, const char *, char *, size_t)' [-Wincompatible-pointer-types]
return careadlinkat (fd, filename, NULL, 0, NULL, readlinkat);
^~~~~~~~~~
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
int main(){
void *a, *b;
struct timespec start, end;
unsigned int i;
a = malloc(128);
# Rime schema
# encoding: utf-8
schema:
schema_id: bopomofo_foolproof
name: 注音完整輸入
version: "1.0"
author:
- 佛振 <chen.sst@gmail.com>
- 魏藥 <mwei@lxde.org>
@medicalwei
medicalwei / sequencer.ino
Created August 5, 2013 01:39
Arduino Esplora Sequencer
#include <Esplora.h>
#include <TFT.h>
#include <SPI.h>
// these are the frequencies for the notes from middle C
// to one octave above middle C:
const int note[] = {
247,
262, // C
diff -r c42f218ebb99 apps/settings/settings.properties
--- a/apps/settings/settings.properties Sat May 04 22:56:29 2013 +0800
+++ b/apps/settings/settings.properties Tue May 28 00:43:44 2013 +0800
@@ -16,7 +16,10 @@
set=設定
notNow=現在不要
turnOn=開啟
-# Device
+
+
@medicalwei
medicalwei / gist:4648305
Last active December 11, 2015 19:28 — forked from audreyt/gist:4646732
combine kcwu's list
# no matching characters
8e5a {拚-厶+ㄊ}
8e65 {犬旁+屯}
8eb0 {云阝}
8ec8 {艸頭+契}
8ef7 {似彐}
8f57 {艸頭+舌}
8f6b {革貴}
8fd5 {奧鳥}
@medicalwei
medicalwei / gist:2922067
Created June 13, 2012 05:38
default hanzi font list
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing TW MBE:style=Light
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai CN:style=Book
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai HK:style=Book
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai TW:style=Book
/usr/share/fonts/truetype/arphic-bkai00mp/bkai00mp.ttf: AR PL KaitiM Big5,文鼎PL中楷:style=Regular
/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf: AR PL KaitiM GB,文鼎PL简中楷:style=Regular
/usr/share/fonts/truetype/arphic-gbsn00lp/gbsn00lp.ttf: AR PL SungtiL GB,文鼎PL简报宋:style=Regular
/usr/share/fonts/truetype/arphic-bsmi00lp/bsmi00lp.ttf: AR PL Mingti2L Big5,文鼎PL細上海宋:style=Reguler,Regular
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai TW MBE:style=Book
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing TW:style=Light