Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mfrost503 on github.
  • I am mfrost503 (https://keybase.io/mfrost503) on keybase.
  • I have a public key ASCVBB_uARKocg123HhSkVpCpMo79sy6iUAUDfwjU_1ocAo

To claim this, I am signing this object:

Verifying that +mfrost503 is my blockchain ID. https://onename.com/mfrost503
@mfrost503
mfrost503 / vim-phpunit.vim
Last active December 9, 2015 15:07
Vim Script to run PHPUnit tests from the editor and display the results in the message bar
let g:test_directory = "tests"
function DirectoryExists(...)
if empty(a:1)
return 0
endif
let a:directory = system("if [ ! -d " . a:1 . " ]; then echo 0; else echo 1; fi")
return a:directory
endfunction
@mfrost503
mfrost503 / one-liners.sh
Created July 16, 2015 23:41
One Liners from the mail conversion
## Find all the files that in the directory that and 1 directory deeper that were using mail
find ./ -maxdepth 2 -type f -name '*.php' -print0 | xargs -0 grep -l \!mail\( | xargs sed -i "3i require_once \'..\/path\/to\/sendgrid\';"
## 3rd line put it after the <?php and session_start();
## Find all the files that have the sendGrid.php require and aren't using the sendGridMail function
find ./ -maxdepth 2 -type f -print '*.php' -print0 | xargs -0 grep -l sendGrid\.php | xargs grep -L sendGridMail\( | xargs sed -i 's/\!mail\(/\!sendGridMail\(/g'
@mfrost503
mfrost503 / add-content
Last active August 29, 2015 14:25
Adding the same content to any number of files
find ./ -maxdepth 2 -type f -name '*.php' -print 0 | xargs -0 grep -L \/path\/to\/some\/file | xargs sed -i "3i require\_once \'..\/path\/to\/some\/file"
So what is this doing:
find ./ - find files in the current directory
- maxdepth 2: look at all the files in the current directory and any files 2 directory levels deep
- type f: looking for files
- name '*.php': any file with a .php extension
- print0: since we're piping to grep, we have to output the file list the way grep expects to receive it
@mfrost503
mfrost503 / oauth-gist.txt
Last active August 29, 2015 14:03
Updated Text
This is completely new text,right?
@mfrost503
mfrost503 / gist:9717307
Created March 23, 2014 01:40
Testing 1,2,3
-----BEGIN PGP MESSAGE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - https://gpgtools.org
hQEMA6iI+4dzsWkcAQf/adW2s35j3AWRokqRNbXC+We5wcsqEF46jX2+VWtvIbgV
CPzP1QqlLS6Wc5ofEezLozeFTj7XBJguPtComfDB4bYnO1pjG1SRS7Um2mMv/rZq
VNxA+9ggnuw9kymBB8mSQA4iLJUCVPw+NvECTKPQI2oNkgiMYvukKox7HpjOYRiv
jge2PPtVbfhoWNXNwGlskoW+q/MUJmdGBFaCPHw+f9VRFD4uetIJ1L5r65/GKFen
7XQE5si5JB/GtQKB91Nl1aDOAMjlbQn1b+49sLPwE60LCXYJdT2D1vtvvECT/nZm
WUM/w4u+U3L13+83oP50XQeZU6mK0lm6m3X9PPULYdLAzwEPwAht/EZthk9emcfd
@mfrost503
mfrost503 / keybase.md
Created March 22, 2014 22:24
keybase.md

Keybase proof

I hereby claim:

  • I am mfrost503 on github.
  • I am mfrost503 (https://keybase.io/mfrost503) on keybase.
  • I have a public key whose fingerprint is 722B 2AC6 4BA0 E048 DE78 3629 8C98 305D A3EC C888

To claim this, I am signing this object:

@mfrost503
mfrost503 / gist:7177913
Created October 27, 2013 04:15
Logical Or
58 $this->db->expects($this->atLeastOnce())
59 ->method('prepare')
60 ->with($this->logicalOr(
61 $expectedQuery,
62 $teachingQuery,
63 $learningQuery
64 ))
65 ->will($this->returnValue($this->statement));
set t_Co=256
set background=dark
set ruler
set number
set showcmd
set ts=4
set sw=4
encoding=utf-8
set ignorecase