Skip to content

Instantly share code, notes, and snippets.

app.post('/app/download.:format', function(req, res) {
if (req.body.attachment) {
console.log("Format is " + req.params.format);
io.setPath('/js/socketio-client/');
var socket = new io.Socket(null, {port: 100}),
game = ko.model(),
input = ko.model({
command: ko.observable('')
}),
canvas = document.getElementById('canvas'),
ctx = canvas.getContext('2d'),
commands = {
script#pageTemplate(type='text/html')
tr.page
td.name
.tool
| <a data-bind='text: name, attr: {href: url}, click: clickAction'></a>
.thumb
| <img data-bind="attr: {src: thumb}" />
td.edit
.tool
a.write(data-bind='click: editMe', href='#')
remote: Waf: Leaving directory `/tmp/node/build'
remote: 'install' finished successfully (0.201s)
remote: DEST_OS: linux
remote: DEST_CPU: ia32
remote: Parallel Jobs: 1
remote: Product type: program
remote: => Installing npm
remote: Configuring node.js application...
remote: => Configuring database...
remote: => Configuring upstart...
#title
h1
span.lead our incredible
strong capabilities
span.tail make us both look good.
#demos
- for(var i = 0; i < 5; i++)
.demo
a(href='/max')
# serve static files
location /images {
root /var/rapp/labs/app/public/;
expires 30d;
}
# pass dynamic content to node
location / {
proxy_pass http://127.0.0.1:90/;
}
@hunterloftis
hunterloftis / gist:973973
Created May 16, 2011 05:25
Zepto + Mustache + KnockoutJS starting point
ko.mustacheTemplateEngine = function () {
this['getTemplateNode'] = function (template) {
var templateNode = document.getElementById(template);
if (templateNode == null)
throw new Error("Cannot find template with ID=" + template);
return templateNode;
}
this['renderTemplate'] = function (templateId, data, options) {
server.use(stylus.middleware({
src: server.set('views') + '/stylus',
dest: server.set('public') + '/styles'
}));
server.configure(function() {
// Settings
server.set('app root', root + '/app');
server.set('view engine', options.view_engine || 'jade');
server.set('views', server.set('app root') + '/views');
server.set('public', server.set('app root') + '/public');
server.set('port', options.port);
server.set('host', options.host);
@hunterloftis
hunterloftis / gist:1025903
Created June 14, 2011 21:14
prepare linode server
# This should be run on a new Linode Ubuntu 32-bit image to prepare it for hosting GTG
# To start, something like this works:
# scp prepare_server.sh root@123.456.789.10:/root
# First, install basic linux utilities (compilers, git, libssl)
cd /root
apt-get update