Skip to content

Instantly share code, notes, and snippets.

View theduderog's full-sized avatar

Roger Hoover theduderog

  • Confluent, Inc.
  • United States
View GitHub Profile

Keybase proof

I hereby claim:

  • I am theduderog on github.
  • I am theduderog (https://keybase.io/theduderog) on keybase.
  • I have a public key ASDfD4E-i0J6CcckOoPeyLFp_xZj1BfeAIIG88ENSvDAPAo

To claim this, I am signing this object:

[2016-08-02 16:26:08,183] INFO Starting stream thread [StreamThread-1] (org.apache.kafka.streams.processor.internals.StreamThread:215)
[2016-08-02 16:26:08,183] INFO Starting stream thread [StreamThread-2] (org.apache.kafka.streams.processor.internals.StreamThread:215)
[2016-08-02 16:26:08,184] INFO Starting stream thread [StreamThread-3] (org.apache.kafka.streams.processor.internals.StreamThread:215)
[2016-08-02 16:26:08,184] INFO Starting stream thread [StreamThread-4] (org.apache.kafka.streams.processor.internals.StreamThread:215)
[2016-08-02 16:26:08,184] INFO Starting stream thread [StreamThread-5] (org.apache.kafka.streams.processor.internals.StreamThread:215)
[2016-08-02 16:26:08,184] INFO Starting stream thread [StreamThread-6] (org.apache.kafka.streams.processor.internals.StreamThread:215)
[2016-08-02 16:26:08,184] INFO Starting stream thread [StreamThread-7] (org.apache.kafka.streams.processor.internals.StreamThread:215)
[2016-08-02 16:26:08,184] INFO Started Kafka Stream process (org.apache.kafka.s
@theduderog
theduderog / node-odbc-invalid-handle.js
Last active December 22, 2015 05:49
Delayed destructor is node-odbc eventually causes SQL_INVALID_HANDLE to always be returned
var odbc = require('odbc'),
util = require('util'),
count = 0;
var getSchema = function () {
var db = new odbc.Database();
console.log(util.format('Count %s, time %s', count, new Date()));
console.log(db);
@theduderog
theduderog / Q-setImmediate
Last active December 19, 2015 15:59
Q does not resolve callbacks until next round of setImmediate()
var q = require('q')
, assert = require('assert')
, dOrigin = q.defer()
, dDependent = q.defer() //this one gets resolved by callbacks from dOrigin
, dDependent2 = q.defer() //this one gets resolved by linking directly to dOrigin
;
//Link to dOrigin by registering callbacks
dOrigin.promise.then(
function (result) {
@theduderog
theduderog / gist:989911
Created May 24, 2011 22:35
MS Outlook for Mac - get rid of yourself in "Reply All"
tell application "Microsoft Outlook"
set myAlias to "your.email@foo.com"
set listMessages to selected objects
set theMessage to first item of listMessages
set outgoingMessage to reply to theMessage
set theSender to sender of outgoingMessage
set theSenderAddress to the address of theSender
set theSenderName to the name of theSender
@theduderog
theduderog / Twisted Transformer.py
Created February 1, 2011 17:31
Basic setup for how you consume from one queue and produce into another
import logging
import simplejson
from twisted.internet import reactor, defer
from stompest.async import StompConfig, StompCreator
class IncrementTransformer(object):
IN_QUEUE = '/queue/testIn'
OUT_QUEUE = '/queue/testOut'
ERROR_QUEUE = '/queue/testTransformerError'
@theduderog
theduderog / Simple Client.py
Created February 1, 2011 17:30
Simple producer
from stompest.simple import Stomp
QUEUE = '/queue/simpleTest'
stomp = Stomp('localhost', 61613)
stomp.connect()
stomp.send(QUEUE, 'test message1')
stomp.send(QUEUE, 'test message2')
stomp.disconnect()
@theduderog
theduderog / Using Timeout Decorator.py
Created December 10, 2010 00:51
Like any decorator, you can use timeout with the @timeout(secs) syntax or manually pass in a function to wrap
from twisted.internet import defer, reactor
@defer.inlineCallbacks
def main():
client = Client()
foo_with_timeout = timeout(5)(client.foo)
try:
result = yield foo_with_timeout(x=1, y=2)
finally:
reactor.stop()
@theduderog
theduderog / Twisted Timeout Decorator.py
Created December 10, 2010 00:12
A decorator for adding timeouts to Deferred calls that don't offer an alternative
#
# This gist is released under Creative Commons Public Domain Dedication License CC0 1.0
# http://creativecommons.org/publicdomain/zero/1.0/
#
from twisted.internet import defer, reactor
class TimeoutError(Exception):
"""Raised when time expires in timeout decorator"""