Skip to content

Instantly share code, notes, and snippets.

View ardakazanci's full-sized avatar
:bowtie:
E=mc^2

Arda K. ardakazanci

:bowtie:
E=mc^2
View GitHub Profile
@logickoder
logickoder / ComposePdfExporter.kt
Created January 1, 2025 16:22
Export a scrollable composable to PDF
package dev.logickoder.printer
import android.app.Dialog
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Rect
import android.graphics.pdf.PdfDocument
import android.view.View
import androidx.compose.foundation.gestures.scrollBy
@vishal2376
vishal2376 / Place.kt
Last active July 31, 2024 10:01
Image Reflection with cool animation using Jetpack Compose
data class Place(
val name: String,
val resId: Int
)
@JunkFood02
JunkFood02 / CardExpandContainerTransform.kt
Last active March 24, 2025 19:31
Container transform for cards (🐈 included)
@file:OptIn(
ExperimentalSharedTransitionApi::class,
ExperimentalMaterial3Api::class
)
package com.example.compose_debug
import android.util.Log
import androidx.activity.compose.BackHandler
import androidx.annotation.DrawableRes
@damianpetla
damianpetla / CurrencyOffsetMapping.kt
Created October 14, 2023 09:28
Transforming EditText value into currency
import androidx.compose.ui.text.input.OffsetMapping
class CurrencyOffsetMapping(originalText: String, formattedText: String) : OffsetMapping {
private val originalLength: Int = originalText.length
private val indexes = findDigitIndexes(originalText, formattedText)
private fun findDigitIndexes(firstString: String, secondString: String): List<Int> {
val digitIndexes = mutableListOf<Int>()
var currentIndex = 0
for (digit in firstString) {
@dladukedev
dladukedev / colors.kt
Created August 3, 2023 15:38
Use Compose Preview to Show your Theme
package com.dladukedev.themetest.ui.theme
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
public class Logger {
private static boolean enableLog = BuildConfig.DEBUG;
public static boolean isEnableLog() {
return enableLog;
}
public static void setEnableLog(boolean enableLog) {
Logger.enableLog = enableLog;
@nieldeokar
nieldeokar / SimpleVibrateDemoActivity.java
Last active September 1, 2023 11:04
Android Vibrate & VibrationEffect class demo Usage
package com.example.nileshdeokar.simplevibratedemo;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
/*
@yocontra
yocontra / aoe2hd.md
Last active June 9, 2023 18:28
Age of Empires II HD - For Mac OSX
[
{
"il": "Adana",
"plaka": 1,
"ilceleri": [
"Aladağ",
"Ceyhan",
"Çukurova",
"Feke",
"İmamoğlu",
@nrollr
nrollr / MySQL.md
Last active October 28, 2020 02:53
Install MySQL on El Capitan using Homebrew

Install MySQL on OS X El Capitan

Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault : bash <(curl -Ls http://git.io/eUx7rg)

However, at the time of writing the script is not compatible with OS X El Capitan (10.11)

Install MySQL using Homebrew

An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"

Make sure Homebrew has the latest formulae, so run brew update first