Skip to content

Instantly share code, notes, and snippets.

View JKirchartz's full-sized avatar
🤖

Joel Kirchartz JKirchartz

🤖
View GitHub Profile
@JKirchartz
JKirchartz / QA-framework.bash
Created February 26, 2019 16:30
A simple "google forms"-style question and answer framework for BASH.
#! /bin/bash
#
# QA-framework.bash
# Copyright (C) 2019 jkirchartz <me@jkirchartz.com>
#
# Distributed under terms of the NPL (Necessary Public License) license.
#
# A simple "google forms"-style way to survey people via bash
#
# usage:
@JKirchartz
JKirchartz / fake_shell.sh
Created December 26, 2018 18:49
make your own fake shell in bash
#!/bin/bash
function parser {
shopt -s nocasematch
case "$*" in
exit) exit 0;;
echo*) shift; echo $*;;
*) figlet $* | lolcat;;
esac
}
@JKirchartz
JKirchartz / convert.js
Last active April 2, 2022 06:34
Toots Against Humanity Generator
let fs = require('fs');
fs.readFile('full.md.json', function(err, data) {
if ( err ) {
console.err(err);
return;
}
data = JSON.parse(data.toString());
var output = { white: [], black: [] , subtext: [] , origin: ["{cut Toots Against Humanity}#black#", "{cut Toots Against Humanity}#black#\n\n#subtext#"]};
@JKirchartz
JKirchartz / jkirchartz_exe.js
Created October 14, 2018 04:29
Javascript to manipulate image in @jkirchartz_exe
var text = document.getElementById('text');
text.setAttribute('textLength', Math.round(text.clientWidth / 1.1));
text.style.fontSize = Math.round(text.clientWidth / text.textContent.length) + 'px';
var img=document.getElementById('image');
img.onload=function(){
var svg=document.getElementById('svg');
svg.height=img.naturalHeight;
svg.width=img.naturalWidth;
};
@JKirchartz
JKirchartz / Makefile
Last active August 22, 2018 03:49
A simple publishing platform for tilde.town ~ clone this into a "drafts" or "src" directory in your home directory, write markdown files here, and run `make` to publish them to your tilde site.
SHELL = /bin/bash
sources := $(wildcard *.md)
objects := $(patsubst %.md,%.html,$(subst $(source),$(output),$(sources)))
all: $(objects)
%.html: %.md
pandoc --template layout.html5 --standalone --smart --to html5 -o $@ $<
mv *.html ../public_html/
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
# Ely Golden, Jun 14 2018
def recaman(n):
seq = []
for i in range(n):
if(i == 0): x = 0
else: x = seq[i-1]-i
@JKirchartz
JKirchartz / convert.sh
Created July 28, 2018 21:55
Convert hpi files into pngs -- based on Ed Halley's Method: http://www.halley.cc/ed/linux/interop/hemera.html
#! /bin/sh
# depends on ImageMagick 6.8.9-9
for name in *.hpi; do
echo $name
# split hpi into component jpg & png
./split.py $name
@JKirchartz
JKirchartz / Enkiv2-Sketchify.py
Created April 9, 2018 12:52
Enkiv2's Sketchify script
#!/usr/bin/env python
import sys, os
from PIL import Image, ImageOps, ImageChops, ImageFont, ImageDraw, ImageFilter
# Make an image more closely resemble a pen drawing, with optional shading and coloring
def sketchify(sourceImage, colorized=True, sketchOnly=False):
sketch=ImageOps.invert(ImageOps.autocontrast(sourceImage).filter(ImageFilter.FIND_EDGES))
if sketchOnly:
return sketch
if(colorized):
7/27/1978
When I was 18... 18 years old, I saw for the first time in my life... I saw an image of clarity. I saw a comic strip... a three panel comic strip that, though simple as it seemed, changed me... changed my being, changed who I am... Made me who I am...
Enlightened me...
The strip, Garfield, the comic strip was new... no more than maybe a month and a half since inception, since... since coming into existence... and there it was before me in print, I saw it... a comic strip... What was it called?
Garfield.
@JKirchartz
JKirchartz / principia+discordia.json
Created August 24, 2017 14:46
Discordian Word List(s) For Tracery (Taken from the Principia Discordia and another more complete corpus, by @enkiv2, adapted for tracery by myself)
{
"principia": [
"eris",
"poee",
"1",
"2",
"5",
"3",
"4",
"discordian",