Skip to content

Instantly share code, notes, and snippets.

@fat
fat / foo
Created Jun 21, 2012
Basic Coffin Implementation
View foo
<head>
<link rel="stylesheet" href="stylesheets/base.css">
<link rel="stylesheet" href="stylesheets/skeleton.css">
<link rel="stylesheet" href="stylesheets/layout.css">
<link rel="stylesheet" href="stylesheets/coffin.css">
</head>
<body>
<!-- Specify an element to toggle your coffin -->
@fat
fat / Tokenahead.less
Created Apr 18, 2012
Tokenahead - ghetto typeahead with facebook-like tokens 4 @couch <3
View Tokenahead.less
// Tokenahead.less
// ---------------
.tokenahead {
cursor: text;
overflow: hidden;
height: auto;
padding-bottom: 0;
border-color: @inputBorder;
}
View gist:2322961
# help text
$ hulk
# help text build all template files
$ hulk /templates/*
# build all templates which end in a mustache extension
$ hulk /templates/*.mustache
# build just the layout template
@fat
fat / gist:1933910
Created Feb 28, 2012
Looping using Recursive Guards in LESS
View gist:1933910
.spanX (@gridColumns) when (@gridColumns = 0) {}
.spanX (@gridColumns) when not (@gridColumns = 0) {
.span1 { .span(@gridColumns); } // need to find out a way to change .span1 into ".span@{gridcolumns}"
#grid .spanX(@gridColumns - 1);
}
.spanX(12); // this actually works
@fat
fat / index.js
Created Jan 12, 2012
Bootstrap Build Server
View index.js
// ========================================================================
// bootstrap-builder v0.1.0
// http://twitter.github.com/bootstrap
// ========================================================================
// Copyright 2011 Twitter, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
@fat
fat / gist:1575714
Created Jan 7, 2012 — forked from sayrer/gist:1504888
Rendering
View gist:1575714
// require hogan
var hogan = require("hogan.js");
// compile template
var template = hogan.compile("@{{name}}");
var team = ['dhg', 'fat', 'jimio', 'nickgreen', 'sayrer'];
team.map(function (twitterer) {
@fat
fat / gist:1484342
Created Dec 16, 2011
Simple Template
View gist:1484342
<div class="timeline">
<!-- load more button -->
<button>{{message}}</button>
<!-- tweet object -->
{{#tweets}}
{{> tweet}}
{{/tweets}}
@fat
fat / gist:1407045
Created Nov 29, 2011
Async Loading
View gist:1407045
!function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (!d.getElementById(id)) {
js = d.createElement(s); js.id = id;
js.src = "//script.js";
fjs.parentNode.insertBefore(js, fjs);
}
}(document, "script", "uniqueID")
@fat
fat / gist:1217433
Created Sep 14, 2011
tabs with history support
View gist:1217433
/* ========================================================
* bootstrap-tabs.js v1.3.0
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@fat
fat / gist:956180
Created May 4, 2011
better contains
View gist:956180
var ALEX = ['foo', 'bar'];
//n00bs write:
if (ALEX.indexOf('foo') > -1) {
//ALEX contains foo
}
//pros write:
if (~ALEX.indexOf('foo')) {
//ALEX contains foo