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 / dabblet.css
Created February 22, 2012 23:40
Page flipper
/**
* Page flipper
*/
* {
box-sizing:border-box;
}
.pages {
position:relative;
width:60%; height:250px;
overflow:hidden;
/**
* CSS button
*/
.button {
position:relative;
background-color:green;
background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(255,255,255,.05) 4px, rgba(255,255,255,.05) 8px);
border:4px solid #015401;
border-radius:50%;
/**
* CSS button
*/
.button {
position:relative;
background-color:green;
background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(255,255,255,.05) 4px, rgba(255,255,255,.05) 8px);
border:4px solid #015401;
border-radius:50%;
@WebInspectInc
WebInspectInc / dabblet.css
Created July 26, 2012 17:31
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
* { box-sizing: border-box; }
.form.login { width:280px; margin:0 auto; }
.login > input, .login > button {
width:100%;
height:33px;
@WebInspectInc
WebInspectInc / dabblet.css
Created October 12, 2012 14:53
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
#home-content {
float: left;
position:relative;
width:780px;
margin: 0 auto;
margin-left: 91px;
@WebInspectInc
WebInspectInc / htmlEscape.js
Last active December 9, 2015 21:38
Convert to an HTML string
if (!String.prototype.htmlEscape)
{
String.prototype.htmlEscape = function()
{
return this.replace(/'/g, "'").replace(/"/g, """);
}
}
@WebInspectInc
WebInspectInc / JS Money Manipulation.js
Last active December 9, 2015 21:48
Convert to a money format (E.g. $1,400.44)
var moneySymbol = '$';
if (!Number.prototype.toMoney) {
Number.prototype.toMoney = function(c, d, t)
{
var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "." : d, t = t == undefined ? "," : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
return moneySymbol + s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, moneySymbol + "1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
}
}
@WebInspectInc
WebInspectInc / consolefix.js
Created December 19, 2012 17:11
A fix for web browsers that don't have consoles.
//A fix for (lack of a) console log errors
if (!window.console)
{
window.console = {
log: function(param) { return param; }
}
}
@WebInspectInc
WebInspectInc / rAFAnimate.js
Last active December 27, 2015 00:18
Animation Delay with rAF
function animate (callback, time, oldTime) {
var oldTime = oldTime || new Date().getTime();
var now = new Date();
if (new Date(oldTime + time) < now) {
callback();
oldTime = now.getTime();
}
requestAnimationFrame(function() { animate(callback, time, oldTime); });
}
@WebInspectInc
WebInspectInc / gist:7917047
Created December 11, 2013 19:43
Turn browser into a tiny code editor
Paste into your location bar:
data:text/html, <body oninput='e.firstChild.srcdoc=t2[v="value"]+"<script>"+t0[v]+"<\/script><style>"+t1[v]'onload='for(i=3;i--;)e.innerHTML+="<textarea id=t"+i+">"'id=e><iframe>