Skip to content

Instantly share code, notes, and snippets.

View SbstnErhrdt's full-sized avatar

Seb SbstnErhrdt

View GitHub Profile
@SbstnErhrdt
SbstnErhrdt / match.py
Created July 13, 2023 08:48
Matching publication numbers / ids from 3rd parties to EPO Patstat (USPTO / EPO)
def clean_uspto_publn_nr_to_patstat_format(dirty:str):
"""
removes 0s from uspto ids
"2010015376" --> "201015376"
"20100015376" --> "2010015376"
"""
if len(dirty) < 9:
return dirty
if dirty[0] == 3:
raise ValueError("Can not process id")
@SbstnErhrdt
SbstnErhrdt / Docker-DNS-Name-Problem.md
Created November 18, 2021 16:43
Docker Ubuntu not detecting names

IF Docker is not able to detect nodes based on their name when running on Ubuntu or differnt Linux distributions....

execute the following script:

sudo apt-get install bridge-utils
sudo pkill docker
sudo iptables -t nat -F
sudo ifconfig docker0 down
sudo brctl delbr docker0
@SbstnErhrdt
SbstnErhrdt / docker-compose.yml
Created February 3, 2021 10:03
grakn - docker-compose
version: "3.2"
services:
grakn:
image: graknlabs/grakn:latest
ports:
- 48555:48555
volumes:
- ./data/:/grakn-core-all-linux/server/db/
restart: on-failure
@SbstnErhrdt
SbstnErhrdt / logger.go
Created January 28, 2021 11:24
Global Logger
package globallogger
import (
"log"
"os"
"sync"
)
type logger struct {
filename string
@SbstnErhrdt
SbstnErhrdt / ISO-3166.txt
Created January 14, 2021 15:03
ISO 3166 COUNTRY CODES
English short name Alpha-2 code Alpha-3 code Numeric
Afghanistan AF AFG 4
Albania AL ALB 8
Algeria DZ DZA 12
American Samoa AS ASM 16
Andorra AD AND 20
Angola AO AGO 24
Anguilla AI AIA 660
Antarctica AQ ATA 10
Antigua and Barbuda AG ATG 28
@SbstnErhrdt
SbstnErhrdt / gzip.go
Last active October 19, 2020 08:24
Golang Gzip / Gunzip
import (
"bytes"
"compress/gzip"
)
// Compresses bytes via gzip
func GzipData(src []byte) ([]byte, error) {
// init buffer
var gzipBuffer bytes.Buffer
// init gzip writer