Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

What if controlling your media queries was as easy as adding on to a Sass list? What if I told you it now is?

This snippet comes from a modified version of mixins in the Aura Responsive Framework and came from me hijacking the respond-to mixin namespace but still wanting to use it for custom media queries. It's a little ugly and requires Sass 3.2+ (for now, (sudo) gem install sass --pre), but it works a charm.

There are two fairly mundane caveats to this method. First, every media query needs to be named. Second, every media query needs a size and assumes min-width and screen. If you want to change min-width, simply add your operator as another option, but if you want to change screen, you need to also include your operator even if you want it to be min-width.

Also, I haven't built in warnings yet for when you do bad things, so bear that in mind.

Without further adue, tada.

body {
font-family: "Helvetica Neue", sans-serif;
line-height: 1.55em;
}
h1,h2 {
line-height: 1.2em;
}
@netlemur
netlemur / gist:1227175
Created September 19, 2011 18:22
nested mongoose models
/*
> db.events.find()
{
"user_id" : ObjectId("4e75ed8dd4512cd934000002"),
"name" : "Event name",
"location" : ObjectId("4e7650b52fac20345d000007"),
"_id" : ObjectId("4e7686bb05a7b00000000009")
}
*/
var os = require('os'),
prevTimes;
function getCpuTimes() {
var cpus = os.cpus(),
times = {
cores: cpus.length
, user: 0
, sys : 0
, nice: 0