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 / validate_phone_number
Created Feb 9, 2015
Regular Expression Pattern to Check Phone Number
View validate_phone_number
var patt = /^\(0\d{2}\)\d{6}$|^\(0\d{1}\)\d{7,8}$|(^0\d{1})-\d{7,8}$|(^0\d{2})-\d{6}$/
var phones = ['089-335482', '(089)335482', '02-23442798', '(02)23442798']; // correct phone numbers format
var length_errors = ['(089)35482', '(089)3354826', '(0889)335482', '(02)335482', '02-335482', '02-234427988']; // improper digits combination
var illegal_chars = ['(089)33548-', '(089-335482', '089=335482']; // contains illegal characters or missing essential characters
// Function to test pattern match
function validate_phone_number( phone ) {
var patt = /^\(0\d{2}\)\d{6}$|^\(0\d{1}\)\d{7,8}$|(^0\d{1})-\d{7,8}$|(^0\d{2})-\d{6}$/;
return phone.map( function(i) {
return patt.test( i );
@twlca
twlca / vol_codes
Last active Oct 26, 2015
志願服務資訊系統專用代碼
View vol_codes
var 專長代碼 = {
"01": "家電修理",
"02": "機械",
"03": "汽車修護",
"04": "工藝",
"05": "刻印",
"06": "印刷",
"07": "語文",
"08": "文書處理",
"09": "編輯",
View gist:bedaf314c9e44afebdb8
// 定義新的陣列 array
var 五都 = ["台北市", "新北市", "台中市", "台南市", "高雄市"];
console.log( 五都.length );
// 5
// 取得陣列的元素,元素由 0 起算
var 首都 = 五都[0];
// "台北市"
var 南部第一大都市 = 五都[五都.length - 1];
// "高雄市"
View bubble_sort.c
/* File Name: bubble_sort.c
*/
#define N 10
int a[N] = {25, 3, 42, 1, 53, 12, 62, 14, 47, 20};
main()
{
int i, j, k, l, t;
@twlca
twlca / use-notepad-plus-plus-as-default-editor.html
Last active Mar 2, 2016
使用 Notepad++ 作為預設編輯器
View use-notepad-plus-plus-as-default-editor.html
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<title>使用 Notepad++ 作為 GitHub 預設的文字編輯器</title>
</head>
<body>
<blockquote>參考來源:<a href="http://www.buildmeimfamous.net/2013/12/use-notepadplusplus-with-git-as-default-editor</a></blockquote>
<p><code>GitHub</code> 雖然提供界面讓使用者可以直接輸入內容,但因為 git 的開發目的主要是為了撰寫程式,所以沒有考慮中文顯示的問題。如果要在文章中鍵入中文,建議採用外部編輯器,在這裡推廌使用 Notepad++。</p>
<h2>如何將 Notepad++ 設定成 GitHub 的預設編輯器</h2>
View 家庭服務中心文件.yml
---
文件名稱: 個案初步評估表
文件撎頭: 臺東縣(鄉/市)原主民族家庭服務中心
文件副抬頭: 個案初步評估表
文件欄位:
- 案號
- 案主名稱
- 訪視日期
- 填寫日期
- 內容:
View lca_docs.php
<?php
/**
* Plugin Name: 愛德資訊系統
* Plugin URI:
* Author: 饒裕奇
* Author URI:
* Version: 0.0.1
* Description: 結合社工與志工的資料庫
* License
* Text Domain: lca_docs
@twlca
twlca / pedigree_terms.txt
Created Apr 24, 2016
家系圖重要名稱
View pedigree_terms.txt
var pedigree = {
'家系圖': 'pedigree',
'親屬': 'relative',
'父親': 'father',
'母親': 'mother',
'兄弟': 'brother',
'姐妹': 'sister',
'兒子': 'son',
'女兒': 'daughter',
'子女': 'children',
View gist:64ea673b17f49c3625701b4f5b8cc3b1
村里 = {
"鄉鎮市": "台東市",
"村里名": [
{
"里名": "大同里",
"人口": null,
"面積": null
},
{
"里名": "中山里",
@twlca
twlca / createElem.js
Last active Jun 15, 2016
Create Elements via JSON data
View createElem.js
ct1 = document.getElementsByClassName('entry-content')[0];
function createElem( fm_name, tag, attrs, options ) {
if ( document.getElementsByName(fm_name).length != 0 ) {
var fm = document.getElementsByName(fm_name)[0];
} else {
var fm = document.createElement('form');
fm.setAttribute('name', fm_name);
ct1.appendChild(fm);
}
You can’t perform that action at this time.