Skip to content

Instantly share code, notes, and snippets.

View Fauntleroy's full-sized avatar

Timothy Kempf Fauntleroy

View GitHub Profile
@Fauntleroy
Fauntleroy / some page.hbs
Last active December 27, 2015 14:39
Centralized Resources plan
{{!
{
"resources": {
"photos": "photos",
"photos-profile": "photos-profile",
"other": "http://other-api.com/data.json"
}
}
}}
var Mediator = require('./mediator.js');
var Chat = require('./chat.js');
var Player = require('./player.js');
var mediator = new Mediator;
var chat = new Chat({
el: '#chat',
mediator: mediator,
});
define( ['vendor/jquery.js'], function( $ ){
var chat = function( el ){
// just in case this is run before DOM is loaded
$(function(){
var $el = $( el );
var $message_form = $el.find('form');
var $new_message = $el.find(':input.message');
@Fauntleroy
Fauntleroy / gist:6491087
Created September 9, 2013 03:12
Node orm "callback never fired" test case
var orm = require('orm');
var db = orm.connect({
database: 'test',
protocol: 'mysql',
host: '127.0.0.1',
user: 'root',
password: null
});
var pos_cursor = 0;
var fetchResource = function( resource_url, callback ){
var parsed_url = url.parse( resource_url );
var response = '';
var req = http.request({
host: parsed_url.host,
hostname: parsed_url.hostname,
port: 80,
path: parsed_url.path,
method: 'GET',
rejectUnauthorized: false
@Fauntleroy
Fauntleroy / gist:5953802
Created July 9, 2013 00:58
npm error with git dependency
npm http 200 https://github.com/SparkartGroupInc/express-expose.git
npm ERR! not a package /var/folders/m0/z6tt0f9n0g37lwsmrv2l45d40000gn/T/npm-10739/1373330731220-0.09528671065345407/tmp.tgz
npm ERR! Error: ENOENT, open '/var/folders/m0/z6tt0f9n0g37lwsmrv2l45d40000gn/T/npm-10739/1373330731220-0.09528671065345407/package/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "solidus"
@Fauntleroy
Fauntleroy / shiffle
Created May 31, 2013 19:33
Shiffle.
else if( order === 'shuffle' ){
next_item_id = Math.floor( Math.random() * items.length );
}
@Fauntleroy
Fauntleroy / markup.css
Created May 12, 2013 22:29
A terse gist
@import url(http://fonts.googleapis.com/css?family=Roboto:400,700);
body {
padding: 30px;
font-family: 'Roboto', sans-serif;
font-size: 13px;
line-height: 22px;
color: rgb( 25, 25, 25 );
}
@Fauntleroy
Fauntleroy / markup.html
Created May 9, 2013 05:09 — forked from devennorton/markup.html
A terse gist
<!DOCTYPE html>
<html>
<head>
<title>Boku in Heat</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Fusion Tables styling</title>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCu0KqDrN-FYvzwTCzec_EakWQlcPeoPC8&sensor=false"></script>
</head>
<body>
@Fauntleroy
Fauntleroy / markup.html
Created May 9, 2013 05:05 — forked from devennorton/markup.html
A terse gist
<!DOCTYPE html>
<html>
<head>
<title>Boku in Heat</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Fusion Tables styling</title>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCu0KqDrN-FYvzwTCzec_EakWQlcPeoPC8&sensor=false"></script>
</head>
<body>