Skip to content

Instantly share code, notes, and snippets.

View thebird's full-sized avatar

Brad Birdsall thebird

  • San Francisco, CA
View GitHub Profile
@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 / 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)
var img = new Image();
$(img).load(function () {
setTimeout(function() {
$('section').addClass('full');
$('span').addClass('fix');
$("#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');