Skip to content

Instantly share code, notes, and snippets.

Joel Kirchartz JKirchartz

Block or report user

Report or block JKirchartz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git-rename.sh
#! /bin/sh
#
# under aliases, add `rename = !~/path/to/git-rename/.sh`
# then to rename the current branch use `git rename <new branch name>`
#
old_branch=$(git rev-parse --abbrev-ref HEAD);
new_branch="$@"
git branch -m $old_branch $new_branch # Rename branch locally
@JKirchartz
JKirchartz / QA-framework.bash
Created Feb 26, 2019
A simple "google forms"-style question and answer framework for BASH.
View QA-framework.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 Dec 26, 2018
make your own fake shell in bash
View fake_shell.sh
#!/bin/bash
function parser {
shopt -s nocasematch
case "$*" in
exit) exit 0;;
echo*) shift; echo $*;;
*) figlet $* | lolcat;;
esac
}
View convert.js
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 Oct 14, 2018
Javascript to manipulate image in @jkirchartz_exe
View jkirchartz_exe.js
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 Aug 22, 2018
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.
View Makefile
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/
View RacamanSequence.py
#! /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 Jul 28, 2018
Convert hpi files into pngs -- based on Ed Halley's Method: http://www.halley.cc/ed/linux/interop/hemera.html
View convert.sh
#! /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 Apr 9, 2018
Enkiv2's Sketchify script
View Enkiv2-Sketchify.py
#!/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):
View The Pipe Transcript
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.
You can’t perform that action at this time.