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 2, 2024 13:48
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.
@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 May 10, 2024 18:56
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 May 5, 2024 14:26
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: {
@jonnyjava
jonnyjava / working_effectively_with_legacy_code.md
Created November 4, 2019 21:51
Working effectively with legacy code summary

WORKING EFFECTIVELY WITH LEGACY CODE

To me, legacy code is simply code without tests. I’ve gotten some grief for this definition. What do tests have to do with whether code is bad? To me, the answer is straightforward, and it is a point that I elaborate throughout the book: Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.

Chapter 1 Changing Software

Four Reasons to Change Software: For simplicity’s sake, let’s look at four primary reasons to change software.

@ilhamsj
ilhamsj / laravel-notes.md
Last active July 13, 2023 02:08
Force HTTPS laravel on heroku

Force HTTPS laravel on heroku

add this line after RewriteEngine On

RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

app\Http\Middleware\TrustProxies.php

@artyorsh
artyorsh / README.md
Last active June 21, 2023 16:36
Metro and Babel monorepo resolver functions

React Native Metro and Babel resolver functions for monorepo projects

Have you ever faced troubles when configuring a fresh react-native app to test your framework locally? These utility functions will help you to configure metro and babel to run your monorepo-structured framework and test it's modules without a need to publish them.

Simply copy and paste the files below into your project root and follow the guides explained in both of them.

See an Example project