Skip to content

Instantly share code, notes, and snippets.

@benjaminfisher
benjaminfisher / ICanHazMenu.html
Created February 11, 2012 11:47
Menu driven by ICanHaz
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>ICanHaz Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://github.com/andyet/ICanHaz.js/raw/master/ICanHaz.min.js"></script>
<script type="text/javascript">
@benjaminfisher
benjaminfisher / ImageReplace
Created May 2, 2012 22:55
CSS Image Replacement
header h1{
background-color: transparent;
background-repeat: no-repeat;
border: 0;
direction: ltr;
display: block;
overflow: hidden;
text-align: left;
text-indent: -999em;
*line-height: 0;
@benjaminfisher
benjaminfisher / jQueryFallback.js
Last active April 13, 2018 01:27
Bullet proof jQuery CDN loading using head.js
<script>
head.js('http://code.jquery.com/jquery-1.9.1.min.js', function(){
if(typeof jQuery === 'undefined'){
head.js('js/lib/jquery/jquery-1.9.1.min.js');
};
})
</script>
@benjaminfisher
benjaminfisher / Recommendations.html
Created May 20, 2012 09:23
Script to retrieve LinkedIn recommendations via Raw API
<html>
<head>
<title>Recommendations on LinkedIn</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: [YOUR API KEY]
authorize: true
</script>
<script type="text/javascript">
// Once we have an authorization, fetch the user's profile via API
@benjaminfisher
benjaminfisher / _nav.php
Created May 21, 2012 19:43
Code to generate dynamic navigation from an array
<?php
$current_page = basename($_SERVER['PHP_SELF']);
$navigation = array(
'About Us' => 'about.php',
'Our Products' => 'products.php',
'Contact' => 'contact.php',
'Testimonials' => 'test.php',
'Blog' => 'blog.php'
@benjaminfisher
benjaminfisher / fullscreen.js
Created November 7, 2012 00:03
Cross browser full screen API access
// Find the right method, call on correct element
function launchFullScreen(element) {
if(element.requestFullScreen) {
element.requestFullScreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
@benjaminfisher
benjaminfisher / css-progress-bar.jade
Created November 19, 2012 07:03
CSS Progress Bar
div.progress
div.inner
/* Lettering.JS 0.6.1 by Dave Rupert - http://daverupert.com */
(function($){function injector(t,splitter,klass,after){var a=t.text().split(splitter),inject='';if(a.length){$(a).each(function(i,item){inject+='<span class="'+klass+(i+1)+'">'+item+'</span>'+after});t.empty().append(inject)}}var methods={init:function(){return this.each(function(){injector($(this),'','char','')})},words:function(){return this.each(function(){injector($(this),' ','word',' ')})},lines:function(){return this.each(function(){var r="eefec303079ad17405c889e092e105b0";injector($(this).children("br").replaceWith(r).end(),r,'line','')})}};$.fn.lettering=function(method){if(method&&methods[method]){return methods[method].apply(this,[].slice.call(arguments,1))}else if(method==='letters'||!method){return methods.init.apply(this,[].slice.call(arguments,0))}$.error('Method '+method+' does not exist on jQuery.lettering');return this}})(jQuery);
/* jQuery Lettering Animate - http://www.giuliandrimba.com/labs/lettering-animate/ */
(function(a
<figure>
<!-- Trigger for fader text -->
<img id="ten" src="images/dollars.png" alt="$10" title="$10" width="388" height="214"/>
</figure>
<div id="fader">
<h3>This is the text that you want to fade in</h3>
<div class="mask"><img src="images/mask.png" /></div>
</div>
@benjaminfisher
benjaminfisher / fadein.css
Created December 5, 2012 15:22
CSS for fadein keyframes
/* name, duration, timing function, delay, fill mode */
-webkit-animation: fadeIn 700ms ease-in-out 1s both;
animation: fadeIn 700ms ease-in-out 1s both;
@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}