Skip to content

Instantly share code, notes, and snippets.

View mpettis's full-sized avatar

Matt Pettis mpettis

  • Personal
  • Minneapolis, MN
View GitHub Profile
@rossta
rossta / ruby-resources.md
Last active January 26, 2024 19:58
Resources I recommend for learning Ruby and Rails

Resources I recommend to learn Ruby and Rails

New? Start here

I like jumping into tutorials first.

"How to write Ruby" Books

@veekaybee
veekaybee / normcore-llm.md
Last active March 10, 2026 18:08
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@darkuncle
darkuncle / Fairness_and_Generosity.md
Last active February 26, 2026 15:29
The Rules - guidelines learned through hard experience in operations

(taken from Hard Sayings of the Bible)

The Rate for the Job? (Mt 20:14-15)

One of the complaints that right-living and religious people made about Jesus arose from his treatment of the more disreputable members of society. They might have agreed that such persons should not be entirely excluded from the mercy of the all-loving God. Even for them there was hope, if they showed by practical repentance and unquestionable amendment of life that they were not beyond redemption. But not until such evidence had been given could they begin to be accepted as friends and neighbors. Jesus, however, accepted them immediately; he did not wait to see the outcome before he committed himself to them. This was disturbing; it was even more disturbing that he seemed to think more highly of them than of those who had never blotted their public copybook. He gave the impression that he actually preferred the company of the rejects of society; he not only made them feel at home in his company, so that they felt free to take l

``` r
library(ggplot2)
library(dplyr)
library(magick)
library(patchwork)
library(gt)
library(ggtext)
mtcars %>%
head() %>%
library(tidyverse)

lag_multiple <- function(x, n_vec){
  map(n_vec, lag, x = x) %>% 
    set_names(paste0("lag", n_vec)) %>% 
    as_tibble()
}

tibble(x = 1:30) %&gt;% 
@dgrtwo
dgrtwo / comparing-polynomial-models-covid.R
Created May 5, 2020 19:33
Comparing the CEA's "cubic model" to quadratic and quartic models
library(tidyverse)
library(broom)
US <- read_csv("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us.csv") %>%
mutate(new_deaths = deaths - lag(deaths)) %>%
filter(date >= "2020-02-26")
models <- tibble(degrees = 2:4) %>%
mutate(model = map(degrees, ~ lm(log(new_deaths + 1) ~ poly(date, .), data = US)))
import numpy as np
import tensorflow as tf
def dense(x, weights, bias, activation=tf.identity, **activation_kwargs):
"""Dense layer."""
z = tf.matmul(x, weights) + bias
return activation(z, **activationn_kwargs)
@djnavarro
djnavarro / ggplot2_geomvector.R
Created March 30, 2019 03:30
Custom ggplot2 geom that plots a (subset of a) vector field
library(ggplot2)
library(dplyr)
library(tibble)
library(tidyr)
GeomVector <- ggproto("GeomVector", Geom,
required_aes = c("x", "y", "direction", "length"),
default_aes = aes(
@mrrodriguez
mrrodriguez / clara_tiered_fact_update_rules.clj
Last active July 1, 2020 18:07
Clara tiered fact update rules
(require '[clara.rules :as r])
;;;; Define 3 rules, where the "priority" order is r1, r2, r3, where the highest priority is first
;;;; and the rest is in descending order of priority.
;;;; :type :rule/result "syntetic" fact is used to hold the final changes that can be queried out
;;;; from a session after `r/fire-rules` via `r/query` on the `find-results` query.
;;;; A namespace qualified keyword is used to avoid collision with externally given :type of
;;;; "real" facts.