Skip to content

Instantly share code, notes, and snippets.

View aarongodin's full-sized avatar
🏃‍♂️
encours

Aaron Godin aarongodin

🏃‍♂️
encours
View GitHub Profile
@aarongodin
aarongodin / main.onyx
Created January 4, 2024 17:44
Onyx - tagged unions undefined behavior
use core { println }
Item :: struct {
value: str;
}
Other :: struct {
value: i32;
}
@aarongodin
aarongodin / pull-request.txt
Last active December 10, 2022 04:33
Personal Runbook PR
# new-pull-request
## Outcome
I've submitted my code for review and ensured confidence in the proposed changes.
## Prereqs
* My code is up to date in the remote repo in a branch off main.
* There are no dangling files to be saved or committed.
@aarongodin
aarongodin / template.txt
Last active December 10, 2022 03:56
Personal Runbook Template
# runbook-title
## Outcome
> Define an outcome. In 1-2 sentences, what should be the result
> of exercising this runbook.
## Prereqs
> Outline anything that must be done before executing this runbook.
@aarongodin
aarongodin / keybase.md
Created August 10, 2022 14:18
keybase.md

Keybase proof

I hereby claim:

  • I am aarongodin on github.
  • I am aarongodin (https://keybase.io/aarongodin) on keybase.
  • I have a public key ASC3xDBmsI6x-7Bu0jcqPezRWmylOwwDrSc_0C2mfN0Vuwo

To claim this, I am signing this object:

@aarongodin
aarongodin / nested_object.ts
Created July 26, 2022 20:13
Recursive partial object matching with Jest expectations
import expect from "expect"
import lodash from "lodash"
function objectToNestedExpectations(input: any) {
const target = {} as any
for (const [key, value] of Object.entries(input)) {
if (lodash.isPlainObject(value)) {
target[key] = objectToNestedExpectations(value)
} else {
num = 50
str1 = %(my num is #{num})
str1 = %[my num is #{num}]
str1 = %{my num is #{num}}
str1 = %<my num is #{num}>
str1 = %|my num is #{num}|
@aarongodin
aarongodin / boop.sh
Created February 26, 2018 16:51
Make iTerm2 resize correctly with spectacle
defaults write com.googlecode.iterm2 DisableWindowSizeSnap -integer 1
require "json"
def boop(props : JSON::Type)
puts props
end
boop({ "test" => "test" }) # => {"test" => "test"}
# This has a compile error
#
@aarongodin
aarongodin / example1.js
Created February 16, 2017 22:14
React IoC Examples
import React from 'react';
const EmailValidator = {
validate: (input) => {
return input.match && input.match(/\S+@\S+(\.\S{2,3})+/);
},
createErrorMessage: () => {
return 'Input was not a valid email';
}
function queryString (object) {
return Object.keys(object)
.reduce(function (collect, key, index, keys) {
collect.push(key + '=' + encodeURIComponent(object[key]))
return collect
}, [])
.join('&')
}
// Usage