Skip to content

Instantly share code, notes, and snippets.

@Khouli00
Khouli00 / Makefile
Last active November 24, 2019 08:54
Chalice Makefile template with pipenv
.PHONY: clean clean-test clean-pyc clean-build docs help
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
@Khouli00
Khouli00 / index.html
Created October 26, 2019 16:52
report poleemploi
<!--https://bulma.io/documentation/layout/tiles/-->
<section class="info-tiles">
<div class="tile is-ancestor has-text-centered">
<div class="tile is-parent" id="chart">
</div>
<div class="tile is-parent" id="chart1">
</div>
</div>
</section>
@Khouli00
Khouli00 / reveal.json
Created September 8, 2019 06:27
reveal-md conf for slides
{
"theme": "night",
"transition": "slide",
"controle": true
}
@Khouli00
Khouli00 / pipenv.md
Created August 14, 2019 06:34
Pipenv tips

Pipenv

Useful config

Env variable

PIPENV_PYPI_MIRROR

If set, tells pipenv to override PyPI index urls with a mirror.
@Khouli00
Khouli00 / windows-wsl.md
Created August 9, 2019 13:23
Windows WSL, linux on windows tips
@Khouli00
Khouli00 / git.md
Last active August 14, 2019 11:05
git cheat sheet
@Khouli00
Khouli00 / setup.py
Last active August 3, 2019 13:53
minimal setup.py
"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
To add data checkout : https://docs.python.org/3.7/distutils/setupscript.html#installing-package-data
"""
from setuptools import setup, find_packages
@Khouli00
Khouli00 / excel.py
Last active November 30, 2018 16:00
Python, Excel and pandas DataFrame
#https://xlsxwriter.readthedocs.io/example_pandas_conditional.html
writer = pd.ExcelWriter('sample.xlsx',engine='xlsxwriter')
dataset.to_excel(writer,sheet_name='data',index=False)
workbook = writer.book
worksheet = writer.sheets['data']
#Example 4. Limiting input to a value in a dropdown list:
#https://xlsxwriter.readthedocs.io/working_with_data_validation.html
worksheet.data_validation('A4', {'validate': 'list',