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
@trevorgreenleaf
trevorgreenleaf / gist:8513341
Created January 20, 2014 01:14
Installing Laravel on Media Temple GS
Go into domain folder
transfer or run a new install of laravel
git clone https://github.com/laravel/laravel example.com && cd example.com
// get composer
curl -sS https://getcomposer.org/installer | php -d allow_url_fopen=On
// install composer
php -d allow_url_fopen=On composer.phar install
@trevorgreenleaf
trevorgreenleaf / gist:2f4092b721471307e7bb9c680559c04b
Created March 10, 2019 20:44
Laravel Valet Uninstall and then Reinstall everytime I switch user accounts
## Uninstall process
#remove valet
rm -rf ~/.valet
rm ~/usr/local/bin/valet
# change the permisions on all brew files
sudo chown -R $(whoami) $(brew --prefix)/*
# now uninstall all brew packages
<?php
ini_set('display_errors', 'On');
require 'vendor/autoload.php';
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\CssSelector\CssSelectorConverter;
$client = new GuzzleHttp\Client();
$url = 'https://us.fotolia.com/search?k=cats&filters%5Bcontent_type%3Aphoto%5D=1&search-submit=Search&limit=5';
$data = $client->get($url);
### 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 / .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:330ee5ee066e0445f35a9305f1c05d44
Created December 21, 2019 01:45
Laravel Valet - MYSQL Password not working after fresh install
Im using MacOS Catalina. and beta version of Sequel Pro
//
Was getting error MySQL said: Authentication plugin 'caching_sha2_password
to fix this I reset the password on mysql and it seemed to do the trick
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[PASSWORD]'; where [PASSWORD] is a password of your choosing.
@trevorgreenleaf
trevorgreenleaf / PHP Image upload
Last active June 10, 2019 09:54
PHP Image upload with date appended.
<?php
/* Image Uploading Script
* ========================================================================================
Process images and moves them into a uploads folder, each image will have the date of upload
appended to its url to prevent replacing.
- Trevor 06/29/13
*/
// only allow the following formats
@trevorgreenleaf
trevorgreenleaf / gist:320eb0f0cdd585dcf6c5654d875163f4
Created April 15, 2019 18:24
Laravel Valet MySQL Connection Issue on Fresh install - caching_sha2_password
Issue with Mysql now makign passwords sha2 you need to fix by running these to commands
https://laracasts.com/discuss/channels/laravel/caching-sha2-password-error-when-running-php-artisan-migrate
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
@trevorgreenleaf
trevorgreenleaf / tweets.redactor.js
Created January 9, 2019 23:36 — forked from chekalsky/tweets.redactor.js
Imperavi Redactor Plugin for Embedding Tweets Usage: mention "tweets" in "plugins" setting of you redactor.
/**
* Imperavi Redactor Plugin for Embedding Tweets
* for version >= 9.1
*
* @author Ilya Chekalskiy <ilya@chekalskiy.ru>
* @version 0.2.2
*/
if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {};
RedactorPlugins.tweets = {