Skip to content

Instantly share code, notes, and snippets.

View dkapitan's full-sized avatar

Daniel Kapitan dkapitan

View GitHub Profile
@dkapitan
dkapitan / quarto-theme.scss
Last active August 6, 2023 08:51
Mozilla design
// Google Fonts
@import url(http://fonts.googleapis.com/css?family=Zilla+Slab|Zilla+Slab+Highlight|Inter|Fira+Code:400italic,700italic,400,700);
// Font Variables
$zilla-slab: "Zilla Slab", serif;
$zilla-slab-highlight: "Zilla Slab Highlight", serif;
$inter: "Inter", sans-serif;
$fira-code: "Fira Code";
// Colours
@dkapitan
dkapitan / conda.yml
Last active September 1, 2023 11:03
Voltron stack: polars, pandas 2.0, altair 5.0
name: python-data-science
channels:
- conda-forge
dependencies:
- python=3.10
- adlfs
- altair==5.0.1
- black
- ipykernel
- matplotlib
@dkapitan
dkapitan / Dockerfile
Last active January 11, 2023 13:24 — forked from alonisser/Dockerfile
Dockerfile for spacy prodigy for cloud setup using remote postgresql including changing instructions file and overriding index.html - and the leanest I've got
FROM python:3.6-alpine
# Opted for alpine to get a lean docker image as possible
RUN apk add --no-cache openssl
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
# Python deps for alpine
@dkapitan
dkapitan / keyboard-shortcuts-windows-11.md
Last active May 3, 2022 09:56
Keyboard shortcuts Windows 11
context shortcut action
desktop ctrl + super + ←/→ switch to desktop left/right
shift + super + ←/→ move active window to display left/right
super + tab show virtual desktops
ctrl + super + D create new virtual desktop
browsing ctrl + shift + L auto-fill username and password with Bitwarden
ctrl + shift + M switch Chrome profile
@dkapitan
dkapitan / cibg-big-register.py
Created March 3, 2022 10:07
Using zeep to query SOAP
from zeep import Client
client = Client("https://webservices.cibg.nl/Ribiz/OpenbaarV4.asmx?wsdl")
client.service.ListHcpApprox4(WebSite="Ribiz", Name="Kerkhoven", Initials="M")
@dkapitan
dkapitan / sparse_matrix_to_tensor.py
Created January 23, 2022 22:25
Convert SciPy sparse matrix to tf.sparse.SparseTensor
def sparse_matrix_to_tensor(X):
"""Transforms SciPy sparse matrix to tensorflow.sparse.SparseTensor."""
row_nnz = np.diff(X.indptr)
indices = np.asarray([[row_i, col_i]
for row_i, nnz in enumerate(row_nnz)
for col_i in range(nnz)], dtype=np.int64)
values = X.data
return SparseTensor(indices=indices, values=values, dense_shape=X.shape)
@dkapitan
dkapitan / config-wsl-ubuntu.md
Last active January 8, 2022 14:37
configuration wsl ubuntu

Base image

  • install Windows Terminal
  • install wsl
  • install Ubuntu
  • sudo apt update && sudo apt upgrade
  • install Homebrew
  • install pyenv
  • install oh-my-posh
  • install jump
@dkapitan
dkapitan / make_polynomial.py
Created November 21, 2021 19:10
Polynomial
def make_polynomial(dataframe, degree=MAX_DEGREE):
"""Function for creating higher-order polynomial features from dataframe.
Dataframe df should be like [Y, X1, X2, .. Xi].
Returns dataframe polynomial features of X1 ... Xi up to degree polynomials."""
df = dataframe.copy()
cols = df.columns[1:]
for i in range(2, degree + 1):
for col in cols:
@dkapitan
dkapitan / stelselcatalogus.ttl
Created September 30, 2021 06:59
Stelselcatalogus
This file has been truncated, but you can view the full file.
# baseURI: http://opendata.stelselcatalogus.nl/id/dataset/sc
# imports: http://purl.org/dc/elements/1.1/
# imports: http://rdfs.org/ns/void
# imports: http://www.w3.org/2004/02/skos/core
@prefix adms: <http://www.w3.org/ns/adms#> .
@prefix begrip_banken: <http://opendata.stelselcatalogus.nl/banken/id/begrip/> .
@prefix begrip_bgt: <http://opendata.stelselcatalogus.nl/bgt/id/begrip/> .
@prefix begrip_bri: <http://opendata.stelselcatalogus.nl/bri/id/begrip/> .
@prefix begrip_brk: <http://opendata.stelselcatalogus.nl/brk/id/begrip/> .
@dkapitan
dkapitan / ISSUE_TEMPLATE.md
Created September 24, 2021 08:46
GitHub templates

Title

When released, this story will ENTER TEXT HERE.

Description

As a ENTER ROLE I want ENTER GOAL, so that ENTER REASON(S).

Requirements