Skip to content

Instantly share code, notes, and snippets.

@philippkraft
philippkraft / README.md
Last active May 12, 2024 01:16
Convert xyz elevation models to GeoTiff

Convert .xyz elevation models to GeoTiff

In Germany, more and more state agencies allow free access to high resolution elevation models. However, these are often released as xyz tables, which are not easily used in GIS environments. A standard method to convert this format to raster formats (eg. GeoTiff) is the GDAL function gdal_translate [1, 2]. However, converting 1M lines takes dozens of seconds and is not trivial to parallize.

@pknowledge
pknowledge / Find_and_Draw_Contours_using_OpenCV_Python.py
Created June 19, 2019 16:38
OpenCV Python Tutorial For Beginners - Find and Draw Contours with OpenCV in Python
import numpy as np
import cv2
img = cv2.imread('baseball.png')
imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(imgray, 127, 255, 0)
contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
print("Number of contours = " + str(len(contours)))
print(contours[0])
@bmaupin
bmaupin / free-backend-hosting.md
Last active May 12, 2024 01:14
Free backend hosting
@korakot
korakot / record.py
Last active May 12, 2024 01:14
Record audio in Colab using getUserMedia({ audio: true })
# all imports
from IPython.display import Javascript
from google.colab import output
from base64 import b64decode
from io import BytesIO
!pip -q install pydub
from pydub import AudioSegment
RECORD = """
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 12, 2024 01:12
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@porst17
porst17 / rc.xml
Created September 9, 2020 09:16
Openbox configuration supporting PulseAudio volume control via keyboard volumes keys (up/down/mute)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
#!/bin/sh
docker run -t -e UID="$(id -u)" -e GID="$(id -g)" -v "$PWD":/w -w /tmp --rm alpine sh -c 'wget "https://github.com/Tomas-M/iotop/archive/master.zip" && unzip master.zip && cd iotop-master && apk add gcc make ncurses-dev linux-headers ncurses-static musl-dev && V=1 LIBS="-no-pie -static -static-libgcc -static-libstdc++" make && strip -s iotop && chown "$UID:$GID" iotop && chmod +x iotop && mv iotop /w/'
@vgmoose
vgmoose / a_readme.md
Last active May 12, 2024 01:02
Yet another How to Create a Windows 11 Install USB from Ubuntu Linux or Mac

Creating a Windows 11 Install USB in 2022

I have been installing Windows for a long time. Does it get easier? I want to say it gets easier, but it seems like there's always some new wrinkle! These instructions are as much a note to my future self as they may be useful to anyone else.

For me, I was not able to get any exfat-based installs, or even any of the GUI helpers to make this process any more straightforward. Maybe on your target Windows / host OS those helpers will work, but the below process (as of current year) is consistent, and not overly complicated.

Overview:

  1. Downloading an official ISO image from MS:
  2. Formatting the drive (at least 8GB) as GPT, and one FAT-format partition (aka MS-DOS)
@advaith1
advaith1 / nitro.md
Created May 4, 2023 01:06
Discord Nitro Subscription Links