Skip to content

Instantly share code, notes, and snippets.

View optikalefx's full-sized avatar

Sean Clark optikalefx

View GitHub Profile
@optikalefx
optikalefx / gist:3058310
Created July 6, 2012 05:53
render rows
// run 3 loops of 5, to fill with loading boxes
for(var i=0;i<3;i++) {
for(var j=0;j<5;j++) {
$(".news-row:eq("+i+") .news-inner-row").append(
render(template)({
title : "",
image : "",
author : "",
source : "loading...",
body : []
@optikalefx
optikalefx / gist:3058311
Created July 6, 2012 05:53
render rows
// run 3 loops of 5, to fill with loading boxes
for(var i=0;i<3;i++) {
for(var j=0;j<5;j++) {
$(".news-row:eq("+i+") .news-inner-row").append(
render(template)({
title : "",
image : "",
author : "",
source : "loading...",
body : []
// run 3 loops of 5, to fill with loading boxes
for(var i=0;i<3;i++) {
for(var j=0;j<5;j++) {
$(".news-row:eq("+i+") .news-inner-row").append(
render(template)({
title : "",
image : "",
author : "",
source : "loading...",
body : []
$.post("npr/get/41",function(res) {
// loop and place
for(i=0;i<res.length;i++) {
// remove one of the loading boxes
$(".news-row:eq(2) .news-inner-row .loading:first").remove();
// add a good article
$(".news-row:eq(2) .news-inner-row").append(
render(template)(res[i])
);
}
FB.getLoginStatus(function(response) {
}, true);
<?=$_includes->loadDocHead()?>
<?=$_includes->showHeader()?>
<!-- login page -->
<div id="pages">
<div id="login" data-role="page" class="page">
<div class="login-header">Link other accounts:</div>
<div id="facebook" class="loginButton">
<img src="/img/mobile/facebook-logo.png" class="fb-logo" />
{{#each_object quiz_questions}}
<div class="quiz-question-text">{{key}}. {{value.quiz_question}}</div>
<div class="quiz-question-choice">
{{#each_object value.quiz_question_answers}}
<label class="quiz-question-label">
<input type="radio" name="quiz-question-id-{{key}}" class="quiz-question-radio" />
{{value}}
</label>
{{/each_object}}
</div>
{{#each quiz_questions}}
<div class="quiz-question-text">{{@id}}. {{value.quiz_question}}</div>
<div class="quiz-question-choice">
{{#each value.quiz_question_answers}}
<label class="quiz-question-label">
<input type="radio" name="quiz-question-id-{{../@key}}" class="quiz-question-radio" />
{{value}}
</label>
{{/each}}
</div>
@import 'lib/nib'
divide(a, b)
a / b
body
padding:80px
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif
font-size: 13px
line-height: 18px
// Root Version SC.05.27.12
///////////////////////////////////////////////////////////////////////////////
// RootJS is basically a way to write much easier OOP code
// Root.DOM is a helper object to inherit from, so you get a bunch of really cool
// dom stuff, like events, objects tied to elements, and a jQuery plugin arch
///////////////////////////////////////////////////////////////////////////////
(function($, window, document, undefined) {
"use strict";
/////////////////////////////////////////////////////////////////////////////////////////////////////////////