Skip to content

Instantly share code, notes, and snippets.

@rbrcurtis
rbrcurtis / QueryStreamer.ts
Last active March 10, 2024 09:50
stream postgres query via cursor into sequelize model
import { promisify } from 'bluebird'
import { getPostgresClient } from 'lib/connectToDatabase'
import { camelCase, set } from 'lodash'
import { Readable, Stream } from 'stream'
const Cursor = require('pg-cursor')
type ReadFunction = (count: number) => Promise<any[]>
export class QueryStreamer<T> extends Readable {
private constructor(
@rbrcurtis
rbrcurtis / index.coffee
Created March 6, 2012 19:41
Spine with Jquery Mobile
require('lib/setup')
Spine = require 'spine'
Stage = require 'lib/stage'
Router = require 'controllers/router'
class App extends Stage.Global
constructor: ->
@rbrcurtis
rbrcurtis / az-campfire.debug
Created January 18, 2012 19:43
debug info for campfire
[Wed Jan 18 2012 11:42:42 GMT-0800 (PST)]: NotificationsWorker - [campfire] sending '[Fill in the Pit] æ, ø, å (2) was moved from Working to Ready by Ryan Curtis' to agilezen.campfirenow.com/room/466416/speak.json - info
[Wed Jan 18 2012 11:42:42 GMT-0800 (PST)]: NotificationsWorker - json payload is {"message":{"type":"TextMessage","body":"[Fill in the Pit] æ, ø, å (2) was moved from Working to Ready by Ryan Curtis"}} - info
[Wed Jan 18 2012 11:42:43 GMT-0800 (PST)]: NotificationsWorker - [campfire] receieved response code 500 - info
[Wed Jan 18 2012 11:42:43 GMT-0800 (PST)]: NotificationsWorker - Posted message to campfire with result: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n\t"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n\n<head>\n <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>\n <title>Oops, something isn&rsquo;t working.</title>\n <style type="text/css">\n body {\n