Change the server location:
composer config --global repo.packagist composer https://packagist.jp
Install composer parallel install plugin:
composer global require hirak/prestissimo
location ~* \.(?:css|js|txt)$ { | |
expires 1M; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay off; | |
add_header Cache-Control "public"; | |
} | |
location ~* \.(?:json|xml|rss|atom)$ { | |
expires 1h; |
{ | |
"version": 1.1, | |
"atDirectives": [ | |
{ | |
"name": "@tailwind", | |
"description": "Use the @tailwind directive to insert Tailwind's `base`, `components`, `utilities`, and `screens` styles into your CSS.\n\n", | |
"references": [ | |
{ | |
"name": "Tailwind's “Functions & Directives” documentation", | |
"url": "https://tailwindcss.com/docs/functions-and-directives/#tailwind" |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
RewriteRule ^wp-admin/includes/ - [F,L] |
// verify that this is a product category page | |
if (is_product_category()){ | |
global $wp_query; | |
// get the query object | |
$cat = $wp_query->get_queried_object(); | |
// get the thumbnail id user the term_id | |
$thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); | |
// get the image URL | |
$image = wp_get_attachment_url( $thumbnail_id ); | |
// print the IMG HTML |
<?php | |
/** | |
* Caching Widgets with transients | |
* | |
* @link http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/ | |
* / | |
class show_ak_events_Widget extends WP_Widget { | |
function show_ak_events_Widget() { | |
/* Widget settings. */ |
<?php | |
function sharelinks( $atts ){ | |
$links = get_transient('share_links' . get_the_ID() ); | |
if($links === false){ | |
// add the links you want | |
$links = "<a href='https://www.facebook.com/sharer.php?u=" . urlencode( get_permalink() ) . "&t=" . get_the_title(). "'></a>"; | |
/** | |
* [http2_server_push description] | |
* @param [type] $content [description] | |
* @return [type] [description] | |
*/ | |
function autoptimize_http2_server_push($content) { | |
$header = "Link: "; | |
if ( preg_match('#="([^"]+/js/autoptimize_[0-9a-f]+\.js)"#', $content, $matches ) ) { | |
$header .= sprintf( |
#!/bin/sh -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will "exit 0" on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution | |
# bits. |
<?php | |
/** | |
* Encrypt Text | |
* @link https://shellcreeper.com/?p=2082 | |
*/ | |
function my_encrypt( $plain_text ){ | |
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); | |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); | |
$h_key = hash('sha256', wp_salt(), TRUE); | |
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $h_key, $plain_text, MCRYPT_MODE_ECB, $iv)); |
Change the server location:
composer config --global repo.packagist composer https://packagist.jp
Install composer parallel install plugin:
composer global require hirak/prestissimo