Docker rails development
Follow this post https://blog.saeloun.com/2023/11/29/rails-7-1-introduces-default-docker-files/ haven't success yet though, making not...
VSCode dev container
無意間發現的 VS Code 有個 dev container 的功能,簡單來說就是可以幫你用 Docker 設定好環境,設定都在 `.devcontainer` 的資料夾內,可以參考官方文章: [https://code.visualstudio.com/docs...
Customize Mac sleep shortcut without any 3rd party software
Settings -> Keyboard -> Keyboard Shortcuts -> App Shortcuts -> Add new shortcut to All application, name is `Sleep`  in Ruby and gems to use
> Feature Toggles (often also refered to as Feature Flags) are a powerful technique, allowing teams to modify system behavior without cha...
Remote tools and tips from ThoughtBot
ThoughBot 跟緊這波疫情 WFH 的潮流發了一篇 remote tips,順便推廣了他們自己的產品 Tuple,還滿想試試看的 另外有個 meeting tip 也不錯,就是舉手的機制,想發言的人要先舉手 再來是被遺忘的 Google Jamboard 可以當快...
How to replace moment.js
Found this repo: https://github.com/you-dont-need/You-Dont-Need-Momentjs Replacement: - [date-fns](https://github.com/date-fns/date-fns...
How to pass arguments to rake task
1. rake way ```rb task :add, [:num1, :num] do |t, args| puts args[:num1].to_i + args[:num].to_i end # rake add\[1,2\] ``` 2. ENV ``...
Ruby HTTP client options
- The built-in net/http client - Faraday - http.rb (HTTP The Gem) - rest-client - httparty - excon - Typhoeus - Curb For some pros and c...
Ruby API serializer options
這週 Ruby Weekly 剛好兩個人在推自己的 serializer gem,大家都要自己做自己的工具,驗證了別人寫的 code 都是屎,只有自己寫的才是最好的真理,呵呵。 趁機整理一下: - https://github.com/rails-api/active_...
Mac: add ssh key to ssh-agent
```sh $ ssh-add -K ~/.ssh/id_rsa ``` https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
ignore and untrack committed file with git
``` git rm --cached config/database.yml ``` https://www.git-tower.com/learn/git/faq/ignore-tracked-files-in-git https://askjong.com/howt...
Ansible + rails + letsencrypt
First, install nginx roles/nginx/tasks/main.yml ```yml - name: Install nginx apt: name: nginx state: latest - name: Disable ...
How to keep forked git repo up to dated?
### 1. Clone your fork: git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git ### 2. Add remote from original repository in...
Suspender 用 1.46.0 可以使用 rails 5.1.6
ThoughtBot 的 rails bootstraper,現在最新版 default 使用了 rails 5.2 很煩,因為我不喜歡 5.2 的 credential 要使用 5.1.x 版本的話要用 v1.46.0 版本的 Suspender,但 1.46.0 是用...
skip document installation when gem install
https://stackoverflow.com/questions/1381725/how-to-make-no-ri-no-rdoc-the-default-for-gem-install 1. 加 ~/.gemrc ``` gem: --no-document...
github issue 和 pr 帶不同 params 就有不同功能
潮潮的,可以指定 title, labels, template 和 assignees 之類的 https://help.github.com/articles/about-automation-for-issues-and-pull-requests-with-qu...
使用 Vagrant 練習 chef-solo deployment
每次都自己調 server 太煩了,用 chef-solo 調一次以後一直套用比較方便,可以用 Vagrant 練習會快一點 先安裝 VirtualBox 和 Vagrant https://www.virtualbox.org/wiki/Downloads https...
想在 server 上持續性地跑個簡單的 script - screen
screen 進到 screen ```sh screen ``` Detach (離開 screen, 但是讓 screen 裡面的東西繼續執行) ``` ctrl+a d ``` Re-attach (重回 screen) ```sh screen ...