Skip to content

Instantly share code, notes, and snippets.

View turbaszek's full-sized avatar
🎯
Trying to make some good

Tomek Urbaszek turbaszek

🎯
Trying to make some good
View GitHub Profile
@turbaszek
turbaszek / README.md
Last active November 8, 2018 22:19
Tree diagram with d3.js v4 and flat JSON

A simple tree diagram built with d3.js. It has simple tooltips, node filter and custom styles for nodes and links. In scripts.js you can find how to use icons for node representation.

The input data is a flat json

[
  {"name": "Eve",   "parent": "" , "label": "L1", "size": 10, "color": "steelblue"},
  {"name": "Cain",  "parent": "Eve", "label": "L2", "size": 10, "color": "steelblue"},
 ...
import re
# TODO:
# - in last step fix all errors like to many lines etc
# - unused argument needs unused argument so those have to be taken out durgin parsing
def remove_unused(line, unused):
""" Removes unused arguments """
for arg in unused:
from functools import reduce
import timeit
class Test:
x = 2
def id(x):
return x
def check_time(f, arg):
@turbaszek
turbaszek / big_dag_example.py
Created November 18, 2020 17:24
Sample big dag
import random
from airflow.operators.dummy_operator import DummyOperator
from airflow.models import DAG
from airflow.utils.dates import days_ago
with DAG(
"big_dag",
start_date=days_ago(1),
schedule_interval=None,
@turbaszek
turbaszek / md_to_pdf.py
Last active February 4, 2021 12:58
Simple script to convert markdown file to pdf
import logging
import os
import markdown
import pdfkit
from bs4 import BeautifulSoup
HTML = """\
<body>
<head>