Skip to content

Instantly share code, notes, and snippets.

View benigumocom's full-sized avatar
🏠
🙆

chanzmao benigumocom

🏠
🙆
View GitHub Profile
@benigumocom
benigumocom / progress.sh
Last active May 18, 2023 01:19
Text Animation using Braille pattern dots
#!/usr/local/bin/bash
chars="⣷ ⣯ ⣟ ⡿ ⢿ ⣻ ⣽ ⣾"
while true
do
for c in $chars
do
sleep 0.2
echo -en "\r[$c] loading "
fun String.printUnicodeEscapeSequences() {
println(this)
println(
this
.chars()
.joinToString("") { "\\u${it.toString(16).uppercase()}" }
)
println()
}
@benigumocom
benigumocom / AnimationText.kt
Last active April 25, 2023 22:17
Jetpack Compose AnimationText like ChatGPT
@Composable
fun AnimationText(text: String) {
var s by remember { mutableStateOf("") }
LaunchedEffect(Unit) {
text.indices.forEach { index ->
delay(10)
s = text.substring(0..index)
}
@benigumocom
benigumocom / chat-completion.sh
Created March 28, 2023 06:48
OpenAI Chat Completion
#!/bin/sh
while read -r question
do
answer=$(
curl \
-sH POST "https://api.openai.com/v1/chat/completions" \
-H "Content-Type: application/json;charset=utf-8" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d "{
@benigumocom
benigumocom / monospaced.applescript
Last active March 14, 2023 08:23
Change text font style on macOS Notes.app
tell application "System Events"
tell process "Notes" -- english app name
activate
set frontmost to true
end tell
-- select all
keystroke "a" using command down
#!/bin/bash
screencapture -i -c -o
tmp_file=$(mktemp -t qr_code.XXXXXXXXXX).png
osascript <<EOF
set png_data to the clipboard as «class PNGf»
set the_file to open for access POSIX path of (POSIX file "$tmp_file") with write permission
write png_data to the_file
.idea
**/node_modules/*
**/.firebaserc
# .gitignore created from Groovy contributors in https://github.com/apache/groovy/blob/master/.gitignore
user.gradle
.gradle/
target/
build/
out/
*.DS_Store
*.class
# Covers files to be ignored for android development using Android Studio.
# Built application files
*.apk
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)