Skip to content

Instantly share code, notes, and snippets.

View threethan's full-sized avatar

Ethan M threethan

  • USA - Massachusetts - Near Boston
View GitHub Profile
@threethan
threethan / ViewFlinger.java
Last active November 18, 2024 01:35
[Updated 2024] ViewFlinger - An android view flipper component with support for touch or mouse, looping, auto-advance, and page indicators.
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@threethan
threethan / DataStoreEditor.java
Last active September 19, 2024 22:18
An easy to use Java-only wrapper for Android DataStores which can be used to migrate from SharedPreferences
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.preference.PreferenceManager;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
// ==UserScript==
// @name Subpixel Kerning for Google Docs (Firefox Only!)
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Enables subpixel kerning on the content of google docs. Includes an automatic dark mode, see code comments for Dark Reader compatibility.
// @author threethan
// @match https://docs.google.com/document/*
// @icon https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico
// @grant none
// ==/UserScript==
@threethan
threethan / compress.sh
Created April 9, 2023 09:54
Compress Godot HTML5 export with gunzip for smaller file size
#!/bin/bash
### usage ./convert.sh game
## where game is baseName of the export
# Based on https://gist.github.com/natrim/1a19f4b7668e0474897f3f28171f3b33
# wish revisions from https://gist.github.com/natrim/1a19f4b7668e0474897f3f28171f3b33?permalink_comment_id=4108811#gistcomment-4108811
if [ ! "$1" ]; then
read -p 'Game name: ' game
else
@threethan
threethan / userChrome.css
Last active March 3, 2023 00:31
Windows 11 Styled Right-Click Menu for FireFox (userChrome tweak)
/*
* Makes the right-click menu in FireFox look like windows 11's native right click menus
*
* Add as your userChrome.css or append to an existing one
* https://www.reddit.com/r/firefox/wiki/userchrome/
*
* Created for Firefox 111 but should work with future versions
*/
menupopup {