Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Curtis rbrcurtis

View GitHub Profile
@rbrcurtis
rbrcurtis / QueryStreamer.ts
Last active Sep 18, 2020
stream postgres query via cursor into sequelize model
View QueryStreamer.ts
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 Mar 6, 2012
Spine with Jquery Mobile
View index.coffee
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 Jan 18, 2012
debug info for campfire
View az-campfire.debug
[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