Skip to content

Instantly share code, notes, and snippets.

Arya Prakasa aryaprakasa

Block or report user

Report or block aryaprakasa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View expire-header.conf
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;
View .htaccess
# 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]
View autoptimize-http2-server-push.php
/**
* [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(
View rc.local
#!/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.
View encryption.php
<?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));
@aryaprakasa
aryaprakasa / composer-fix.md
Created Apr 19, 2018
Fix Composer slow install for SEA
View composer-fix.md
@aryaprakasa
aryaprakasa / eh.conf
Created Jan 2, 2018
Nginx Expires Header
View eh.conf
location ~* \.(css|js)$ {
expires 365d;
}
location ~* \.(jpe?g|png|gif|ico|ogg|mp4|woff2?|ttf|otf|svg)$ {
expires 30d;
}
View enable-autoembed.php
<?php
add_action( 'init', 'ap_enable_autoembed_intro' );
/**
* Run shortcodes and enable autoembed at Genesis archive intro text.
*/
function ap_enable_autoembed_intro(){
/** Global $wp_embed */
global $wp_embed;
@aryaprakasa
aryaprakasa / gist:5501800
Last active Dec 16, 2015
Dequeue Default fontawesome styles from Widget Text Icon plugin
View gist:5501800
add_action( 'wp_enqueue_scripts', 'wti_dequeue_fontawesome_styles' );
/**
* Dequeue Default fontawesome styles from Widget Text Icon plugin
*
*/
function wti_dequeue_fontawesome_styles() {
if ( class_exists( 'Widget_Text_Icon' ) ) {
wp_dequeue_style( 'fontawesome' );
wp_dequeue_style( 'fontawesome-ie7' );
@aryaprakasa
aryaprakasa / gist:5082956
Last active Dec 14, 2015
Remove price display at homepage
View gist:5082956
add_action( 'get_header', 'remove_price_at_homepage' );
/**
* Remove price display and add to chart button at homepage
*
* @see http://docs.woothemes.com/document/hooks/
*/
function remove_price_at_homepage() {
if ( is_home() || is_front_page() ) {
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
You can’t perform that action at this time.