Skip to content

Instantly share code, notes, and snippets.

@marekstachura
marekstachura / HttpClient.cs
Last active December 30, 2022 18:28
C# http long polling example
var url = "http://localhost:8082/consumers/my_binary_consumer/instances/my_instance/topics/test";
using (var client = new HttpClient())
{
client.Timeout = TimeSpan.FromMilliseconds(Timeout.Infinite);
var request = new HttpRequestMessage(HttpMethod.Get, url);
using (var response = await client.SendAsync(
request,
HttpCompletionOption.ResponseHeadersRead))
@marekstachura
marekstachura / NancyTest.cs
Created July 13, 2015 22:42
Stub rest service using Nancy
using System;
using Nancy;
using Nancy.Hosting.Self;
using NUnit.Framework;
using RestSharp;
namespace NancyApp
{
public class StubModule : NancyModule
{
@marekstachura
marekstachura / devenv-config.json
Created May 5, 2015 10:14
devenv config.json
{
"syncedFolders": [],
"git": {
"version": "2.1.2",
"user": {
"name": "Marek Stachura",
"email": "marek.stachura@laterooms.com"
}
},
"proxy": {
@marekstachura
marekstachura / kafka-docker-compose.yml
Last active June 8, 2023 07:45
Kafka docker-compose.yml
zookeeper:
image: marekstachura/zookeeper-docker
ports:
- 2181:2181
environment:
ZOOKEEPER_MAXCLIENTCNXNS: 0
kafka1:
image: wurstmeister/kafka:0.8.2.0
ports:
- "9092:9092"
@marekstachura
marekstachura / NancyTest.cs
Created April 23, 2015 22:23
Nancy self host with dependency
using System;
using Nancy;
using Nancy.Hosting.Self;
using Nancy.TinyIoc;
using NUnit.Framework;
using RestSharp;
namespace NancyApp
{
public class Bootstraper : DefaultNancyBootstrapper
@marekstachura
marekstachura / booking.json
Last active August 29, 2015 14:16
Create booking
{
"languageCode": "en",
"items": [
{
"id": 69,
"productId": 79,
"type": "carPark",
"arrivalDate": "2015-03-01",
"arrivalTime": "12:00",
"departureDate": "2015-03-10",
@marekstachura
marekstachura / bootstrap.sh
Last active August 29, 2015 13:58 — forked from Wallsays/bootstrap.sh
Chef bootstrap, Ruby 2.1.1, Debian 7
#!/usr/bin/env bash
apt-get -y update
# Install dependencies
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev curl
# Install Ruby 2.1.1 from source
wget ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz
tar -xvzf ruby-2.1.1.tar.gz
cd ruby-2.1.1/
./configure --prefix=/usr/local