Skip to content

Instantly share code, notes, and snippets.

View icorbrey's full-sized avatar
🕹️
N64s are cool

Isaac Corbrey icorbrey

🕹️
N64s are cool
View GitHub Profile
@icorbrey
icorbrey / Makefile
Last active February 20, 2019 15:20
My standard makefile, no frills
DIR_CURR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
DIR_DEPS = $(DIR_CURR)/include
DIR_SRC = $(DIR_CURR)/src
DIR_OBJ = $(DIR_CURR)/obj
DIR_BUILD = $(DIR_CURR)/build
SOURCES = $(wildcard $(DIR_SRC)/*.cpp)
OBJECTS = $(patsubst $(DIR_SRC)/%.cpp, $(DIR_OBJ)/%.o, $(SOURCES))
DEPS = $(wildcard $(DIR_DEPS)/*.h)
@icorbrey
icorbrey / binary-search-tree.pep
Created February 7, 2020 15:55
Binary Search Tree in Pep/9 Assembly
;; Isaac Corbrey
;; Binary Search Tree
;; 4 December 2019
BR main
;; struct node ;;
data: .EQUATE 0 ; MEMBER: The data at this node. #2d
left: .EQUATE 2 ; MEMBER: The left child of this node. #2h
right: .EQUATE 4 ; MEMBER: The right child of this node. #2h
@icorbrey
icorbrey / USAGE.md
Last active March 4, 2020 15:51
Typechecked Redux middleware generator
export type MiddlewareNames =
	'duplicateMiddleware',
	'loggingMiddleware'

export default createMiddleware<MiddlewareNames, StateType, ActionTypes>({
	
	duplicateMiddleware: (state, next, action) =>
	{
 // Do middleware things...

Part of the HTTP communication process that occurs between web servers and browsers are the HTTP headers that are included in the request and response. For example, the following are the headers recorded from a typical response to a web request on a typical site:

Headers Received Value
(Status-Line) HTTP/1.1 200 OK
Cache-Control Private
Connection Keep-Alive
Content-Length 6619
Content-Type Text/html
Date Thu, 07 Nov 2019 19:12:06 GMT
@icorbrey
icorbrey / .vimrc
Created June 18, 2020 17:01
My Vim configuration file!
set nocompatible
filetype off
set encoding=utf-8
" Initialize Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Let Vundle manage itself
Plugin 'VundleVim/Vundle.vim'
@icorbrey
icorbrey / normalizeObjectArray.js
Created June 24, 2020 20:16
A module that squashes your array of objects into an object with array properties. Ideal for lots of objects with identical property names.
/**
* Given an array of objects, each with identical property names but different
* values, combines them into one object with each property name associated
* with an array of the given objects' values.
*
* ### Example:
*
* ```
* const data = [{ a: 1, b: 'a' }, { a: 2, b: 'b' }]
* console.log(normalizeObjectArray(data)) // { a: [1, 2], b: ['a', 'b'] }
@icorbrey
icorbrey / match.ts
Created October 1, 2020 00:52
A typechecked action type matcher for reducers
type IndexableType = string | number
type Action<PossibleTypes extends IndexableType> = {
type: PossibleTypes
payload: any
}
type Matchers<
PossibleTypes extends IndexableType,
PossibleActions extends Action<PossibleTypes>,
export const getDispatchableActions = (dispatch, actions) =>
getPropertyPairs(actions)
.map(toDispatchableActionPair(dispatch))
.map(toPropertyObject)
.reduce(toSingleObject, {})
const getPropertyPairs = object => Object
.keys(object)
.map(key => [key, object[key]])
@icorbrey
icorbrey / home-inspection.md
Created March 31, 2021 02:54
List of things to check when buying a house

List of Things to Check When Buying a House

Exterior

  • What does the neighborhood look like? Is there trash in yards? Broken down cars? Lawns that aren't well-kept? It sounds petty, but something that doesn't bother you today will be an embarrassment tomorrow.
  • Which way is the ground sloping? Ideally the ground around the house should be sloping away, towards the street and ditches. If the ground is sloping towards the house, it's a sign of ground water pooling up around the
@icorbrey
icorbrey / git-repo-setup.md
Created June 25, 2021 17:52
Git Repo Setup

Setting Up a New GitHub Repo

Branches

Branch Purpose
master Holds the latest development progress.
stable Holds the latest stable release.
enhancement/* Contains WIP enhancements.
hotfix/* Contains hotfixes for bugs.