Skip to content

Instantly share code, notes, and snippets.

Christopher Hunt huntc

Block or report user

Report or block huntc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Ringo.scala
package com.typesafe.jse
import akka.actor._
import scala.collection.mutable.ListBuffer
import scala.concurrent.blocking
import java.io._
import akka.contrib.process.StreamEvents.Ack
import akka.contrib.process.{Sink, Source}
import scala.collection.immutable
import com.typesafe.jse.Engine.ExecuteJs
@huntc
huntc / gist:7700511
Last active Dec 29, 2015
Experiments with state transformers for managing file dependencies and other things
View gist:7700511
package com.typesafe.sbt.web
import scalax.collection.Graph
import scalax.collection.GraphEdge.DiEdge
import scala.collection.immutable
import sbt._
import scala.language.higherKinds
/**
* State that represents a directed graph of files.
@huntc
huntc / process.scala
Last active Dec 28, 2015
Prototype Process Actor.
View process.scala
package akka.contrib.process
import akka.actor._
import akka.util.ByteString
import java.io._
import scala.collection.JavaConversions._
import java.lang.{ProcessBuilder => JdkProcessBuilder}
import akka.contrib.process.Process.Started
import akka.contrib.process.StreamEvents.{Done, Ack, Output}
@huntc
huntc / LocalBrowser.scala
Last active Dec 23, 2015
WebDriver browser ideas
View LocalBrowser.scala
package com.typesafe.webdriver
import akka.actor.{FSM, Props, Actor}
import scala.sys.process._
import java.io.File
import com.typesafe.webdriver.LocalBrowser._
import scala.Some
/**
* Provides an Actor on behalf of a browser. Browsers are represented as operating system processes and are
View pom.scala
/**
* Copyright (c) 2012 to original author or authors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
import org.sonatype.maven.polyglot.scala.model._
implicit val scalaVersion = ScalaVersion("2.10.2")
View HelloWorldViewTest.html
<html>
<head>
<script type="text/javascript" src="../../js/org/codehaus/mojo/almond/0.0.2-alpha-1/almond-0.0.2-alpha-1.js"></script>
<script type="text/javascript" src="../../js/org/codehaus/mojo/qunit-amd/1.5.0-alpha-1/qunit-amd-1.5.0-alpha-1.js"></script>
<script type="text/javascript" src="../../js/org/codehaus/mojo/jquery-amd/1.7.1-alpha-1/jquery-amd-1.7.1-alpha-1.js"></script>
<script type="text/javascript" src="../../js/org/codehaus/mojo/jquery-ui-amd/1.8.16-alpha-1/jquery-ui-amd-1.8.16-alpha-1.js"></script>
<script type="text/javascript" src="../../js/HelloWorld/desktop/HelloWorldView.js"></script>
<script type="text/javascript" src="../../js/HelloWorld/desktop/HelloWorldViewTest.js"></script>
<link rel="stylesheet" type="text/css" href="../../css/qunit.css" />
@huntc
huntc / README
Created Jan 29, 2012
socket.io stresstest
View README
1. Start node using the supplied server js e.g.:
node stress-socket.io-server.js
2. Open stress-socket.io.html in your browser
3. Open the console for the above web page in your browser
4. Type "go(1)". You should see something like the following:
Started
Subscribed: 1 Received: 1 Mean: 0.019s Stddev: 0.000s Min: 0.019s Max: 0.019s
Done
5. Now type "go(250)". You should see that 250 are received, but less are for me.
6. After a period of time (say a minute or so), I start seeing the
@huntc
huntc / .gitignore
Created May 3, 2011
test-gemfire-project
View .gitignore
.classpath
.project
.settings
target
BACKUP*
DRLK*
View Application.scala
def render(project: Project.Value, path: String) = EssentialAction { rh =>
val futureAction = project match {
case Project.ConductR =>
conductrDocRenderer.actorRef
.ask(DocRenderer.Render(path))(settings.doc.renderer.timeout)
.map {
case html: Html => Action(Ok(html))(rh)
case action: Action[AnyContent] => action(rh)
case DocRenderer.NotFound(p) => Action(NotFound(s"Cannot find $p"))(rh)
case DocRenderer.NotReady => Action(ServiceUnavailable("Initializing documentation. Please try again in a minute."))(rh)
View SourceInputStream.scala
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.contrib.stream
import akka.actor.{ ActorRef, ActorRefFactory, FSM, Props }
import akka.pattern.ask
import akka.stream.actor.ActorSubscriberMessage.{ OnComplete, OnError, OnNext }
import akka.stream.actor.{ ActorSubscriber, RequestStrategy, ZeroRequestStrategy }
You can’t perform that action at this time.