Skip to content

Instantly share code, notes, and snippets.

View afkvido's full-sized avatar
:electron:
rush

gemsvidø afkvido

:electron:
rush
View GitHub Profile
@afkvido
afkvido / polyfill.js
Created March 1, 2023 23:17
Ensures that the webpage has all JavaScript standard library features, and loads them if it doesn't. (using core-js)
(async()=>{eval(await(await fetch("https://cdn.jsdelivr.net/npm/core-js-bundle/minified.min.js")).text())})();
@afkvido
afkvido / dirname.ts
Last active February 28, 2023 21:14
EMCAscript fill for CommonJS __dirname.
import path from "path";
import { fileURLToPath } from "url";
const dirname : string = path.resolve(fileURLToPath(import.meta.url), "../..");
export default dirname;
@afkvido
afkvido / tsconfig.json
Last active February 28, 2023 21:15
TypeScript config for quickstarting prototype.
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
"incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
"tsBuildInfoFile": "./dist/.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
@afkvido
afkvido / StringMatch.kt
Last active February 28, 2023 21:16
Capture one RegEx match from a String in Kotlin.
/** Captures a String from a regex */
fun String.match (regex : String) : String {
return this.match(Regex(regex))
}
/** Captures a String from a regex */
fun String.match (regex : Regex) : String {
val x : String? = regex.find(this)?.value
return if (x !== null) x else ""
}
@afkvido
afkvido / Fetch.kt
Last active February 28, 2023 21:16
Read data from URL in Kotlin.
import java.net.URI
import java.net.URL
import java.util.*
/** Get text from an online resource */
fun fetch (url : URL) : String {
println("Fetching resource from $url")
return Scanner(url.openStream(), "UTF-8").useDelimiter("\\A").next()
}
According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and yellow!
Let's shake it up a little.
Barry! Breakfast is ready!
Coming!
Hang on a second.
Hello?
<!DOCTYPE html>
<html>
<head>
<title>
<!--This is what will be displayed at the top of your page-->
</title>
</head>
<body>
<h1>This is a Heading</h1>
@afkvido
afkvido / soon.md
Created February 17, 2022 22:56
Coming soon gist

Coming Soon™

@R1DD1387
R1DD1387 / Prodigy Mod Menu V.1
Created February 28, 2020 12:37
Modmenu for the game Prodigy
function closeit(){
prodigydiv.remove()
}
setTimeout("closeit", 3000);
function getallCurrencies() {
PIXI.game.prodigy.player.backpack.data.currency=[]
x = PIXI.game.state.states.Boot._gameData.currency
for (i in x) {
PIXI.game.prodigy.player.backpack.data.currency[i] = {"ID": x[i].ID, "N": 9999999999}
}