Skip to content

Instantly share code, notes, and snippets.

View pineapplemachine's full-sized avatar
🍍
Is a pineapple

Sophie Kirschner pineapplemachine

🍍
Is a pineapple
View GitHub Profile
@pineapplemachine
pineapplemachine / pokeditor_csv_formatter.py
Last active October 9, 2022 17:47
PokEditor human-readable CSV formatter
"""
This is a script that can be used in conjunection with the PokEditor tool.
https://github.com/turtleisaac/PokEditor-v2
When using PokEditor locally, without online Google Sheets, game data is
represented in a set of CSVs in the `local/` subdirectory of the user's
chosen project directory.
These CSVs contain Excel-style Google Sheets formulas that are used to
@pineapplemachine
pineapplemachine / elden-vttbatch.py
Last active March 20, 2022 21:29
Batch speech-to-text Python script
"""
This script can be used to perform automated speech-to-text on every
*.ogg audio file in a directory, recursively.
This was written in order to help better document the items in the
`sounds` directory represented in Elden Ring's Data0.bhd archive file.
Here were the steps taken:
1. Extract files including sounds/pck/normal.pck from Data0.bhd in
@pineapplemachine
pineapplemachine / frag.glsl
Created November 6, 2021 23:01
MSDF fragment shader scratch
// This code is distributed under the Unlicense https://unlicense.org/
// In other words, I am releasing it as public domain.
// Reasonably well working MSDF fragment shader.
// Good discussion per shader: https://github.com/Chlumsky/msdfgen/issues/22
export const TextGlyphFragmentShader = `
precision mediump float;
// Contains MSDF glyph data
uniform sampler2D u_glyphTexture;
@pineapplemachine
pineapplemachine / mod-manager-2-dracula-bigger-fonts.qss
Last active May 22, 2025 16:40
Light edit of the "dracula.qss" style file included with Mod Organizer v2.2.2.1 to increase font size.
/*
* Drop background color of most widgets
*/
/*
* This is a light edit of the "dracula.qss" style file included with
* Mod Organizer v2.2.2.1.
*
* It increases the font size as well as the height of rows in lists and
* tables and such, making the interface much more readable on my display.
@pineapplemachine
pineapplemachine / lib.csv-stringifiers.abstract-concat.js
Created August 21, 2018 15:17
csv-writer performance and memory use comparison
// Put this file in `lib/csv-stringifiers` alongside `abstract.js`
'use strict';
const RECORD_DELIMITER = '\n';
class AbstractCsvStringifier {
constructor(params) {
this._fieldStringifier = params.fieldStringifier;
@pineapplemachine
pineapplemachine / watch.js
Created July 24, 2018 07:23
Simple watcher to run a shell command when a file changes
// Watch a file or directory recursively and run a shell
// command any time a change to that path is observed.
// Usage:
// node watch.js <path> <command>
// For example:
// node watch.js style.scss "sass style.scss style.css"
const childProcess = require("child_process");
const fs = require('fs');
@pineapplemachine
pineapplemachine / english-article.js
Created June 21, 2018 17:31
Determine with moderate confidence whether an English noun should be preceded by "a" or "an"
// Helper to determine if a noun should be preceded by "a" or "an".
// This should produce a sensible result in the majority of cases.
function englishArticle(noun){
if(!noun || typeof(noun) !== "string"){
return undefined;
}else if(noun.length === 1){
return "an";
}else if(noun.toUpperCase() === noun){
return "AEFHILMNORSX".indexOf(noun[0]) < 0 ? "a" : "an";
}else if("AEIOUaeiou".indexOf(noun[0]) >= 0){
// Draws an approximated phase diagram given a substance's triple point and critical point.
// Goto line 104 to use different inputs from the hydrogen example
class Material{
constructor(name, abbreviation, properties){
this.name = name;
this.abbreviation = abbreviation;
this.properties = properties;
this.triplePointKelvin = properties.triplePointKelvin;
this.triplePointPascals = properties.triplePointPascals;
@pineapplemachine
pineapplemachine / add-standard-labels.js
Created March 1, 2018 14:10
Add standard labels to a github repository
const axios = require("axios");
// The labels that will be added
const labels = [
{
"name": "effort: high",
"color": "7319e7",
"description": "The issue will probably take a single contributor several days of work to resolve."
},
{
@pineapplemachine
pineapplemachine / copy-labels.js
Last active March 2, 2018 11:02
Copy github labels with descriptions 01/03/2018
// Usage:
// This script can be used to copy the labels from one github repository to another.
// Enter the source and destination repository information toward the bottom of this
// source file, as well as an API access token with permission to view the source
// repository and to modify the target repository.
// WARNING: By default, the script will delete all the labels in the destination
// repository before copying them over from the source repository.
const axios = require("axios");