This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.post('/app/download.:format', function(req, res) { | |
| if (req.body.attachment) { | |
| console.log("Format is " + req.params.format); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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='#') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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/; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server.use(stylus.middleware({ | |
| src: server.set('views') + '/stylus', | |
| dest: server.set('public') + '/styles' | |
| })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
OlderNewer