This file contains hidden or 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
# 取得git branch名稱 | |
function git_branch { | |
# 取得git branch,若此資料夾沒有git brangh,則將錯誤訊息丟至回收桶,回傳空值 | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return; | |
# 若有取得git branch,則將取得的名稱「ref/heads/branchname」,並將前面的前贅詞去除,只保留branch名稱 | |
echo "("${ref#refs/heads/}") "; | |
} | |
# 設定prompt名稱為 [資料夾路徑 現在時間] (branch) | |
# \e[1;32m:綠色 | |
# \e[1;35m:紫色 |
This file contains hidden or 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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
worktree=/var/www | |
[receive] | |
denycurrentbranch = ignore |
This file contains hidden or 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
<?php | |
function getEmailList($xml = '' , $access_token = '' , &$contact_list = array()) { | |
if (empty($xml)) { | |
return false; | |
} | |
$doc = new DOMDocument; | |
$doc->loadXML($xml); | |
$xpath = new DOMXPath($doc); | |
$contacts = $xpath->query("//gd:email"); | |
// 撈取email跟姓名 |
This file contains hidden or 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
<?php | |
//before | |
if (curl_errno($ch) == 60) { // CURLE_SSL_CACERT | |
self::errorLog('Invalid or no certificate authority found, '. | |
'using bundled information'); | |
curl_setopt($ch, CURLOPT_CAINFO, | |
dirname(__FILE__) . '/fb_ca_chain_bundle.crt'); | |
$result = curl_exec($ch); | |
} | |
This file contains hidden or 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
var RegCheck = { | |
/** | |
* 正規表示式 | |
*/ | |
_reg:{ | |
// Email正規表示式 | |
email: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/, | |
// 非「英文大小寫」和「數字」出現過一次 | |
not_en_digital_least1: /[^a-zA-Z0-9]+/, | |
// 「英文大小寫」和「數字」各出現過一次(a1,b2...) |
This file contains hidden or 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
{ | |
"cmd": ["C:/Program Files/nodejs/node.exe", "-p", "$file"] | |
} |
This file contains hidden or 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
-- 建立資料表 | |
-- 留言 | |
CREATE TABLE IF NOT EXISTS `comment` ( | |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '編號', | |
`content` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '留言', | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; | |
-- 使用者 |
This file contains hidden or 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
<?php | |
/** | |
* @author:SANKAI | |
* @license:MIT & GPL | |
**/ | |
class PhpCodeZip{ | |
//欲進行壓縮加密的來源資料夾 | |
var $sourceDir = '.'; | |
//進行壓縮加密的存放的資料夾 | |
var $targetDir = 'tmp'; |
This file contains hidden or 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
<?php | |
//載入函式 | |
include_once('phpCodeZip.php'); | |
//建立加密物件 | |
/** | |
* example : | |
* $encryption = new PhpCodeZip('test','test_compiler'); | |
* 請直接指定與compiler.php同目錄的資料夾名稱,不要使用「./test」或「./test_compiler」的資料夾名稱,導致程式出錯 | |
*/ | |
$encryption = new PhpCodeZip('sourceDir','targetDir'); |
This file contains hidden or 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
/* | |
<div class="parent_group"> | |
<div class="float-left"> </div> | |
<p> ABC123 </p> | |
</div> | |
*/ | |
.parent_group:before, .parent_group:after { | |
content: ""; | |
display: block; | |
} |