Skip to content

Instantly share code, notes, and snippets.

View androiddevnotes's full-sized avatar
🐣

Android Dev Notes androiddevnotes

🐣
View GitHub Profile
@androiddevnotes
androiddevnotes / License.pdf
Created October 7, 2024 21:00
Apple SF Symbols License as of 10/07/2024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@androiddevnotes
androiddevnotes / pre-commit
Created September 17, 2024 00:13
Automatically format Swift source files using swift-format from SwiftLang before committing changes in a Git repository. Ensure you have swift-format installed
#!/bin/sh
# Format Swift files with swift-format before committing
git diff --name-only -z --cached -- '*.swift' | \
xargs -0 -I {} sh -c 'swift-format -i {} || exit $?'
# If swift-format fails (returns non-zero), the commit will be aborted
# Re-add the files to stage the changes made by swift-format
git diff --name-only -z --cached -- '*.swift' | \
@androiddevnotes
androiddevnotes / README.md
Created September 16, 2024 21:17
Automatically format Kotlin source files using ktlint before committing changes in a Git repository.

to use it:

  1. install ktlint first: brew install ktlint - if not on mac, use different installation: https://github.com/pinterest/ktlint

  2. modify your pre-commit file in .git folder

  3. create .editorconfig file in root of your project

example config of .editorconfig:

import android.graphics.Matrix
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
# pip install pyautogui
# Reference: https://pyautogui.readthedocs.io/en/latest/mouse.html
import pyautogui, sys, time
# Set the timer interval (in seconds)
interval = 0
print('Press Ctrl-C to quit.')
@androiddevnotes
androiddevnotes / ModalBottomSheet.kt
Created November 28, 2022 21:07 — forked from LouisCAD/ModalBottomSheet.kt
Put this in its own Gradle module to have ModalBottomSheet in Material3 (or even without Material Design at all).
package com.louiscad.splitties.eap.bottomsheet
import android.app.Activity
import android.view.ViewGroup
import androidx.activity.compose.BackHandler
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetLayout
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
@androiddevnotes
androiddevnotes / NoScoreMDL.css
Last active June 15, 2022 14:07
Userstyle to hide score, views, and member count on MDL (MyDramaList). This is so that you won't judge Dramas by ratings and views but give each one a fair chance. Link: https://userstyles.world/style/5186/no-score-mdl
/* ==UserStyle==
@name No Score MDL
@version 20220615.14.05
@namespace userstyles.world/user/androiddevnotes
@description Userstyle to hide score, views, and member count on MDL (MyDramaList). This is so that you won't judge Dramas by ratings and views but give each one a fair chance.
@author androiddevnotes
@license No License
==/UserStyle== */
@-moz-document domain("mydramalist.com") {
@androiddevnotes
androiddevnotes / NoScoreMAL.css
Last active April 16, 2022 23:59
Userstyle to hide scores, views, member count from MyAnimeList to give each anime, manga, light novel a fair chance. Link: https://userstyles.world/style/4220/no-score-mal
/* ==UserStyle==
@name No Score MAL
@version 20220416.23.57
@namespace userstyles.world/user/androiddevnotes
@description Userstyle to hide score, views, and member count on MAL (MyAnimeList). This is so that you won't judge Anime, Manga, and Light Novels by ratings and views but give each one a fair chance.
@author androiddevnotes
@license No License
==/UserStyle== */
@-moz-document url-prefix("https://myanimelist.net/") {
@androiddevnotes
androiddevnotes / ffmpeg.md
Created February 22, 2022 01:52 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@androiddevnotes
androiddevnotes / script.sh
Created February 17, 2022 00:10
Bash script to make directory from file name and move the file inside the directory. Run: bash script.sh
#!/bin/bash
for file in $(find . -name "*.md" -type f)
do
echo "file: $file"
filenamewithextension=${file##*/}
echo "file name with extension: $filenamewithextension"
mkdir ${filenamewithextension%.*}
echo "file name without extension: ${filenamewithextension%.*}"
mv ${filenamewithextension} ${filenamewithextension%.*}/${filenamewithextension}
done