Skip to content

Instantly share code, notes, and snippets.

View kixxauth's full-sized avatar

Kris Walker kixxauth

View GitHub Profile
@kixxauth
kixxauth / contact_form.html
Created November 29, 2010 17:44
Code snippets for a contact form.
<form action="/contactme" method="post">
<textarea id="greeting" name="greeting"></textarea>
<label for="email">email:</label>
<input type="text" id="email" name="email" />
<input type="submit" value="Send" />
</form>
@kixxauth
kixxauth / kristous.conf
Created January 25, 2011 16:48
Use upstart and spark2 to start a hello world http server on node.js
description "kristo.us node.js server"
author "Kris Walker"
start on startup
stop on shutdown
script
cd /home/kixx/development/kristo.us/
exec sudo /home/kixx/local/bin/spark2 2>&1 >> /home/kixx/development/kristo.us/test.log
end script
@kixxauth
kixxauth / fontstack.css
Created January 26, 2011 19:04
My CSS font stack that I always seem to come back to.
/*---------------------------------------------------------
copyright: (c) 2010 by Kris Walker. All rights reserved.
----------------------------------------------------------*/
body {
/* Choose one font-family and delete the rest */
/* sans serif */
font-family: "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, sans-serif;
/* serif */
font-family: "Palatino Linotype", Palatino, "Bitstream Charter", "Book Antiqua", Baskerville, "Nimbus Roman No9 L", "URW Palladio L", "Century Schoolbook L", Georgia, serif;
@kixxauth
kixxauth / datamodel.js
Created March 8, 2011 15:05
Simple JS data modeling
var db = require('db');
var assert = require('assert');
var Q = require('q');
function hash() {
// Hashing function used to make keys etc.
}
var Story = db.Model('Story', {
title: db.StringProperty()
@kixxauth
kixxauth / ebooq-db-binding.js
Created March 17, 2011 20:34
SQLite binding API for milestone 1 for Node.js app.
// Open questions
// --------------
// * Async or synchronous. Which is easier to implment in terms of SQLite for
// milestone 1?
//
// * How will the database be poplulated for milestone 1? I assume through
// another channel during the build process.
//
// * What properties should the connection object/handle passed to the proxy
// functions have so that the proxy functions have all the information they
@kixxauth
kixxauth / basecamp-mobile.html
Created April 3, 2011 17:41
The bootstrap page to load the Basecamp mobile web app.
<!DOCTYPE html>
<html manifest="cache.manifest">
<head>
<meta charset="utf-8" />
<title>Basecamp</title>
<style type="text/css">
html * {
-webkit-transform: translate3d(0,0,0);
-webkit-font-smoothing: antialiased;
@kixxauth
kixxauth / long-polling.html
Created April 11, 2011 01:21
A Node.js http long polling server for HTTP streaming.
<!DOCTYPE html>
<html>
<style type="text/css">
body {
font-size: 18px;
background: #000;
color: #fff;
}
#container {
width: 600px;
@kixxauth
kixxauth / struct.js
Created May 6, 2011 18:11
Data structure for Royal Node
/**
* DAG node
* --------
*/
var tabbar =
[
{ name: "tabname",
title: "Title",
thumbnail: "Icon",
resource_type: "list, movie, image, ...",
@kixxauth
kixxauth / namespaced-events.coffee
Created May 30, 2011 13:59
Namespaced and "stateful" event emitter.
###
# Kris Walker <kixxauth@gmail.com>
# Copyright 2011 Licensed under the MIT License http://opensource.org/licenses/mit-license.php
#
# Namespaced and Stateful events
# * Event names are namespaced
# * Event name specificity is separated by a dot "."
# * Event names get more specific from left to right.
#
@kixxauth
kixxauth / node-static-hang.coffee
Created June 25, 2011 22:58
Hanging responses from Node-static
# This is a factory function which creates a middleware handler
# for serving static files.
#
# We have to use staticServer.serveFile() instead of .serve() because
# we are dynamically rewriting the file path based on the name of the
# application asking for the file.
resourceHandler = (opts) ->
staticServer = new static.Server(STATIC_PATH)