Instantly share code, notes, and snippets.

Chris Aniszczyk caniszczyk

View GitHub Profile
View gist:1ffa583555401777a9f6
### Keybase proof
I hereby claim:
* I am caniszczyk on github.
* I am zx ( on keybase.
* I have a public key whose fingerprint is 24B2 D8E1 F36E 2EFC 7ACC FE3B E7FB 2DB9 DF71 84CD
To claim this, I am signing this object:
View datagrants.rb
require 'csv'
csvs = (1..13).map{|i|"data#{i}.csv", "w")}
CSV.foreach("datagrants.csv") do |row|
puts row # TODO remove
csvs.sample << row
View gist:9192214
There's a metro rail in Austin which is awesome but it doesn't go to many areas yet, they plan on extending the service soon:
To get an idea of apt pricing, here are some that are being built or are built in decent locations that are a bit "fancier" (used to live there, super fancy though and next to Whole Foods HQ) (great location near Zilker, walkable to SoLa, Zilker Park and downtown) (south lamar, close to zilker and new alamo draft house, newly built) (fairly newly built) (older but cheap for its location) (newly built on the east side)
View gist:8921257
val timelineSvc = Thrift.newIface[TimelineService](...) // #1
val tweetSvc = Thrift.newIface[TweetService](...)
val authSvc = Thrift.newIface[AuthService](...)
val authFilter =[Req, AuthReq, Res, Res] { (req, svc) => // #2
authSvc.authenticate(req) flatMap svc(_)
val apiService =[AuthReq, Res] { req =>
timelineSvc(req.userId) flatMap {tl =>
View gist:8921074
class ServerBridge[In, Out](
serveTransport: Transport[In, Out] => Unit,
) extends SimpleChannelHandler {
override def channelOpen(
ctx: ChannelHandlerContext,
e: ChannelStateEvent
val channel = e.getChannel
val transport = new ChannelTransport[In, Out](channel) // #1
View gist:8921026
case class Netty3Listener[In, Out](
pipelineFactory: ChannelPipelineFactory,
channelFactory: ServerChannelFactory
bootstrapOptions: Map[String, Object], ... // stats/timeouts/ssl config
) extends Listener[In, Out] {
def newServerPipelineFactory(
statsReceiver: StatsReceiver, newBridge: () => ChannelHandler
) = new ChannelPipelineFactory { // #1
def getPipeline() = {
val pipeline = pipelineFactory.getPipeline()
View gist:8920924
case class Netty3Transporter[In, Out](
pipelineFactory: ChannelPipelineFactory,
newChannel: ChannelPipeline => Channel =
newTransport: Channel => Transport[In, Out] =
new ChannelTransport[In, Out](_),
// various timeout/ssl options
) extends (
(SocketAddress, StatsReceiver) => Future[Transport[In, Out]]
View gist:8920827
object Netty3Transporter {
val channelFactory: ChannelFactory =
new NioClientSocketChannelFactory(
Executor, 1 /*# boss threads*/, WorkerPool, DefaultTimer
// no-op; unreleasable
override def releaseExternalResources() = ()
} #1
val defaultChannelOptions: Map[String, Object] = Map(
"tcpNoDelay" -> java.lang.Boolean.TRUE,
View gist:8920758
private[netty3] class ChannelConnector[In, Out](
newChannel: () => Channel,
newTransport: Channel => Transport[In, Out]
) extends (SocketAddress => Future[Transport[In, Out]]) {
def apply(addr: SocketAddress): Future[Transport[In, Out]] = {
require(addr != null)
val ch = try newChannel() catch {
case NonFatal(exc) => return Future.exception(exc) #1
// Transport is now bound to the channel; this is done prior to