composer global require drush/drush:8.2.2
Use drush v8 when working on older versions of Drupal.
Run drush up to update core Drupal and modules from CLI.
References:
| find . -type f -exec file {} \; | awk -F: '{ if ($2 ~/[Ii]mage|EPS/) print $1}' | rename --make-dirs --lower-case --keep-extension --expr 's/[^[:alnum:]\/]+/-/g; s/\A-*//; s/[\^-]*$//' --hardlink --trim --prepend='./optimized/' | |
| find . -type f -exec file {} \; | awk -F: '{ if ($2 ~/[Ii]mage|EPS/) print $1}' | magick '*.jpg[1000x1000]' | |
| convert *.png -set filename:base "%[basename]" "%[filename:base].jpg" | |
| convert '*.*[700x700]' %03d-opt.jpg | |
| convert '*.*[700x700]' -verbose -quality 80 -set filename:base "%[basename]" "%[filename:base].jpg" |
| import React, { Component } from "react" | |
| /* | |
| Challenge: | |
| Given a stateless functional component: | |
| 1. Follow the steps necessary to add state to it, | |
| 2. Have state keep track of whether the user is logged in or not | |
| 3. Add a button that logs the user in/out | |
| a. extra challenge - make the button display "log in" if they're not logged in and "log out" if they are |
composer global require drush/drush:8.2.2
Use drush v8 when working on older versions of Drupal.
Run drush up to update core Drupal and modules from CLI.
References:
| { | |
| "debug": true, | |
| "delay": 0.25, | |
| "lint_mode": "background", | |
| "linters": { | |
| "eslint": { | |
| "@disable": false, | |
| "args": [], | |
| "excludes": [], | |
| "env": { |
| // https://www.npmjs.com/package/gulp-gm | |
| // https://www.npmjs.com/package/gulp-newer | |
| gulp.task('images', () => { | |
| return gulp.src( `${dir.theme_components}/images/**/*` ) | |
| .pipe( $.newer( `${dir.assets}/images` ) ) | |
| .pipe( $.gm( gmfile => { | |
| return gmfile.resize( 1300, 1300 ); | |
| })) | |
| .pipe( $.imagemin({ |
| apt-get update | |
| apt-get install php-xml | |
| composer global require "squizlabs/php_codesniffer=3.*" | |
| mkdir /utilities | |
| cd /utilities | |
| git clone https://github.com/PHPCompatibility/PHPCompatibility.git | |
| cd PHPCompatibility | |
| git checkout tags/8.1.0 |
| #!/bin/bash -e | |
| # Resources | |
| # http://www.ltconsulting.co.uk/getting-wp-cli-work-mamp/ | |
| # http://www.ltconsulting.co.uk/automated-wordpress-installation-with-bash-wp-cli/ | |
| wp-init () { | |
| echo "" | |
| echo "=================================================================" | |
| echo "WP CLI WordPress Installer" |
| <a href="http://www.google.com/calendar/event? | |
| action=TEMPLATE | |
| &text=[event-title] | |
| &dates=[start-custom format='Ymd\\THi00\\Z']/[end-custom format='Ymd\\THi00\\Z'] | |
| &details=[description] | |
| &location=[location] | |
| &trp=false | |
| &sprop= | |
| &sprop=name:" | |
| target="_blank" rel="nofollow">Add to my calendar</a> |
| <?php | |
| ini_set('display_errors', '1'); | |
| error_reporting(E_ALL); |