Skip to content

Instantly share code, notes, and snippets.

View mrmorris's full-sized avatar

Ryan Morris mrmorris

  • Two Bit Solutions LLC
  • Brooklyn, NY
View GitHub Profile
@mrmorris
mrmorris / commit-msg
Created July 15, 2021 12:12
Gerrit 3.4 Commit MSG Hook
#!/bin/sh
# From Gerrit Code Review 3.4.0
#
# Part of Gerrit Code Review (https://www.gerritcodereview.com/)
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@mrmorris
mrmorris / members-index.js
Created June 18, 2020 16:23
Sample Project File
import { Alert, Input, Row } from 'antd';
import { debounce } from 'lodash';
import React, { useCallback, useState } from 'react';
import { createPaginationContainer, graphql } from 'react-relay';
import PersonCard from 'components/cards/PersonCard';
import FlexGrid from 'components/FlexGrid';
import InfiniteScroller from 'components/InfiniteScroller';
import InnerWrapper from 'components/InnerWrapper';
import WaveStroke from 'components/svgs/WaveStroke';
#!/bin/sh
# tail -F $HISTFILE | ./historymaker.sh
awk '
BEGIN { print "Beginning" }
# $0 ~ / ([0-9]+):[0-9]+;(.+)/ { print $0}
match($0, / ([0-9]+):[0-9]+/) {print "\033[37m"strftime("%m/%d/%Y @%H:%M:%S", substr($0, RSTART+1, RLENGTH-1))}
match($0, /;(.+)/) {print "\033[32m" "" substr($0, RSTART+1, RLENGTH-1)}
END { print "done"}
@mrmorris
mrmorris / commands.md
Created April 28, 2020 11:48
Git power commands

Is this commit in this branch?

Or, which branch has my commit?

# Any branch have this commit?
git branch --contains $COMMIT_ID

# Filter for branches (only this branch) if it has this commit
@mrmorris
mrmorris / rmb.sh
Last active June 19, 2020 11:53
Remove My Branches
rmb () {
current_branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ "$current_branch" != "master" ]
then
echo "WARNING: You are on branch $current_branch, NOT master."
fi
echo "Fetching merged branches..."
git remote prune origin
remote_branches=$(git branch -r --merged | grep -v '/master$' | grep -v "/$current_branch$")
local_branches=$(git branch --merged | grep -v 'master$' | grep -v "$current_branch$")
@mrmorris
mrmorris / gist:a4aee2f00a4834ccedefd1a4b05383fb
Created February 7, 2019 22:38
Sublime Merge Git Config
# edit your ~/.gitconfig file...
[diff]
tool = smerge
[merge]
tool = smerge
[difftool]
prompt = false
[mergetool]
@mrmorris
mrmorris / README.md
Created October 3, 2017 22:44 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@mrmorris
mrmorris / gist:76f65e6fb2ff144fda49
Created June 26, 2015 12:19
My git colors - add to your .gitconfig file
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
@mrmorris
mrmorris / post-receive
Created June 20, 2015 14:08
Dummy pore-receive hook
#!/bin/bash
# For each ref being updated
# If it is master (branch)
# Then... update our server?
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then

Keybase proof

I hereby claim:

  • I am mrmorris on github.
  • I am mrmorris (https://keybase.io/mrmorris) on keybase.
  • I have a public key whose fingerprint is 23E3 DFC1 19C9 ED3E A4E2 E33D AC2D 7EEF F409 0A5B

To claim this, I am signing this object: