Skip to content

Instantly share code, notes, and snippets.

@graygilmore
graygilmore / time-difference
Created November 10, 2012 00:41
Time Difference
function timeDifference(current, previous) {
var msPerMinute = 60 * 1000;
var msPerHour = msPerMinute * 60;
var msPerDay = msPerHour * 24;
var msPerMonth = msPerDay * 30;
var msPerYear = msPerDay * 365;
var elapsed = current - previous;
@graygilmore
graygilmore / gist:5862373
Last active February 4, 2021 16:49
Mixin for removing top and bottom margins on first and last child.
@mixin someNameThatMakesSense () {
> *:first-child {
margin-top: 0;
}
> *:last-child {
margin-bottom: 0;
}
@graygilmore
graygilmore / hover-color.scss
Last active February 4, 2021 16:30
The goal of this Sass function is provide a hover color that works with any color on any background. No longer do we need to bundle hover color options with our themes, let Sassy McSasserson take care of that for you.
/*
The Ultimate Hover Color Function
@author Gray Gilmore - http://code.graygilmore.com
The goal of this Sass function is provide a hover color that works
with any color on any background. No longer do we need to bundle
hover color options with our themes, let Sassy McSasserson take care
of that for you.
The hover color, seen in this demo as "After" text, must be visible in
@graygilmore
graygilmore / keybase.md
Last active September 24, 2019 21:48
Keybase Proof

Keybase proof

I hereby claim:

  • I am graygilmore on github.
  • I am graygilmore (https://keybase.io/graygilmore) on keybase.
  • I have a public key ASCdiAvLxQVeICrU96scBFZe5fSHLpwndZ-0Ja0Gl5MFQQo

To claim this, I am signing this object:

@graygilmore
graygilmore / dabblet.css
Created May 3, 2012 18:25 — forked from anonymous/dabblet.css
Weirdness when using "size" and HTML5 number input
/**
* Weirdness when using "size" and HTML5 number input
*/
input {
display: block
}
.small { width: 30px; }
.medium { width: 120px; }
@graygilmore
graygilmore / dabblet.css
Created March 10, 2012 00:38 — forked from anonymous/dabblet.css
Untitled
#wrapper {
width: 900px;
margin: 0 auto;
position: relative;
background: #999;
}
#content {
width: 500px;
#wrapper {
width: 900px;
margin: 0 auto;
position: relative;
background: #999;
}
#content {
width: 500px;
html { background: grey; }
div.photo { border-radius: 5px; overflow: hidden; background-clip: border-box; }
div.photo img { }
@graygilmore
graygilmore / dabblet.css
Created February 16, 2012 21:29 — forked from anonymous/dabblet.css
Untitled
body {
background:#e9e8e1;
}
.button {
display: inline-block;
padding: 8px 13px;
color: #fff;
font-weight: bold;
text-decoration: none;
@graygilmore
graygilmore / dabblet.css
Created February 16, 2012 21:29 — forked from anonymous/dabblet.css
Untitled
body {
background:#e9e8e1;
}
.button {
display: inline-block;
padding: 8px 13px;
color: #fff;
font-weight: bold;
text-decoration: none;