Using 5% increments, quickly see the varients of your color choice side by side for lighten and darken Sass functions
A Pen by Smartass.io on CodePen.
//Grid System Setup | |
.price-row{ | |
@for $i from 1 through 12 { | |
.col-#{$i} { | |
width: 100% / 12 * $i; | |
float: left; | |
box-sizing: border-box; | |
} | |
} | |
margin:0 auto; |
Using 5% increments, quickly see the varients of your color choice side by side for lighten and darken Sass functions
A Pen by Smartass.io on CodePen.
Part 2 of my particle engine tutorial.
Forked from dissimulate's Pen Particle engine tutorial part 2 [a].
A Pen by Smartass.io on CodePen.
$(function() { | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return false; |
Nice input box with a lot of styling based on sibling selectors and psuedo classes.
CSS only, and WCAG 2.0 AA compliant!
A Pen by Andrew Tunnecliffe on CodePen.
<?php | |
$args = array( | |
'meta_key'=>'readmoretext', | |
'meta_value'=>'Go check this out', | |
'post_status'=>'publish', | |
'post_type'=>'post', | |
'orderby'=>'date', | |
'order'=>'DESC' | |
); |
A Pen by Smartass.io on CodePen.
var choices = [ | |
[10, "apples"], | |
[20, "oranges"], | |
[70, "bananas"] | |
]; | |
function pickChoice() { | |
rand = Math.floor(Math.random() * 100); | |
choice = -1; |
This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)
Sister Document - Restore MySQL from Amazon S3 - read that next
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc
// tinyxhr by Shimon Doodkin - licanse: public doamin - https://gist.github.com/4706967 | |
// | |
// tinyxhr("http://site.com/ajaxaction",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data) }); | |
// tinyxhr("http://site.com/ajaxaction",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data) },'POST','value1=1&value2=2'); | |
// tinyxhr("http://site.com/ajaxaction.json",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data); console.log(JSON.parse(data)) },'POST',JSON.stringify({value:1}),'application/javascript'); | |
// cb - a callback function like: function (err,data,XMLHttpRequestObject){ if (err) throw err; } | |
// | |
function tinyxhr(url,cb,method,post,contenttype) | |
{ |