Skip to content

Instantly share code, notes, and snippets.

View thebird's full-sized avatar

Brad Birdsall thebird

  • San Francisco, CA
View GitHub Profile
$("#contact-form").submit(function(){
var self = $(this),
emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/,
email = $('#email'),
message = $('#message');
if( !email.val() || !emailReg.test(email.val()) ) {
email.parent().addClass('invalid');
} else if ( !message.val() ) {
message.parent().addClass('invalid');
email.parent().removeClass('invalid');
var img = new Image();
$(img).load(function () {
setTimeout(function() {
$('section').addClass('full');
$('span').addClass('fix');
@thebird
thebird / gist:2390778
Created April 15, 2012 07:51
SetTimeout for Morgan :)
setTimeout(function() {
alert('Hey morgan its Brad! This happened 3 seconds after you called this function :)')
}, 3000)
@thebird
thebird / gist:2365462
Last active October 3, 2015 01:47
cross browser inline block ftw
.inline-block {
display: -moz-inline-box;
display:inline-block;
zoom:1;
*display:inline;
vertical-align:top;
}
@thebird
thebird / namespace.js
Created December 6, 2011 19:23 — forked from nzakas/namespace.js
A single global with a namespace method
//BSD Licensed
var YourGlobal = {
namespace: function(ns){
var parts = ns.split("."),
object = this,
i, len;
for (i=0, len=parts.length; i < len; i++) {
if (!object[parts[i]]) {
{
"color_scheme": "Packages/Color Scheme - Default/Blackboard.tmTheme",
"font_face": "Meslo LG S",
"font_size": 13.0,
"gutter": true,
"highlight_line": true,
"line_numbers": false,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"word_wrap": true
<!--[if lt IE 7 ]>
<script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>
CFInstall.check();
</script>
<![endif]-->
@thebird
thebird / gist:995603
Created May 27, 2011 16:17
<hr> cross browsers styling
hr {
background:#d8d8d8;
border:none;
border-bottom:1px solid #fff;
height:1px;
overflow: hidden;
line-height: 1px;
width: 100%;
display: block;
clear:both;
@thebird
thebird / gist:804570
Created January 31, 2011 18:55
Flush DNS on Mac
dscacheutil -flushcache
INCLUDE 'derivative.inc'
XREF MCU_init
XDEF Entry, _Startup, main
ORG $2000
ValueA ds.b 1
ValueB ds.b 1
ValueC ds.b 1
ValueA2 ds.b 1