This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| norm(){ | |
| awk ' | |
| /^import/ { | |
| if(current) print current | |
| current = $0 | |
| } | |
| $0 !~ /^import/ { | |
| current = current $0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.twitter.finagle.example.echo | |
| package router | |
| import com.twitter.finagle.Service | |
| import com.twitter.finagle.builder.{ServerBuilder, ClientBuilder, Server} | |
| import com.twitter.util.Future | |
| import java.net.InetSocketAddress | |
| object EchoServer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* $FreeBSD$ */ | |
| /* $Id: nfs4_subs.c,v 1.3 2004/05/14 18:37:20 marius Exp $ */ | |
| /* | |
| * nfs4client/nfs4_vfsops.c | |
| * | |
| * Copyright (c) 2003, 2004 The Regents of the University of Michigan. | |
| * All rights reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/finagle/finagle-core/src/main/scala/com/twitter/finagle/builder/ClientBuilder.scala b/finagle/finagle-core/src/main/scala/com/twitter/finagle/builder/ClientBuilder.scala | |
| index 1df9c58..32663db 100644 | |
| --- a/finagle/finagle-core/src/main/scala/com/twitter/finagle/builder/ClientBuilder.scala | |
| +++ b/finagle/finagle-core/src/main/scala/com/twitter/finagle/builder/ClientBuilder.scala | |
| @@ -56,7 +56,7 @@ import org.jboss.netty.channel.socket.nio._ | |
| import org.jboss.netty.handler.ssl._ | |
| import org.jboss.netty.handler.timeout.IdleStateHandler | |
| -import com.twitter.util.{Future, Duration, Throw, Return} | |
| +import com.twitter.util.{Future, Duration, Throw, Return, Monitor, NullMonitor} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| exec runscala -dfinagle/finagle-core -dfinagle/finagle-ostrich4 -dfinagle/finagle-http "$0" "$@" | |
| !# | |
| import java.net.InetSocketAddress | |
| import com.twitter.finagle._ | |
| import com.twitter.finagle.builder._ | |
| import com.twitter.finagle.http._ | |
| import com.twitter.finagle.stats.OstrichStatsReceiver | |
| import org.jboss.netty.handler.codec.http._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait LogicLike[A, This[A] <: LogicLike[A, This]] { | |
| def or(t: => This[A]): This[A] | |
| def map[B](f: A => B): This[B] | |
| def flatMap[B](f: A => This[B]): This[B] | |
| def filter(p: A => Boolean): This[A] | |
| def split: Option[(A, This[A])] | |
| def |(t: => This[A]): This[A] = or(t) | |
| def run(n: Int): List[A] = | |
| if (n <= 0) Nil else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defvar git-grep-history '()) | |
| (defvar git-grep-command "git grep -nH") | |
| (defvar git-tree-command "git rev-parse --show-cdup") | |
| ;; from http://www.emacswiki.org/emacs/ElispCookbook | |
| (defun chomp (str) | |
| "Chomp leading and tailing whitespace from STR." | |
| (let ((s (if (symbolp str) (symbol-name str) str))) | |
| (replace-regexp-in-string "\\(^[[:space:]\n]*\\|[[:space:]\n]*$\\)" "" s))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.twitter.test; | |
| import java.net.InetSocketAddress; | |
| import java.net.SocketAddress; | |
| import java.util.concurrent.Executors; | |
| import org.apache.thrift.TException; | |
| import org.apache.thrift.protocol.TBinaryProtocol; | |
| import com.twitter.finagle.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.LinkedBlockingQueue | |
| import java.util.concurrent.atomic.AtomicInteger | |
| object Hotpotato { | |
| private val nwaiters = new AtomicInteger(0) | |
| private val executionQueue = new LinkedBlockingQueue[Function0[Unit]] | |
| def serialized(f: => Unit) { | |
| executionQueue offer { () => f } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # $ sshm /fifo/directory host1 host2 host3... | |
| # $ sshm -k /fifo/directory | |
| # $ sshm /fifo/directory -c "ls" | |
| # XXX - extra ssh flags | |
| # set -- $(getopt kc "$@") |