Skip to content

Instantly share code, notes, and snippets.

View WebInspectInc's full-sized avatar
:shipit:
shippin' shippin' shippin'

Timothy Miller WebInspectInc

:shipit:
shippin' shippin' shippin'
View GitHub Profile
@WebInspectInc
WebInspectInc / cache_for_a_day.js
Last active August 29, 2015 14:15
JS localStorage basic caching for a day
// Usage: cache_for_a_day('data_id', <data>);
// If you only provide an ID, it gets
// If you provide both, it checks the date and returns cached data if it's been cached less than a day. Otherwise it sets the new data
function cache_for_a_day(id, data) {
var new_data = {};
var old_data = JSON.parse(localStorage.getItem(id));
if (old_data) {
var cache_date = new Date(old_data.cache_date);
@WebInspectInc
WebInspectInc / dabblet.css
Created January 9, 2012 02:13
Pseudo Element Transformation Tests
/**
* Pseudo Element Transformation Tests
* A test of 2-dimensional transforms on pseudo-elements.
*/
.content {
background:grey;
}
.content:after {
position:absolute;
@WebInspectInc
WebInspectInc / dabblet.css
Created January 11, 2012 01:56 — forked from QBobble/dabblet.css
Some <hr> Tests
/*
*Some <hr> Tests
*/
body {
text-align:center;
}
#rule1 {
height:1px;
background:red;
border:2px dashed white;
@WebInspectInc
WebInspectInc / dabblet.css
Created January 20, 2012 00:38
Wazzat Do?
/**
* Wazzat Do?
* An interactive Web Platform Diagram.
* Inspired by Paul Irish: https://github.com/paulirish/lazyweb-requests/issues/38
*/
h1 {
font-size:2em;
padding:3px 10px;
transition:all 0.5s linear;
@WebInspectInc
WebInspectInc / dabblet.css
Created January 20, 2012 01:59
Dabble it!
/**
* Dabble it!
* A nice li'l bookmarklet that makes it easy to open a GitHub Gist in Dabblet.
* Created by Timothy Miller, 2012. http://q-bobble.com/blog/
* Free for you to use however you wisheth.
*/
section {
width:70%;
margin:30px auto;
@WebInspectInc
WebInspectInc / dabblet.css
Created January 20, 2012 20:22
Random color pallete
/**
* Random color pallete
*/
h1 {
margin:0;
padding:50px;
}
h1:first-child {
background:#1F5EFF;
}
@WebInspectInc
WebInspectInc / dabblet.css
Created February 1, 2012 23:19
Border-Box Tests
/**
* Border-Box Tests
*/
div {
width:80%;float:left;
height:200px;
background:blue;
box-sizing:border-box;
-moz-box-sizing:border-box;
padding:30px;
@WebInspectInc
WebInspectInc / dabblet.css
Created February 2, 2012 19:24
3D Transforms Tests
/**
* 3D Transforms Tests
*/
div, div:before {
color:white;
position:absolute;
width:500px;height:200px;
background:rgba(31, 111, 155,1);
transition:all 2s linear;
perspective:200px;
@WebInspectInc
WebInspectInc / dabblet.css
Created February 14, 2012 22:38
CSS Tabs Testing Groundz
/**
* CSS Tabs Testing Groundz
*/
#tabarea1 {
position:relative;
background:slategrey;
height:200px;
}
#tabarea1 > .tab > label {
@WebInspectInc
WebInspectInc / dabblet.css
Created February 19, 2012 21:29
Page flipper
/**
* Page flipper
*/
* {
box-sizing:border-box;
}
.pages {
position:relative;
width:30%; height:250px;