sudo apt update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE DATABASE dbname; | |
| USE dbname; | |
| CREATE USER 'dbusr'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxxxxxxxxxxxxxx'; | |
| GRANT ALL PRIVILEGES ON dbname.* TO dbusr@'localhost' WITH GRANT OPTION; | |
| FLUSH PRIVILEGES; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global $wp_query; | |
| $paged = get_query_var('paged', 1); | |
| $args = array( | |
| 'post_type' => '{your_post_type_name}', | |
| 'meta_query' => array('{add your meta query argument if need}'), | |
| 'orderby' => 'modified', | |
| 'order' => 'DESC', | |
| 'posts_per_page' => 20, | |
| 'paged' => $paged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name www.domain.com domain.com; | |
| return 301 https://domain.com$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; # managed by Certbot | |
| ssl_certificate /etc/letsencrypt/live/thewritekit.com/fullchain.pem; # managed by Certbot | |
| ssl_certificate_key /etc/letsencrypt/live/thewritekit.com/privkey.pem; # managed by Certbot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a.skip-main { | |
| left:-999px; | |
| position:absolute; | |
| top:auto; | |
| width:1px; | |
| height:1px; | |
| overflow:hidden; | |
| z-index:-999; | |
| } | |
| a.skip-main:focus, a.skip-main:active { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install -y libappindicator1 fonts-liberation | |
| wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
| sudo dpkg -i google-chrome*.deb | |
| sudo apt-get -f install | |
| google-chrome-stable -version | |
| // docs https://developers.google.com/web/updates/2017/04/headless-chrome |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Reference: https://github.com/aws/aws-sdk-php-laravel | |
| ## Setup 1. Include AWS SDK into composer | |
| composer require aws/aws-sdk-php-laravel | |
| ## Setup 2. Publish AWS Class into Laravel | |
| php artisan vendor:publish --provider="Aws\Laravel\AwsServiceProvider" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Requirements | |
| ------------------------- | |
| In wp-admin you do not need to do anything, the js library is always loaded | |
| In the front-end you need to enqueue the script wp-util, like this: | |
| add_action( 'wp_enqueue_scripts', 'my_enqueue_function' ); | |
| function my_enqueue_function() { | |
| // Option 1: Manually enqueue the wp-util library. | |
| wp_enqueue_script( 'wp-util' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* --- Used to display thumbnails automatically created by WordPress --- */ | |
| // Get attachement ID (this is circuitous, but seems to be the most "wordpress" way w/o needing plugins, etc | |
| $attachment_id = array_keys(get_attached_media('*,*',$post->ID))[0]; | |
| // Once you have the attachment_id, proceed as normal | |
| echo wp_get_attachment_image( $attachment_id, 'full', $icon, $attr ); |
NewerOlder