Skip to content

Instantly share code, notes, and snippets.

View azharisubroto's full-sized avatar
😁
santuy

Azhari Subroto azharisubroto

😁
santuy
View GitHub Profile
@azharisubroto
azharisubroto / wp-move-scripts-to-footer.md
Created June 18, 2020 08:38 — forked from japalekhin/wp-move-scripts-to-footer.md
Move all scripts to footer in WordPress
@azharisubroto
azharisubroto / .htaccess
Created June 10, 2018 16:41 — forked from jentanbernardus/.htaccess
.htaccess Rules for Better Google Page Speed Results - Here's a set of default rules that I add to any site that I want to significantly increase the speed of. It took a lot of weeding through and testing, but this seems to work the best and will (guarantee not included) increase your Google Page Speed score by taking care of a lot of the cache …
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>
@azharisubroto
azharisubroto / functions.php
Created September 13, 2016 10:53 — forked from anonymous/functions.php
Query Args
<?php
function themeslug_query_vars( $qvars ) {
$vars[] = 'headertype';
return $vars;
}
add_filter( 'query_vars', 'themeslug_query_vars' , 10, 1 );
@azharisubroto
azharisubroto / instagram_scrape.php
Created August 4, 2016 14:54 — forked from cosmocatalano/instagram_scrape.php
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}
@azharisubroto
azharisubroto / php-html-css-js-minifier.php
Created January 28, 2016 15:50 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {