This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# checks any .php files that are edited in the current branch for syntax errors | |
# reports a list of files, putting errors in red and reporting the error and line number | |
FILES=$(git status -s | grep '\.php$') | |
for f in $FILES | |
do | |
if [[ $f =~ ^.*\.php$ ]]; then | |
RESULT=$(php -l $f 2>&1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gb='git branch' | |
alias gg='git status' | |
alias gitfiles='git diff-tree --no-commit-id --name-only -r ' | |
alias gitlog='git log --graph --abbrev-commit --decorate --format=format:'\''%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'\'''\'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'\'' --all' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git ls-files --deleted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@dd(get_defined_vars()['__data']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/philfreo/1040968 | |
/** | |
* Add the querystring variable $key with a value $value to $url. | |
* If $key is already specified within $url, it will replace it. | |
* | |
* Based upon http://www.addedbytes.com/code/querystring-functions/ | |
* | |
* @param string $url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Laravel includeIfAuth() function. | |
* | |
* Usage: @includeIfAuth($templateName) | |
*/ | |
\Blade::directive('includeIfAuth', function ($expression) { | |
if(\Auth::check()) { | |
return \Blade::compileString("@include({$expression})"); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/.ssh/id_rsa.pub | pbcopy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git commit --allow-empty -m 'push to execute post-receive' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addEvent(obj, evt, fn) { | |
if (obj.addEventListener) { | |
obj.addEventListener(evt, fn, false); | |
} | |
else if (obj.attachEvent) { | |
obj.attachEvent("on" + evt, fn); | |
} | |
} | |
addEvent(document, "mouseout", function(e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Seeder; | |
use Illuminate\Database\Eloquent\Model; | |
class DatabaseSeeder extends Seeder | |
{ | |
protected $toTruncate = ['users']; | |
public function run() |
NewerOlder