Skip to content

Instantly share code, notes, and snippets.

@douglasback
douglasback / sv_performance.php
Created November 1, 2011 18:51
Puts a little Query Count and Template Load time badge at the bottom right of the page. Copy this code into a new snippet, and place it anywhere within the <body> element.
{if member_group == '1'}
<div id="bsd-performance" style="position: fixed; right: 0; bottom: 0; padding: 7px; background: rgba(0,0,0,0.7); color: white; font-family: Verdana, sans-serif; z-index: 999; ">
<span id="bsd-total-queries">{total_queries}</span> queries<br />
<span id="bsd-elapsed-time">{elapsed_time}</span> seconds
</div>
{/if}
@douglasback
douglasback / wrapper.regex
Created October 25, 2011 16:18
wrapper regex
pattern: (href|src)="(\/)((.)*?)"
replace: $1="http://[domain]/$3"
@douglasback
douglasback / button-inset-gradients.css
Created October 12, 2011 21:26
Smoother submit buttons. No more ugly borders.
.your-button-selector {
border: 0;
color: #fff;
background: #007da6;
-webkit-box-shadow: -1px -1px 5px #003b5a inset, 1px 1px 4px #d3e7f2 inset;
-moz-box-shadow: -1px -1px 5px #003b5a inset, 1px 1px 4px #6ec0f7 inset;
-ms-box-shadow: -1px -1px 5px #003b5a inset, 1px 1px 4px #6ec0f7 inset;
-o-box-shadow: -1px -1px 5px #003b5a inset, 1px 1px 4px #6ec0f7 inset;
box-shadow: -1px -1px 5px #003b5a inset, 1px 1px 4px #d3e7f2 inset;
}
@douglasback
douglasback / normalize.css
Created September 21, 2011 20:45
normalize - whitespace
/* 01 =Normalize.css
------------------------- */
/*! normalize.css 2011-08-12T17:28 UTC · http://github.com/necolas/normalize.css */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }
audio:not([controls]) { display: none; }
[hidden] { display: none; }
html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
body { margin: 0; }
body, button, input, select, textarea { font-family: sans-serif; }
@douglasback
douglasback / link-arrow.css
Created September 15, 2011 20:21
Generate arrows for links using nothing but CSS (Webkit, FF, IE8+)