Skip to content

Instantly share code, notes, and snippets.

View msackman's full-sized avatar

Matthew Sackman msackman

View GitHub Profile
@msackman
msackman / websocket.html
Created December 18, 2016 21:38
example doing the very initial handshake with new websocket support
<!DOCTYPE html>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script src="https://rawgit.com/kawanet/msgpack-lite/master/dist/msgpack.min.js"></script>
<script language="javascript" type="text/javascript">
var wsUri = "wss://localhost:9999/ws";
var output;
var websocket;
@msackman
msackman / build.gradle
Created November 26, 2016 18:35
parent project
subprojects {
apply plugin: 'java'
test {
maxParallelForks = 1
environment(
'GOSHAWKDB_DEFAULT_CLUSTER_HOSTS': 'localhost',
'GOSHAWKDB_DEFAULT_CLUSTER_CERT': project(':java-client').projectDir.path.concat('/src/test/resources/defaultClusterCert.pem'),
'GOSHAWKDB_DEFAULT_CLIENT_KEYPAIR': project(':java-client').projectDir.path.concat('/src/test/resources/defaultClientKeyPair.pem'),
'GOSHAWKDB_DEFAULT_ROOT_NAME': 'test'
)
@msackman
msackman / CoDelConsumer.java
Created May 11, 2012 10:05
Using the CoDel Queueing Consumer
package com.rabbitmq.examples;
import java.io.IOException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.ConsumerCancelledException;
import com.rabbitmq.client.QueueingConsumerCoDel.Delivery;
import com.rabbitmq.client.QueueingConsumerCoDel;
@msackman
msackman / QueueingConsumerCoDel.java
Created May 11, 2012 10:00
QueueingConsumer extended with the CoDel algorithm
// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License
// at http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
// the License for the specific language governing rights and
// limitations under the License.
//
Before:
-module(test_cut).
-compile({parse_transform, cut}).
-compile(export_all).
test_cut() ->
F0 = foo(a, b, _, 5+6, _),
F1 = F0(_, e),
F1(c).
-module(test_do).
-compile({parse_transform, erlando}).
-compile(export_all).
test_statet(Arg) ->
StateT = statet:new(maybe), %% statet wrapping of maybe monad
StateT:execStateT(
do([StateT
|| S0 <- StateT:get(),
Before:
-module(test_do).
-compile({parse_transform, erlando}).
-compile(export_all).
test_maybe(Arg) ->
do([maybe
|| X <- return(Arg),