This file contains 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 { Request, NextFunction } from 'express' | |
interface JsonResponse<T> { | |
status(code: number): JsonResponse<T> | |
json(value: T): JsonResponse<T> | |
} | |
type JsonHandler<T> = ( | |
req: Request, | |
res: JsonResponse<T>, |
This file contains 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
package com.javadocmd.drawing; | |
import com.badlogic.gdx.ApplicationAdapter; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.Input; | |
import com.badlogic.gdx.InputAdapter; | |
import com.badlogic.gdx.files.FileHandle; | |
import com.badlogic.gdx.graphics.Color; | |
import com.badlogic.gdx.graphics.GL20; | |
import com.badlogic.gdx.graphics.Pixmap; |
This file contains 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 { Transform } from 'stream' | |
import { StringDecoder } from 'string_decoder' | |
const split = (r: RegExp = /\r?\n/) => { | |
const enc = 'utf8' | |
const dec = new StringDecoder(enc) | |
let prev: string = '' | |
return new Transform({ | |
defaultEncoding: enc, | |
transform(chunk, e, callback) { |
This file contains 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 { default as Socket } from 'socket.io-client' | |
// dependencies: socket.io-client | |
// Usage example: | |
// $ node ./dist/index.js "Philly Pies" | espeak-ng -v en-us -s 120 | |
function main() { | |
const team = process.argv[2] || 'Philly Pies' | |
const socket = Socket('https://blaseball.com') |
This file contains 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
using UnityEngine; | |
using UniRx; | |
using UniRx.Triggers; | |
// NOTE: Unity won't actually let you put two MonoBehaviours in one file. | |
// They're both listed here just for convenience. | |
namespace Assets.Scripts.v2 { | |
public class InputsV2 : MonoBehaviour { |
This file contains 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
#!/usr/bin/env python | |
import os, subprocess, json | |
# Get all bookmarks matching the given name(s) | |
def get_bookmarks(profile_dir, names): | |
with open(os.path.join(profile_dir, 'Bookmarks')) as f: | |
j = json.load(f) | |
results = [] | |
# There are two root-level bookmark folders: one for the bookmark bar and one for all others. |
This file contains 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
using UnityEngine; | |
using UniRx; | |
using UniRx.Triggers; | |
namespace Assets.Scripts.v3 { | |
public class InputsV3 : MonoBehaviour { | |
// Singleton. | |
public static InputsV3 Instance { get; private set; } |
This file contains 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
/* | |
Copyright 2022 Tyler Coles (javadocmd.com) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains 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
/* | |
Copyright 2022 Tyler Coles (javadocmd.com) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains 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
/* | |
Copyright 2022 Tyler Coles (javadocmd.com) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |