Skip to content

Instantly share code, notes, and snippets.

@fat
fat / Tokenahead.less
Created April 18, 2012 04:01
Tokenahead - ghetto typeahead with facebook-like tokens 4 @couch <3
// Tokenahead.less
// ---------------
.tokenahead {
cursor: text;
overflow: hidden;
height: auto;
padding-bottom: 0;
border-color: @inputBorder;
}
@fat
fat / gist:3744369
Created September 18, 2012 17:10
all you probably really need
/*! normalize-all-you-really-need-tho.css v1.0.0 | MIT License */
html {
font-family: sans-serif; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
body {
margin: 0;
# 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:1484342
Created December 16, 2011 03:39
Simple Template
<div class="timeline">
<!-- load more button -->
<button>{{message}}</button>
<!-- tweet object -->
{{#tweets}}
{{> tweet}}
{{/tweets}}
var spawn = require('child_process').spawn
var cp = spawn('git', ['clone', "git://github.com/jquery/jquery.git"])
cp.stdout.setEncoding('utf8')
cp.stderr.setEncoding('utf8')
cp.stdout.on('data', function (data) {
console.log(arguments)
})
@fat
fat / github.js
Created July 2, 2012 03:48
simple basic-auth node github api
// Simple Use:
// ----------
// github('/user/repos', callback);
// github('/repos/:user/:repo/issues', { user: user, repo: repo }, callback);
var request = require('request');
var querystring = require('querystring');
var github = function (path, options, callback) {
var username = 'username';
@fat
fat / gist:3744339
Created September 18, 2012 17:06
normalize jacob's iphone :P
/*! normalize-mobile.css v1.0.0 | MIT License */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/*
* Prevents modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
@fat
fat / lit.js
Created January 25, 2016 04:14
a lambda file to teach alexa is it lit
exports.handler = function (event, context) {
try {
console.log("event.session.application.applicationId=" + event.session.application.applicationId);
if (event.session.application.applicationId !== "amzn1.echo-sdk-ams.app.b67c3ab5-40ec-4345-856e-21c281cfded7") {
context.fail("Invalid Application ID");
}
if (event.request.type === "IntentRequest") {
onIntent(event.request,
@fat
fat / gist:956180
Created May 4, 2011 22:28
better contains
var ALEX = ['foo', 'bar'];
//n00bs write:
if (ALEX.indexOf('foo') > -1) {
//ALEX contains foo
}
//pros write:
if (~ALEX.indexOf('foo')) {
//ALEX contains foo
@fat
fat / gist:1407045
Created November 29, 2011 23:03
Async Loading
!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")