Skip to content

Instantly share code, notes, and snippets.

View Stwissel's full-sized avatar

Stephan H. Wissel Stwissel

View GitHub Profile
@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
@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 / 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 / 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;
<!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!">
import rx.Observable;
import rx.functions.Action0;
import rx.functions.Action1;
/**
* @author stw
*
*/
public class RXTest {
import rx.Observable;
import rx.functions.Action0;
import rx.functions.Action1;
import rx.functions.Func0;
import rx.functions.Func1;
/**
* @author stw
*
*/
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;
@Stwissel
Stwissel / keybase.md
Created December 27, 2016 08:26
Keybase identity claim

Keybase proof

I hereby claim:

  • I am stwissel on github.
  • I am stwissel (https://keybase.io/stwissel) on keybase.
  • I have a public key whose fingerprint is DF99 5261 9EC4 F46C EAB4 AB56 5FB7 DEAC CD7C E989

To claim this, I am signing this object:

@Stwissel
Stwissel / sgspeedtest.sh
Created July 22, 2017 10:23
Command line speed Test for Singapore
#!/bin/bash
# Linux or Mac shell script to test download speeds in Singapore
# using the speedtest CLI https://github.com/sivel/speedtest-cli
# VERY quick and dirty
resultfile=speedresult.asc
speedparam='--secure --simple --server '
date >> $resultfile
echo 2054 Viewqwest Pte Ltd Singapore, Republic of Singapore [12.77 km]
echo 2054 Viewqwest Pte Ltd Singapore, Republic of Singapore [12.77 km] >> $resultfile
speedtest $speedparam 2054 >> $resultfile