Skip to content

Instantly share code, notes, and snippets.

@b4z81
b4z81 / ie-css-hacks.css
Created April 15, 2012 08:16 — forked from necolas/ie-css-hacks.css
IE CSS hacks
/*
* Property prefix hacks
*/
/* IE6 only - any combination of these characters */
_ - £ ¬ ¦
/* IE6/7 only - any combination of these characters */
@b4z81
b4z81 / dabblet.css
Created April 17, 2012 09:35 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@b4z81
b4z81 / htaccess.py
Created April 19, 2012 09:10
improve performance
#1: Prevent Hotlinking
RewriteEngine On
#Replace ?mysite\.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
#Replace /images/nohotlink.jpg with your “don’t hotlink” image url
@b4z81
b4z81 / hideaddrbar.js
Created April 19, 2012 09:45 — forked from scottjehl/hideaddrbar.js
Normalized hide address bar for iOS & Android
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){
@b4z81
b4z81 / snippet.js
Created April 19, 2012 13:20 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@b4z81
b4z81 / features.js.php
Created May 7, 2012 16:54
Detector perrequest
<?php
// to be included in your <head></head> tag to run the per-request tests
require(TEMPLATEPATH."/detector/Detector.php");
header("content-type: application/x-javascript");
$test = Detector::perrequest();
?>
@b4z81
b4z81 / detection.js
Created May 9, 2012 10:21
Device Detection
var $window = $(window);
windowWidth = $window.width();
if(screen.width > 959) { // check the size of the monitor
isDestkop = TRUE;
}
elseif(windowWidth > 520 && windowWidth < 959){ // check the size of the browser
isTablet = TRUE;
}
else{
@b4z81
b4z81 / gist:2710788
Created May 16, 2012 14:31 — forked from bjankord/gist:2572749
Picture Source src modification through CSS image-set and URI Templates
<head>
<style type="text/css">
picture source {
src: image-set(url({filename}@2x.{ext} 2x high-bandwidth));
}
@media screen and (min-width:321px){
picture source {
src: image-set(url({filename}-m.{ext}), url({filename}-m@2x.{ext} 2x high-bandwidth));
}
}
@b4z81
b4z81 / snippet.js
Created July 10, 2012 15:39 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@b4z81
b4z81 / Custom.css
Created October 10, 2012 10:04 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*