= 2016-04-15 = == Gist == * http://defunkt.io/gist/ * https://github.com/defunkt/gist * !RubyGems 安裝: {{{ gem install gist }}} * Mac 安裝 {{{ brew install gist }}} * Debian / Ubuntu 安裝 {{{ apt-get -y install gist }}} * 使用 * 登入 {{{ gist login }}} * 上傳單一檔案 {{{ gist file1 }}} * 上傳多個檔案 {{{ gist file1 file2 }}} * 上傳 STDIN 到指定檔名 {{{ 指令 | gist -f "檔名" }}} * 複製 gist URL 到剪貼簿 {{{ 指令 | gist -c }}} == Bash == * 偶爾會用到一些 Bash 的色塊 COLOR * http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html * https://wiki.archlinux.org/index.php/Bash/Prompt_customization * TLDP 的測試腳本可以在 gist 取得 * https://gist.github.com/jazzwang/55203a9f33386e0e567328fb86ebf7db == Gradle == * 安裝 Gradle * Debian / Ubuntu 安裝 {{{ ~$ sudo apt-get -y install gradle }}} * Mac OS X 安裝 {{{ ~$ brew install gradle }}} * 驗證 Gradle 版本 - `gradle -v` {{{ ~$ gradle -v ------------------------------------------------------------ Gradle 2.12 ------------------------------------------------------------ Build time: 2016-03-14 08:32:03 UTC Build number: none Revision: b29fbb64ad6b068cb3f05f7e40dc670472129bc0 Groovy: 2.4.4 Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013 JVM: 1.8.0_77 (Oracle Corporation 25.77-b03) OS: Mac OS X 10.11.4 x86_64 }}} * 使用 `gradle init` 產生 gradle 專案目錄的範本 {{{ ~$ mkdir -p gradle-sample ~$ cd gradle-sample ~/gradle-sample$ gradle init :wrapper :init BUILD SUCCESSFUL Total time: 2.419 secs This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.12/userguide/gradle_daemon.html }}} * `gradle init` 產生的目錄結構如下: {{{ . ├── build.gradle ├── gradle │ └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle 2 directories, 6 files }}} * 可以用 `gradle tasks` 了解目前定義了哪些 task {{{ :tasks ------------------------------------------------------------ All tasks runnable from root project ------------------------------------------------------------ Build Setup tasks ----------------- init - Initializes a new Gradle build. [incubating] wrapper - Generates Gradle wrapper files. [incubating] Help tasks ---------- buildEnvironment - Displays all buildscript dependencies declared in root project 'gradle-sample'. components - Displays the components produced by root project 'gradle-sample'. [incubating] dependencies - Displays all dependencies declared in root project 'gradle-sample'. dependencyInsight - Displays the insight into a specific dependency in root project 'gradle-sample'. help - Displays a help message. model - Displays the configuration model of root project 'gradle-sample'. [incubating] projects - Displays the sub-projects of root project 'gradle-sample'. properties - Displays the properties of root project 'gradle-sample'. tasks - Displays the tasks runnable from root project 'gradle-sample'. BUILD SUCCESSFUL Total time: 1.994 secs This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.12/userguide/gradle_daemon.html }}}