Skip to content

Instantly share code, notes, and snippets.

View Gnzlt's full-sized avatar

Gonzalo Toledano Gnzlt

View GitHub Profile
Listado de Proxies para Telegram
Copia y pega los enlaces en el navegador para que se abran con Telegram.
Añade los servidores y DESACTIVA el proxy mientras no lo necesites.
Podéis gestionarlos desde Ajustes > Datos y almacenamiento > Proxy
*23/03/2024*
tg://proxy?server=proxy.digitalresistance.dog&port=443&secret=d41d8cd98f00b204e9800998ecf8427e
@inidamleader
inidamleader / AutoSizeText.kt
Last active June 1, 2024 10:51
Composable function that automatically adjusts the text size to fit within given constraints with optimal performance by using a binary search algorithm
// LAST UPDATE: 01 Jun 2024 V6:
// - Remove ImmutableWrapper due to new possibilities to make List class stable in jetpack compose (compose_compiler_config.conf or enableStrongSkippingMode)
package com.inidamleader.ovtracker.util.compose
import android.util.Log
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.text.InlineTextContent
import androidx.compose.material3.LocalContentColor
@chk1
chk1 / README.md
Last active February 23, 2024 23:05
Dell S2721dgf/S2721dgfa volume control via Dell Display Manager (ddm) on Windows
@ln-12
ln-12 / CameraPreview.kt
Last active August 21, 2023 09:28
Jetpack Compose example usage of the new ImageAnalysis MlKitAnalyzer (https://android-developers.googleblog.com/2022/08/camerax-12-is-now-in-beta.html)
@Composable
fun CameraPreview(
modifier: Modifier = Modifier,
cameraSelector: CameraSelector = CameraSelector.DEFAULT_BACK_CAMERA,
scaleType: PreviewView.ScaleType = PreviewView.ScaleType.FILL_CENTER,
onBarCodesFound: (barCodes: List<Barcode>) -> Boolean,
) {
val lifecycleOwner = LocalLifecycleOwner.current
val context = LocalContext.current
@thesauri
thesauri / change-mac-address-monterey.md
Created February 22, 2022 15:38
Change MAC address macOS 12 Monterey

Change MAC address in macOS Monterey

I was unable to change the MAC address of the Wi-FI device on a MacBook Air (M1 2020) running macOS Monterey due to the following error: ifconfig: ioctl (SIOCAIFADDR): Can't assign requested addres.

By running the commands in following sequence I was able to change it successfully:

  1. Turn WiFi device off
  2. Turn the WiFi device on again: networksetup -setairportpower en0 on
  3. Change the MAC: ifconfig en0 ether <mac-address-here>
  4. Run: networksetup -detectnewhardware
@amal
amal / Tooltip.kt
Last active December 21, 2023 11:25
How to show a tooltip in AndroidX Jetpack Compose?
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
// Tooltip implementation for AndroidX Jetpack Compose
// See usage example in the next file
// Tested with Compose version **1.1.0-alpha06**
// Based on material DropdownMenu implementation.
import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.animation.core.animateFloat
#! /usr/bin/env python
# hg658c.wordpress.com
"""
To decrypt encrypted values in the config, use
echo -n "Lp0xkiAANwcYpVPbI3D/Mg==" | base64 -d | openssl enc -d -aes-128-cbc
-K DBAF3361E81DA0EF5358A1929FC90A80 -iv 629EA150533376741BE36F3C819E77BA -nopad
"""
import sys
import os
from binascii import hexlify, unhexlify
@johnwgillis
johnwgillis / How to setup GPG for git.md
Last active April 22, 2024 17:13
How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

  1. Install GPG tools
    1. Install GPG tools and setup pin entry by running:
    brew install gnupg pinentry-mac
    mkdir -m 700 -p ~/.gnupg
    echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
    killall gpg-agent
    
@gabrielemariotti
gabrielemariotti / README.MD
Last active March 7, 2024 07:50
How to use the ShapeableImageView.

The Material Components Library introduced with the 1.2.0-alpha03 the new ShapeableImageView.

In your layout you can use:

 <com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:srcCompat="@drawable/..." />

Then in your code apply the ShapeAppearanceModel to define your custom corners:

@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 28, 2024 11:46
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !