Skip to content

Instantly share code, notes, and snippets.

View MarcusResell's full-sized avatar
😼

Marcus Resell MarcusResell

😼
View GitHub Profile
@MarcusResell
MarcusResell / git lb-remote
Created November 29, 2021 09:19
List all local and up-to-date remote branches according to time and pick which one you want to checkout
# requires xargs, awk, fzf, sed to be installed
lb-remote = !git fetch --all --prune && git branch -a --sort='-committerdate' --format='%(color:green)%(committerdate:relative)%(color:reset) %(refname:short)' | fzf --ansi --layout=reverse --border=rounded --info=hidden --height=10 | sed 's/.*ago[ ]*//g' | xargs git checkout
@MarcusResell
MarcusResell / git lb
Last active November 29, 2021 09:19
List all local branches according to time and pick which one you want to checkout
# List all local branches according to time and pick which one you want to checkout
# requires xargs, awk, fzf, sed to be installed
lb = !git branch --sort='-committerdate' --format='%(color:green)%(committerdate:relative)%(color:reset) %(refname:short)' | fzf --ansi --layout=reverse --border=rounded --info=hidden --height=10 | sed 's/.*ago[ ]*//g' | xargs git checkout
@MarcusResell
MarcusResell / app.component.final.html
Last active February 5, 2024 08:53
Dynamic checkboxes in Angular tutorial
<form [formGroup]="musicForm" (ngSubmit)="submit()">
<label>
<input type="checkbox" formControlName="selectAll">
Select/Unselect all
</label>
<label formArrayName="musicPreferences" *ngFor="let genre of musicForm.controls['musicPreferences'].controls; let i = index">
<input type="checkbox" [formControlName]="i">
{{musicPreferences[i].genre}}
</label>