This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# INSTALLATION | |
# | |
# COPY THE FILE commit-msg INTO .git/hooks/commit-msg | |
# COPY THE FILE package.json INTO THE ROOT OF YOUR PROJECT | |
# MODIFY THE FILE package.json TO MATCH PROJECT DESCRIPTION | |
# RUN npm install to install standard-version locally | |
# CODE, COMMIT YOUR CODE | |
# RUN 'npm run patch', 'npm run minor' or 'npm run major' TO GENERATE THE VERSION NUMBER and THE CHANGELOG FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -- Options for LaTeX output ------------------------------------------------ | |
f = open('latex-styling.tex', 'r+') | |
PREAMBLE = f.read() | |
latex_elements = { | |
# https://www.sphinx-doc.org/en/master/latex.html | |
# 'classoptions': ',openany,twoside', | |
'classoptions': ',openany', | |
# 'babel' : '\\usepackage[french]{babel}', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Made by ALT-F1 SPRL, Abdelkrim Boujraf | |
%\usepackage{bookmark} | |
%\usepackage{charter} | |
%\usepackage[defaultsans]{lato} | |
%\usepackage{inconsolata} | |
% \usepackage{pbsi} | |
% \usepackage[T1]{fontenc} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python 3 | |
def enter_exit_info(func): | |
def wrapper(*arg, **kw): | |
print(f'-- entering {func.__name__}') | |
res = func(*arg, **kw) | |
print(f'-- exiting {func.__name__}') | |
return res | |
return wrapper | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python : Calculate time taken to execute a piece of code | |
import time | |
start_time = time.time() | |
a,b = 5,10 | |
c = a+b | |
end_time = time.time() | |
time_taken = (end_time- start_time)*(10**6) | |
print("Time taken in micro_seconds:", time_taken) # Time taken in micro_seconds: 39.577484130859375 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language = "python" | |
reversed_language = language[::-1] | |
print(reversed_language) # nohtyp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_even(num): | |
return num % 2 == 0 | |
is_even(10) # True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Swap values between two variables | |
a = 5 | |
b = 10 | |
a, b = b, a | |
print(a) # 10 | |
print(b) # 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sizeof_number(number, currency=None): | |
""" | |
format values per thousands : K-thousands, M-millions, B-billions. | |
parameters: | |
----------- | |
number is the number you want to format | |
currency is the prefix that is displayed if provided (€, $, £...) | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build | |
chore (maintain i.e. updating grunt tasks etc; no production code change) | |
ci (continuous integration) | |
docs: add Blaze to list of projects | |
feat: Adding French translation | |
fix (bug fix) | |
perf (performance improvements) | |
refactor | |
revert | |
style: Welcome page tweaks for long texts. Removing ettier unnecessary changes |