Skip to content

Instantly share code, notes, and snippets.

View elementary-my-dear.snt
array5<array5<int5>> X;
X.each(function (row) {
row.each(function (cell) {
invariant cell.between?(1, 5);
});
});
function valid?(ary) {
invariant ary.uniq?;
View Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
gem "jasmine", git: "https://github.com/jasmine/jasmine-gem.git", branch: "main"
View rsa-auth.swift
extension Int {
var bcd: [UInt8] {
var d: [UInt8] = []
var n = self
while n > 0 {
let (q, r) = n.quotientAndRemainder(dividingBy: 100)
let (hundreds, tens) = r.quotientAndRemainder(dividingBy: 10)
d.append(UInt8((hundreds << 4) | tens))
n = q
}
View rsa.rb
#!/usr/bin/env ruby -w
require "openssl"
FLD_DIGIT_SHIFT = 6;
FLD_DIGIT_MASK = (0b111 << FLD_DIGIT_SHIFT);
FLD_NUMSECONDS_SHIFT = 0;
FLD_NUMSECONDS_MASK = (0b11 << FLD_NUMSECONDS_SHIFT);
def bcd(str)
View crosswords.rb
require "date"
require "open-uri"
class Store
def initialize(base_dir)
@base_dir = base_dir
end
# Super inefficient, but whatever...
def []=(date, day_data)
View vocabulary.md


  • Stress + rest = growth
  • Schadenfreude
  • Zugzwang
  • Shibboleth
  • Dunning-Kruger Effect
  • L'esprit de l'escalier: ("staircase wit") is a French term used in English for the predicament of thinking of the perfect reply too late.
View vocabulary.md


  • Stress + rest = growth
  • Schadenfreude
  • Zugzwang
  • Shibboleth
  • Dunning-Kruger Effect
  • L'esprit de l'escalier: ("staircase wit") is a French term used in English for the predicament of thinking of the perfect reply too late.
View refactoring.rb
require "yaml"
require "minitest/autorun"
require "minitest/pride"
class TestStatement < Minitest::Test
def statement(invoice, plays)
total_amount = 0
volume_credits = 0
result = "Statement for #{invoice.fetch("customer")}\n"
View notes.md
  • asymmetric colocation
    • Kevin: put your zoom room in your slack status
    • Teamspeak
  • tools for screen sharing w/clients
    • Team Viewer
    • Tandem ("do not share with clients")
    • Zoom
    • WebEx?
  • wearing headphones all day
    • krisp (?) audio filter
View main.rs
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate warp;
use warp::Filter;
fn main() {
// Match any request and return hello world!