Skip to content

Instantly share code, notes, and snippets.

View riccardone's full-sized avatar

Riccardo Di Nuzzo riccardone

View GitHub Profile
@riccardone
riccardone / gist:29bcdf99588b2c22022f5eaef0c9de39
Created February 10, 2017 20:45
Apache2 Angular2 static website Dockerfile
FROM ubuntu:16.04
RUN apt update
RUN apt install -y apache2
COPY dist /var/www/html
CMD /usr/sbin/apache2ctl -D FOREGROUND
EXPOSE 80
@riccardone
riccardone / app.component.html
Last active February 19, 2017 08:09
Angular2 Customers module example
<ul>
<li *ngFor="let customer of customersList">{{customer.name}}</li>
</ul>
@riccardone
riccardone / gist:278eaeddfab33479dbe545e291949732
Created February 28, 2018 19:24
httpclient generic post
public async Task<string> Post<T>(string path, T data)
{
using (var client = new HttpClient())
{
client.Timeout = new TimeSpan(0, 0, 5);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var json = JsonConvert.SerializeObject(data);
@riccardone
riccardone / logstash-rdnltd.yml
Last active August 14, 2023 10:40
Configuration example for Logstash: from csv to EventStore
input {
file {
path => ["C:/inbound/*/*.csv"]
start_position => "beginning"
}
}
filter {
fingerprint {
source => "message"
target => "[@metadata][fingerprint]"
@riccardone
riccardone / docker-compose.yaml
Created August 8, 2018 08:30
EventStore docker-compose.yaml
version: '3.4'
services:
esclienttest:
image: testclient
build:
context: .
dockerfile: Dockerfile
depends_on:
- eventstore1
@riccardone
riccardone / Dockerfile
Created August 8, 2018 08:31
Dockerfile C# minimal
FROM mono:4.6.2.16
ADD . /home/TestClusterConnection
CMD [ "mono", "home/TestClusterConnection/TestClusterConnection.exe" ]
@riccardone
riccardone / Program.cs
Created August 8, 2018 08:32
EventStore C# TestClusterConnection App
namespace TestClusterConnection
{
class Program
{
private const string Stream = "MyTestStream";
static void Main(string[] args)
{
try
{
@riccardone
riccardone / config.yaml
Last active January 9, 2019 17:31
EventStore configuration for cluster node example
IntTcpPort: 2111
ExtTcpPort: 2112
IntHttpPort: 2113
ExtHttpPort: 2114
IntTcpHeartbeatInterval: 1500
IntTcpHeartbeatTimeout: 3000
ExtTcpHeartbeatInterval: 1500
ExtTcpHeartbeatTimeout: 3000
GossipIntervalMs: 2000
GossipTimeoutMs: 4000
@riccardone
riccardone / git_fetch_pull_all_subfolders.sh
Created December 5, 2018 17:52 — forked from mnem/git_fetch_pull_all_subfolders.sh
Simple bash script for fetching and pulling all repos in the executed folder to the latest of the branch they are on
#!/bin/bash
################
# Uncomment if you want the script to always use the scripts
# directory as the folder to look through
#REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPOSITORIES=`pwd`
IFS=$'\n'
@riccardone
riccardone / Indexer.cs
Created February 26, 2019 09:03
C# ElasticSearch Synchroniser for CQRS apps
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Timers;
using Nest;
using TaskZero.ReadModels.Elastic.Model;
using Timer = System.Timers.Timer;
namespace TaskZero.ReadModels.Elastic