Skip to content

Instantly share code, notes, and snippets.

View c5inco's full-sized avatar

Chris Sinco c5inco

View GitHub Profile
@c5inco
c5inco / WearPreviewUtility.kt
Last active February 22, 2022 16:24
Small utility for framing a Compose Wear app in a watch bezel, whether round, square, or rectangular.
import android.content.res.Configuration
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
@c5inco
c5inco / MaterialMotionTransitions.kt
Last active December 7, 2023 08:12
Reusable transitions that map to Material 2 motion system - https://material.io/develop/android/theming/motion
// Requires Compose 1.1.0-alpha02+
// Best used with navigation animation transitions in Accompanist 0.17.0+
import androidx.compose.animation.*
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@c5inco
c5inco / .zshrc
Last active February 21, 2021 06:42
# enable the default zsh completions!
autoload -Uz compinit && compinit
# Aliases
alias zshrc='code ~/.zshrc'
alias gitconfig='code ~/.gitconfig'
alias ..='cd ..'
alias ...='cd ../..'
alias ls='ls -GFh'
alias ll='ls -alh'
@c5inco
c5inco / useful-git-commands.sh
Created November 14, 2019 22:58
Useful git commands
# Fix .gitigore if added late
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
find . -type f | cut -c 3- > list.csv
#!/bin/sh
if [ $# -gt 0 ]
then
defaults write com.apple.finder CreateDesktop $@
killall Finder
else
echo 'Error: Missing boolean'
fi
@c5inco
c5inco / git-setup.config
Last active November 3, 2020 05:37
Some aliases for Git
[alias]
st = status
co = checkout
b = branch
a = add .
can = commit --amend --no-edit
hist = log --graph --pretty=format:'%Cred%h%Creset |%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
rh = reset --hard
cp = cherry-pick
cln = clean -xfd
@c5inco
c5inco / launch.json
Last active February 14, 2016 19:09
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/bot.js",
"stopOnEntry": false,
"args": [],