Skip to content

Instantly share code, notes, and snippets.

View manchuwook's full-sized avatar
💭
I may be slow to respond.

Steven Altsman manchuwook

💭
I may be slow to respond.
View GitHub Profile
@manchuwook
manchuwook / generate_tls_secret.js
Last active March 12, 2024 18:48
Generate a kubernetes secret yaml using a certificate
const fs = require('fs');
const path = require('path');
function encodeFileContent(filePath) {
return new Promise((resolve, reject) => {
fs.readFile(filePath, { encoding: 'base64' }, (err, data) => {
if (err) {
reject(`Error reading file ${filePath}: ${err}`);
} else {
resolve(data);
@manchuwook
manchuwook / background-check.schema.json
Created September 11, 2023 00:40
background-check for characters
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"basicInformation": {
"type": "object",
"x-label": "Basic Information",
"properties": {
"basicInfo": {
"description": "What is the character’s age, sex, ethnicity? Describe {{possPronoun}} physical appearance (hair and eye color; body build; skin tone; height and weight; unique features such as glasses, scars, dimples, etc.).",
@manchuwook
manchuwook / tarot.json
Created September 5, 2023 03:30
Tarot JSON
{
"majorArcana": [
{
"name": "The Fool",
"cardNumber": 1,
"symbols": [
"A man standing at the edge of a cliff",
"A barking dog"
],
"description": "The Fool represents new beginnings, having faith in the future, being inexperienced, not knowing what to expect, having beginner's luck, improvisation and believing in the universe to provide.",
@manchuwook
manchuwook / emphasis.txt
Last active June 4, 2023 19:58
A list of phrases to use for your ML vocal training.
She said she loved him
Only she said she loved him.
She only said she loved him.
She said only she loved him.
She said she only loved him.
She said she loved only him.
She said she loved him only.
@manchuwook
manchuwook / tag.txt
Created May 12, 2023 21:40
Regex for tags
Apologies for the confusion. If you only want to encode `<` and `>` characters that are not part of XML tags, you can modify the regex and the encoding logic. Here's an updated example:
```javascript
const text = "<example>Some text with <tag> and > symbol</example>";
// Regular expression to match '<' or '>' not followed by an XML tag
const regex = /(<(?!\/?[a-zA-Z]+\b)[^>]*>)|([<>])/g;
// Function to encode the matched characters
function encodeNonXmlTags(match, xmlTag) {
@manchuwook
manchuwook / character.schema.json
Created March 20, 2023 13:07
character.schema.json
"personalLife": {
"description": "Friends, allies, rivals, enemies, superiors, romantic partners, role models, influence among them all",
"type": "array",
"items": {
"type": "string"
}
},
"portrait": {
"type": "string"
},
@manchuwook
manchuwook / tarot.schema.json
Last active March 16, 2023 19:56
Data for tarot cards sourced from ChatGPT
{
"type": "object",
"x-stoplight": {
"id": "4254907af0db3"
},
"x-examples": {
"data": {
"majorArcana": [
{
"name": "The Fool",
@manchuwook
manchuwook / sample.mjs
Last active January 25, 2023 14:29
Stoplight @stoplight/json
import { parseWithPointers, safeParse, safeStringify } from "@stoplight/json";
const result = parseWithPointers(`{
"hello": "world",
"address": {
"street": 123
}
}`);
console.log(result.data);
console.log(result.pointers); // Returns undefined
@manchuwook
manchuwook / app.module.ts
Last active July 26, 2020 21:40
Creating a TypeORM entity and using it in a module
// tslint:disable: quotemark
// modules
import { Module } from '@nestjs/common';
import { CharacterModule } from './character/character.module';
import { CampaignModule } from './campaign/campaign.module';
import { PlayerModule } from './player/player.module';
import { SageModule } from './sage/sage.module';
import { TypeOrmModule } from "@nestjs/typeorm";
import { Connection } from 'typeorm';
hostname: guiltygear4
k3os:
data_sources:
- gcp
- cdrom
modules:
- kvm
- nvme
dns_nameservers: