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.get('/upload', checkAuth, function(req, res) { | |
| res.render('upload'); | |
| }); | |
| app.post('/upload', checkAuth, function(req, res) { | |
| console.log('Got Here'); | |
| req.form.complete(function(err, fields, files) { | |
| if (err) { | |
| throw new Error('Upload failed'); |
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.get('/upload', checkAuth, function(req, res) { | |
| res.render('upload'); | |
| }); | |
| //Doesn't work (times out) if checkAuth is used as middleware, works fine without check auth | |
| app.post('/upload', checkAuth, function(req, res, next) { | |
| req.form.complete(function(err, fields, files){ | |
| if (err) { | |
| next(err); | |
| } else { |
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.Draw.findNode = function(e) { | |
| var mousePos = new THREE.Vector3(0, 0, 1), | |
| r, | |
| matrix; | |
| mousePos.x = (e.clientX / window.innerWidth) * 2 - 1; | |
| mousePos.y = (e.clientY / window.innerHeight) * 2 + 1; | |
| mousePos.z = 1; | |
| r = new THREE.Ray(); |
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
| var http = require('http'), | |
| CONFIG = require('./config'), | |
| Client = require('mysql').Client, | |
| fs = require('fs'), | |
| client = new Client(CONFIG), | |
| TEST_DB = 'node_test', | |
| TEST_TABLE = 'test', | |
| count = 0; | |
| client.connect(); |
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.get('/jobs/:id', checkAuth, function(req, res, next) { | |
| Job.findOne({ _id: req.params.id, user_id: req.session.user._id }, function(err, j) { | |
| if (!j) return(new NotFound()); | |
| res.render('jobs/show', { | |
| locals: { | |
| j: j, | |
| user: req.session.user | |
| } | |
| }); |
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
| // with normalizing middleware | |
| app.use(normalizeResponse) | |
| app.get('/account', common, UserRead) | |
| function UserRead(req, res, next) { | |
| // do stuff and attach it onto the res object | |
| // call next() when done | |
| next() |
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 app is full of fail | |
| var express = require("express") | |
| exports.createServer = function() { | |
| var app = express.createServer() | |
| app.get('/', function(req, res) { | |
| process.exit(1) // obviously not going to get past this |
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
| request = require 'request' | |
| _ = require 'underscore' | |
| transformUrl = (host, url) -> | |
| return host + url | |
| onError = (err, req, res) -> | |
| res.send "an error occurred", 500 | |
| makeDefaults = (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
| while [ ! -e /dev/xvdh1 ]; do echo waiting for /dev/xvdh1 to attach; sleep 10; done | |
| while [ ! -e /dev/xvdh2 ]; do echo waiting for /dev/xvdh2 to attach; sleep 10; done | |
| while [ ! -e /dev/xvdh3 ]; do echo waiting for /dev/xvdh3 to attach; sleep 10; done | |
| while [ ! -e /dev/xvdh4 ]; do echo waiting for /dev/xvdh4 to attach; sleep 10; done | |
| while [ ! -e /dev/xvdh5 ]; do echo waiting for /dev/xvdh5 to attach; sleep 10; done | |
| while [ ! -e /dev/xvdh6 ]; do echo waiting for /dev/xvdh6 to attach; sleep 10; done | |
| while [ ! -e /dev/xvdh7 ]; do echo waiting for /dev/xvdh7 to attach; sleep 10; done | |
| while [ ! -e /dev/xvdh8 ]; do echo waiting for /dev/xvdh8 to attach; sleep 10; done | |
| apt-get update > /tmp/apt-get-update.log 2>&1 | |
| apt-get install -y mongodb-10gen > /tmp/apt-mongo.log 2>&1 |
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
| file "/etc/chef/ohai/hints/ec2.json" do | |
| action :create | |
| end | |
| ohai "reload" do | |
| action :reload | |
| end | |
| execute "create and mount non provisioned EBS volumes" do |
OlderNewer