Skip to content

Instantly share code, notes, and snippets.

View tjstankus's full-sized avatar

TJ Stankus tjstankus

  • Chapel Hill, NC
View GitHub Profile
@tjstankus
tjstankus / wordle-nyt-possible-solutions.txt
Last active January 3, 2024 12:33 — forked from cfreshman/wordle-nyt-answers-alphabetical.txt
(NO LONGER ACCURATE - NYT now curates answers per-day, see all possible guesses https://gist.github.com/cfreshman/d97dbe7004522f7bc52ed2a6e22e2c04). NYTimes Wordle answers from source code in alphabetical order. Additional allowed guesses (12546 words as of 9/2): https://gist.github.com/cfreshman/d5fb56316158a1575898bba1eed3b5da (original: https…
aback
abase
abate
abbey
abbot
abhor
abide
abled
abode
abort
@tjstankus
tjstankus / wordle-nyt-allowed-guesses.txt
Last active January 3, 2024 12:30 — forked from cfreshman/wordle-nyt-words-14855.txt
NYT now curates Wordle answers per-day (as of 2022-11-07), so there's no static list of answers. This is the latest list (as of 2023-03-27) of all possible guesses, which includes the previous static answer list. Past: guesses https://gist.github.com/cfreshman/d5fb56316158a1575898bba1eed3b5da answers https://gist.github.com/cfreshman/a7b776506c7…
aahed
aalii
aapas
aargh
aarti
abaca
abaci
aback
abacs
abaft
@tjstankus
tjstankus / outliner.vim
Last active February 16, 2022 05:05
outliner.vim
" these settings work well for a simple outliner, indented with tabs
" nvim -S outliner.vim
set ai
set backspace=2
set foldmethod=indent
set noexpandtab
set nosmarttab
set softtabstop=0
set breakindent
set list
@tjstankus
tjstankus / petal.md
Last active January 17, 2021 15:46
Notes and annotations for article PETAL: the end-to-end web stack
# - [x] Display dialog at end
# - [x] Display dialog return value
# - [x] Capture output from dialog
# - [x] Actually snooze the timer
# - [ ] Smart update the UI
channel = Channel(String).new
now = Time.local
ends_at = now + 5.seconds
@tjstankus
tjstankus / fibonacci.cr
Created November 18, 2019 23:01
Fibonacci numbers in Crystal - concurrent and non-concurrent
def fib(n)
return n if n <= 1
fib(n-1) + fib(n-2)
end
######################################################
# Concurrent version:
# $: crystal build --release fibonacci.cr
# $: time ./fibonacci
# 701408732
defmodule CountdownSong do
def song(%{upper: upper, lower: lower}, verse_template) do
verses(upper, lower, verse_template)
end
def verses(upper, lower, verse_template) do
upper..lower
|> Enum.map(fn n -> verse(n, verse_template) end)
|> Enum.join("\n")
end
class Integer
def to_roman
RomanNumeral.for(self)
end
end
class RomanNumeral
ARABIC_ROMAN = {
1000 => 'M',
500 => 'D',
@tjstankus
tjstankus / examples.rb
Last active October 26, 2015 02:43
Functional Ruby
# - Reusable, immutable objects
# - Inject dependencies in constructor
class UserQuery
attr_reader :query
def initialize(query)
@query = query
end

Keybase proof

I hereby claim:

  • I am tjstankus on github.
  • I am tjstankus (https://keybase.io/tjstankus) on keybase.
  • I have a public key whose fingerprint is DEFC 99A1 E5B8 378C E73E E143 CC21 2ABD 83B5 AE2B

To claim this, I am signing this object: