Skip to content

Instantly share code, notes, and snippets.

@abubelinha
abubelinha / xyz_vs_tms.md
Created August 20, 2024 16:47 — forked from tmcw/xyz_vs_tms.md
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abubelinha
abubelinha / split_wav.py
Created April 25, 2024 17:09 — forked from rudolfbyker/split_wav.py
Split WAV files at silence
#!/usr/bin/env python
from scipy.io import wavfile
import os
import numpy as np
import argparse
from tqdm import tqdm
# Utility functions
@abubelinha
abubelinha / python2pseudo.py
Created April 21, 2024 23:25 — forked from BlueNexus/python2pseudo.py
Python to Pseudocode converter
import os.path
import re
'''
INSTRUCTIONS
1. Create a file with the following code
2. Put the file you want to convert into the same folder as it, and rename it to "py_file.py"
3. Add a "#F" comment to any lines in the code which have a function call that doesn't assign anything (so no =),
as the program cannot handle these convincingly
4. Run the converter file
@abubelinha
abubelinha / wikidata+pandas.ipynb
Created March 31, 2024 22:49 — forked from sirex/wikidata+pandas.ipynb
Wikidata + Python Pandas.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abubelinha
abubelinha / Vob2Mp4.bat
Created March 6, 2024 19:16 — forked from andreasbotsikas/Vob2Mp4.bat
Convert DVD to mp4 using ffmpeg
REM Download ffmpeg from https://www.ffmpeg.org/download.html.
REM Place ffmpeg.exe in the folder with the vob files
REM Merge all vob files into one
REM VTS_01_0.VOB is usually the menu which you may not want
if exist VTS_01_7.VOB (
copy /b VTS_01_1.VOB+VTS_01_2.VOB+VTS_01_3.VOB+VTS_01_4.VOB+VTS_01_5.VOB+VTS_01_6.VOB+VTS_01_7.VOB ConCat.vob
) else if exist VTS_01_6.VOB (
copy /b VTS_01_1.VOB+VTS_01_2.VOB+VTS_01_3.VOB+VTS_01_4.VOB+VTS_01_5.VOB+VTS_01_6.VOB ConCat.vob
) else if exist VTS_01_5.VOB (
@abubelinha
abubelinha / annotorious-firebase.html
Created December 16, 2023 20:19 — forked from rsimon/annotorious-firebase.html
Using Firebase as Annotation Backend for Annotorious
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Annotorious | Firebase Demo</title>
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<style>
html, body {
padding:20px;
margin:0px;
@abubelinha
abubelinha / annotorious-opencv-find-contours.js
Created December 16, 2023 20:00 — forked from rsimon/annotorious-opencv-find-contours.js
Sample code for AnnotoriousOSD that automates polygon selection by tracing contours in the selected image section.
import OpenSeadragon from 'openseadragon';
import * as Annotorious from '@recogito/annotorious-openseadragon';
import '@recogito/annotorious-openseadragon/dist/annotorious.min.css';
/*************************************************************************
*
* Basic concept for this is from the official OpenCV docs:
* https://docs.opencv.org/3.4/dc/dcf/tutorial_js_contour_features.html
*
@abubelinha
abubelinha / Caddyfile
Created December 16, 2023 12:45 — forked from jpoehls/Caddyfile
Caddyfile PHP on Windows
# http://caddyserver.com/download
http://localhost:8080 {
startup php.cmd &
fastcgi / 127.0.0.1:9123 php
}
@abubelinha
abubelinha / geojson-test.py
Created November 27, 2023 13:18 — forked from alanorth/geojson-test.py
Checking if GPS points are in a polygon with Shapely
#!/usr/bin/env python
#
# Given the three points below, this code prints:
#
# $ ~/src/geojson-test.py
# True
# True
# False
#
# Requires shapely to be installed in the virtual environment.