Skip to content

Instantly share code, notes, and snippets.

View treyharris's full-sized avatar

Trey Harris treyharris

View GitHub Profile
@treyharris
treyharris / michio-and-michiko.fountain
Last active January 7, 2023 02:43
A ChatGPT-generated screenplay: Michio and Michiko — Click “Raw” to avoid sideways scrolling
Title:
_**Michio and Michiko**_
Credit: written and directed by
Author: Chad Jeept
Source: Based on the novel by Toni Morrison
Copyright: (c) 2003 Columbia Pictures
Date: 2022
====
@treyharris
treyharris / jitai.user.js
Last active November 30, 2022 00:14 — forked from obskyr/jitai.user.js
Jitai (字体): A fairly full-featured font randomizer for WaniKani.
// ==UserScript==
// @name Jitai
// @version 1.3.2
// @description Display WaniKani reviews in randomized fonts, for more varied reading training.
// @author Samuel (@obskyr)
// @copyright 2016-2018, obskyr
// @license MIT
// @namespace http://obskyr.io/
// @homepageURL https://gist.github.com/obskyr/9f3c77cf6bf663792c6e
// @icon http://i.imgur.com/qyuR9bD.png
@treyharris
treyharris / syntax-highlighting.md
Created October 3, 2022 20:54
Java syntax highlighting
String name = "asdf";
int numberOne = 0;

System.out.println("hello world!"); // "hello world!\n"
System.out.print("hello world!"); // "hello world!"

Let's try some quotes:

This is a quote 1.

This is a quote 2. Can I go back to quote 1? No, because Markdown doesn't allow that.

Can I go to quote 3? Yes. But how about quote 1 again? Nope—you can never go back a level.

That's unfortunately just how Markdown works.

@treyharris
treyharris / output.console
Created July 26, 2021 17:54
Playing with Raku Rat and sqrt
rat's type is Rat
z's type is Rat
13 6 squared= 169 36
Rat(169 36)'s sqrt, 2.1666666666666665, is a Num, but coerced, is Rat(13 6)
@treyharris
treyharris / README.md
Last active July 17, 2021 21:30
The shortest possible HTML5 validatable without warnings?

In search of the shortest HTML5 document

I was curious what wass the minimum-allowed HTML5 document. I think it is (neglecting newlines and indention whitespace, which are deleted to make the document shorter in character length):

<!doctype html>
<html lang>
  <title>
 .

ediff org files…

Annoyingly, ediff tends to fire up org-mode files folded, which makes it impossible to see the hunks. A fix from Rémi Vanicat:

;; diff hooks for org mode
(add-hook 'ediff-select-hook 'f-ediff-org-unfold-tree-element)
(add-hook 'ediff-unselect-hook 'f-ediff-org-fold-tree)
;; Check for org mode and existence of buffer
2020-02-03 09:40:54 Geth ¦ doc/str-version: 0efcb72704 | (Stoned Elipot)++ | doc/Type/Str.pod6
2020-02-03 09:40:54 Geth ¦ doc/str-version: Document Str.Version
2020-02-03 09:40:54 Geth ¦ doc/str-version: review: https://github.com/Raku/doc/commit/0efcb72704
2020-02-03 09:42:13 Geth ¦ doc: stoned++ created pull request #3197: Document Str.Version
2020-02-03 09:42:14 Geth ¦ doc: review: https://github.com/Raku/doc/pull/3197
2020-02-03 12:27:45 Geth ¦ doc/str-version: 038fd29668 | (Stoned Elipot)++ | doc/Type/Str.pod6
2020-02-03 12:27:45 Geth ¦ doc/str-version: Add version information for Str.Version
2020-02-03 12:27:45 Geth ¦ doc/str-version: review: https://github.com/Raku/doc/commit/038fd29668
2020-02-03 12:34:14 Geth ¦ doc: 0efcb72704 | (Stoned Elipot)++ | doc/Type/Str.pod6
2020-02-03 12:34:14 Geth ¦ doc: Document Str.Version
#!/usr/bin/env raku
class B {
method foo(B:U: --> Str) { "Bee" }
}
say B.foo;
my B $b;
say $b.foo;
$b.new;
# moshPids is an array of pids
for p in $moshPids; do
if [[ -n $interactive ]]; then
stty -echo
read -q "answer?Kill $p? (N/y)"
stty echo
echo >&2
[[ "${answer}" == 'n' ]] && continue
fi
# do_kill set to print “killing $1” in debug