Skip to content

Instantly share code, notes, and snippets.

View zyrolasting's full-sized avatar
🔋
Professional battery includer

Sage Gerard zyrolasting

🔋
Professional battery includer
View GitHub Profile
@zyrolasting
zyrolasting / hello.rkt
Created January 11, 2021 19:25
For use in a Xiden example
#lang racket/base
(provide say-hello)
(define (say-hello)
(displayln "Hello!"))
#lang racket/base
(require racket/tcp
openssl)
(define port 8080)
(define test.pem (collection-file-path "test.pem" "openssl"))
(define (serve .pem handle)
(define main-cust (make-custodian))
#lang racket/base
(require racket/tcp)
(define port 8080)
(define (serve handle)
(define main-cust (make-custodian))
(parameterize ([current-custodian main-cust])
(define listener (tcp-listen port 5 #f))
@zyrolasting
zyrolasting / html-elements.txt
Last active September 29, 2019 23:04
Sometimes I need a complete list of HTML elements, old and new, ungrouped. Obsolete/deprecated elements included. Here it is in case you need it too.
a
abbr
acronym
address
applet
area
article
aside
audio
b
@zyrolasting
zyrolasting / print-simple-bank-support-thread.md
Last active July 20, 2019 14:35
Printer-friendly support threads on Simple bank

Here's a messy yet working way to print support threads from Simple Bank. I don't make the printed thread look the same, I only put the messages and ONLY the messages in chronological order.

The method below may no longer work when the Simple site updates. Please ping me here or on Reddit (u/vzen) if this page needs updating.

Quick and easy, and bad-habit forming

BEWARE!! In 100% of circumstances it is a huge, nasty, no-good, blood-red flag for a stranger on the internet like me to ask you to run arbitrary code with your bank portal visible. But because not everyone reading this page is an engineer, I have to make this easy somehow. Just do NOT trust me off the bat. You really should read on to see how I break this code down and show you what each instruction does in plain English.

But for convenience of less-technically inclined users, you can do one of two things:

@zyrolasting
zyrolasting / .gitconfig
Created September 11, 2018 14:09
Useful .gitconfig
[user]
name = Your Name
email = your.name@example.com
[alias]
co = checkout
br = branch
st = status
ci = commit
ca = commit --amend --no-edit
fr = !git fetch && git rebase
@zyrolasting
zyrolasting / racket-koans-lang.rkt
Created August 26, 2018 22:28
Racket koans lang, with bug
#lang racket
(require rackunit)
;; Blanks are exactly five contiguous underscores in source.
(define blank '_____)
;; Recursively search for a non-list element in a list.
@zyrolasting
zyrolasting / keybase.md
Created October 24, 2017 13:48
keybase.md

Keybase proof

I hereby claim:

  • I am zyrolasting on github.
  • I am sagegerard (https://keybase.io/sagegerard) on keybase.
  • I have a public key ASA3riuqNJ_L2VYMHXtrswWX-i-i7gi21PBnKdW-G4wj0Qo

To claim this, I am signing this object:

@zyrolasting
zyrolasting / whoknows.py
Created November 16, 2016 01:32
List Git author name with highest number of commits for paths matching given glob. Used to deduce good first contacts when researching parts of big projects
#!/usr/bin/env python
import os, subprocess, sys, glob
"""
Big teams with little documentation use oral history to share knowledge.
This script tells you the authors with the most Git commits for each path
matching a given glob, so that you might have a good first contact when
learning about a part of a project from a bird's eye view.
I find this useful in my jobs, but there are caveats: