Find /list all files bigger than 5MB and delete them in command line for linux/mac

find . -type f -size +3000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’ ./Uploads/Page-Photos/About-Us/9653a21167/DSCN1703.JPG: 3.3M ./Uploads/103eca7540/tori.jpg: 4.4M ./Uploads/845d819c4d/FCU-157_master.jpg: 4.1M ./Uploads/PDF-Forms/Annual-Reports/fe6ddf67be/First-Credit-Union-Annual-Report-2015.pdf: 19M ./Uploads/PDF-Forms/Annual-Reports/802f311485/First-Credit-Union-Annual-Report-2018.pdf: 3.0M   $ find . -type f -size +3000k -exec ls -lh {} \; -rw-r–r– 1 xx staff 6.3M 4 Jun 09:21 ./Images/Promotions/eace8a9a35/Staff-1.jpg -rw-r–r– 1 xx …

Run/install compser update/install in a shared hosting space/server

First run these commands to download and install composer: cd ~ mkdir bin mkdir bin/composer curl -sS https://getcomposer.org/installer | php mv composer.phar bin/composer Determine the location of your php-cli (needed later on): which php-cli (If the above fails, use which php) It should return the path, such as /usr/bin/php-cli, /usr/php/54/usr/bin/php-cli, etc. edit ~/.bashrc and make sure …

Create/generate PDF file in Silverstripe via Dompdf

install dompdf first: composer require dompdf/dompdf in Silverstripe controller: use Dompdf\Dompdf; use SilverStripe\Control\Email\Email; $pdfHtml = $memberapplication->renderWith(‘PDF/NewMemberPdf’); exit($pdfHtml); // uncomment for pdf debug $dompdf = newDompdf(); $dompdf->loadHtml($pdfHtml); $dompdf->setPaper(‘A4’, ‘portrait’); $dompdf->render(); //$dompdf->stream(); $pdfData = $dompdf->output(); $pdfFilename = ‘pdf/NewMemberPdf-‘.$memberapplication->ID.’.pdf’; file_put_contents($pdfFilename,$pdfData); // will save to public/pdf folder PDF/NewMemberPdf.ss in the SilverStripe templates folder using $memberapplication object’s variables send an email …

Install Larvel telescope for dev env

$ composer require laravel/telescope –dev Problem 1 – phpoffice/phpspreadsheet 1.5.2 requires ext-zip * $ sudo port install php72-zip   Problem 1 – dompdf/dompdf v0.8.2 requires ext-gd * $ sudo port install php72-gd php artisan telescope:install php artisan migrate php artisan telescope:publish After running telescope:install, you should remove the TelescopeServiceProvider service provider registration from your app configuration file. Instead, manually register …

How to fix _this.props.dispatch is not a function in React.JS

When you got error _this.props.dispatch is not a function, you can try below things: 1) Convert the (handleSubmit) function to an arrow function so in that case, it won’t have its own this. handleSubmit = (user) => { // …logic here } 2) Create a constructor inside the component and do the next step: this.handleSubmit = this.handleSubmit.bind(this) …

ReactJS support IE11/IE10/IE9/IE8

@php $ua = htmlentities($_SERVER[‘HTTP_USER_AGENT’], ENT_QUOTES, ‘UTF-8’); if (preg_match(‘~MSIE|Internet Explorer~i’, $ua) || (strpos($ua, ‘Trident’) !== false )) { //echo ‘<h3>Only for IE</h3>’ . $ua; echo'<script src=”https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.4.0/polyfill.min.js”></script>’; } @endphp

Sass .scss: Nesting and multiple classes? eg. div.myClass

use the parent selector reference &, it will be replaced by the parent selector after compilation: // override the text on the banner $banner-text-height : 125px; $anchor-hero-height : 75px; .hero-new-section { height: 300px; // default height and can be reset at back-end margin-bottom: $banner-text-height; background-position: 50% 50%; .new-hero-card { width: 100%; height: $banner-text-height; bottom: -$banner-text-height; …

How to fix Support for the experimental syntax ‘classProperties’ isn’t enabled

Error: esources/reactSkilledMigrantPoint/containers/TaskAddContainer.js failed (from ./node_modules/babel-loader/lib/index.js): F:\document_root_002\xinxilan.org\laravel\resources\reactSkilledMigrantPoint\containers\TaskAddContainer.js: Support for the experimental syntax ‘classProperties’ isn’t enabled (20:18): andleChange = event => { ^ this.setState({ [event.currentTarget.name]: event.currentTarget.value }); lugin-proposal-class-properties (https://git.io/vb4SL) to the ‘plugins’ section of your Babel config to enable transformation. t.raise (F:\document_root_002\xinxilan.org\laravel\node_modules\@babel\parser\lib\index.js:3851:17)   How to fix: add .babelrc to the root path: { “presets”: [ “@babel/preset-env”, “@babel/preset-react” …