Skip to content

Instantly share code, notes, and snippets.

View francescomari's full-sized avatar

Francesco Mari francescomari

View GitHub Profile
@francescomari
francescomari / fgrep.go
Created January 30, 2019 14:33
An implementation of the Aho and Corasick string searching algorithm and a simpler clone of the fgrep tool.
package main
import (
"bufio"
"fmt"
"os"
"path"
)
type node struct {
@francescomari
francescomari / stats.go
Created May 31, 2017 16:09
Computes basic statistics about children, properties and sizes of repository nodes
// This script parses data formatted like the following:
//
// (//tmp/social-enablement,1,4,63)
// (//tmp/social-enablement/rep:policy,3,2,22)
// (//tmp/social-enablement/rep:policy/allow,0,3,40)
// (//tmp/social-enablement/rep:policy/allow0,0,3,48)
// (//tmp/social-enablement/rep:policy/deny,0,3,390)
// (//tmp/fd,2,3,41)
// (//tmp/fd/af,1,4,63)
//
@francescomari
francescomari / benchmark.go
Created May 10, 2017 14:36
Convert benchmark output from Apache Jackrabbit Oak in a better consumable format
// MIT License
//
// Copyright (c) 2017 Francesco Mari
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@francescomari
francescomari / referrers.js
Created March 22, 2016 16:52
OQL script for VisualVM to find objects based on the type of their referrers
// Search every object of a specific class (SegmentId) and filter them according
// to some specific criteria on their referrers. The objects are allowed to be
// referenced by other objects whose class belongs to a specific whitelist
// (ALLOWED_CLASS_NAMES). Objects that are referenced *only* by those objects
// are not shown in the results.
var ALLOWED_CLASS_NAMES = [
"org.apache.jackrabbit.oak.plugins.segment.Segment",
"org.apache.jackrabbit.oak.plugins.segment.SegmentId[]",
"java.lang.ref.WeakReference"
### Keybase proof
I hereby claim:
* I am francescomari on github.
* I am frm (https://keybase.io/frm) on keybase.
* I have a public key whose fingerprint is D258 A304 CC4E 940E 5828 A693 790D B944 CF42 71E8
To claim this, I am signing this object: