Skip to content

Instantly share code, notes, and snippets.

View chabgood's full-sized avatar
Working from home

Chris Habgood chabgood

Working from home
View GitHub Profile
View gist:699c992d2fa6ae73a4e790c5c58aa284
BRANCH=$(git rev-parse --abbrev-ref HEAD)
RELEASE=$(git branch -a | grep -Eo 'release/\d{2}.\d{2}.\d{2}' | tail -n 1)
git checkout ${RELEASE} && git pull
git checkout ${BRANCH} && git rebase ${RELEASE}
chabgood / React Inspect props
Last active March 1, 2020 18:27
React Inspect props
View React Inspect props
<code>{JSON.stringify(props, null, 4)}</code>
chabgood / eslint config react
Created February 23, 2020 07:00
eslint config react
View eslint config react
"extends": [
"rules": {
chabgood / gist:7b24c5b5463c51f1683319fdcd077308
Created January 2, 2019 18:50
save state db when changing branch
View gist:7b24c5b5463c51f1683319fdcd077308
#!/usr/bin/env ruby
require 'yaml'
class UnsupportedDatabaseAdapter < RuntimeError
attr_reader :adapter
def initialize(adapter)
@adapter = adapter
chabgood / gist:431271af6f29492348201ddf63a1fe0d
Created April 17, 2017 14:25
Find a the count of a word in a file
View gist:431271af6f29492348201ddf63a1fe0d
def find_word(word)
file =, "r")
index = 0
file.each_line { |line|
if line.include?(word)
chabgood / pre-commit
Last active August 2, 2016 01:38
git pre-commit hook prevent pry debug
View pre-commit
#!/usr/bin/env ruby
class CheckForDebug
@files = `git grep --all-match -e 'binding.pry' --and --not -e 'add binding' --line-number`
exit_and_notify if @files.length > 0
exit 0;
def self.exit_and_notify
p @files.strip