Skip to content

Instantly share code, notes, and snippets.

View drazisil's full-sized avatar
💭
Always Online - Somewhere

Molly Crendraven drazisil

💭
Always Online - Somewhere
View GitHub Profile
error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file '/home/drazisil/racebox/tools/database/package.json'. Supply the `rootDir` compiler option to disambiguate.
@drazisil
drazisil / bad.rs
Last active November 21, 2023 13:54
// This does not
// 1. Start by reading the encrypted session key and displaying it as an ascii string
let session_key = parsed_packet.get_encrypted_session_key();
debug!("Encrypted session key: {}", session_key);
// 2. Convert the ascii string to bytes
let session_key_bytes = hex::decode(session_key).unwrap();
export function TCPListener({
incomingSocket,
config,
log,
onSocketData = onSocketData,
onSocketError = onSocketError,
}: {
incomingSocket: ISocket;
config: TServerConfiguration;
log: TServerLogger;

Using JavaScript/JSDoc (not TypeScript), is there a way to document a class method as returning a generic type that extends a base type?

/** @extends {BaseType}
class SubType {
  /** @return {} */
  makeNew() {
    // return <T extends BaseType>
  }
}
Uncaught TypeError: log is not a function
FROM
Socket.onSocketError (file:///home/drazisil/mcos/packages/mcos-gateway/src/index.js:41:16)
Socket.emit (node:events:513:28)
Socket.emit (node:domain:489:12)
emitErrorNT (node:internal/streams/destroy:151:8)
emitErrorCloseNT (node:internal/streams/destroy:116:3)
process.processTicksAndRejections (node:internal/process/task_queues:82:21)
zsh: trace trap (core dumped)
@drazisil
drazisil / exampleActivityPubMessage.json
Last active January 17, 2023 01:57
An example ActivityPub JSON message
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
"conversation": "ostatus:conversation",
"sensitive": "as:sensitive",
"toot": "http://joinmastodon.org/ns#",
@drazisil
drazisil / bookmarklet.js
Created November 24, 2022 13:03 — forked from bramus/bookmarklet.md
Mastodon User Page Bookmarklet
javascript:(function(){
const MY_MASTO_LOCAL_DOMAIN = 'social.drazisil.com'; /* 👈 Change this value */
const MY_MASTO_WEB_DOMAIN = MY_MASTO_LOCAL_DOMAIN; /* 👈 Only change this value if your Masto host is hosted an different domain than the LOCAL_DOMAIN */
function tryAndGetUserName() {
/* Profile with a moved banner (e.g. https://mastodon.social/@bramus): follow that link */
const userNewProfile = document.querySelector('.moved-account-banner .button')?.getAttribute('href');
if (userNewProfile) {
return userNewProfile.substring(2);
}
5.5 Deflating - Method 8
------------------------
5.5.1 The Deflate algorithm is similar to the Implode algorithm using
a sliding dictionary of up to 32K with secondary compression
from Huffman/Shannon-Fano codes.
5.5.2 The compressed data is stored in blocks with a header describing
the block and the Huffman codes used in the data block. The header
format is as follows:
for f in $(apt-file search vim -l); dpkg-query --showformat='${binary:Package}\t${Status}' --show $f 2> /dev/null | grep " installed"
@drazisil
drazisil / log4j_minecraft.xml
Created April 2, 2020 19:14
My modified log4j config file for troubleshooting Minecraft, as of 1.15.2
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="com.mojang.util">
<Appenders>
<Console name="SysOut" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{HH:mm:ss.SSS}] [%t/%level]: %msg%n" />
</Console>
<Queue name="ServerGuiConsole">
<PatternLayout pattern="[%d{HH:mm:ss.SSS} %level]: %msg%n" />
</Queue>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">