Mac 外接滑鼠移動速度

下這個指令關閉智障的滑鼠移動加速,若沒關閉的話每次滑鼠移到按鈕旁邊就會變慢,有夠智障 ```sh defaults write .GlobalPreferences com.apple.mouse.scaling -1 ``` 聽說調過滑鼠移動速度後這個設定就會重新倍 ...

Wayne

DHH shares hey.com Gemfile

```rb ruby '2.7.1' gem 'rails', github: 'rails/rails' gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data # Actio...

Wayne

Golang environment variable

1. Built-in `os` package 2. Ruby style `godotenv` https://github.com/joho/godotenv 3. Recommended `viper` https://github.com/spf13/viper ...

Wayne

Golang version manager

GVM: https://github.com/moovweb/gvm Built-in: https://icanhazdowntime.org/posts/2019-10-11-go-has-a-built-in-go-version-manager/ ## Re...

Wayne

壓力測試的工具 - JMeter

JMeter 是個可以拿來做 performance testing 的工具,可以併發 request 做壓力測試 https://jmeter.apache.org/ ![Screenshot 2020-06-29 18.13.02.png](https://wayn...

Wayne

血淋淋的鍵盤設定之路 - Vortexgear Tab75

## Spec - 鍵盤:Vortexgear Tab75 - MacOS: 10.15.4 - Karabiner-Elements: 12.0.9 ## 鍵盤配置: `[ L1 ][ L2 ][ L3 ][ Space ][ R1 ][ R2 ][ R3 ]` ...

Wayne

Feature toggle (a.k.a Feature Flags) 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...

Wayne

Frontend mock API response 的小工具

這篇用來記錄一下有哪些工具可以用,以後持續更新 - https://github.com/miragejs/miragejs

Wayne

Remote tools and tips from ThoughtBot

ThoughBot 跟緊這波疫情 WFH 的潮流發了一篇 remote tips,順便推廣了他們自己的產品 Tuple,還滿想試試看的 另外有個 meeting tip 也不錯,就是舉手的機制,想發言的人要先舉手 再來是被遺忘的 Google Jamboard 可以當快...

Wayne

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...

Wayne

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 ``...

Wayne

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...

Wayne

Ruby API serializer options

這週 Ruby Weekly 剛好兩個人在推自己的 serializer gem,大家都要自己做自己的工具,驗證了別人寫的 code 都是屎,只有自己寫的才是最好的真理,呵呵。 趁機整理一下: - https://github.com/rails-api/active_...

Wayne

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

Wayne

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...

Wayne

Ansible + rails + letsencrypt

First, install nginx roles/nginx/tasks/main.yml ```yml - name: Install nginx apt: name: nginx state: latest - name: Disable ...

Wayne

How to keep forked git repo up to dated?

### 1. Clone your fork: git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git ### 2. Add remote from original repository in...

Wayne

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 是用...

Wayne

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...

Wayne

github issue 和 pr 帶不同 params 就有不同功能

潮潮的,可以指定 title, labels, template 和 assignees 之類的 https://help.github.com/articles/about-automation-for-issues-and-pull-requests-with-qu...

Wayne

使用 Vagrant 練習 chef-solo deployment

每次都自己調 server 太煩了,用 chef-solo 調一次以後一直套用比較方便,可以用 Vagrant 練習會快一點 先安裝 VirtualBox 和 Vagrant https://www.virtualbox.org/wiki/Downloads https...

Wayne

想在 server 上持續性地跑個簡單的 script - screen

screen 進到 screen ```sh screen ``` Detach (離開 screen, 但是讓 screen 裡面的東西繼續執行) ``` ctrl+a d ``` Re-attach (重回 screen) ```sh screen ...

Wayne

chmod 改變檔案權限

Linux檔案的基本權限就有九個,分別是owner/group/others三種身份各有自己的read/write/execute權限, 先複習一下剛剛上面提到的資料:檔案的權限字元為:『-rwxrwxrwx』, 這九個權限是三個三個一組的!其中,我們可以使用數字來代表各...

Wayne

讓 VSCode 識別 .js 成 JavascriptReact jsx 這樣才可以 autocomplete

因為上網找好幾次了很煩,註記一下 在設定裡面加上 ``` { "files.associations": { "*.js": "javascriptreact" } } ``` 以 rails + webpacker 為例 ``` { "files.assoc...

Wayne

git ignore globally

➜ ~ touch . gitignore_global ➜ ~ vim . gitignore_global ➜ ~ git config --global core.excludesfile '~/.gitignore_global' https://gis...

Wayne