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
# 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
# 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
% 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
# -- 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
#!/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
{ | |
"name": "altf1bemanagesemver", | |
"description": "ALT-F1 SPRL: Empty package.json including the management of the semver", | |
"authors": "Abdelkrim Boujraf, ALT-F1 SPRL", | |
"version": "1.0.1", | |
"main": "build/html/index.html", | |
"scripts": { | |
"release": "standard-version", | |
"patch": "npm run release -- --release-as patch", | |
"minor": "npm run release -- --release-as minor", |
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
Copyright (c) 2010-2020 Abdelkrim Boujraf ([email protected]), ALT-F1 SPRL | |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
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
# correct the issue : pdf generation fails after a 'libpng error: Not a PNG file' | |
# See https://github.com/readthedocs/readthedocs.org/issues/6770 | |
# gist source: https://gist.github.com/Abdelkrim/c1d7005feccbcfa66b198151dc1c4abd | |
# -- manage git-lfs ---------------------------------------------------------- | |
import os | |
if not os.path.exists('./git-lfs'): | |
os.system('wget https://github.com/git-lfs/git-lfs/releases/download/v2.7.1/git-lfs-linux-amd64-v2.7.1.tar.gz') |
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
# store the file in the root of your sphinx repository | |
unidecode | |
Sphinx | |
sphinx-rtd-theme | |
sphinxcontrib-plantuml | |
# Docs | |
sphinxcontrib-httpdomain==1.4.0 | |
# git lfs |