Skip to content

Instantly share code, notes, and snippets.

@lurebat
lurebat / README.md
Last active November 1, 2024 07:36
Jetmove - A script to enhance navigation and multiple carets in Jetbrains IDEs

What is this?

Jetmove is a script I wrote to myself for some navigation and multiple carets features I felt were missing in Jetbrains IDEs.

It uses the excellent Live Plugin to run the script in the IDE.

All features support multiple carets, and are designed to work with them.

Features

@asandeep
asandeep / prefect_cleanup.py
Created October 27, 2020 02:57
Flow to cleanup old prefect flow runs.
import pendulum
import prefect
from dynaconf import settings
from prefect import schedules
from prefect.schedules import clocks
# Cron schedule to execute cleanup job. Currently set to run at 00:00 (UTC)
# every Sunday.
DATA_CLEANUP_SCHEDULE_CRON_STRING = "0 0 * * 0"
import prefect
from prefect import Flow, task, Task, case, Parameter
from prefect.environments import LocalEnvironment
from prefect.environments.storage import S3
from prefect.tasks.prefect import FlowRunTask
from prefect.tasks.control_flow import merge
from prefect.engine.results import PrefectResult
@task
@kmhofmann
kmhofmann / installing_nvidia_driver_cuda_cudnn_linux.md
Last active January 10, 2025 22:30
Installing the NVIDIA driver, CUDA and cuDNN on Linux

Installing the NVIDIA driver, CUDA and cuDNN on Linux (Ubuntu 20.04)

This is a companion piece to my instructions on building TensorFlow from source. In particular, the aim is to install the following pieces of software

on an Ubuntu Linux system, in particular Ubuntu 20.04.

@tamuhey
tamuhey / tokenizations_post.md
Last active July 27, 2024 14:46
How to calculate the alignment between BERT and spaCy tokens effectively and robustly

How to calculate the alignment between BERT and spaCy tokens effectively and robustly

image

site: https://tamuhey.github.io/tokenizations/

Natural Language Processing (NLP) has made great progress in recent years because of neural networks, which allows us to solve various tasks with end-to-end architecture. However, many NLP systems still require language-specific pre- and post-processing, especially in tokenizations. In this article, I describe an algorithm that simplifies calculating correspondence between tokens (e.g. BERT vs. spaCy), one such process. And I introduce Python and Rust libraries that implement this algorithm. Here are the library and the demo site links:

@nileshtrivedi
nileshtrivedi / home-server.md
Last active June 1, 2024 00:11
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

from sqlalchemy import create_engine
from collections import namedtuple
import re
from tqdm.auto import tqdm
Tag = namedtuple('Tag', 'id name count regex')
USERNAME = ''
PASSWORD = ''
URL = 'localhost'
@estasney
estasney / index.html
Created November 25, 2019 17:03
D3 Collapsible Tidy Tree (v5)
<html>
</<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<script src="https://d3js.org/d3.v5.js"></script>
<script type="text/javascript" src="d3-hierarchy.js"></script>
<style>
.link {
@PAG-ASAP
PAG-ASAP / outlook_automation.py
Created June 29, 2019 08:15
Automated Image/PDF creation from excel and delivery of it via OUTLOOK.
import win32com.client as win32
from PIL import ImageGrab
from PIL import Image
import img2pdf
import subprocess
import traceback
import time
class MailDispatcher:
@aplz
aplz / draw_text_with_background_opencv.py
Last active February 3, 2025 23:46
draw text with background // opencv
import cv2 # opencv
import numpy as np
font_scale = 1.5
font = cv2.FONT_HERSHEY_PLAIN
# set the rectangle background to white
rectangle_bgr = (255, 255, 255)
# make a black image
img = np.zeros((500, 500))