Skip to content

Instantly share code, notes, and snippets.

View indyfromoz's full-sized avatar
🏠
Working from home

Indrajit Chakrabarty indyfromoz

🏠
Working from home
View GitHub Profile
@subhransu
subhransu / .gitconfig
Created September 29, 2025 16:14
Git aliases for faster workflow
[alias]
co = checkout
cob = checkout -b
cm = commit -m
ca = commit --amend
s = status -sb
st = status
aa = add --all
ap = add -p
br = branch
@NinoDLC
NinoDLC / FoldableRow.kt
Created September 23, 2025 11:57
An example for a Row that will "fold" (when there's not enough width) into even splits
package com.example.myapplication
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.material3.VerticalDivider
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.IntrinsicMeasurable
import androidx.compose.ui.layout.IntrinsicMeasureScope
import androidx.compose.ui.layout.Layout
@iprashantpanwar
iprashantpanwar / BouncyHeart.kt
Last active October 17, 2025 17:42
Bouncy, pulsating heart animation in Jetpack Compose — inspired by https://dribbble.com/shots/2419184-Heart-Rate-Monitor-Animation
@Composable
fun HeartBeatScreen(
modifier: Modifier = Modifier
) {
Box(
modifier = modifier
.fillMaxSize(),
contentAlignment = Alignment.Center
) {
AnimatedLayeredHearts(modifier)
@riggaroo
riggaroo / KeyframesWithSpline.kt
Created December 17, 2024 11:34
KeyframesWithSpline Example
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.VectorConverter
import androidx.compose.animation.core.animateValue
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.keyframesWithSpline
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
@riggaroo
riggaroo / AnimateBounds.kt
Last active December 27, 2024 08:07
Simple Modifier.animateBounds() example
@OptIn(ExperimentalSharedTransitionApi::class)
@Preview
@Composable
private fun AnimateBoundsSimple() {
// We need the SharedTransitionLayout in order for the animateBounds modifier to have a
// lookaheadScope to use.
SharedTransitionLayout {
var position by remember {
mutableStateOf(true)
}
@emeowj
emeowj / DialControl.kt
Last active November 4, 2024 23:34
DialControl Final Code
import androidx.annotation.FloatRange
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.VectorConverter
import androidx.compose.animation.core.spring
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.scaleIn
import androidx.compose.animation.scaleOut
@tarrouye
tarrouye / AMAlbumDetailsView.swift
Created October 5, 2024 23:49
Sample code replicating the album details / track list screen from Apple Music
struct AMAlbumDetailsView: View {
let albumArt: Image
let title: String
let artist: String
let genre: String
let releaseYear: String
let quality: String
let tracks: [String]
@State private var playingTrack: String?
@dannguyen
dannguyen / README.openai-structured-output-demo.md
Last active October 2, 2025 18:53
A basic test of OpenAI's Structured Output feature against financial disclosure reports and a newspaper's police blotter. Code examples use the Python SDK and pydantic for the schema definition.

Extracting financial disclosure reports and police blotter narratives using OpenAI's Structured Output

tl;dr this demo shows how to call OpenAI's gpt-4o-mini model, provide it with URL of a screenshot of a document, and extract data that follows a schema you define. The results are pretty solid even with little effort in defining the data — and no effort doing data prep. OpenAI's API could be a cost-efficient tool for large scale data gathering projects involving public documents.

OpenAI announced Structured Outputs for its API, a feature that allows users to specify the fields and schema of extracted data, and guarantees that the JSON output will follow that specification.

For example, given a Congressional financial disclosure report, with assets defined in a table like this:

@emenjivar
emenjivar / AnimatedTypingIndicator.kt
Created June 23, 2024 17:39
Animated typing indicator in jetpack compose
/**
* Display an animated typing indicator with a configurable number of dots.
*
* @param modifier The modifier to be applied to the component.
* @param configuration The configuration for the component's appearance.
* @param totalDots The total number of dots displayed in the indicator.
*/
@Composable
fun AnimatedTypingIndicator(
modifier: Modifier = Modifier,
@akexorcist
akexorcist / BeakShape.kt
Last active July 6, 2024 22:34
Beak Shape for Jetpack Compose or Compose Multiplatform
import androidx.annotation.FloatRange
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Outline
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.LayoutDirection
import kotlin.math.atan2
import kotlin.math.cos
import kotlin.math.pow