跳到主要內容

發表文章

目前顯示的是 3月, 2017的文章

[Sublime] 搜尋檔案中是否有使用IPv4

因為原server要搬移,導至IP會變,所以被求找出使用到的IP 這時候用Regular是最快的了~ 1. 首先去查查有沒有網友寫好的reguler 找到  http://www.regular-expressions.info/ip.html 簡單點,使用這個 \b(?:\d{1,3}\.){3}\d{1,3}\b 2. 以前都是用UltraEdit,但在Mac只好用sublime嘍 注意!這裡的Regular要寫成  (?:\d{1,3}\.){3}\d{1,3} 限制搜尋的檔案類型 多種類的話就一直加下去︰ /Users/kirk/Documents/Projects/,*.h,*.m,*.swift,*.xml 以上~

[佳句]

  韋恩.格雷耶基(Wayne Gretzky)的成功 並不是因為他滑向冰球 而是因為他滑向冰球滾動的方向     分享自雪倫的文章 「沒安全感,其實只是你害怕面對不想要的結果」

[MAC] spotlight 不能搜尋了!!

Spotlight其實不常用,但Alfred不能用就有點跛腳了~ 解法︰ 輸入以下指令,關掉索引 sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist   輸入以下指令,重新啟用索引 sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist   參考︰ https://errerrors.blogspot.tw/2016/01/mac-spotlight.html

[SEO] 關於 Google 不到自己的 Blogger 這件事

查了一下網路上的說法,大概就是 title, h1, h2 這3個的問題 用下面的工具看一下,果然 h2 是沒資料的 Chrome工具: https://www.techcoke.com/2015/02/chrome-extension-open-seo-stats.html title: http://www.laird.tw/2015/06/seo-blogger-seo.html h1, h2: https://www.techcoke.com/2017/01/blogger-widgte-title-html-tag-seo.html 文章url, 搜尋說明: http://www.wfublog.com/2012/07/blogger-custom-post-url.html   Meta: https://kai73002981.blogspot.tw/2016/06/blogger-meta-tag.html  

[Java] equals 與 ==

今天被同事問到Java equals的問題,發現觀念已經有點模糊了…老啦 只記得數字就用==,字串就用equals,至於原因已經還給老師了 Sample: 一開始真的有點打結,不同的物件怎麼會有相同的hashCode…是我的記憶有了錯誤嗎XD 想不通只好各種解釋… String s1 = new String("ABC"); String s2 = new String("ABC"); System.out.println("s1." + s1 + ".hashCode:" + s1.hashCode()); System.out.println("s2." + s2 + ".hashCode:" + s2.hashCode()); if(s1.equals(s2)){ System.out.println("s1 is equals s2 !"); }else{ System.out.println("s1 is not equals s2 !"); } if(s1 == s2){ System.out.println("s1 = s2 !"); }else{ System.out.println("s1 != s2 !"); } Object o1 = new Object(); Object o2 = new Object(); System.out.println("o1." + o1 + ".hashCode:" + o1.hashCode()); System.out.println("o2." + o2 + ".hashCode:" + o2.hashCode()); if(o1.equals(o2)){ System.out.println("o1 is equals o2 !"); }else{ System.out.println("o1 is not equals o2 !"); } if(o1 =

[Python] 學習資源

IDE︰ Eclipse + PyDev 這個可以直接在Eclipse裡面安裝 http://tw.tonytuan.org/2011/04/python-eclipsepydev.html   語言教學︰ Python 2.7 https://openhome.cc/Gossip/CodeData/PythonTutorial/index.html https://github.com/JustinSDK/PyConTW2013Tutorial/blob/master/tutorial/PythonTutorial.MD Python 3 https://openhome.cc/Gossip/Python/ 通過例子說明Python 2.7.x和Python 3.x關鍵差異 https://kknews.cc/zh-tw/news/bl2mj.html   安裝Python︰ 原本Mac就有python2了,但朋友用的是Python3,所以還是來裝一下 看了幾篇網路上的教學後還是選擇用homebrew來裝,因為它簡單吶! # 先更新一下 brew update # 查詢是否已有安裝,到安裝目錄下看是否有python及python3 ls /usr/local/Cellar/ # 安裝python3 brew install python3 # 檢查系統路徑中/usr/local/bin是否在/usr/bin的前面,如果不是的話就調整一下 echo $PATH # 檢查python3是否在正確位置 which python3 參考︰   Mac OSX 正確地同時安裝 Python 2.7 和 Python3 https://stringpiggy.hpd.io/mac-osx-python3-dual-install/   使用Pyenv安裝不同版本Python https://medium.com/@hyWang/%E4%BD%BF%E7%94%A8pyenv%E5%AE%89%E8%A3%9D%E4%B8%8D%E5%90%8C%E7%89%88%E6%9C%ACpython-1d83a5164883 pyenv https://gist.github.com/Bouke/11261620   開發

[React Native] 筆記

1.安裝node.js 2.安裝watchman (https://facebook.github.io/watchman/docs/install.html) brew update brew install watchman 2.1修正Error Error: Cannot write to /usr/local/Cellar sudo chown -R $(whoami):admin /usr/local

[NodeJS] 建置記錄

1.建立新專案︰ $ express --view=pug nodeservice create : nodeservice create : nodeservice/package.json create : nodeservice/app.js create : nodeservice/public create : nodeservice/public/stylesheets create : nodeservice/public/stylesheets/style.css create : nodeservice/public/images create : nodeservice/routes create : nodeservice/routes/index.js create : nodeservice/routes/users.js create : nodeservice/public/javascripts create : nodeservice/views create : nodeservice/views/index.pug create : nodeservice/views/layout.pug create : nodeservice/views/error.pug create : nodeservice/bin create : nodeservice/bin/www install dependencies: $ cd nodeservice && npm install run the app: $ DEBUG=nodeservice:* npm start 2.安裝相依項目(install dependencies 同上面所寫) $ cd nodeservice && npm install 以下是目前會用的到,也一起安裝 npm install date-utils --save npm install fs --save npm install quick-local-ip --save npm install mongodb --save 3.在console.log上加上時間 在app.js上增加 require('date-utils');