Skip to content

Instantly share code, notes, and snippets.

@miaoski
miaoski / boshiamy.txt
Created May 7, 2016 10:38
fcitx-boshiamy
;fcitx Version 0x03 Table file
KeyCode=,.'abcdefghijklmnopqrstuvwxyz[]
Length=6
Pinyin=@
PinyinLength=5
Prompt=&
ConstructPhrase=^
[Data]
' 、
' .
@miaoski
miaoski / boshiamy.conf
Created May 7, 2016 10:38
fcitx-boshiamy
[CodeTable]
UniqueName=boshiamy
Name=Boshiamy
Name[de]=Boshiamy
Name[zh_CN]=嘸蝦米
Name[zh_TW]=嘸蝦米
Name[ja]=Boshiamy
IconName=boshiamy
File=boshiamy.mb
AdjustOrder=AdjustNo
@miaoski
miaoski / rm.js
Created January 25, 2016 11:55
Notes on Facebook Activities
function rm() {
var r = $jq('a[aria-label="編輯"] i').click();
var s = $jq('span:contains(收回讚)').click();
var s = $jq('._54nh').filter(function() { return $jq(this).text() === "刪除"; }).click();
$jq("button:contains(刪除貼文):visible").click();
$jq("button:contains(關閉):visible").click();
$jq('a:contains(More Activity)').last().click();
if(r.length > 0 || s.length > 0)
setTimeout(rm, 10000);
}
startup_message off
caption always "%{=u .r} %-w%<%{=ub .Y}%n %t%{=u .r}%+w "
hardstatus alwaysignore
hardstatus alwayslastline "%{= .K} [%l]%<%=%{= .Y}$USER%{= .R}@%H %=%{= .m} %Y/%m/%d%{= .M} %0c "
defutf8 on
#caption always "%{= wk} %{= KY} [%n]%t @ %H %{-} %= %{= KR} %l %{-} | %{= KG} %Y-%m-%d %{-} "
#hardstatus alwayslastline " %-Lw%{= Bw}%n%f %t%{-}%+Lw %=| %0c:%s "
defscrollback 20480
@miaoski
miaoski / fileserv.py
Created March 11, 2015 08:31
Easy File Server
from flask import Flask, request, send_from_directory
# set the project root directory as the static folder, you can set others.
app = Flask(__name__)
@app.route('/<path:path>')
def send_js(path):
return send_from_directory('/Users/philippe/iso/', path)
if __name__ == "__main__":
@miaoski
miaoski / pir-cam.py
Created February 27, 2015 16:48
picamera + PIR
# -*- coding: utf8 -*-
import RPi.GPIO as GPIO
import time
import picamera
import datetime
SENSOR = 4
CAMDIR = '/cam'
GPIO.setmode(GPIO.BCM)
@miaoski
miaoski / relay.py
Created February 21, 2015 07:19
Simple GPIO for RPi2 + relay
# -*- coding: utf8 -*-
# sudo python relay.py
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(38, GPIO.OUT)
GPIO.setup(40, GPIO.OUT)
print 'Usage:'
@miaoski
miaoski / white.ls
Last active August 29, 2015 14:15
Drone lib test
Drone = require './drone'
white = \44c2ecadf8b443d08ba485612189bb6e
blue = \37103d1e4f024913a2777f3f015037eb
red = \1447dcb43e48451b8bbd1647fa28554a
up = !-> it.up {steps: 30}
forward = !-> it.forward {steps: 300}
turnLeft = !-> it.turnLeft {steps: 300}
tiltLeft = !-> it.tiltLeft {steps: 30, speed: 100}

Keybase proof

I hereby claim:

  • I am miaoski on github.
  • I am miaoski (https://keybase.io/miaoski) on keybase.
  • I have a public key whose fingerprint is 8651 0CBA B078 A80E 31F3 BABF E7F6 58AC F991 AE66

To claim this, I am signing this object:

@miaoski
miaoski / gist:53f16a73f7a09dc2ded7
Created January 18, 2015 04:59
Dockerfile of moedict-webkit
#
# Dockerfile to build miaoski/moedict_amis:0.1
#
FROM ubuntu:14.04.1
MAINTAINER miaoski
RUN apt-get update
RUN apt-get install -y git
RUN apt-get install -y tree