Skip to content

Instantly share code, notes, and snippets.

Mathieu CAROFF mathieucaroff

  • IMT Atlantique
  • Brest
Block or report user

Report or block mathieucaroff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mathieucaroff /
Created Sep 28, 2018
Download build and install GHDL on Ubuntu 18.04 (tested 2018-09-28)
# It took about 5 minutes on my laptop (2018-09-28).
sudo apt update
sudo apt install -y git make gnat zlib1g-dev
git clone
cd ghdl
View expandedLog.ts
var MAX_DEPTH = 20
export var expandedLog = (obj: Record<string, unknown>, depth: number = 0) => {
var [[name, item]] = Object.entries(obj)
if (depth < MAX_DEPTH && typeof item === 'object' && item) {
var typeString =
var objType = typeString.replace(/\[object (.*)\]/, '$1')`${name}: ${objType}`)
Object.entries(item).forEach(([key, value]: any) => {
mathieucaroff /
Created Jan 28, 2019
A copy-past of the default helper snippets shown on Gitlab in empty repositories (2019-01-28)

Command line instructions

Git global setup

git config --global "Mathieu CAROFF"
git config --global ""

Create a new repository

mathieucaroff /
Created Nov 11, 2018
Create a (read only) slice without creating a copy of the given sequence.
# This solution is based on python 3 range ability to be sliced and indexed
# in constant time.
# It supports slicing, equality comparsion, string casting, and reproducers,
# but doesn't support assigment (and I don't plan to add support for it).
# Creating a SliceableSequenceView of a SliceableSequenceView won't slow down
# access times as this case is detected.
mathieucaroff / util_str.vhd
Created Nov 20, 2018
VHDL Utilitary functions to convert std_logic_vector(s) to strings
View util_str.vhd
-- Mathieu CAROFF
-- 2018-11-20
-- util_str.vhd
-- Utilitary functions to convert std_logic_vector(s) to strings
-- Test:
-- ```bash
-- ghdl -a util_str.vhd
-- ghdl -r util_str_tb
-- ```
mathieucaroff /
Created Nov 6, 2018
Test shell variables to know how to determine path to the current shell script. Includes sample script output.
# Usage examples (you might want to `sudo apt install zsh ksh`):
# ./ dash bash
# ./ dash bash zsh ksh
# ./ dash bash zsh ksh | less -R
mathieucaroff /
Last active Nov 1, 2018
Using a raspberryPi 3 as wifi router

Using a raspberryPi 3 as wifi router

... with raspbian OS

Written after trying a number of other techniques which failed. (2018-08-31)

I. Get Network-Manager to work on Raspbian

By default, because of a bug, Network-Manager doesn't manage wifi. It can be worked around though.

mathieucaroff /
Created Oct 17, 2018
Fill a circle with 0s and 1s
#!/usr/bin/env python3
# Fill a circle with 0 and 1's
# The circle is made of half as many lines as it is made of columns.
# This way, it usually appears round (with most terminal fonts at least).
# Accept the circle's width-radius as argument. See the default radius r, below.
r = 15
from sys import argv
if len(argv) > 1:
View 36-aes128-output-examples.txt
mathieucaroff /
Last active Sep 10, 2018
Tree for Collatz conjecture / Syracuse conjecture / Hailstone sequence. Output can be text or png (png requires graphviz). Can produce regular binary Collatz tree or Collatz-like trees without even numbers.

Collatz tree generator

Output can be text or png (png requires graphviz). Can produce regular binary Collatz tree or Collatz-like trees without even numbers.

  • Note: The trees start at 8 to avoid the 4-2-1 loop.
  • Note': See the end of the file for two example text trees.
  • Note": There is a .py version of this gist here: mathieucaroff/

Setup for linux or wsl

You can’t perform that action at this time.