Skip to content

Instantly share code, notes, and snippets.

View mathias's full-sized avatar

Matt Gauger mathias

View GitHub Profile
@mathias
mathias / .zshrc
Last active October 4, 2023 19:37 — forked from bashbunni/.zshrc
CLI Pomodoro for Mac
# I'll be doing another one for Linux, but this one will give you
# a pop up notification and sound alert (using the built-in sounds for macOS)
# Requires https://github.com/caarlos0/timer to be installed
# Mac setup for pomo
alias work="timer 60m && osascript -e 'display notification \"☕\" with title \"Work Timer is up!\" subtitle \"Take a Break 😊\" sound name \"Crystal\"'"
alias rest="timer 10m && osascript -e 'display notification \"☕\" with title \"Break is over!\" subtitle \"Get back to work 😬\" sound name \"Crystal\"'"
@mathias
mathias / step_1.rb
Created October 14, 2021 15:35
how keyboard firmwares work in Ruby psuedo-code
# 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 June 29, 2021 18:38 — forked from stevenharman/gemfresh
gemfresh: A handy script for determining the freshness of dependencies in a Ruby code base. Leverages bundler and libyear-bundler.
#!/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'
(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})
@mathias
mathias / simple.fnl
Last active September 20, 2019 03:07
(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)
@mathias
mathias / gist:5e33715865966924f0485baecc115b80
Created September 20, 2019 02:45
lua error line numbers?
$ 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 March 20, 2019 01:51
Matt's Garden 2019 Notes

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.

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

@mathias
mathias / dog.c
Last active March 13, 2017 17:03
#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;