Skip to content

Instantly share code, notes, and snippets.

饒裕奇 twlca

Block or report user

Report or block twlca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@twlca
twlca / postalCode.json
Created May 31, 2017
郵遞區號一覽表 (JSON)
View postalCode.json
{
"台北市":
{
"100": "中正",
"103": "大同",
"104": "中山",
"105": "松山",
"106": "大安",
"108": "萬華",
"110": "信義",
@twlca
twlca / donators_core.js
Last active Jul 4, 2017
// 將資料依指定的 property 組成群組
View donators_core.js
// 要求:
// 1. 列印收據(點陣式)
// 2. 報表依捐款人、捐款金額、手續費、實收金額列印
// 3. 可供期間查詢:包含螢幕查詢及報表
// 4. 以捐款人、捐款日期、捐款種類、捐款管道分類,日期則以倒序法排列(最近的日期在最上方)
// 5. 捐款管道、手續費、捐款種類可以由使用者設定
// 6. 捐款人快速查詢:姓名排列、連絡地址排列(分類)
// 7. 捐款人組織或個人分類
var donators = [
@twlca
twlca / array_snippets.js
Created Apr 28, 2017
Patch an array so it can be used as range separator. First we validate the argument is an array then check if each array element is integer. Then we add 0 and infinity to the array.
View array_snippets.js
// patch an array so it add 0 as 1st element and Infinite as last element
function checkArr( arr ) {
try {
Array.isArray( arr );
} catch(e) {
console.log( 'Input arguments is not an array' );
return false;
};
// validate element types
View tva_member_data.json
{"id": null,
"organizationName": null,
"orgContactName": null,
"orgAddress": null,
"phone": null,
"fax": null,
"relatedURL": null,
"zip": null,
"orgContactTitle": null,
}
@twlca
twlca / tva_organization.json
Created Feb 8, 2017
志工隊運用單位及志工隊資料集架構
View tva_organization.json
{ "organizationName": "",
"zip": "",
"county": "",
"address": "",
"organizationId": "",
"orgContactName": "",
"orgContactPhone": "",
"orgContactMobile": "",
"orgContactEmail": "",
"orgAddress": "",
@twlca
twlca / tva.taitung_metadata.json
Last active Feb 8, 2017
臺東縣志願服務協會開放資料-資料集架構
View tva.taitung_metadata.json
{ "id": "",
"format": "",
"metadata_modified": "",
"title": "",
"type": "",
"display_name": "",
"author": "",
"attirbuteCategory": "",
"baseLaw": "",
"publishCategory": "",
@twlca
twlca / open_data_taipai.json
Last active Feb 8, 2017
臺北市政府公開資料格式
View open_data_taipai.json
{
"編號" : "id",
"計費方式" : "cost",
"資料集描述" : "description",
"資料集語系" : "language",
"資料集所屬管理機關聯絡人電子郵件" : "",
"收錄期間(迄)" : "",
"資料集說明網址" : "",
"資料集所屬管理機關名稱" : "",
"資料集所屬管理機關聯絡人電話" : "",
@twlca
twlca / fill_form_fields_via_array_in_php.php
Created Oct 21, 2016
以 PHP 的陣列定義表單輸入項參數,再以迴圈完成每個輸入項名稱加上 $prefix,以保障資料庫安全
View fill_form_fields_via_array_in_php.php
<?php
$prefix = 'tdva_';
$application_unit_info = array(
array(
'type' => 'text',
'name' => $prefix . '運用單位'
),
array(
'type' => 'text',
'name' => $prefix . '承辦人'
View digit_transfer.js
var digits = '0123456789'; // 阿拉伯數字
var small_chinese_digits = '〇一二三四五六七八九'; // 中文小寫數字
var capital_chinese_digits = '零壹貮參肆伍陸㭍捌玖拾佰仟萬億兆'; // 中文大寫數字,應用侷限在金融,例如支票、匯款單、存款/提款單等
// 由阿拉伯數字轉換成小寫中文數字
var year = '106';
year.split('').map( function( item ) {
return small_chinese_digits.split('')[item];
}).join('');
// 回傳 "一〇五"
@twlca
twlca / digit_transfer.js
Created Oct 15, 2016
在公文、表單標題等應用場合,有時需要將年、月、日日期註記轉記轉換成中文小寫。由於儲存在資料庫中的日期資料通常是由阿拉伯數字型式儲存(以利計算),所以在此類應用必需轉換。
View digit_transfer.js
var digits = '0123456789'; // 阿拉伯數字
var small_chinese_digits = '〇一二三四五六七八九'; // 中文小寫數字
var capital_chinese_digits = '零壹貮參肆伍陸㭍捌玖拾佰仟萬億兆'; // 中文大寫數字,應用侷限在金融,例如支票、匯款單、存款/提款單等
// 由阿拉伯數字轉換成小寫中文數字
var year = '106';
year.split('').map( function( item ) {
return small_chinese_digits.split('')[item];
}).join('');
// 回傳 "一〇五"
You can’t perform that action at this time.