View gist:4770306
jQuery('a[href*=".amazon."]').click(function(){ | |
_gaq.push(['_trackPageview', '/aff/'.jQuery(this).html()]); | |
}); |
View toc.css
#toc li { | |
font-size: 80%; | |
line-height: 1; | |
} | |
#toc .h2 { | |
font-size: 90%; | |
} | |
#toc .h3 { | |
font-size: 70%; | |
margin-left: 1em; |
View gist:4770325
// Add 'first' class to intro text in #post-content container | |
$('#post-content>p:not(:has(img))').eq(0).addClass('first'); |
View gist:4770332
// Load Prettyprint only if needed | |
if ($('.content pre').length > 0) { | |
$('.content pre').addClass('prettyprint'); | |
$('head').append('<link href="/prettify.css" type="text/css" rel="stylesheet" /><script type="text/javascript" src="prettify.js"></script>'); | |
prettyPrint(); | |
} |
View gist:4770337
// Add target blank and track outgoing links in Google Analytics | |
// Method 1 (recommended): Event delegation. Track as Event. | |
// 'click' | |
// element and class names (i.e. a.button) | |
// href value clicked | |
$('body').on('click', function( e ) { | |
var target = $(e.target); | |
if ( target.tag == 'A' ) | |
{ |
View gist:4987211
<p>Below is just about every <abbr title="HyperText Markup Language">HTML</abbr> element you might want to use in your blog posts. Check the source code to see the many embedded elements within paragraphs.</p> | |
<hr /> | |
<h1>Heading 1</h1> | |
<h2>Heading 2</h2> | |
<h3>Heading 3</h3> | |
<h4>Heading 4</h4> | |
<h5>Heading 5</h5> | |
<h6>Heading 6</h6> |
View gist:4995633
<!-- Deprecated --> | |
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/GUL8B3CPmmc&autoplay=1&controls=0&rel=0&showinfo=0&iv_load_policy=3&theme=light&modestbranding=1" width="601" height="338" id="player" style="visibility: visible;"></object> | |
<!-- New --> | |
<iframe width="560" height="315" src="https://www.youtube.com/embed/FV7wx01BGQk?controls=2&modestbranding=1&rel=0&showinfo=0&hl={{ config.lang }}" frameborder="0" allowfullscreen></iframe> | |
<!-- | |
Documentation: https://developers.google.com/youtube/player_parameters |
View gist:5005111
document.getElementById('ID-headerPanel').style.display='none'; | |
document.getElementById('ID-headerTabPanel').style.display='none'; | |
document.getElementsByClassName('uI')[0].style.marginTop=0; | |
document.getElementById('ID-navToggle').click(); | |
if (document.getElementsByClassName('ACTION-remove')[0]) {document.getElementsByClassName('ACTION-remove')[0].click();} | |
document.getElementById('ID-reportHeader-toolbarSection').style.display='none'; | |
document.getElementById('ID-reportHeader-titleSection').style.display='none'; |
View lemon_mysql.php
<?php | |
/** | |
* A quick little function to interact with a MySQL database. | |
* Updated by Xavi Esteve to use mysqli, original by AngeloR (https://gist.github.com/AngeloR/919695) | |
* | |
* When working with Limonade-php a full-fledged MySQL wrapper seems like | |
* overkill. This method instead accepts any mysql statement and if it works | |
* returns either the result or the number of rows affected. If neither worked, | |
* then it returns false | |
* |
View is-touch.js
/** | |
* TOUCH DEVICE | |
* Detects touch devices | |
* Usage: if (is_touch_device) { yes! } | |
*/ | |
var is_touch_device = 'ontouchstart' in document.documentElement; | |
OlderNewer