Skip to content

Instantly share code, notes, and snippets.

Avatar

Cassio Zen cassiozen

View GitHub Profile
View .gitconfig
[user]
name = XXX
email = XXX
[alias]
ci = commit
co = checkout
st = status
# update local branch with latest stuff from origin and rebase any local commits
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Get the current branch name (not so useful in itself, but used in other aliases)
View .gitconfig
[user]
name = xxx
email = xxx
[alias]
ci = commit
co = checkout
st = status
# update local branch with latest stuff from origin and rebase any local commits
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Get the current branch name (not so useful in itself, but used in other aliases)
View Hyper Settings sync
plugins: [
"hyper-one-dark",
"hyper-search",
"hyper-opacity",
"hyper-alt-click",
"hyper-sync-settings"
],
View elvis2.kt
val name = nullableUser?.name ?: "Guest"
View elvis.kt
val name = nullableUserName ?: "Guest"
View safe call chain.kt
val currentCity: String? = user?.address?.city
View safe call operator.kt
val a = "Kotlin"
val b: String? = null
println(a?.length) // 6
println(b?.length) // null
View manual null check.kt
val len = if (nullableGreeting != null) {
nullableGreeting.length
} else {
0
}
View null2.kt
var nullableGreeting: String? = "Hello, World"
nullableGreeting = null // Works
View null1.kt
var greeting: String = "Hello, World"
greeting = null // Compilation Error