Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Gauger mathias

View GitHub Profile
@mathias
mathias / step_1.rb
Created Oct 14, 2021
how keyboard firmwares work in Ruby psuedo-code
View step_1.rb
# Step 1: A single key
require 'board'
## A key = row 2, pin 11
board.setInput(11) # Pin 11
board.setHigh(11) # Activate pullup resistor
# Set rows 0-3 outputs, and high:
[0, 1, 2, 3].each do |row|
@mathias
mathias / gemfresh
Last active Jun 29, 2021 — forked from stevenharman/gemfresh
gemfresh: A handy script for determining the freshness of dependencies in a Ruby code base. Leverages bundler and libyear-bundler.
View gemfresh
#!/usr/bin/env bash
# shellcheck disable=SC2059
set -eu
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
CLEAR_LINE='\r\033[K'
View tests.fnl
(local lume (require :lume))
(local busted (require :busted))
(local describe busted.describe)
(local it busted.it)
(lambda plus-one [a]
(+ a 1))
(local tests {1 2
3 4})
View simple.fnl
(local tbl {:foo (fn [] "bar")})
(fn qux [f]
(each [e f]
(print e))) ; where my code has the bug
(fn baz []
(if tbl.foo
(let [result (tbl.foo)]
(print result)
View gist:5e33715865966924f0485baecc115b80
$ fennel lore.fnl
lore.fnl:91: attempt to call a table value
stack traceback:
lore.fnl:58: in function 'step'
lore.fnl:84: in function 'i_generate_events'
lore.fnl:90: in function 'generate_events'
lore.fnl:122: in main chunk
[C]: in function 'xpcall'
/usr/local/lib/luarocks/rocks-5.3/fennel/0.2.1-2/bin/fennel:34: in function 'dosafe'
/usr/local/lib/luarocks/rocks-5.3/fennel/0.2.1-2/bin/fennel:130: in main chunk
@mathias
mathias / garden-2019-notes.md
Last active Mar 20, 2019
Matt's Garden 2019 Notes
View garden-2019-notes.md

Matt's Garden 2019 Notes

Indoor:

Started with https://aggressivelyorganic.com/ kit (pods, light, nutrients, etc.) Found some issues. (See timeline) Moving towards recycled glass peanut butter jars, 3" net pots, and experimenting with moving away from the peat seed starter pucks to either rockwool or pumice beads.

Lettuce varieties for indoor growing: (Seeds from Aggressively Organic did poorly, so now I am using)

  • Generic red romaine lettuce that I had
  • Little Gem Romaine (available in this seed pack on Amazon. This is often recommended for indoor growing.
View intaug-code-of-conduct.md

Code of Conduct

The intaug.org forum is dedicated to providing a harassment-free experience for everyone, regardless of gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, or religion. We do not tolerate harassment of participants in any form. Sexual language and imagery is not appropriate without discussion and pre-approval from a moderator. Participants violating these rules may be sanctioned or expelled from the group at the discretion of @mathiasx or another moderator.

Harassment includes offensive verbal comments related to gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, religion, sexual images in public spaces, deliberate intimidation, stalking, following, harassing photography or recording, sustained disruption of discussion, inappropriate contact, and unwelcome sexual attention.

Participants asked to stop any harassing behavior are expected to comply immedi

View dog.c
#include <stdio.h>
int main(void) {
int number_of_barks = 5;
for(int i=0;i<number_of_barks;i++) {
printf("Woof!\n");
}
return 0;
View rewrite-markdown-link-to-org.el
View gist:bd6e6784ec83fd027455861ef3288772
For all major modes:
52317 31.82% self-insert-command €..ÿ
17695 10.76% next-line C-n, <down>
15124 9.20% previous-line C-p, <up>
11891 7.23% left-char <left>
11699 7.12% paredit-backward-delete
11364 6.91% right-char <right>
4378 2.66% delete-backward-char
4336 2.64% mwheel-scroll <C-wheel-down>, <S-wheel-down>, <wheel-down>, <C-wheel-up>, <S-wheel-up>, <wheel-up>