Skip to content

Instantly share code, notes, and snippets.

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

Juan Cristobal Pazos jCrip

🏠
Working from home
  • Modyo
  • Santiago, Chile
View GitHub Profile
@jCrip
jCrip / ir.css
Created March 12, 2012 21:11
CSS: Image replacement
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@jCrip
jCrip / pubsub.js
Created March 12, 2012 16:02
jQuery: pub/sub
// PubSub
(function( $ ) {
var o = $( {} );
$.each({
trigger: 'publish',
on: 'subscribe',
off: 'unsubscribe'
}, function( key, val ) {
jQuery[val] = function() {
@jCrip
jCrip / snippet.js
Created March 8, 2012 14:32 — 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],