Skip to content

Instantly share code, notes, and snippets.

View Stwissel's full-sized avatar

Stephan H. Wissel Stwissel

View GitHub Profile
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import rx.Observable;
import rx.functions.Action0;
import rx.functions.Action1;
import rx.functions.Action2;
import rx.functions.Func1;
import rx.Observable;
import rx.functions.Action0;
import rx.functions.Action1;
import rx.functions.Func0;
import rx.functions.Func1;
/**
* @author stw
*
*/
import rx.Observable;
import rx.functions.Action0;
import rx.functions.Action1;
/**
* @author stw
*
*/
public class RXTest {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How to make this draggable</title>
<meta name="description" content="Source code generated using layoutit.com">
<meta name="author" content="LayoutIt!">
@Stwissel
Stwissel / AsyncInputStream.java
Last active March 11, 2024 10:21
AsyncInputStream for vert.x - Take 2
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import io.vertx.core.AsyncResult;
import io.vertx.core.Context;
import io.vertx.core.Future;
import io.vertx.core.Handler;
@Stwissel
Stwissel / AsyncInputStream.java
Last active April 17, 2024 14:12
Wrapping an InputStream into a ReadStream<Buffer> for vert.x
# ==========================================================================
# Copyright (C) 2017-2024 NotesSensei ( https://www.wissel.net/ )
# All rights reserved.
# ==========================================================================
# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0>.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@Stwissel
Stwissel / firsttest.js
Created April 16, 2014 15:46
POC for a filtering proxy, botched attempt
var httpProxy = require('http-proxy');
// Create an array of selects that harmon will process.
var actions = [];
var actionOne = {};
actionOne.query ='body';
actionOne.func = function (node) {
var out = '<h1>You have been proxied</h1>';
node.createWriteStream({ outer: true }).end(out);
console.log("body function called: " + out);
@Stwissel
Stwissel / the config
Last active December 11, 2015 21:28
Docpad Struggles
# Configure DocPad
docpadConfig = {
templateData:
# Get a collection of available categories
getCategoryList: ->
workCollection = @getCollection('documents')
resultCollection = {}
for document in workCollection
resultCollection[document.category] = document.category
return resultCollection