Skip to content

Instantly share code, notes, and snippets.

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
function sendEmails() {
var emailAddress = 'someone@example.com';
var subject = 'Subject Line';
var message = 'Your message here';
MailApp.sendEmail(emailAddress, subject, message, {
htmlBody: message,
cc : 'cc@example.com',
bcc : 'bcc@example.com'
});
ssh -i /path/my-key-pair.pem my-instance-user-name@my-instance-public-dns-name
# 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]
</IfModule>
# END WordPress
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"url": "http://www.example.com",
"name": "Unlimited Ball Bearings Corp.",
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-401-555-1212",
"contactType": "Customer service"
<?php
/*
Template Name: Ajax Demo
*/
<h3>Simple AJAX in Wordpress Demo</h3>
<button id="triggerajax" onclick="fetchposts()">Click to Fetch Posts</button>
<div id="postcontainer"></div>
/* Ajax Function */
add_action("wp_ajax_my_ajax_action", "my_ajax_handler");
add_action("wp_ajax_nopriv_my_ajax_action", "my_ajax_handler");
function my_ajax_handler() {
$args = array(
'post_type' => 'post',
'post_status' => 'publish',