Skip to content

Instantly share code, notes, and snippets.

View rschiang's full-sized avatar
🐳
Sailing

Poren Chiang rschiang

🐳
Sailing
View GitHub Profile
@rschiang
rschiang / 權限清查.gs
Created August 6, 2013 14:11
SITCON 2013 行政組自動化管理專案。
/*
* Author: Poren Chiang <ren.chiang@gmail.com>
* 這程式會試圖清查所有未交割所有權的文件。
*/
var outputSheetId = "RS0123456789SITCONabcdefghijklmnopqrstuvwxyz"; // 輸出試算表的位置
var rootFolderId = "SITCON2013abcdefghijklmnopqr"; // 根資料夾的位置
var correctEmail = "sitcon.tw@gmail.com"; // 檔案正確的擁有者
var closed = [];
var currentSheet;
@rschiang
rschiang / big5recover.py
Last active December 24, 2015 04:29
嘗試還原遺失ASCII高位元的Big5字串。
import codecs, itertools
decode = codecs.getdecoder('big5')
f = open('input.txt', 'r')
l = 8 # 8-byte decode block
L = 2 ** l # Use bit-flag to do permutations
d = f.read()
for pointer in range(0, len(d), l):
s = d[pointer:pointer+l]
@rschiang
rschiang / SITCON 2013.txt
Created October 13, 2013 13:29
SITCON 2013 討論區社團敘述備份。
官方網站:
http://sitcon.org/
讓我們辦一個學生的Conf吧~
一個以學生、資訊為主題的活動
不限定學生參加,但是以學生為主軸
這個社團,歡迎大家一起表達意見~
如果有人沒興趣就按退出吧:D
@rschiang
rschiang / conn.php
Created December 24, 2013 16:23
rsPlurkAI training site PHP connection code in 2011
<?php
require_once("functions.php");
class AIDatabase {
var $m_conn = 0;
var $m_query = 0;
// Constructor
function AIDatabase() {}
@rschiang
rschiang / BallotNewMoveController.php
Last active August 29, 2015 14:02
102-2 臺大宿舍抽籤程式,檢驗樣本(Jesda 公司承包)
<?php
require_once APPLICATION_PATH . '/modules/staff/controllers/BallotController.php';
/**
* 新生遷出住宿抽籤
*
* @author Kim
*
*/
class Staff_BallotNewMoveController extends Staff_BallotController
@rschiang
rschiang / Journey-Screenshot.png
Last active December 5, 2019 06:34
"Journey", a Plurk theme in the new era.
Journey-Screenshot.png
@rschiang
rschiang / zipcode.py
Created June 16, 2014 03:30
Batch process zip code
#!/usr/bin/python
# sudo pip install zipcodetw
from codecs import open
import zipcodetw
i = open('address.txt', 'r', encoding='utf-8')
o = open('address_a.txt', 'w+', encoding='utf-8')
for addr in i:
internal encoding: nil
external encoding: #<Encoding:UTF-8>
rel_path encoding: #<Encoding:UTF-8>
string encoding: #<Encoding:UTF-8>
FS encoding: UTF-8
internal encoding: nil
external encoding: #<Encoding:UTF-8>
rel_path encoding: #<Encoding:UTF-8>
string encoding: #<Encoding:UTF-8>
FS encoding: UTF-8
@rschiang
rschiang / pingstat.txt
Created March 24, 2015 06:29
2015-03-24 Ping NTU from NTUCC Room 116 - 74 until 14:27
PING www.ntu.edu.tw (140.112.8.116): 56 data bytes
64 bytes from 140.112.8.116: icmp_seq=0 ttl=252 time=1.391 ms
64 bytes from 140.112.8.116: icmp_seq=1 ttl=252 time=1.454 ms
64 bytes from 140.112.8.116: icmp_seq=2 ttl=252 time=3.527 ms
64 bytes from 140.112.8.116: icmp_seq=3 ttl=252 time=2.484 ms
64 bytes from 140.112.8.116: icmp_seq=4 ttl=252 time=2.231 ms
64 bytes from 140.112.8.116: icmp_seq=5 ttl=252 time=2.272 ms
Request timeout for icmp_seq 6
64 bytes from 140.112.8.116: icmp_seq=7 ttl=252 time=15.965 ms
64 bytes from 140.112.8.116: icmp_seq=8 ttl=252 time=1.537 ms
@rschiang
rschiang / monokai.xml
Created August 10, 2015 14:51
Qt Creator Monokai theme
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="Monokai">
<style name="Text" foreground="#f8f8f2" background="#272822"/>
<style name="Link" foreground="#66d9ef"/>
<style name="Selection" background="#49483e"/>
<style name="LineNumber" foreground="#8d9089"/>
<style name="SearchResult" foreground="#000000" background="#ffe792"/>
<style name="SearchScope" foreground="#000000" background="#ffe792"/>
<style name="Parentheses"/>
<style name="CurrentLine" background="#3e3d32"/>