Skip to content

Instantly share code, notes, and snippets.

View andhikayuana's full-sized avatar
🌏
bertapa

Andhika Yuana andhikayuana

🌏
bertapa
View GitHub Profile
@ahmadrosid
ahmadrosid / write-fixer.py
Created April 17, 2024 10:02
Fixed typos, spelling mistakes, and grammar while maintaining clarity and a concise tone using Claude.
import sys
import anthropic
from dotenv import load_dotenv
load_dotenv()
client = anthropic.Anthropic()
prompt_template = """
Please review and edit the following text to ensure it is grammatically correct, clear, and concise. Aim to maintain a casual tone without being overly informal. Provide suggestions for improvement and explain any changes you make. Do not add double quotes in you rewrite answer. Answer in direct response.
@kamilogorek
kamilogorek / _screenshot.md
Last active May 27, 2024 12:50
Clutter-free VS Code Setup
image
@andrimuhyidin
andrimuhyidin / gcr-cleaner.sh
Last active June 8, 2022 13:50
Deleting unused image tags from Google Container Registry, leaving x number left
#!/bin/bash
IFS=$'\n\t'
set -eou pipefail
if [[ "$#" -ne 3 || "${1}" == '-h' || "${1}" == '--help' ]]; then
cat >&2 <<"EOF"
gcr-cleaner.sh will cleans up the gcr tags or untaged images pushed in a repository (image name with the specific tag)
and except the given number most recent images.
@mxalbert1996
mxalbert1996 / Scrollbar.kt
Last active July 24, 2024 22:50
Modifiers to draw scrollbars in Jetpack Compose
/*
* MIT License
*
* Copyright (c) 2022 Albert Chang
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@amal
amal / Tooltip.kt
Last active July 10, 2024 15:05
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
@LongClipeus
LongClipeus / HashUtils.kt
Last active March 13, 2024 11:54
How to generate checksum hash for a file in Kotlin
import StringUtils.encodeHex
import java.io.File
import java.io.FileInputStream
import java.io.InputStream
import java.security.MessageDigest
object HashUtils {
const val STREAM_BUFFER_LENGTH = 1024
@FreddieOliveira
FreddieOliveira / docker.md
Last active July 25, 2024 00:50
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@viktoriia-io
viktoriia-io / maven_publish.gradle
Last active November 7, 2023 08:47
Maven publishing script for customising pom file generation
apply plugin: 'maven-publish'
afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
groupId project.ext.pomGroupID
artifactId project.name
version project.ext.pomVersion
@teknogeek
teknogeek / universalUnpin.js
Last active July 2, 2024 20:36
Frida Universal™ SSL Unpinner
Java.perform(function() {
console.log('\n[.] Cert Pinning Bypass');
// Create a TrustManager that trusts everything
console.log('[+] Creating a TrustyTrustManager that trusts everything...');
var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager');
var TrustyTrustManager = Java.registerClass({
name: 'com.example.TrustyTrustManager',
implements: [X509TrustManager],
methods: {
@webserveis
webserveis / MainActivity.kt
Created January 19, 2020 22:37
Show app usage with UsageStatsManager
import android.Manifest
import android.app.AppOpsManager
import android.app.usage.StorageStats
import android.app.usage.StorageStatsManager
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.os.Process