Skip to content

Instantly share code, notes, and snippets.

@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
Created April 29, 2022 19:45
CloudFlare Worker for MTA-STS policy
const mode= 'testing';
//const mode= 'enforce';
const max_age= 604800; // 1 week
const mx_list = [
'aspmx.l.google.com'
,'aspmx2.googlemail.com'
,'aspmx3.googlemail.com'
,'aspmx4.googlemail.com'
,'aspmx5.googlemail.com'
,'alt1.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 December 28, 2023 06:52
Jetpack Compose Expandable Search Bar (Top Bar)

Sample

@chaodonghu
chaodonghu / unfollow-everyone-instagram.js
Last active April 19, 2024 18:10
Google Chrome script that allows user to mass unfollow instagram users on user's profile
// Run GOOGLE CHROME - WORKING AS OF DEC 26 2023
// 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 April 22, 2024 14:56
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/
@jaymollica
jaymollica / README.md
Last active April 6, 2024 18:21
Emojis to Words

Emojis to Words

  1. json encode an emoji to get its surrogate pair
$surrogate_pair = json_encode(🌊);
print $surrogate_pair; //"\ud83c\udf0a"
  1. The surrogate pair is the key in the array, check if the key exists and send back the associated keyword. The $emojis_to_words variable is an array you need to include in your project.