Skip to content

Instantly share code, notes, and snippets.

@benknight
benknight / gist:5127586
Last active December 14, 2015 18:09
Inverted Google Analytics Dashboard. Cool for big screen monitors!
#main-body {
-webkit-filter: invert(100%) hue-rotate(180deg);
zoom: 125%;
}
#ID-overtimePanel {
padding-top: 10px;
}
/* remove margin intended to clear header */
@benknight
benknight / dabblet.css
Created January 28, 2013 02:52 — forked from LeaVerou/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@benknight
benknight / dabblet.css
Created January 17, 2013 21:47
Demonstating negative margin behavior on absolutely positioned elements.
/*
* Demonstating negative margin behavior on absolutely positioned elements.
*
* Conclusion: Browser only changes position when the margin is set on the same side as the position offset.
* E.g. style rule has margin-top and top set, or margin-bottom and bottom. See A & C.
*/
div {
position: absolute;
width: 100px;
height: 100px;
@benknight
benknight / dabblet.css
Created January 7, 2013 23:48
Look! Protocol relative URIs don't work in data URIs.
/**
* Look! Protocol relative URIs don't work in data URIs.
*/
iframe { width: 500px; }
@benknight
benknight / gist:4047491
Created November 9, 2012 18:51
Alfred Shell Script Extension for opening an SSH tunnel via BrowserStack's Java command line tool to test multiple internal hosts.
#!/bin/bash
# BrowserStack SSH Tunnel Setup
# Find your key by logging into BrowserStack and finding your command line tunnel setup info
KEY=YOUR_KEY_HERE
# Add your internal hosts here
INTERNAL_HOSTS=( dev alpha beta whatever whocares )
for host in ${INTERNAL_HOSTS[@]} ; do
@benknight
benknight / dabblet.css
Created October 19, 2012 23:56
Chrome inline-block with floated element page zoom bug
/**
* Chrome inline-block with floated element page zoom bug
*
* Problem: Zooming the page causes text to break to next line with black square above at certain zoom levels.
* This behavior isn't reproduced in other Webkit browsers, namely Safari.
*
* Temporary solutions:
* 1) Setting white-space: no-wrap on the outer <div>
* 2) Using display: inline-block on <i> instead of float: left.
*/
@benknight
benknight / dabblet.css
Created September 18, 2012 19:10
REM demo
/* REM demo */
html { font-size: 19px; }
div { font-size: .5rem }
p { font-size: 2em; }
@benknight
benknight / dabblet.css
Created September 13, 2012 21:48
iframe content via data urls
/* iframe content via data urls */
p { color: blue !important }
@benknight
benknight / gist:3372277
Created August 16, 2012 18:14
Email media queries
/* mobile-specific CSS styles... yee-haw */
@media only screen and (max-device-width: 480px) {
body {
margin: 10px 0;
}
table {
background: none !important;
}
@benknight
benknight / dabblet.css
Created August 13, 2012 17:16
Scroped CSS
/**
* Scroped CSS
* Just checking this out since I enabled it in chrome://flags
*/