Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| const mix = require('laravel-mix'); | |
| const tailwindcss = require('tailwindcss'); | |
| const rootPath = Mix.paths.root.bind(Mix.paths); | |
| const tailwindPlugins = function(configFile, paths) { | |
| const pluginList = [tailwindcss(configFile)]; | |
| if (mix.inProduction()) { | |
| pluginList.push(require('@fullhuman/postcss-purgecss')({ |
| # Rails Stuff | |
| alias stoprails='kill -9 $(lsof -i :3000 -t)' | |
| alias startrails='rails server -d' | |
| alias restartrails='stopRails && startRails' | |
| #Check PHP For Erroes | |
| alias phpcheck='find ./ -name \*.php | xargs -n 1 php -l' | |
| # ROT13-encode text. Works for decoding, too! ;) | |
| alias rot13='tr a-zA-Z n-za-mN-ZA-M' |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name domain.com; | |
| autoindex off; | |
| index index.php index.html; | |
| root /srv/www/domain.com/public; |
| <?php | |
| ### --- Snip --- ### | |
| App::after(function($request, $response) | |
| { | |
| // HTML Minification | |
| if(App::Environment() != 'local') | |
| { | |
| if($response instanceof Illuminate\Http\Response) |
| <?php | |
| class NewRelic_Error extends Exception {} | |
| function NewRelic_Date(DateTime $date) { | |
| return $date->format('Y-m-d') . 'T' . $date->format('H:i:s') . 'Z'; | |
| } | |
| function NewRelic_Metrics2Array(SimpleXMLElement $result) { | |
| $return = array(); |
| <?php | |
| /** | |
| * Turn all URLs in clickable links. | |
| * | |
| * @param string $value | |
| * @param array $protocols http/https, ftp, mail, twitter | |
| * @param array $attributes | |
| * @return string | |
| */ | |
| public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array()) |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.