Skip to content

Instantly share code, notes, and snippets.

@andershaig
andershaig / gototop.js
Created June 11, 2012 21:29
Scroll Up After AJAX
$(document).bind('didRefreshWidgetContent', function () {
FB.Canvas.scrollTo(0,0); // Go to top of page
});
@andershaig
andershaig / gist:2962351
Created June 20, 2012 21:30
Simple Local HTTP Server
python -m SimpleHTTPServer
@andershaig
andershaig / voting.liquid
Created June 21, 2012 20:05
Voting with Categories Example
{% plugin voting my_voting %}
{% marker my_voting %}
<div class="voting">
{% formblock my_voting %}
{% if my_voting.has_categories %}
{% for category in my_voting.categories %}
<div class="category">
<h1>{{ category.title }}</h1>
{% for entry in category.entries %}
@andershaig
andershaig / countdown.css
Created August 14, 2012 16:38
Moving Countdown from Time Reveal Plugin
/* Countdown */
#clock { margin: 0 auto; overflow: hidden; width: 532px; }
#clock span { display: block; font-weight: 700; }
#clock .separator, #clock .amount { height: 76px; line-height: 76px; }
#clock .separator { float: left; font-size: 18px; font-weight: 700; text-align: center; width: 40px; }
#clock .section { float: left; overflow: hidden; position: relative; text-align: center; width: 103px; }
#clock .amount { background-image: url(//s3.amazonaws.com/wildfireapp/assets/number.png); font-size: 60px; font-weight: 400; letter-spacing: 20px; margin-bottom: 10px; overflow: hidden; padding: 0 7px; }
#clock .label { font-size: 18px; text-transform: uppercase; }
#clock .line { background-image: url(//s3.amazonaws.com/wildfireapp/assets/line.png); height: 2px; left: 0; overflow: hidden; position: absolute; text-indent: -999em; top: 38px; width: 100%; }
@andershaig
andershaig / console.js
Created August 16, 2012 16:14
Empty console.log for browsers lacking
if (!window.console) window.console={log:function(){}};
@andershaig
andershaig / default.css
Created October 23, 2012 17:26
Boilerplate Header
#header-logo {
margin: 30px 0;
}
#header-logo img {
display: block;
margin: 0 auto;
}
@andershaig
andershaig / default.css
Created October 23, 2012 17:31
Boilerplate Sharing
#sharing {
text-align: center;
margin-top: 20px;
margin-bottom: 10px;
overflow: hidden;
}
.like_and_send {
display:inline-block;
}
@andershaig
andershaig / channel.js
Created November 20, 2012 22:52
Test Channel by Class
var channel;
if ($(body).hasClass('fbfanpage')) {
channel = 'fbfanpage';
} else if ($(body).hasClass('fbcanvas')) {
channel = 'fbcanvas';
} else if ($(body).hasClass('microsite')) {
channel = 'microsite';
} else if ($(body).hasClass('mobile')) {
channel = 'mobile';
@andershaig
andershaig / fix.css
Created December 3, 2012 07:27
Temporary Fix for Modal Position
.span4:nth-child(1) .entry-lightbox { top:800px !important; }
.span4:nth-child(2) .entry-lightbox { top:800px !important; }
.span4:nth-child(3) .entry-lightbox { top:800px !important; }
.span4:nth-child(4) .entry-lightbox { top:1061px !important; }
.span4:nth-child(5) .entry-lightbox { top:1061px !important; }
.span4:nth-child(6) .entry-lightbox { top:1061px !important; }
.span4:nth-child(7) .entry-lightbox { top:1322px !important; }
.span4:nth-child(8) .entry-lightbox { top:1322px !important; }
@andershaig
andershaig / gist:4199220
Created December 4, 2012 00:02
rgba(0,0,0,0.75) - Cross Browser
background-color:transparent;
background:rgba(0,0,0,0.75);
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000); /* IE6 & 7 */
zoom: 1;