Skip to content

Instantly share code, notes, and snippets.

View jasonkeene's full-sized avatar
:shipit:

Jason Keene jasonkeene

:shipit:
View GitHub Profile
@jasonkeene
jasonkeene / before_onpar_test.go
Last active December 24, 2021 03:14
Golang Test Setup
// Before method that runs before each test and can communicate values via arguments
// Pros: Consolidate setup code
// Pros: No sharing of memory between tests, can run in parallel
// Pros: Use symbols for dependencies
// Cons: A little bit magical with using reflection.
func TestSomething(t *testing.T) {
t.Before(func (t *testing.T) (*db.Conn, map[string]interface{}) {
return createDBConn(t), createFixture()

Title Diagram

  • Marcros are divided into two food sources:
    1. Red Meat (Ruminants) for protein and fat
      • Rumainants are herbivore mamals that digest cellulose
      • Sources are:
        • Bison
        • New York Strip
        • Top Sirloin
  • Lean Ground Beef
@jasonkeene
jasonkeene / README.md
Last active December 12, 2024 17:10
Late Night Shutdown Prompt

Prompt yourself every 5 minutes after 7 PM if you really want to still be using your computer or not. This helps to avoid late night device use. You can dismiss the dialog every 5 minutes. If you don't dismiss it within 15 seconds your computer will shutdown.

Installation

  1. Add the shutdown.applescript to your local bin folder ~/.local/bin/shutdown.applescript. You may have to create this directory first with mkdir -p ~/.local/bin. Make the script executable with