Skip to content

Instantly share code, notes, and snippets.

View lucamartinetti's full-sized avatar

Luca Martinetti lucamartinetti

View GitHub Profile
#!/bin/bash
set -eo pipefail
# Install mono
curl "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" > mono.asc
echo -ne '\n' >> mono.asc
rpm --import mono.asc
curl "https://download.mono-project.com/repo/centos7-stable.repo" > /etc/yum.repos.d/mono-centos7-stable.repo
yum install mono-devel
//https://mix-sig.com/images/datasheets/MSGEQ7.pdf
int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 3; // reset is attached to digital pin 3
int spectrumValue[7]; // to hold a2d values
void setup()
@lucamartinetti
lucamartinetti / Readme.md
Created April 2, 2019 15:29
Dotnet core test coverage with Coverlet and Lcov
cd test
dotnet add package coverlet.msbuild
dotnet test /p:CollectCoverage=true /p:CoverletOutput=Coverage/ /p:CoverletOutputFormat=lcov
# install lcov
genhtml coverage.info

Keybase proof

I hereby claim:

  • I am lucamartinetti on github.
  • I am lucaio (https://keybase.io/lucaio) on keybase.
  • I have a public key ASCAAREE7rnYiRweKNoEf0H9miHJVNG1R7qno_-IW19J1wo

To claim this, I am signing this object:

@lucamartinetti
lucamartinetti / size.sql
Created April 7, 2016 20:42
redshift size
select
trim(pgdb.datname) as Database,
trim(pgn.nspname) as Schema,
trim(a.name) as Table,
b.mbytes,
a.rows
from (
select db_id, id, name, sum(rows) as rows
from stv_tbl_perm a
group by db_id, id, name
#!/usr/bin/env python3
import re
import fileinput
def sizeof_fmt(num, suffix='B'):
for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']:
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f%s%s" % (num, 'Yi', suffix)