跳到主要內容

發表文章

目前顯示的是 10月, 2016的文章

Learning Git Branch

http://learngitbranching.js.org/

CHANGELOG Style

如何維護更新日誌 http://keepachangelog.com/zh-TW/0.3.0/ 範例 https://github.com/olivierlacan/keep-a-changelog/blob/master/CHANGELOG.md 語意版本 http://semver.org/lang/zh-TW/

Java Base64

Java8 的寫法可以這樣 final Base64.Decoder decoder = Base64.getDecoder(); final Base64.Encoder encoder = Base64.getEncoder(); final String text = "字串文字"; final byte[] textByte = text.getBytes("UTF-8"); //編碼 final String encodedText = encoder.encodeToString(textByte); System.out.println(encodedText); //解碼 System.out.println(new String(decoder.decode(encodedText), "UTF-8")); base64 wiki : https://zh.wikipedia.org/wiki/Base64

Java owner boilerplate

今天又睡不著了,就來隨便介紹一下 java owner boilerplate,它有一些很酷又很方便的feature,方便管理常需要用到的 configue 設定 支援一些 `.properties` 的檔案載入與管理 讓你可以快速地把 properties 設定的東西, 快速轉成 Java 的 enum 支援 properties HotReload Singleton 這boilerplate 在 aws 的 lambda 上根本無敵。 java port=80 hostname=foobar.com maxThreads=100 public interface ServerConfig extends Config { int port(); String hostname(); int maxThreads(); } public class MyApp { public static void main(String[] args) { ServerConfig cfg = ConfigFactory.create(ServerConfig.class); System.out.println("Server " + cfg.hostname() + ":" + cfg.port() + " will run " + cfg.maxThreads()); } } Site: [http://owner.aeonbits.org/docs/why/]( http://owner.aeonbits.org/docs/why/ Example: [https://github.com/lviggiano/ownerava]( https://github.com/lviggiano/ownerava