Skip to content

Instantly share code, notes, and snippets.

@klongdesigns
klongdesigns / social-media-scss.scss
Created May 17, 2015 20:55
Social Media Colors SCSS code
/* SASS / Social Media Brand Colors */
$twitter: #00aced;
$facebook: #3b5998;
$googleplus: #dd4b39;
$pinterest: #cb2027;
$linkedin: #007bb6;
$youtube: #bb0000;
$vimeo: #aad450;
$tumblr: #32506d;
@klongdesigns
klongdesigns / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@klongdesigns
klongdesigns / cron-job
Created September 15, 2014 17:29
Cron Job for Wordpress posts setup
php -q /home/survivi/public_html/wp-cron.php
@klongdesigns
klongdesigns / ga-demographics
Created September 5, 2014 14:18
Google Analytics Demographic add lin
//for universal analytics
ga('require', 'displayfeatures');
@klongdesigns
klongdesigns / ga-event-tracking-analytics
Created August 28, 2014 19:52
Google Analytics event tracking code for WordPress
function sendToGA(pagename,section) {
ga('send', {
'hitType': 'event', // Required.
'eventCategory': 'footerLink', // Required.
'eventAction': 'click', // Required.
'eventLabel': 'Footer Link: ' + section,
'eventValue': 4,
'page':'/'+pagename,
});
}
@klongdesigns
klongdesigns / font-sizing rems.less
Last active August 29, 2015 14:04
Less file for setting font sizes in rem
//mixin declaration
.font-size(@sizeValue) {
@remValue: @sizeValue;
@pxValue: @sizeValue;
font-size: ~"@{pxValue}px";
font-size: ~"@{remValue}rem";
}
//media queries set
SELECT post.post_title, post.post_name, tt.name
FROM `wp_posts` AS post
INNER JOIN `wp_term_relationships` AS terms ON ( post.ID = terms.object_id )
INNER JOIN `wp_term_taxonomy` AS tax ON ( terms.term_taxonomy_id = tax.term_taxonomy_id )
INNER JOIN `wp_terms` AS tt ON ( tax.term_id = tt.term_id )
WHERE post.post_type = 'post'
/* iFrame Buster */
<script language="javascript" type="text/javascript">
//if (window!= top) top.location.href = location.href;
(function(window) {
if (window.location !== window.top.location) {
window.top.location = window.location;
}
})(this);
</script>
/* Password Protect Admin section */
ErrorDocument 401 "Unauthorized Access"
ErrorDocument 403 "Forbidden"
<FilesMatch "wp-login.php">
AuthName "Authorized Only"
AuthType Basic
AuthUserFile /home/username/.htpaswrdname
require valid-user
</FilesMatch>
#### Robots.txt file to block others
User-agent: MJ12bot*
Disallow: /
User-agent: NinjaBot
Allow: /
User-agent: Mediapartners-Google*
Allow: /