Skip to content

Instantly share code, notes, and snippets.

View ggirelli's full-sized avatar
🐿️
Decaf squirrel.

Gabriele Girelli ggirelli

🐿️
Decaf squirrel.
View GitHub Profile
@ggirelli
ggirelli / proof.md
Created May 29, 2025 08:54
KeyOxide proof

$argon2id$v=19$m=64,t=512,p=2$lYfb/rF6c+HbRDbF+BZP4g$SzHfCKSNvUulhI80Nk86yw

@ggirelli
ggirelli / conventional-commits-stats-check.sh
Last active February 7, 2023 13:45
Provides some states on the conventional commits found in your git repo's log from a certain date.
#! /bin/env bash
sinceDate="2023-02-01"
untilDate=$(date +%Y-%m-%d)
headerPattern='(\w+)(\(\w+\))?!?\: (.*)'
prefixPattern='[a-z0-9]+ [0-9-]+ '
typeGroupPattern='(feat|fix|revert|ci|docs|refactor|style|perf|test|chore)'
if [ ${#@} -gt 0 ]; then sinceDate=$1; fi
if [ ${#@} -gt 1 ]; then untilDate=$2; fi
@ggirelli
ggirelli / best_alignment.ipynb
Last active October 14, 2021 14:52
Align strings (brute force)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ggirelli
ggirelli / speed_test.ipynb
Created August 17, 2021 14:59
Speeding up ggplot2 geom_point to plot more than 1 million points.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ggirelli
ggirelli / hic_chrom_sizes
Last active March 2, 2021 11:54
Quickly check chromosome sizes in hic file
#!/usr/bin/env bash
# As hic files contain sparse matrices, the matrix size is usually smaller than the expected (especially at high resolutions)
# This needs straw to be installed, see here: https://github.com/aidenlab/straw
hic_file="SRR2184278-93.hic"
resolution=100000
chromosomes=($(seq 1 22) X Y)
if [ -f "$hic_file.chrom_size.tsv" ]; then
@ggirelli
ggirelli / short_cv.py
Last active August 6, 2025 18:49
MyShortCV Python3 class
from gg.enums import Pronoun
from gg.types.education import EdLevel, Institute, Subject
from gg.types.geography import City, Country, Province
from gg.types.personal import Url
from gg.types.time import FromYear, ToYear
from gg.types.work import Employer, JobTitle
type Location = tuple[City, Province, Country]

Keybase proof

I hereby claim:

  • I am ggirelli on github.
  • I am gggirelli (https://keybase.io/gggirelli) on keybase.
  • I have a public key ASAU6K-iIjJnP-FZZ6_Hzvv5teH4HL24B_r35ePiSGPiXwo

To claim this, I am signing this object:

@ggirelli
ggirelli / multirange.py
Last active February 8, 2020 12:35
Python3.6+ class to convert a printer-like page sequence into an Iterator
'''
@author: Gabriele Girelli
@contact: gigi.ga90@gmail.com
'''
import re
from typing import Iterator, List, Optional, Pattern, Tuple
class MultiRange(object):