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
/**
* @var array
*/
public $fixtures = array();
/**
* List of plugin fixtures to always include
* @var array
*/
public $plugin_fixtures = array(
public function create($data = array(), $filterKey = false) {
$this->_validator = new ModelValidator($this);
return parent::create($data);
}
// TEST that shows issue/fix
public function testModelValidationClearing() {
// in bootstrap
Configure::write('Dispatcher.filters', array(
'fb-prefix' => array(
'callable' => function($event){
/*
if (isset($this->params['prefix']) && method_exists($controller, $this->params['prefix'] . '_' . $this->params['action'])) {
$this->params['action'] = $this->params['prefix'] . '_' . $this->params['action'];
} elseif (strpos($this->params['action'], '_') > 0) {
@mrmorris
mrmorris / pr.md
Created March 25, 2013 21:27 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

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:

@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
@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 / README.md
Created October 3, 2017 22:44 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@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 / 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$")