Skip to content

Instantly share code, notes, and snippets.

@nielsenrc
nielsenrc / wp-automatic-feed-links.php
Created September 9, 2015 19:26
Fix feed links in Wordpress
@nielsenrc
nielsenrc / robots-deny-all.txt
Last active January 4, 2016 12:39
Robots.txt: Deny All Robots.txt
User-agent: *
Disallow: /
@nielsenrc
nielsenrc / htaccess | Implement Browser Caching
Last active January 4, 2016 12:39
htaccess: Implement Browser Caching
## 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 application/pdf "access 1 month"
ExpiresByType text/javascript "access 1 month"
@nielsenrc
nielsenrc / JS: Google + Asynchronous Snippet.js
Last active April 26, 2016 19:28
JS | Google + Asynchronous Snippet
<script type="text/javascript"
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js?onload=onLoadCallback';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
@nielsenrc
nielsenrc / PHP | Show Content Only to My IP.php
Last active January 4, 2016 11:58
PHP | Show Content Only to My IP
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip == "[ip]"):
//do things
endif;
?>