Skip to content

Instantly share code, notes, and snippets.

View adeolaawoyemi's full-sized avatar
🏠
Working from home

Adeola Awoyemi adeolaawoyemi

🏠
Working from home
  • Yahoo
  • San Jose, CA
View GitHub Profile
@adeolaawoyemi
adeolaawoyemi / reset.css
Created March 20, 2012 23:55
HTML5 CSS Reset
/*
html5doctor.com Reset Stylesheet
v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
Twitter: @rich_clark
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@adeolaawoyemi
adeolaawoyemi / gist:2032887
Created March 14, 2012 00:14
clearfix micro hack
/* For modern browsers */
.cf:before,
.cf:after {
content:"";
display:table;
}
.cf:after {
clear:both;
}
@adeolaawoyemi
adeolaawoyemi / gist:1231640
Created September 21, 2011 09:14
wait for jQuery before using it to bind
var bindTimer = setInterval(function() {
if ("undefined" != typeof jQuery && isMobileDevice) {
$('.myclass').bind('click', clickHandlerToMobilePage);
clearTimeout(bindTimer);
}
}, 50);
@adeolaawoyemi
adeolaawoyemi / gist:909587
Created April 8, 2011 10:02
callBabel with object_property_filter
getPhotoWithTransformations : function(id, forceFetch)
{
if(forceFetch || !(photo = pbx.babel.photos[id]))
{
photo = pbx.babel.callBabel('Community.Photo.Fetch', {
objectid : id,
object_property_filter : ['transformation', 'is_edited']
//object_property_filter : { ':default' : { ':standard' : 't', 'transformation' : 'r', 'is_edited' : 'r' } }
}).response;
pbx.babel.photos[id] = photo;
@adeolaawoyemi
adeolaawoyemi / getName.js
Created February 17, 2011 12:54
function to get a Function's name
Object.prototype.getName = function() {
var funcNameRegex = /function (.{1,})\(/;
var results = (funcNameRegex).exec((this).constructor.toString());
return (results && results.length > 1) ? results[1] : "";
};
@adeolaawoyemi
adeolaawoyemi / no_plan.pl
Created February 7, 2011 10:27
creating a test w/o a plan
#!/opt/local/bin/perl
use strict;
use warnings;
use Test::More;
my $name = 'barney';
my $status = 'in trouble';
ok($name, 'we have $name');
isnt($name, '', "\$name isn't empty");
sub new {
my $self = shift;
my $args = @_ && ref $_[0] eq 'HASH' ? shift : { @_ };
my $class = ref($self) || $self;
return bless $args, $class;
}
@adeolaawoyemi
adeolaawoyemi / ping.rb
Created January 18, 2011 14:12
ping a list of servers to know if they are available
# script to ping server for activity
# Author: Adeola Awoyemi ([email protected])
require 'net/http'
require 'uri'
urls = [
'http://www.photobox.co.uk/',
'http://www.idontexist.co.uk/'
]
@adeolaawoyemi
adeolaawoyemi / gist:745959
Created December 18, 2010 00:19
hilight keywords like 'FIXME:', 'TODO:' and 'BUG:' in code
;; hilight some useful keywords
(set-face-background 'font-lock-warning-face "yellow")
(set-face-foreground 'font-lock-warning-face "black")
(add-hook 'font-lock-mode-hook
(lambda ()
(font-lock-add-keywords nil
'(("\\<\\(FIXME\\|TODO\\|BUG\\):" 1 font-lock-warning-face prepend)))))
@adeolaawoyemi
adeolaawoyemi / 001_home_links.pl
Created December 16, 2010 13:08
Perl Selenium tests for Pbx home page links