Skip to content

Instantly share code, notes, and snippets.

View moreguppy's full-sized avatar

Mike Guppy moreguppy

View GitHub Profile
@moreguppy
moreguppy / new_gist_file
Created July 17, 2013 11:59
Get image size
<?php list($width, $height) = getimagesize('PATH_TO_IMAGE'); ?>
<!-- Value of width -->
<?= $width ?>
<!-- Value of height -->
<?= $height ?>
@moreguppy
moreguppy / gist:7b29d01ab66198d9738d
Created July 31, 2014 13:54
Fixes grey bar bug on iPhone when minimal-ui is applied. For iOS7
window.addEventListener("orientationchange", function() {
window.scrollTo(0, 0);
}, false);
@moreguppy
moreguppy / cycle-middleman-method
Created September 11, 2014 11:37
Cycle method for Middleman & HAML
- (1..36).each do |i|
- cycle = i % 2 == 0 ? 'even' : 'odd'
.foo{:class => cycle} #{i}
@moreguppy
moreguppy / _ondevicemotion.js
Created September 19, 2014 14:19
Tilt device for output
window.ondevicemotion = function(event) {
var accelerationX = event.accelerationIncludingGravity.x;
var accelerationY = event.accelerationIncludingGravity.y;
var accelerationZ = event.accelerationIncludingGravity.z;
}
@moreguppy
moreguppy / flexing.scss
Last active August 29, 2015 14:11
Using flexbox for centered floaty layouts
/*
Notes:
- Using bourbon.io
- Currently only supported down to IE10 :(
- This was helpful <http://jonibologna.com/flexbox-cheatsheet/>
- Bourbon flex docs <http://bourbon.io/docs/#flexbox>
*/
@moreguppy
moreguppy / droplet-cheatsheet.md
Last active November 30, 2016 16:30
Droplet Cheatsheet