Skip to content

Instantly share code, notes, and snippets.

View bopomofo_foolproof.schema.yaml
# Rime schema
# encoding: utf-8
schema:
schema_id: bopomofo_foolproof
name: 注音完整輸入
version: "1.0"
author:
- 佛振 <chen.sst@gmail.com>
- 魏藥 <mwei@lxde.org>
View measure.c
#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);
@medicalwei
medicalwei / gist:bc8dd0649fff525c1c95
Created Nov 26, 2014
Error building m7g5yay5r5anrvc8ack4v2kq5v564rl7-gnutar-1.27.1
View gist:bc8dd0649fff525c1c95
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);
^~~~~~~~~~
View keybase.md

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 / genlist.py
Created Jul 4, 2015
Pebble Font Glyph List Generator
View genlist.py
#!/usr/bin/python3
import fileinput
print('{"codepoints":[')
print(",".join(map(lambda x: str(ord(x)), fileinput.input().next().decode('utf-8'))))
print("]}")
View 01.make
2015-07-14 19:21:33 +0800
make
PREFIX=/usr/local/Cellar/mercurial/3.4
install-bin
python setup.py build
running build
running build_mo
warning: hgbuildmo: could not find msgfmt executable, no translations will be built
View Guess number AI in Python
#!/usr/bin/python3
import itertools
import operator
def ab(x,y):
a=sum(map(operator.eq,x,y))
b=len(set(x).intersection(y))-a
return (a,b)
q=list(itertools.permutations(range(10), 4))
@medicalwei
medicalwei / .fonts.conf
Last active Sep 24, 2015
medicalwei's ~/.fonts.conf
View .fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="pattern">
<test name="family" qual="any">
<string>serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Bitstream Vera Serif</string>
<string>DejaVu Serif</string>
View sobel.c
// ImageReadingDoc.cpp : implementation of the CImageReadingDoc class
//
#include "stdafx.h"
#include "ImageReading.h"
#include "ImageReadingDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
View serialDemo.pde
void setup()
{
Serial.begin(9600); // Use serial with 9600 baud rate
pinMode(13, OUTPUT);
}
void loop()
{
if(Serial.available()) // Check if there is something for Arduino to read