Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# coding: utf8
import copy
import PyPDF2
import sys
def split_page(src, dst, row=1, col=1, margin=0):
src_f = file(src, 'r+b')
@pajachiet
pajachiet / install_Q2A.sh
Last active January 29, 2019 17:31
Installation notes for Question2Answer platform
#!/usr/bin/env bash
# Work for OpenChronic project https://entrepreneur-interet-general.etalab.gouv.fr/defis/2019/openchronic.html
# https://docs.question2answer.org/install/
SERVER=
ROOT_PASSWORD=
Q2A_MYSQL_PASSWORD=
Q2A_ROOT_PASSWORD=
@pajachiet
pajachiet / superset_sankey_role_table_dashboard.sql
Last active January 23, 2023 10:08
This allows to create the base table for a dashboard with a sankey diagram visualizing relationships between role, table and dashboards
CREATE OR REPLACE VIEW table_to_role AS (
SELECT
tables.id as table_id,
tables.table_name as table_name,
ab_role.name as role_name
FROM
tables
LEFT JOIN ab_view_menu ON ab_view_menu.name = tables.perm
LEFT JOIN ab_permission_view on ab_permission_view.view_menu_id = ab_view_menu.id
LEFT JOIN ab_permission on ab_permission_view.permission_id = ab_permission.id
@pajachiet
pajachiet / create_superset_users.py
Last active April 24, 2023 12:39
Scripting on Superset backend to fix bugs or automate tasks
#!/usr/bin/env python
# coding: utf8
# Script to create superset users
import pandas as pd
from sqlalchemy import create_engine
import datetime
import pexpect
import os