Skip to content

Instantly share code, notes, and snippets.

@designedbyscience
designedbyscience / gist:5094209
Created March 5, 2013 20:57
Using ImagicMagick with Wordpress (Specifically doing a color image overlay)
function make_blue_image($data){
if(!empty($data)) {
$upload_dir = wp_upload_dir();
if(!empty($data['sizes']) && array_key_exists('blue', $data['sizes'])) {
$filepath = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . dirname($data['file']) . DIRECTORY_SEPARATOR . $data['sizes']['blue']['file'];
}
@designedbyscience
designedbyscience / htmlcacheloop
Last active December 14, 2015 02:39
Bash command for building up a cache manifest with confess.js
for file in *.html; do phantomjs ~/path/toconfess.js http://localhost:8888/$file appcache ~/path/to/config.json >> manifest.cache;done
//Needed for any set of columns
@include grid_prereqs();
.example{
//Include the number of columns to span and the total number of columns
@include span_columns(2, 6);
}
@mixin grid_prereqs(){
.row {
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
line-height: 0;
//Needed for any set of columns
@include grid_prereqs();
//Includes span* and offset classes for a 12 column grid
@include grid_columns(12);
//In your HTML, simply add class <div class="span12_4"></div> will span 4 columns of a 12 column grid
@designedbyscience
designedbyscience / grid_generator.scss
Last active December 10, 2015 22:49
SCSS to generate easy, flexible grid system
@mixin grid_prereqs(){
.row {
*zoom: 1;
}
.row:before, .row:after {
display: table;
content: "";
line-height: 0;
}