Skip to content

Instantly share code, notes, and snippets.

View coderabbi's full-sized avatar

Yitz Willroth coderabbi

View GitHub Profile
@coderabbi
coderabbi / post-merge
Created December 18, 2017 11:27
'composer install' git post-merge hook
# .git/hooks/post-merge
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
composer_install_on_changed_lockfile() {
echo "$changed_files" | grep --quiet "composer.lock" &&
echo "Changes to 'composer.lock' detected; running 'composer install'." &&
composer install
}
@coderabbi
coderabbi / post-checkout
Created December 18, 2017 11:26
'composer install' git post-checkout hook
# .git/hooks/post-checkout
changed_files="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
composer_install_on_changed_lockfile() {
echo "$changed_files" | grep --quiet "composer.lock" &&
echo "Changes to 'composer.lock' detected; running 'composer install'." &&
composer install
}
@coderabbi
coderabbi / coderabbi.opml
Created November 14, 2017 10:26
Pocket Casts Export - 20171114
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<opml version="1.0">
<head>
<title>Pocket Casts Feeds</title>
</head>
<body>
<outline text="feeds">
<outline type="rss" text="15 Minute History" xmlUrl="http://feeds.feedburner.com/15MinuteHistory" />
<outline type="rss" text="Live In The Feast" xmlUrl="http://www.omnycontent.com/d/playlist/2c70f92a-ac02-41d3-afa8-a735012469d5/3cefbd23-a552-4a23-8e08-a73501248aca/e08192a3-cdd5-44bb-8c3c-a73501265f58/podcast.rss" />
<outline type="rss" text="Freakonomics Radio" xmlUrl="http://feeds.feedburner.com/freakonomicsradio" />
@coderabbi
coderabbi / git-fix.md
Last active January 28, 2021 10:54
Git Alias: fix

Ever wish you could add something to a prior commit, but you've committed a few times since?

Simple, right? git commit --fixup <hash-to-fix> followed by git rebase -i <last-good-hash>

I don't know about you, but that's one more hash than I want to deal with and since the --autostash option sets up the rebase properly for me, I really don't want to have to deal with my editor, either....

Consider the "git fix" alias.

Definition:

@coderabbi
coderabbi / podcasts-2017-08.opml.xml
Created August 6, 2017 11:06
Podcast Lineup August 2017
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<opml version="1.0">
<head>
<title>Pocket Casts Feeds</title>
</head>
<body>
<outline text="feeds">
<outline type="rss" text="Inquiring Minds" xmlUrl="HTTP://feeds.feedburner.com/inquiring-minds" />
<outline type="rss" text="The Moth Podcast" xmlUrl="http://feeds.feedburner.com/themothpodcast" />
<outline type="rss" text="Useful Science" xmlUrl="https://rss.simplecast.com/podcasts/1419/rss" />
#!/bin/bash
set -e
GVERSION="1.7"
GFILE="go$GVERSION.linux-amd64.tar.gz"
GOPATH="$HOME/go"
GOROOT="/usr/local/go"
if [ -d $GOROOT ]; then
echo "Installation directories already exist $GOROOT"
@coderabbi
coderabbi / .env
Last active June 25, 2017 10:37
Laravel Debugbar .env Conversion
DEBUGBAR_STORAGE_ENABLED=true
DEBUGBAR_STORAGE_DRIVER='file'
DEBUGBAR_STORAGE_PATH='storage/debugbar'
DEBUGBAR_STORAGE_CONNECTION=null
DEBUGBAR_INCLUDE_VENDORS=true
DEBUGBAR_CAPTURE_AJAX=true
DEBUGBAR_CLOCKWORK=false
DEBUGBAR_COLLECTOR_PHPINFO=true
DEBUGBAR_COLLECTOR_MESSAGES=true
DEBUGBAR_COLLECTOR_TIME=true
@coderabbi
coderabbi / bira.zsh
Created March 7, 2017 21:02
Updated Bira OMZ THeme
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local user_symbol='$'
fi

Keybase proof

I hereby claim:

  • I am coderabbi on github.
  • I am coderabbi (https://keybase.io/coderabbi) on keybase.
  • I have a public key whose fingerprint is 809F DF04 E9BF 1742 D4A6 5E24 8CEA 6959 FAC8 E8A7

To claim this, I am signing this object:

Let's say you have this:
class SomeClass
{
// users are encouraged to extend and set to true to enable magical powers...
protected $someQuality = false;
public function isSomeQuality()
{
return $this->someQuality;