原创 1.Sed 初識

Sed 指的是 Stream Editor SED can be used in many different ways, such as: Text substitution, 文字替換 Selective printing

原创 3 .Sed Loop

LOOP 類似於goto we can define a label as follows: :label :start :end :up In the above example, a name after colon(

原创 mysql stored routine (存儲例程) 中 definer 的作用 和實例

創建 例程語法參見https://dev.mysql.com/doc/refman/5.7/en/create-procedure.html 創建procedure 的語法如下 CREATE [DEFINER = {

原创 2. Sed 語法初步

sed [-n] [-e] 'command(s)' files sed [-n] -f scriptfile files 可以寫在 文件中使用 sed -f scriptfile files 這樣的格式調用 在scriptfi

原创 glob 模式簡

【轉】 不同語言的 glob 庫支持的規則會略有不同。下面是 node-glob 的匹配規則。 * 匹配任意 0 或多個任意字符 ? 匹配任意一個字符 […] 若字符在中括號中,則匹配。若以 ! 或 ^ 開頭,若字符不在中括號

原创 mac ampps 安裝php redis 擴展

我在安裝php redis 的時候 遇到了一些問題 我是用的是homebrew 方式安裝 ampps 使用的 php 版本是 php5.6 下面在終端執行代碼 ~$ brew install php56-redis ... =

原创 centos 6.6 安裝 imagemagick 和 php imagick 插件安裝 心路歷程

先介紹 環境Linux 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/LinuxCentOS release

原创 11. Sed 例子

去除代碼中的註釋 dingmac@ubuntu:~$ echo -e "One\nTwo One\n#One\n//zhang" | sed -E 's@(//.*|#.*)@ ---- @' 打印出行數 類似wc -l s

原创 grep 全詳解

使用的正則是 POSIX 格式的正則 不可以使用\d 只能使用[:digit:] 這樣的縮寫 但是我也不建議使用[:digit:] 這樣的形式 [0-9] 不是更直接 \w 使用 [a-zA-Z0-9]替代 反正根據自己的需求來 [\w

原创 git 原理

參考文檔 https://maryrosecook.com/blog/post/git-from-the-inside-out 參考 http://blog.csdn.net/bdss58/article/details/450234

原创 PHP 單例模式的實現

單例設計模式爲了解決在一個應用中只有一個實例【比如數據庫實例】,並且禁止clone 複製在PHP中可以繼承單例模式來使用單例模式的特性,避免每次創建一個類都要創建一個對象一般Sigleton類的實現 參考【https://stackove

原创 git 從源 編譯升級 安裝[centos]

準備 從github 下載最新版的 官方的git 倉庫 https://github.com/git/git/releases 【順便膜拜一下大神,git的締造者是 linus Torvalds】 從倉庫中隨便選擇一個rc 的是待發布版本

原创 Mysql 鎖 小結

MyISAM :MyISAM存儲引擎使用的鎖定機制完全是由MySQL提供的表級鎖定實現,MyISAM在執行查詢語句(SELECT)前,會自動給涉及的所有表加讀鎖,在執行更新操作(UPDATE、DELETE、INSERT等)前,會自動給涉及

原创 正則表達式之貪婪模式講解

沒有注意過 貪婪模式和 非貪婪模式的含義 查看 這篇文章 參考 https://stackoverflow.com/questions/5319840/greedy-vs-reluctant-vs-possessive-quantif

原创 find 全解析

find 命令是linux 世界中查找文件用的最多的一個命令 最簡單的用法如下 find dir -d(depth) 1 -type f(f 文件 d 文件夾) -ctime -1d -atime 最後的訪問時間 s seco