Publish to Heroku
Init git and commit your code.
git init
git add .
git commit -m "init project"
Login heroku
heroku login
Using Golang backpack
heroku create -b https://github.com/kr/heroku-buildpack-go.git
Vendoring: For Go 1.6 (refer here)
go get -u github.com/tools/godep
Save your dependency godep save github.com/kkdai/githubrss
Submit your depdendency
git add .
git commit -m "godep"
Push your complete code to Heroku
git push heroku master
Add “Deploy to Heroku”
copy app.json (refer more spec here)
Remember must include buildpack. And all buildpack list here.
Make sure your buildpack sync with what you use
In my case, I use https://github.com/kr/heroku-buildpack-go.git:
"buildpacks": [
{
"url": "https://github.com/kr/heroku-buildpack-go.git"
},
{
"url": "heroku/go"
}
All app.json sample as follow (refer to rss-webserver):
這是什麼? 程式週記主要內容如下: Gihub project 介紹: 主要會貼一些github,但是會盡量寫上一些有用的評語(或是我容易想到的關鍵詞)幫助以後查詢 網路文章心得: 會寫些心得,強迫自己閱讀. “程式週記”並且定期週期性更新. 大部分內容在我的twitter都會有,這邊只是將一些簡單的心得與感想註解一下. 本週摘要 本週時間花在Survey 各種IoT Big Data的架構與各種元件的用法,因為Docker三週年聚會,也花了不少時間玩Docker. 比較少時間來弄Golang.下周應該繼續看分散式系統才對. Go Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template 這個Go template 效能有點恐怖.. 20x faster than html/template!! “Go Learn: Some rookie Go mistakes we made (And how we recovered from them)” 不少值得看的粗心錯誤,挑出幾個很容易犯的: Naked return (先定義好的return value) 會讓整個function 更難閱讀(因為return不需要再帶回傳值). 並且很容易少回傳幾個參數而造成回傳沒有意義的初始值. Map 的concurrency 不穩定性 (可以參考Go FAQ: Atomic_Maps),要寫concurrency program 要儘量避免使用map 同場加印: Gist上面有人提供Go地雷Landmines 主要是for i scope interface pointer 前面提到Naked return與容易踩到scope問題. vim-go 1.5 Release vim-go release新版 New in 1.5 (1) fatih/motion 提供函式檢索的功能 (2) GoAlternate 可以快速切換test跟原本檔案 A microservice toolkit 號稱有著相當多microservice功能的 toolkit,並且具有pluggable(可拔插)功能的設計.感覺很酷… jsonparser: Alternative JSON parser for Go that does not require schema 相當快速的json parser(根據作者測試),甚至可以比”encoding/json” 快上九倍. 其實有附上跟一些其他json parser的效能比較表,可以參考看看. 同場加映: https://github.com/mailru/easyjson 也說他比 “ encoding/json”快上不少… 不過他跟jsonparser沒有比過效能.. 倒底”encoding/json”是有多慢呢 XDDD Python Android/JAVA/NODE.JS Docker docker-NAT-router: Docker container that functions as a simple NAT router. Linux iptables MASQUERADE provides network address...
快速紀錄一下:
在Windows 的Quick Start Terminal (Toolbox)下,如果git下載 docker-compose.yml下來會無法順利讀到. 原因是unix的文件檔案在Windows底下會無法正確閱讀. (CRLF問題)
解決方式: 參考這篇吧
�[31mERROR�[0m: In file '.\docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration option
此外,如果很聰明地使用了vagrant來進入ubuntu VM中跑docker-compose.如果不小心把檔案寫到了跟Widows共享的資料夾內,一樣會有相同的問題.
結論: MacOSX/Linux 的Docker最安全… Windows好危險 XDDD
這是什麼? 程式週記主要內容如下: Gihub project 介紹: 主要會貼一些github,但是會盡量寫上一些有用的評語(或是我容易想到的關鍵詞)幫助以後查詢 網路文章心得: 會寫些心得,強迫自己閱讀. “程式週記”並且定期週期性更新. 大部分內容在我的twitter都會有,這邊只是將一些簡單的心得與感想註解一下. 本週摘要 本週依舊圍繞在AlphaGo與機器學習上,不過工作上的長官給了我很好的學習方向. 對於新的事物,我們只要搞懂三件事情(不論你有沒有興趣) 為何以前做不到? 以前的困難是什麼? 這一次做到的原因是什麼? 突破點是什麼? 對於相關技術未來的展望? 這個禮拜花了不少時間先思考該如何寫專案,確定好整個方向與架構後才開始動手.想不到卻相當的迅速. Go A very minimal but flexible golang web application framework, providing a robust set of features for building single & multi-page, web applications. http://kataras.github.io/iris/ minimal but flexible golang web application framework for #golang, and the performance benchmark is perfect Official golang implementation of the Ethereum protocol http://ethereum.github.io/go-ethereum/ 類似於blockchain的系統(我不是很確定該用哪種名稱來統稱這種系統). groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. 類似於memcached,可以透過key來cache資料. Python Flappy Bird hack using Deep Reinforcement Learning (Deep Q-learning). 用Tensorflow (深度學習) 玩#FalppyBird 聽說可以玩360關 AlphaGo: A replication of DeepMind’s 2016 Nature publication, “Mastering the game of Go with deep neural networks and tree search,” details of which can be found on their website. 使用Python 建立的AlphaGo Deep Learning Engine. Ruby jekyll-now:...