Skip to content

Instantly share code, notes, and snippets.

View bgruszka's full-sized avatar

Blazej Gruszka bgruszka

View GitHub Profile
@markuman
markuman / README.md
Last active September 18, 2024 12:21
🗺️ OSM - self host the entire planet 🌎 in ~30 minutes 🚀

🗺️ OSM - self host the entire planet 🌎 in ~30 minutes 🚀

TL;DR

mkdir osm
wget -O osm/planet.mbtiles https://hidrive.ionos.com/api/sharelink/download?id=SYEgScrRe
podman run -ti --rm -p 9000:9000 --name sms -v $(pwd)/osm/:/data/ registry.gitlab.com/markuman/sms:latest
firefox http://localhost:9000
@robert-mcdermott
robert-mcdermott / ollama-web-qa.py
Last active September 12, 2024 10:23
Use Ollama with a local LLM to query websites
import argparse
import requests
from langchain.llms import Ollama
from langchain.document_loaders import WebBaseLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.embeddings import GPT4AllEmbeddings
from langchain.vectorstores import Chroma
from langchain.chains import RetrievalQA
def main(args):
@tpoechtrager
tpoechtrager / zte.js
Last active September 13, 2024 11:36
/*
*
* Original code by Miononno
* https://www.youtube.com/watch?v=1kanq1w2DA0
*
* Enhanced by unknown @ lteforum.at
*
*/
console.log("Loading ZTE Script v" + "2024-08-31-#1");
@shilman
shilman / storybook-docs-typescript-walkthrough.md
Last active May 28, 2024 17:42
Storybook Docs Typescript Walkthrough

Storybook Docs w/ CRA & TypeScript

This is a quick-and-dirty walkthrough to set up a fresh project with Storybook Docs, Create React App, and TypeScript. If you're looking for a tutorial, please see Design Systems for Developers, which goes into much more depth but does not use Typescript.

The purpose of this walkthrough is a streamlined Typescript / Docs setup that works out of the box, since there are countless permutations and variables which can influence docs features, such as source code display, docgen, and props tables.

Step 1: Initialize CRA w/ TS

npx create-react-app cra-ts --template typescript
@aarongorka
aarongorka / gitlab_dag_diagram.py
Last active April 30, 2021 12:33
Prints a PlantUML diagram that shows the DAG of the GitLab pipeline
#!/usr/bin/env python3
"""Prints a PlantUML diagram that shows the DAG of the GitLab pipeline"""
import sys
import yaml
from pprint import pprint
def merge(user, default):
if isinstance(user,dict) and isinstance(default,dict):
for k,v in default.items():
@pdxjohnny
pdxjohnny / .gitignore
Last active May 30, 2024 16:41
Setting Up k3s for Serverless (knative) on a $5 DigitalOcean Droplet Using k3d
.terraform/
*.pem
*.tf
*.tfstate
*.yaml
*.backup
istio-*/
cert-manager-*/
*.swp
env
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active September 20, 2024 16:38
set -e, -u, -o, -x pipefail explanation
@schollz
schollz / files.sh
Last active July 30, 2023 00:19
Go upload/recieve files via POST
#! /bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=file$( printf %d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
done
@clarksun
clarksun / kafka_topic_msg_count.sh
Created October 9, 2017 06:36
get kafka topic message count
kafka-run-class kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic xxx --time -1 --offsets 1 | awk -F ':' '{sum += $3} END {print sum}'
#import necessary libraries
import cv2
import numpy as np
#capture video from the webcam
cap = cv2.VideoCapture(0)
#load the face finder
face_cascade = cv2.CascadeClassifier('/home/sm/Desktop/haarcascade_frontalface_default.xml')