This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class UiState { | |
object SignedOut : UiState() | |
object InProgress : UiState() | |
object Error : UiState() | |
object SignIn : UiState() | |
} | |
class MyViewModel : ViewModel() { | |
private val _uiState = mutableStateOf<UiState>(SignedOut) | |
val uiState: State<UiState> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun TopicChip(topic: Topic, selected: Boolean){ | |
val radius by animateDpAsState( | |
if (selected) 20.dp else 0.dp | |
) | |
Card( | |
shape = RoundedCornerShape( | |
topStart = radius | |
) | |
){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/sbin/softwareupdate --install-rosetta --agree-to-license | |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
arch -x86_64 brew install <package> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"To configure the initial branch name to use in all | |
of your new repositories, which will suppress this warning, call: " | |
git config --global init.defaultBranch <name> | |
" Names commonly chosen instead of 'master' are 'main', 'trunk' and | |
'development'. The just-created branch can be renamed via this command: " | |
git branch -m <name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo=bar | |
" The value is '$foo'" # prints The value is bar | |
foo=$(pwd) | |
" We are in '$foo' " # prints We are in < PATH > | |
cat <(ls) <(ls ..) # concats the output of ls and ls .. | |
mkdir sandbox / # Will need permissions | |
sudo !! # !! inserts mkdir sandbox / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Moves *.py files to < PATH > " | |
find . -name "*.py" -print0 | xargs -0 -I {} mv {} /Users/<user>/Desktop/unix_practice/code/python | |
" Deletes everything inside . but -name <file> " | |
find . ! -name index.html -delete | |
" Copies everything with permissions " | |
cp -rp unix_practice/* ./unix_practice_backup_1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -background transparent "favicon.png" -define icon:auto-resize=16,24,32,48,64,72,96,128,256 "favicon.ico" | |
magick -density 256x256 -background transparent favicon.svg -define icon:auto-resize -colors 256 favicon.ico | |
convert Operations.gif -coalesce -scale 792x446 -layers Optimize Output.gif | |
mogrify -format jpg *.heic | |