Skip to content

Instantly share code, notes, and snippets.

@fat
fat / gist:859445
Created March 7, 2011 22:58
make this better.
function __tailingFn () {
for (var i = arguments.length; i--;) {
if (typeof arguments[i] == 'function') {
var fn = arguments[i];
arguments[i] = undefined;
return fn;
}
}
}
@fat
fat / gist:3956766
Created October 26, 2012 03:52
module.exports
module.exports = MyModule;
function MyModule (a, b) {
if (!(this instanceof MyModule)) return new MyModule(a, b);
}
@fat
fat / gist:3240888
Created August 2, 2012 21:40 — forked from dustinsenos/gist:3240838
LESS Mixin with String Interpolation, broken?
@cdn: "rons-house";
.add-bg(@url) {
background-image: @url;
}
.foo {
.add-bg(~"url(@{cdn}/bar.png)");
}
@fat
fat / hush.html
Created June 25, 2012 06:38
Hush
<!-- CSS -->
<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/hush.css">
<!-- JS -->
<script src="javascript/hush.js"></script>
@fat
fat / coffin.html
Last active October 6, 2015 08:18
coffin thing
<!-- Defines a coffin drawer -->
<div class="coffin">
<div class="bar">coffin</div>
<ul class="nav">
<li><a data-coffin="click" href="#about">About</a></li>
<li><a data-coffin="click" href="#contact">Contact</a></li>
</ul>
</div>
<!-- Defines a coffin stage -->
@fat
fat / assets.html
Created June 21, 2012 07:17
Basic Coffin Implementation
<!-- CSS -->
<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">
<!-- JS -->
<script src="javascript/coffin.js"></script>
@fat
fat / foo
Created June 21, 2012 07:16
Basic Coffin Implementation
<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 / gist:1933910
Created February 28, 2012 17:44
Looping using Recursive Guards in LESS
.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 January 12, 2012 17:43
Bootstrap Build Server
// ========================================================================
// 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 January 7, 2012 19:23 — forked from sayrer/gist:1504888
Rendering
// 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) {