Skip to content

Instantly share code, notes, and snippets.

View huntc's full-sized avatar

Christopher Hunt huntc

View GitHub Profile
@huntc
huntc / .gitignore
Created May 3, 2011 21:15
test-gemfire-project
.classpath
.project
.settings
target
BACKUP*
DRLK*
@huntc
huntc / README
Created January 29, 2012 10:31
socket.io stresstest
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
<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 / pom.scala
Last active December 21, 2015 21:18
pom for tesla-polyglot-scala/pom.xml (original xml here: https://github.com/huntc/tesla-polyglot/blob/master/tesla-polyglot-scala/pom.xml)
/**
* 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")
@huntc
huntc / LocalBrowser.scala
Last active December 23, 2015 12:19
WebDriver browser ideas
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
@huntc
huntc / process.scala
Last active December 28, 2015 01:59
Prototype Process Actor.
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 / gist:7700511
Last active December 29, 2015 16:58
Experiments with state transformers for managing file dependencies and other things
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.
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 / a.js
Last active January 2, 2016 18:59
Shows how NODE_PATH, amdefine and Node can be used together to run things with multiple context paths.
/*global define */
// This file for the target/public folder
define(function() {
return 1;
});
@huntc
huntc / main.scala
Created February 5, 2014 07:12
Illustrates how a single Itinerary or an array of Itinerary objects can be rendered as a List[Itinerary]
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.json._
case class Itinerary(name: String)
object Itinerary {
implicit val format = Json.format[Itinerary]