Git squash

Consider your new feature branch is called bugfix. You have done a lot of commits eg. 20 commits to the branch and want to squash all commits to one before merging to main. Standard squash The standard way is like this.

Read More

Smerge, ediff and diff

Updated: 2021-12-22 For enditing conflict in git, use smerge or ediff. Smerge Basic workflow: Open magit status with SPC g g in Doom Identify the mark with Unmerged under Unstage list Go to the file and press Enter to open the file The base command for Smerge is C-c ^ You will see the conflict and selecting the upper with C-c ^ u and lower with C-c ^ l To select all ‘conflicting’ changes press C-c ^ a To navigate the conflicts use C-c ^ n and C-c ^ p for next and previous conflict To see all the keybindings use C-c ^ h With DOOM and hydra:

Read More

data.table tips

Updated: 2021-09-17 Some tips for data.table that I came across while googling which might be useful. Print To print more rows that default can be done with either: options(datatable.print.topn = 70) print(DT, topn = 70) Using options will implement the changes globally.

Read More

Merge atau join

Fungsi yang selalu dipakai bila mengemaskini dan menyusun data ialah penggunaan merge atau join. Cara biasa menggunakan teknik data frame ialah seperti begini: library(data.table) DT1 = data.table(area=c('US', 'UK', 'EU', 'Asia'), id=c('c001', 'c002', 'c003', 'c004'), value=c(100, 200, 300, 400) ) DT2 = data.

Read More