Skip to content

Instantly share code, notes, and snippets.

View NicHub's full-sized avatar
😈

NicHub

😈
  • Switzerland
  • 20:10 (UTC +02:00)
View GitHub Profile
@NicHub
NicHub / gist:073d343103254c317ae2
Last active February 15, 2024 12:20
Git-Cheat-Sheet

GIT CHEAT SHEET

Other Cheat Cheet

GUI

FIRST-TIME GIT SETUP

On Windows, set VS Code as your default editor

@NicHub
NicHub / timeitdeco.py
Created October 31, 2018 04:45
Python timeit decorator
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""timeit decorator
Source:
https://stackoverflow.com/a/27737385/3057377
@NicHub
NicHub / silent_exit_on_keyboard_interrupt.py
Created October 31, 2018 04:55
Python silent exit on keyboard interrupt
if __name__ == "__main__":
try:
main()
except(KeyboardInterrupt, SystemExit):
print("\b\b\033[K")
print("\nThat’s all folks")
@NicHub
NicHub / bash_profile
Last active October 11, 2021 13:10
bash_profile
# **
# .bash_profile
# *
source ~/.bashrc
shopt -s expand_aliases
# **
# prompt PS1
# *
# source /usr/local/bin/prompt.sh
# MÉTROLOGIE
Vocabulaire international des termes fondamentaux et généraux de métrologie
Deuxième édition 1993
ISBN 92-67-01075-1
## 5. CARACTÉRISTIQUES DES INSTRUMENTS DE MESURE
# source https://itsfoss.com/mount-exfat/
sudo add-apt-repository universe
sudo apt update
sudo apt install exfat-fuse exfat-utils
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Find characters with ASCII code greater than 127.
usage:
cd /DIRECTORY_TO_CHECK/
python /PATH_TO/check_char.py
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
# Create
conda create --name myenv
conda create -n myenv python=3.7
conda create -n myenv python=3.7 scipy=0.15.0 astroid babel
@NicHub
NicHub / get_disk_space.py
Last active December 20, 2019 14:54
Get disk space in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Display disk stats
"""
import shutil
total, used, free = shutil.disk_usage("/")
print("DISK SPACE")