Skip to content

Instantly share code, notes, and snippets.

@PhompAng
PhompAng / BetterAirlineClub.userscript.js
Last active June 11, 2024 04:18 — forked from aphix/BetterAirlineClub.userscript.js
Better Airline Club + Cost Per PAX Combined & Improved
// ==UserScript==
// @name Better Airline Club + Cost Per PAX Combined & Improved
// @namespace http://tampermonkey.net/
// @version 1.1.2
// @description Enhances airline-club.com and v2.airline-club.com airline management game (protip: Sign into your 2 accounts with one on each domain to avoid extra logout/login). Install this script with automatic updates by first installing TamperMonkey/ViolentMonkey/GreaseMonkey and installing it as a userscript.
// @author Aphix/Torus (original "Cost Per PAX" portion by Alrianne @ https://github.com/wolfnether/Airline_Club_Mod/)
// @match https://*.airline-club.com/
// @icon https://www.google.com/s2/favicons?domain=airline-club.com
// @downloadURL https://gist.githubusercontent.com/PhompAng/f00eb6f16aaaa5a32c9896b450fc73e0/raw/bca8ee0a256aa83f435e896df319439b8b124719/BetterAirlineClub.userscript.js
// @updateURL https://gist.githubusercontent.com/PhompAng/f00eb6f16aaaa5a32c9896b450fc73e0/raw/bca8ee0a256aa83f435e896df319439b8b12
@PhompAng
PhompAng / run-in-browser-console.js
Last active August 3, 2021 13:30 — forked from kmxz/run-in-browser-console.js
Script to add to gartic.io
const setNativeValue = (element, value) => {
const valueSetter = Object.getOwnPropertyDescriptor(element, 'value').set;
const prototype = Object.getPrototypeOf(element);
const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, 'value').set;
if (valueSetter && valueSetter !== prototypeValueSetter) {
prototypeValueSetter.call(element, value);
} else {
valueSetter.call(element, value);
}
fun isDebug(): Boolean {
return context.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0
}
@PhompAng
PhompAng / packageInfo_version_name.kt
Last active January 15, 2020 18:54
PackageInfo get version name
fun getAppVersionName(): String? {
return try {
val packageInfo = context.packageManager.getPackageInfo(applicationContext.packageName, 0)
packageInfo.versionName
} catch (e: PackageManager.NameNotFoundException) {
throw RuntimeException("Could not get package name: $e")
}
}
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
Techsauce | Tech and Biz Ecosystem Leader for Startups Technologies and Business
</title>
<script>
function getMobileOperatingSystem() {
import groovy.io.FileType
import groovy.text.SimpleTemplateEngine
// Adapted from http://stancalau.ro/java_package-info_generator_gradle/
def generatedPackageInfoDir = "$buildDir/generated/package-info"
// Handle Android projects
if (project.plugins.hasPlugin("android")) {
android.sourceSets.main.java.srcDirs generatedPackageInfoDir
}