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 / 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 June 27, 2023 07:33
MyShortCV Python3 class
from typing import Dict, List, Tuple
City = str
Country = str
Institute = str
Lab = str
Language = str
LoveLevel = float
Program = str
Title = str

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):