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
/** | |
* Parse Express Router Layers into something usable, with | |
* formatted paths, parameters lists, and ancestry tracking. | |
*/ | |
/** | |
* A "reduced layer", the output of `reduceStack`. Has | |
* simplified information in it. | |
*/ | |
export interface ReducedLayer { |
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
/** | |
* Wrap a web storage with a prefix. | |
* @author Michael Fedora | |
* @link https://gist.github.com/MichaelFedora/031e1ec7a3df736b2b004d6b437e526e | |
*/ | |
export class WrappedStorage implements Storage { | |
#store: Storage; | |
#prefix: string; | |
#key(k: string): string { return `${this.#prefix}_${k}`; } |
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
export interface TinyRequest { | |
// CORE (std) | |
url: string; | |
method: string; | |
headers: Headers; | |
json<T = unknown>(): Promise<T>; | |
text(): Promise<string>; |
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
<template> | |
<transition name='fade'> | |
<div v-if='active' | |
class='modal is-active' | |
:class='{ [type]: true }' | |
role='dialog' | |
aria-modal='true'> | |
<div class='modal-background' @click='cancel()'></div> | |
<div class='modal-card'> | |
<header v-show='title'> |
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
[ | |
{ | |
"id": 2, | |
"name": "Oree", | |
"type": ["Digital"], | |
"stats": { | |
"hp": 0, | |
"sta": 0, | |
"spd": 0, | |
"atk": 0, |
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 { r, RTable } from 'rethinkdb-ts'; | |
import { Store } from 'express-session'; | |
import { getLogger, Logger } from '@log4js-node/log4js-api'; | |
export class SessionEntry { | |
id: string; | |
expires: Date; | |
session: Express.SessionData; | |
} |
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
const fs = require('fs-extra'); | |
const path = require('path'); | |
/** | |
* Get's the size of a file or directory. | |
* | |
* @param {string} p The path to the file or directory | |
* @returns {number} | |
*/ | |
function sizeSync(p) { |
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
/** | |
* PlayCanvas Engine Typings | |
* | |
* Use it by downloading and placing both this and `playcanvas-stable.js` in the same directory. | |
* | |
* (c) 2017 Michael Fedora (michaelfedora.github.io) | |
* Licensed under MIT. | |
*/ | |
type DomKeyboardEvent = KeyboardEvent; |
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
(async () => { | |
let foo = (i: number): [number, Promise<any>] => { | |
switch(i) { | |
case 0: return [4, import('./test')]; | |
default: return [0, Promise.resolve(null)]; | |
} | |
} | |
const res = foo(0); | |
console.log(res[0], await res[1]); | |
// should output `4 { default: { greeting: 'Hello World!' } }` |
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
/* | |
This happens after writing to the sign, though the DataTransactionResult says it succeeds, I don't think it does (have to double-check). | |
The first one happens when secondary(right)-clicking the sign. | |
The second one then happens every so often afterwards. | |
After restarting the server, there is no sign-text anymore. | |
This is my plugin, Fedora's Market, built off of Sponge 4.1.0-SNAPSHOT, JDK 1.8.0_77. | |
The server is running on Forge 1764, Sponge 4.0.3. | |
*/ | |
[17:27:03] [Server thread/FATAL]: Error executing task |