Skip to content

Instantly share code, notes, and snippets.

View ackernaut's full-sized avatar

Terry Acker ackernaut

View GitHub Profile
@ackernaut
ackernaut / _breakpoints-fibonacci.scss
Last active August 29, 2015 14:22
Breakpoints on a Fibonacci scale
// Breakpoints on a Fibonacci scale
// --------------------------------
$bp-s0-min: 0px;
$bp-s0-max: 99px;
$bp-s1-min: 100px;
$bp-s1-max: 199px;
$bp-s2-min: 200px;
$bp-s2-max: 299px;
$bp-s3-min: 300px;
:first-child i === 0
:last-child i === arr.length - 1
:only-child arr.length === 1
:nth-child(even) i % 2
:nth-child(odd) !(i % 2)
:nth-child(n) i === n - 1
:nth-last-child(n) i === arr.length - n
@ackernaut
ackernaut / _mq-high-res.scss
Created July 22, 2016 18:45
Sass media query for high resolution (with optional min-width version)
// _mq-high-res.scss
@mixin mq-high-res {
@media only screen and (-webkit-min-device-pixel-ratio: 1.3),
only screen and (-o-min-device-pixel-ratio: 13/10),
only screen and (min-resolution: 120dpi)
{
@content;
}
@ackernaut
ackernaut / randomUnsplash.js
Created August 17, 2016 20:02
Get random image from unsplash
// Requires jQuery or Zepto
// Get Random Image (unsplash.it)
var jsRandomImg = $('.js-random-img');
function getRandomIntInclusive(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}

Keybase proof

I hereby claim:

  • I am ackernaut on github.
  • I am ackernaut (https://keybase.io/ackernaut) on keybase.
  • I have a public key ASDh34Vswpw7tnWdkirjceTgwFUP3WNvQpSlboNFKAoqdwo

To claim this, I am signing this object: