Skip to content

Instantly share code, notes, and snippets.

View milksense's full-sized avatar
🙂

milksense

🙂
View GitHub Profile
import { ThemedText } from "@/components/themed-text";
import { BottomSheet, Button, Host, Slider } from "@expo/ui/swift-ui";
import { frame, offset } from "@expo/ui/swift-ui/modifiers";
import { Canvas, Fill, Shader, Skia, vec } from "@shopify/react-native-skia";
import { useState } from "react";
import {
PlatformColor,
StyleSheet,
useWindowDimensions,
View,
export const init = async () => {
const lp = retrieveLaunchParams();
const isDebug = lp.startParam === "debug";
$debug.set(isDebug);
if (isDebug && ["android", "ios"].includes(lp.platform)) {
try {
const eruda = await import("eruda");
eruda.default.init({
tool: ["console", "elements", "network", "resources", "info"],
@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:

@Kyle-Ye
Kyle-Ye / iPhone Mirroring.md
Last active March 20, 2025 11:27
Launch iPhone Mirroring.app on macOS 15 Beta 1
@KlassenKonstantin
KlassenKonstantin / AnimatedFocusIndicator.kt
Created May 28, 2024 10:27
Animated focus indicator
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
BorderPathTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Box(
modifier = Modifier
.fillMaxSize()
@JunkFood02
JunkFood02 / Motion.kt
Last active July 19, 2024 11:57
A music player demo made with Jetpack Compose animation APIs, including shared element transition, list animations, animated content, etc.
package com.example.compose_debug
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.Easing
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.PathEasing
@edsunman
edsunman / ThrelteAnimationUtils.ts
Last active March 8, 2025 19:25
Threlte Utilities
/**
* A timeline with internal clock to schedule simple animations.
* @example
* // create timeline
* let timeline = new Timeline();
*
* // schedule a function to be run in two seconds time
* timeline.addKeyframe(2, () => {
* console.log('Hello in two seconds time');
* });
@rexydye
rexydye / gradient.md
Created January 2, 2024 09:54
Add titlebar gradient to VS Code like in intelij idea / other jetbrains IDE
  1. Install this extension: Custom CSS and JS Loader
  2. Create vscodestyle.css file somewhere on your system with this content:
.monaco-workbench .part.titlebar {
  position: relative;
}
.monaco-workbench .part.titlebar::before {
  content: "";
  position: absolute;
 top: 50%;
@KlassenKonstantin
KlassenKonstantin / TextTransition.kt
Created October 1, 2023 17:42
Cascading Text Transition
@Composable
fun TextTransition(textAndColor: Pair<String, Color>) {
AnimatedContent(
targetState = textAndColor,
transitionSpec = {
fadeIn() togetherWith fadeOut()
}
) { (text, color) ->
Row {
text.forEachIndexed { index, char ->
@ChristopherA
ChristopherA / touchidforsudo.md
Last active December 2, 2023 03:27
TouchID for sudo (updated for Sonoma 14.0)