This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS=-fextended-identifiers -std=c99 | |
objects=chinese.ucn.o | |
target=chinese | |
.PHONY: all clean | |
all: $(target) | |
$(target): $(objects) | |
$(CC) $< -o $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# - * - coding: UTF-8 - * - | |
import cgi | |
import json | |
import urllib | |
import httplib2 | |
h = httplib2.Http() | |
query = urllib.urlencode({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_pass http://ghs.google.com; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stddef.h> | |
namespace mozilla { | |
template<typename Iterator> | |
struct IteratorTraits | |
{ | |
typedef typename Iterator::ValueType ValueType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=lambda s:s.replace("\\","\\\\").replace("\"","\\\"");a,b="r=lambda s:s.replace(\"\\\\\",\"\\\\\\\\\").replace(\"\\\"\",\"\\\\\\\"\");a,b=\"","\";print(a+r(a)+\"\\\",\\\"\"+r(b)+b)";print(a+r(a)+"\",\""+r(b)+b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="zh-TW"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Polyfill demo for tone mark positioning</title> | |
<style> | |
body { | |
-webkit-writing-mode: vertical-rl; | |
-ms-writing-mode: tb-rl; | |
writing-mode: vertical-rl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys as _sys | |
import json as _json | |
import base64 as _base64 | |
import logging as _logging | |
import mimetypes as _mimetypes | |
import urllib.parse as _url | |
import configparser as _configparser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template<class T> | |
class Out | |
{ | |
private: | |
T& mValue; | |
public: | |
explicit Out(T& aValue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
files=$(hg status | awk '$1 == "?" && $2 ~ /\.(orig|rej)$/ { print $2 }') | |
echo "$files" | |
read -r -p "Remove these files? [y/N]" resp | |
case $resp in | |
[yY][eE][sS]|[yY]) | |
rm $files | |
;; | |
*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# - * - coding: UTF-8 - * - | |
import sys | |
import json | |
import concurrent.futures as futures | |
from pathlib import Path | |
from difflib import Differ | |
from urllib.request import urlopen |