Skip to content

Instantly share code, notes, and snippets.

View tafaust's full-sized avatar
💻
Coding

Thomas Faust tafaust

💻
Coding
View GitHub Profile
@tafaust
tafaust / enterprise-gateway-pod-log.txt
Last active October 7, 2022 15:30
enterprise-gateway kubernetes log - connection issue
Starting Jupyter Enterprise Gateway...
[D 2022-10-07 14:58:34.251 EnterpriseGatewayApp] Searching ['/usr/local/bin', '/home/jovyan/.jupyter', '/home/jovyan/.local/etc/jupyter', '/opt/conda/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-10-07 14:58:34.251 EnterpriseGatewayApp] Looking for jupyter_config in /etc/jupyter
[D 2022-10-07 14:58:34.252 EnterpriseGatewayApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-10-07 14:58:34.252 EnterpriseGatewayApp] Looking for jupyter_config in /opt/conda/etc/jupyter
[D 2022-10-07 14:58:34.253 EnterpriseGatewayApp] Looking for jupyter_config in /home/jovyan/.local/etc/jupyter
[D 2022-10-07 14:58:34.253 EnterpriseGatewayApp] Looking for jupyter_config in /home/jovyan/.jupyter
[D 2022-10-07 14:58:34.254 EnterpriseGatewayApp] Looking for jupyter_config in /usr/local/bin
[D 2022-10-07 14:58:34.254 EnterpriseGatewayApp] Looking for jupyter_enterprise_gateway_config in /etc/jupyter
[D 2022-10-07 14:58:34.255 EnterpriseGatewayApp]
@tafaust
tafaust / gen-tailwind-cmap.js
Last active January 5, 2023 14:17
Generates
const fs = require('fs');
const pseudo = ['hover', 'active', 'focus']
const prefix = ['text', 'bg'];
const colors = ['primary', 'secondary' , 'success' , 'error' , 'warning'];
const intensity = ['50' , '100' , '200' , '300' , '400' , '500' , '600' , '700' , '800' , '900'];
const fileContent = [];
const p = (str) => fileContent.push(str);

Keybase proof

I hereby claim:

  • I am tahesse on github.
  • I am tahesse (https://keybase.io/tahesse) on keybase.
  • I have a public key ASC5oB1TWSKfC3-p_ZDDJ3m5XEf0kGzJlapCX-Gm-pOSuQo

To claim this, I am signing this object:

@tafaust
tafaust / filter_obj_by_obj.js
Last active May 12, 2022 09:11
Javascript filter object by object with mutation
const a = [
{id: 1},
{id: 4},
{id: 8},
{id: 6},
];
const b = [
{id: 1, op: 'foo'},
{id: 2, op: 'abc'},
{id: 3, op: 'def'},
@tafaust
tafaust / application.py
Created April 21, 2022 19:41
FastAPI singleton service dependency injection across multiple requests
import random
import click
import uvicorn
from fastapi import FastAPI, APIRouter, Depends, Request
# Service
class MySingletonService:
def __init__(self):
@tafaust
tafaust / development_time_check.py
Created February 12, 2022 08:24
Python run time vs development time dict key check
from typing import TypedDict
class Movie(TypedDict):
name: str
year: int
def foo(movie_params: Movie):
pass # do your thing
@tafaust
tafaust / debian_install_docker.sh
Last active March 23, 2022 17:33
Docker install script for debian
#!/usr/bin/env sh
# https://docs.docker.com/engine/install/debian/
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
apt-get remove docker docker-engine docker.io containerd runc
@tafaust
tafaust / toggletouchpad
Created February 21, 2021 07:14
Bash script to toggle touchpad state on X server
#!/bin/bash
# set your device name here (can be found through `xinput`)
touchpadDevice='SynPS/2 Synaptics TouchPad'
if [ ! -z "$1" ]; then
# set the device state via argument (must be 0 or 1)
devEnabled=$1
else
# toggle the device state
@tafaust
tafaust / main.dart
Created February 6, 2021 07:06
How to check if Dart List contains certain object instance?
class Book {
String title;
Book(this.title);
}
void main() {
List<Book> bookList = [
Book('foo'),
];
@tafaust
tafaust / type_enforcement.py
Created March 13, 2018 10:04
Python 3.6 type «enforcement» (/ check) through annotations or custom list of types
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging.config
import functools
from typing import Callable, Union
__author__ = 'Thomas Hesse'