// jQuery
$(document).ready(function() {
// code
})
<?php | |
/** | |
* Saves post meta value | |
* | |
* @param int ID of the post | |
* @param string Name of the post_meta key (same as the $_POST key and nonce name) | |
* @param string Name of the nonce key | |
* @param mixed The default value to be assigned if not set | |
* | |
* @return string Value that was saved |
<?php | |
/** | |
* This code is intended to be added to your wp-config.php file just below the top comment block. | |
* It should replace the existing define('DB_*') statements. You can add or remove sections | |
* depending on the number of environments you intend to setup. You should change all values of | |
* DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST for each environment, making them all distinct | |
* for security purposes. | |
*/ | |
// determine the current environment |
jQuery(document).ready(function($) { | |
// load touchdown resposnive nav | |
$('#site-navigation .menu').Touchdown(); | |
// check window size | |
if (matchMedia) { | |
var mq = window.matchMedia("(min-width: 769px)"); | |
mq.addListener(WidthChange); | |
WidthChange(mq); | |
} |
<h1>Advanced Checkbox Hack</h1> | |
<input type="checkbox" id="button" /> | |
<label for="button" onclick>click / touch</label> | |
<div> | |
Change my color! | |
<br> | |
<span>even mine :D</span> | |
</div> |
// Which HTML element is the target of the event | |
function mouseTarget(e) { | |
var targ; | |
if (!e) var e = window.event; | |
if (e.target) targ = e.target; | |
else if (e.srcElement) targ = e.srcElement; | |
if (targ.nodeType == 3) // defeat Safari bug | |
targ = targ.parentNode; | |
return targ; | |
} |
<snippet> | |
<content><![CDATA[ | |
this.inherited(arguments); | |
]]></content> | |
<tabTrigger>inh</tabTrigger> | |
<scope>source.js</scope> | |
<description>this.inherited(arguments);</description> | |
</snippet> |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso