Skip to content

Instantly share code, notes, and snippets.

View mcmire's full-sized avatar
🦊

Elliot Winkler mcmire

🦊
View GitHub Profile
@mcmire
mcmire / tmux.conf
Created April 2, 2021 20:42
Nested tmux sessions
### Nested sessions (YO DAWG)
# Source: <https://www.freecodecamp.org/news/tmux-in-practice-local-and-nested-remote-tmux-sessions-4f7ba5db8795/>
# TODO - remove
color_status_text="colour245"
color_window_off_status_bg="colour238"
color_light="white" #colour015
color_dark="colour232" # black= colour232
color_window_off_status_current_bg="colour254"
@mcmire
mcmire / keybase.md
Created October 30, 2020 21:10
keybase.md

Keybase proof

I hereby claim:

  • I am mcmire on github.
  • I am mcmire (https://keybase.io/mcmire) on keybase.
  • I have a public key ASC7iNozmJJj7k2-uykoJm9ewCoCxX2z4PmeX7wpjbZeygo

To claim this, I am signing this object:

@mcmire
mcmire / super_diff_81.md
Last active May 15, 2020 04:34
super_diff #81

Let's say you have this test:

expected = {
  created_at: "Tue Jan 13 19:28:24 +0000 2009",
  favourites_count: 38,
  geo_enabled: false,
  verified: true,
  media_count: 51_044,
  statuses_count: 273_860,
@mcmire
mcmire / 00_README.md
Last active October 31, 2022 01:17
Installation and uninstallation scripts for dotfiles

This gist provides scripts that you can use to install files inside of a dotfiles repo into your home directory and uninstall them if you wish. To use these, download the zip file of this gist and unzip it into the bin folder of your dotfiles repo. Then run chmod +x bin/install bin/uninstall. After this, run:

bin/install --help
bin/uninstall --help
@mcmire
mcmire / active_record_persistence_instrumenter.rb
Created October 23, 2019 02:09
Produces a tree of ActiveRecord + Fabrication calls
# This file allows to you to debug use of fabricators in tests by producing a hierarchical tree of
# objects created via ActiveRecord and Fabrication.
#
# Place this at spec/support/active_record_persistence_instrumenter.rb.
#
module PersistenceInstrumenter
class Tree
def initialize
@stack = []
@children = []
@mcmire
mcmire / graphql.md
Last active August 29, 2019 19:49
Guide to GraphQL

A Guide to GraphQL

We use GraphQL to implement APIs across our tech stack, particularly as a protocol for communication between a backend app and frontend app.

[REST][rest] is a mainstay in the API world; its concepts are more or less integrated into Rails, Django, Symfony, and other modern web frameworks. But GraphQL, which was developed and released by Facebook in 2015, offers a fundamentally different approach.

@mcmire
mcmire / 00_README.md
Last active July 11, 2019 04:44
validate_not_nil matcher (sketch)

You can use this matcher like so:

RSpec.describe User, type: :model do
  it { is_expected.to validate_not_nil(:favorite_numbers) }
end
@mcmire
mcmire / package.json
Created December 18, 2018 02:36
TypeScript configuration
{
...,
"dependencies": {
"typescript": "^3.2.2"
},
"devDependencies": {
"tslint": "^5.11.0",
"typescript-tslint-plugin": "^0.2.1"
}
}
@mcmire
mcmire / checksum.sh
Created July 12, 2018 17:40
Calculate a checksum of multiple directories
#!/bin/bash
set -euo pipefail
uname=$(uname)
checksum() {
if [[ $uname == 'Darwin' ]]; then
md5 -r
else
@mcmire
mcmire / have_row.rb
Created May 4, 2018 18:51
Table matchers for RSpec
module FeatureSpecs
def have_row(expected_row)
HaveRowMatcher.new(self, expected_row)
end
class HaveRowMatcher
def initialize(context, expected_row)
@context = context
@expected_row = expected_row
end