Skip to content

Instantly share code, notes, and snippets.

View odnarb's full-sized avatar
😜
hacking

Brandon Chambers odnarb

😜
hacking
View GitHub Profile
var request = require('request');
var _ = require('underscore');
//get data from db
var extractQuery = "select top 1000 * from mytable";
var chunkedPostOptions = {
method: 'POST',
rejectUnauthorized: false, //self-signed ssl
headers: {
//This is supposed to be an ACTION inside a sails.js controller.
stream_to_file: function(req, res) {
//WRITE TO FILE, CHUNKED TRANSFER
// console.log( "Processing chunk transfer!" );
var UUIDGenerator = require('node-uuid');
var filename = 'my-stream-' + UUIDGenerator.v4() + '.txt';
var fs = require('fs');
/**
* A simple example of how to use Waterline v0.10 with Express
*/
var express = require('express'),
_ = require('lodash'),
app = express(),
Waterline = require('waterline');
// Require any waterline compatible adapters here