Skip to content

Instantly share code, notes, and snippets.

@bmc08gt
bmc08gt / Kotlin+Gif.kt
Created February 22, 2024 04:49
SwiftyGif Kotlin Style
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.suspendCancellableCoroutine
import platform.CoreFoundation.CFDataRef
import platform.CoreGraphics.CGImageRef
import platform.Foundation.CFBridgingRelease
import platform.Foundation.CFBridgingRetain
import platform.Foundation.NSData
import platform.Foundation.NSDictionary
@jaredsburrows
jaredsburrows / build.yml
Last active March 18, 2023 19:04
Flutter - Android + iOS + Web
name: build
on:
push:
branches:
- main
pull_request:
types: [ opened, labeled, unlabeled, synchronize ]
env:
@dotysan
dotysan / mta-sts.js
Last active December 13, 2024 04:38
CloudFlare Worker for MTA-STS policy
// const mode = 'testing';
const mode = 'enforce';
// const max_age = 86400; // 1 day
const max_age = 604800; // 1 week
const mx_list = [
'aspmx.l.google.com',
'alt1.aspmx.l.google.com',
'alt2.aspmx.l.google.com',
@hiking93
hiking93 / themes.xml
Last active July 21, 2022 19:47
Edge-to-edge theme configuration with Material 3.
<style name="Theme.App" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?isLightTheme</item>
<item name="android:windowLightNavigationBar">?isLightTheme</item>
</style>
@hardiksachan
hardiksachan / README.md
Last active February 10, 2025 18:38
Jetpack Compose Expandable Search Bar (Top Bar)

Sample

@chaodonghu
chaodonghu / unfollow-everyone-instagram.js
Last active March 25, 2025 20:37
Google Chrome script that allows user to mass unfollow instagram users on user's profile
// Run GOOGLE CHROME - WORKING AS OF MARCH 23 2025
// Please @ me in the comments if this stops working, I will try to get it working again within the month
// INSTRUCTIONS
// 1. Open Instagram in Chrome
// 2. Click on "FOLLOWING" on your Instagram profile
// 3. Open developer tools by right clicking on the page and clicking "INSPECT"
// 4. Copy the code below and paste in the developer tools console and press enter to run
// 5. Script will not run if tab is navigated away from, minimized of unfocused (It is recommended to open a new chrome window or push tab to the side and let script run in background)
@johnnypea
johnnypea / useful-one-liners.sh
Last active March 30, 2025 17:21
Useful one liners
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
@e-lin
e-lin / glide.java
Created June 26, 2019 08:03
Glide Module - Cloud Storage for Firebase plugin
@GlideModule
class MyAppGlideModule : AppGlideModule() {
override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
// Register FirebaseImageLoader from FirebaseUI to handle StorageReference
registry.append(StorageReference::class.java, InputStream::class.java,
FirebaseImageLoader.Factory())
}
}
@patrickjh
patrickjh / CustomizedAndroidRunner.java
Last active April 2, 2023 21:08
Junit Retries annotation for Android
package whatever;
import android.app.Instrumentation;
import android.os.Bundle;
import android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
import android.support.test.internal.util.AndroidRunnerParams;
import org.junit.rules.TestRule;
import org.junit.runners.model.InitializationError;
// https://developers.cloudflare.com/workers/about/
// https://tutorial.cloudflareworkers.com
//
// A Service Worker which adds Security Headers.
// Checks:
// https://securityheaders.io/
// https://observatory.mozilla.org/
// https://csp-evaluator.withgoogle.com/
// https://hstspreload.org/
// https://www.ssllabs.com/ssltest/