Skip to content

Instantly share code, notes, and snippets.

@trevorgreenleaf
trevorgreenleaf / px-rem-tw.csv
Last active April 1, 2024 15:42
PX to REM'S to TAILWIND CSS
PX REM TW
4 0.25 1
8 0.5 2
16 1 4
32 2 8
48 3 12
64 4 16
80 5 20
96 6 24
112 7 28
apt-get update
apt-get install php-imagick
service php7.0-fpm restart
service nginx restart
@trevorgreenleaf
trevorgreenleaf / gist:aacffbd29fa8e299fd40194be66ad008
Created December 19, 2017 08:05
Remove large file accidentally committed to git
git filter-branch --tree-filter 'rm -rf path/to/your/file' HEAD
@trevorgreenleaf
trevorgreenleaf / .bash
Last active September 7, 2021 15:48
Laravel Valet on Multiple User Accounts
sudo rm -rf /usr/local/Homebrew/
sudo rm -rf /usr/local/var/homebrew/
sudo rm -rf /usr/local/Cellar/php71/
sudo rm -rf /usr/local/include/php/
sudo rm -rf ~/.valet
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install homebrew/php/php71
@trevorgreenleaf
trevorgreenleaf / gist:b1508d5524d43a666757f9e9fd1e3903
Created September 24, 2017 21:13
Laravel Error Whoops Snippet
@if (count($errors) > 0)
<div class="alert alert-danger text-left">
<strong>Whoops!</strong> There were problems with input:
<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
### Aliases
# Open specified files in Sublime Text
# "s ." will open the current directory in Sublime
alias subl='open -a "Sublime Text"'
alias phpini='cd /usr/local/etc/php/7.1; subl php.ini'
# Color LS
@trevorgreenleaf
trevorgreenleaf / .php
Created July 15, 2017 06:29
Laravel Query Group, Year, Month, Day
$usage = DB::table('styles')
->select(
DB::raw('count(id) as `total_created`'),
DB::raw("DATE_FORMAT(created_at, '%d-%m-%Y') new_date"),
DB::raw('
YEAR(created_at) year,
MONTH(created_at) month,
DAY(created_at) day')
)
->groupby('year','month','day')
add_action('set_current_user', 'cc_hide_admin_bar');
function cc_hide_admin_bar() {
if (!current_user_can('edit_posts')) {
show_admin_bar(false);
}
}
@trevorgreenleaf
trevorgreenleaf / Wordpress Redirect
Created April 4, 2017 00:51
Wordpress Redirect on Login
function admin_default_page() {
return '/new-dashboard-url';
}
add_filter('login_redirect', 'admin_default_page');
PATH=~/.composer/vendor/bin:$PATH
export PATH=$PATH:~/bin
alias show_files='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hide_files='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
alias copykey='cat ~/.ssh/github_rsa.key | pbcopy'
alias c='clear'