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 / soon.md
Created February 17, 2022 22:56
Coming soon gist

Coming Soon™

This file has been truncated, but you can view the full file.
function _optionalChain(ops) {
let lastAccessLHS = undefined;
let value = ops[0];
let i = 1;
while (i < ops.length) {
const op = ops[i];
const fn = ops[i + 1];
i += 2;
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
return undefined;
@afkvido
afkvido / game.min.js@2-0-0.js
Created July 30, 2022 02:37
Prodigy game.min.js version 2-0-0
This file has been truncated, but you can view the full file.
!function(t,e){for(var i in e)t[i]=e[i]}(window,function(t){var e={};function i(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,a){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:a})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1033)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a,n=i(166),o=i(2),r=i(4),s=i(13);!function(t){t[t.UserID=0]="UserID",t[t.ClassID=1]="ClassID",t[t.Grade=2]="Grade"}(a=e.SplitTestType||(e.SplitTestType={}));var l=function(){function t(){}return t.capitalize=function(e){return t.isValid(e)?e.charAt(0).toUpperCase()+e.slice(1):""},t.setCookie=function(t,e,i){var a=new Date;a.setTime(a.getTime()+24*i*60*60*1
@afkvido
afkvido / ProdigyHacks.bat
Last active March 1, 2023 23:08
Hacks for Prodigy, the math game. GUI and Windows supported.
@echo OFF
SET ProdigyAccesWrapper=px20z
@rem start https://math.prodigygame.com?wrap=%ProdigyAccesWrapper%
@rem SET ProdigyLoader="prod"
@rem SET ProdigyLoader="ig"
SET ProdigyLoader=gy
SET cheatGUIheightENUMvalueONLY=.short
@afkvido
afkvido / DeltaMath-main.js
Created August 26, 2022 19:49
Unminified source code of delta math
This file has been truncated, but you can view the full file.
(window.webpackJsonp = window.webpackJsonp || []).push([
[2], {
"+auO": function(t, e, n) {
var i = n("XKFU"),
r = n("lvtm");
i(i.S, "Math", {
cbrt: function(t) {
return r(t = +t) * Math.pow(Math.abs(t), 1 / 3)
}
})
@afkvido
afkvido / NoEcho.sh
Last active February 28, 2023 21:17
Remove functionality of echo and print for some reason.
echo () { }
print () { }
@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()
}
@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 / JavalinCORS.kt
Last active February 28, 2023 21:12
A simple method to allow all origins to access your Javalin server.
val app = Javalin.create().start(7070)
app.before { ctx ->
ctx.header("Access-Control-Allow-Origin", "*") // Allow CORS
}
app.get("/") {
ctx -> ctx.result("Hello World")
}
@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. */