This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DeduplicationContext } from "./Context"; | |
import { App } from "../models/App"; | |
export class AppContext extends DeduplicationContext<App, ConstructorParameters<typeof App>> { | |
// These functions can be substituted with however you want to serialize/deserialize your classes. | |
// For this, I simply implemented a `serialize()` method that returns `ConstructorParameters<App>`. | |
// I have the same `serialize()` method for `User` as well. | |
protected decodeValue(encoded: ConstructorParameters<typeof App>): App { | |
return new App(...encoded); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Inventory, Item, SharedKit } from '../types/kit'; | |
import { decode, encode, toRGBA8 } from 'upng-js'; | |
let MCTEXTURES: Textures; | |
const INV_WIDTH = 181; | |
const INV_HEIGHT = 115; | |
const ITEM_WIDTH = 32; | |
const ITEM_HEIGHT = 32; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- For the sake of performance, I'm going to include everything into one file --> | |
<!doctype HTML5> | |
<head> | |
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1"> | |
<meta name=" author" content="Cole Crouter"> | |
<meta name="twitter:card" content="summary"> | |
<meta name="twitter:description" content="This is not the page you are looking for..."> | |
<meta name="twitter:image" | |
content="https://static.wikia.nocookie.net/minecraft_gamepedia/images/f/fc/Bucket_JE2_BE2.png/revision/latest/scale-to-width-down/160?cb=20200510234539"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
There's very little info on how to programmatically do bash autocomplete online, much less how to do it outside of | |
the bash language. I've used libraries, such as posener/complete, but they don't let you build autocomplete | |
behaviour how you want to. In my case, I'm using gRPC to get data from servers across the globe, so it doesn't make | |
sense to fetch *all* the info you *could* need, every time for both dynamic & static suggestions. Here I've made a | |
program that has static subcommands (predefined), but uses functions to get dynamic suggestion after that, such as | |
"'stop serverX' as long as serverX is online", where "stop" is static, but "serverX" is dynamic. To use this in | |
practice, you'll have to compile like this: | |
go build autocomplete.go | |
then add this command to your .bashrc or .zshrc: |