Valet switch PHP version with these commands
Install PHP 5.6 and switch Valet to PHP 5.6
valet stop
brew unlink php71
brew install php56
brew install php56-mcrypt
<?php | |
/** | |
* Plugin Name: Deny Giant Image Uploads | |
* Description: Prevents Uploads of images greater than 3.2MP | |
* Author: TJNowell | |
* Author URI: http://tomjn.com | |
* Plugin URI: http://tomjn.com/164/clients-who-upload-huge-camera-photos-decompression-bombs/ | |
* Version: 1.1 | |
*/ |
// using HtmlAgilityPack; | |
// using Newtonsoft.Json.Linq; | |
private static async Task ScrapeOffFormSkeletonFromGoogleFormsAsync(string yourGoogleFormsUrl) | |
{ | |
HtmlWeb web = new HtmlWeb(); | |
var htmlDoc = await web.LoadFromWebAsync(yourGoogleFormsUrl); | |
var htmlNodes = htmlDoc.DocumentNode.SelectNodes("//script").Where( | |
x => x.GetAttributeValue("type", "").Equals("text/javascript") && |
<?php | |
class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu { | |
function start_lvl( &$output, $depth ) { | |
//In a child UL, add the 'dropdown-menu' class | |
$indent = str_repeat( "\t", $depth ); | |
$output .= "\n$indent<ul class=\"dropdown-menu\">\n"; |
SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120) | |
FROM information_schema.processlist | |
WHERE command <> 'Sleep' | |
AND info NOT LIKE '%PROCESSLIST%' | |
ORDER BY time DESC LIMIT 50; |
<?php | |
/** | |
* Super-simple AWS CloudFront Invalidation Script | |
* | |
* Steps: | |
* 1. Set your AWS access_key | |
* 2. Set your AWS secret_key | |
* 3. Set your CloudFront Distribution ID | |
* 4. Define the batch of paths to invalidate | |
* 5. Run it on the command-line with: php cf-invalidate.php |
<?php | |
/** | |
* @author: Biplob Hossain <biplob.ice@gmail.com> | |
* @license MIT | |
*/ | |
namespace BatchProcessing\Console\Command; | |
use Concrete\Core\Console\Command; | |
use Concrete\Core\Support\Facade\Facade; |
img.grayscale.disabled { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); | |
-webkit-filter: grayscale(0%); | |
} |
This assumes you are now connected to the server via SSH.
sudo -s
Enter root mode for admin accessgroupadd devgroup
Create new group to be later granted access to /var/www/htmluseradd -G root,devgroup masterdev
Create new root user. Also add to the devgrouppasswd masterdev
Change password for the new root user# Global composer install for MAMP Users on OSX | |
# http://getcomposer.org/doc/00-intro.md#globally | |
# For PHP 5.4 Use: | |
# alias php=/Applications/MAMP/bin/php/php5.4.4/bin/php; | |
alias php=/Applications/MAMP/bin/php/php5.3.6/bin/php; | |
curl -sS https://getcomposer.org/installer | php; | |
mv composer.phar /usr/local/bin/composer; | |
composer help; |