Skip to content

Instantly share code, notes, and snippets.

View louislefebvre's full-sized avatar
🎯
Focusing

Louis louislefebvre

🎯
Focusing
  • Berlin, Germany
View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@paullaffitte
paullaffitte / install-csfml.sh
Last active June 4, 2023 08:46
CSFML installer for Ubuntu
#!/usr/bin/env bash
set -e
SFML_VERSION='2.2'
GLEW_VERSION='1.10.0'
get_file()
{
local file_to_get="$1"
@cbonesana
cbonesana / beautify-json.py
Last active June 22, 2022 16:51
Basic Python script that merge and beautify multiple JSONs files in subfolders. Given an input folder, it scans the directory tree, merging together the JSONs file found in a file in the parent folder called "<folder>-output.json". This script has one only CLI argument, i.e. "python beautify-json.py <root-folder>"
import json
import os
import sys
encoding = 'utf-8'
indentNum = 4
def clean(data):
return json.dumps(data, sort_keys=True, indent=indentNum, separators=(',', ': '))
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@glueckpress
glueckpress / px-rem-cheat-sheet.css
Created May 26, 2013 16:17
Cheat sheet for rem-calculations based upon 14px and 16px.
/*! = $rembase: 14px
--------------------------------------------------------------
* hmtl { font-size: 87.5%; }
* body { font-size: 14px; font-size: 1rem; line-height: 1; }
* 4px 0.28571429rem
* 8px 0.571428571rem
* 12px 0.857142857rem
* 13px 0.928571429rem
* 14px 1rem
* 16px 1.142857143rem
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n