Skip to content

Instantly share code, notes, and snippets.

View kevinmpowell's full-sized avatar

Kevin Powell kevinmpowell

View GitHub Profile
# Input strings like "52 lb 6 oz" or "8 oz"
def weight_string_to_float(weight_string)
/(?<lb>[0-9]*\slb\s)*(?<oz>[0-9]*\soz)/ =~ weight_string
lbs = 0
unless lb.nil?
lbs += lb.to_i
end
unless oz.nil?
lbs += (oz.to_i * 0.0625)

Easy responsive sprites using grunt-spritesmith and SCSS

Requires grunt-spritesmith which generates a spritesheet from a bunch of images.

This gist passes a custom template for spritesmith to generate the SCSS file.

Gruntfile.js

sprite: {
 src: "images/*.png",
@kevinmpowell
kevinmpowell / dabblet.css
Created October 18, 2012 15:11
Android 2.3.4 2d transform bug when 3d transform rule is given
/**
* Android 2.3.4 2d transform bug when 3d transform rule is given
*/
.rotate-me-working {
position:absolute;
left:50%;
top:50%;
-webkit-transform: rotate(45deg);
}