Skip to content

Instantly share code, notes, and snippets.

Avatar
🔋
Professional battery includer

Sage Gerard zyrolasting

🔋
Professional battery includer
View GitHub Profile
@zyrolasting
zyrolasting / hello.rkt
Created Jan 11, 2021
For use in a Xiden example
View hello.rkt
#lang racket/base
(provide say-hello)
(define (say-hello)
(displayln "Hello!"))
View tcp.rkt
#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))
View tcp-tls.rkt
#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))
@zyrolasting
zyrolasting / html-elements.txt
Last active Sep 29, 2019
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.
View html-elements.txt
a
abbr
acronym
address
applet
area
article
aside
audio
b
@zyrolasting
zyrolasting / print-simple-bank-support-thread.md
Last active Jul 20, 2019
Printer-friendly support threads on Simple bank
View print-simple-bank-support-thread.md

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 Sep 11, 2018
Useful .gitconfig
View .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 Aug 26, 2018
Racket koans lang, with bug
View racket-koans-lang.rkt
#lang racket
(require rackunit)
;; Blanks are exactly five contiguous underscores in source.
(define blank '_____)
;; Recursively search for a non-list element in a list.
View 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 Nov 16, 2016
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
View whoknows.py
#!/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: