Skip to content

Instantly share code, notes, and snippets.

View alexvictoor's full-sized avatar

Alexandre Victoor alexvictoor

View GitHub Profile
@alexvictoor
alexvictoor / README.md
Created October 28, 2018 15:07
BigInt bitwise micro benchmark

BigInt divide benchmark

BigInt, integers using 64 bits are now available with latest v8, hence NodeJS and Chrome browsers.
With good old JavaScript numbers, bitwise operators are only working on 32 bits.
Now with BigInts, bitwise operators work on 64 bits! The aim of this microbenchmark is to assess the performances of the '>>' operators to divide an integer.

To run the bench:

@alexvictoor
alexvictoor / Test.cs
Created July 5, 2016 23:46
Rx Observable FromEvent example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
@alexvictoor
alexvictoor / README.md
Last active February 8, 2021 19:47
First steps with Flatbuffers in Javascript

This is a tiny sample to help you get up to speed with flatbuffers, javascript flavor. This gist contains a flatbuffers schema, tick.fbs, and the related generated javascript code, tick_generated.js . The git does not include flatbuffers.js itself, you can download it from flatbuffers github repository.
In index.html you will find a simple code fragment showing how to build a flatbuffer "Tick" buffer and how to read a Tick object out of an array of bytes.

If you want to change the model, hence the schema, you need the 'flatbuffers compiler', available for download on flatbuffers release page Then you can use the following command line:

flatc -s tick.fbs --gen-mutable

@alexvictoor
alexvictoor / pom.xml
Last active November 1, 2015 22:43
Jersey + RxJava + Hystrix sandbox
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.alex</groupId>
<artifactId>hystrix-sandbox</artifactId>
<version>1.0-SNAPSHOT</version>
@alexvictoor
alexvictoor / build.xml
Last active October 4, 2017 14:41
Coverage report & sonarqube analysis msbuild script
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!--
msbuild build.xml => compile and run unit tests
msbuild build.xml /t:CoverageReport => compile, test and generate coverage report
msbuild build.xml /t:Sonar => run sonarqube analysis
-->
@alexvictoor
alexvictoor / pb-avro-test_pom.xml
Last active February 11, 2021 09:20
Demo of Protobuff integration within Avro
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.avro.is.great</groupId>
<artifactId>protobuff-avro-demo</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Demo of protobuff integration with Avro</name>
<build>
<plugins>
@alexvictoor
alexvictoor / gist:5d50bb4f745620356887
Created March 24, 2015 21:48
Plotter for hdrhistogram customized with dark & green colors (for devoxxfr2015)
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
/*body {
background-color: black;
}*/
div.histo {
visibility: hidden
@alexvictoor
alexvictoor / App.java
Created February 8, 2015 23:18
Quick hdr histogram experiment
package com.github.alexvictoor;
import org.HdrHistogram.Histogram;
import org.HdrHistogram.SynchronizedHistogram;
/**
* Hello world!
*
*/
public class App
@alexvictoor
alexvictoor / custom-conf_pom.xml
Last active January 31, 2019 10:01
Playing with jakarta commons configuration, reading external files
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.alexvictoor</groupId>
<artifactId>custom-conf</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>custom-conf</name>
@alexvictoor
alexvictoor / crawler.go
Last active August 29, 2015 14:05
My solution to the golang webcrawler exercise
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)