Skip to content

Instantly share code, notes, and snippets.

daz / gist:477190328f5f20121c26c42ef8fbedbc
Created Sep 23, 2022
Upgrading postgresql 12 to 14 homebrew with postgis
View gist:477190328f5f20121c26c42ef8fbedbc
brew install postgresql
brew services stop postgresql
pg_upgrade --old-bindir=/opt/homebrew/opt/postgresql@12/bin \
--new-bindir=/opt/homebrew/opt/postgresql@14/bin \
--old-datadir=/opt/homebrew/var/postgresql@12 \
--new-datadir=/opt/homebrew/var/postgres \
# If you're getting non-empty database errors for the new database, rename the directory to a backup and init a new db:
daz / organize-h20t.rb
Last active Sep 2, 2022
Organize DJI H20T images into folders
View organize-h20t.rb
#!/usr/bin/env ruby
# organize-h20t.rb [files]
# Organize H20T images, videos, and captions into folders by camera types, i.e. S, T, W, Z
# Creates a folder for each camera type, and moves the files into their respective folder
# Usage:
# cd DJI_202208071450_002
# ./organize-h20t.rb DJI_20220807145439_0001_S.MP4 DJI_20220807145439_0001_T.MP4 DJI_20220807145439_0001_W.MP4 DJI_20220807145439_0001_Z.MP4
daz /
Created Apr 12, 2022
Prepare 360 photo for Facebook with max resolution
# Resizes any equirectangular image down to the max resolution and file size
# that Facebook will allow and adds 360 metadata. Saves copy with _fb appended
# to file name.
# Usage:
# ./ equirectangular_360_image.jpg
# Max settings, working April 2022
daz / is-inside.js
Created Mar 8, 2022
Check if images are inside a polygon
View is-inside.js
#!/usr/bin/env node
// Example usage:
// ./is-inside.js base/path/to/images -21,149 -21.1,152 -24,152.2 -24.1,148.9
import glob from "glob";
import * as fs from "fs";
import * as path from "path";
import * as turf from "@turf/turf";
daz /
Created Oct 29, 2021 — forked from mkormendy/
UniFi Network Controller Setup for MacOS with Homebrew
brew tap homebrew/cask-drivers
brew install --cask homebrew/cask-versions/adoptopenjdk8
brew install --cask ubiquiti-unifi-controller
daz /
Created Mar 12, 2021
Hikvision ANPR ISAPI list with curl
curl --digest -u username:password \
-d '<AfterTime><picTime>2020-03-07T21:00:00Z</picTime></AfterTime>'
daz / airdata-flights.js
Created Oct 23, 2020
Download all Airdata flights
View airdata-flights.js
// Get a list of all Airdata flight download URLs in KML, GPX, CSV, original format.
// Go to and paste this into the console
let urlList = $("#item_list_dt")
.context[0] => {
return a._aData.h;
.slice(1, -1)
daz / RightClick.applescript
Created Aug 23, 2020 — forked from vitorgalvao/Right-Click.applescript
Make right-clicking on OSX accessible via a keyboard shortcut.
View RightClick.applescript
Even though a [native solution][1] exists, it still suffers from a big flaw: it right-clicks the place you cursor is, not what you’re selecting. This addresses that limitation.
You can install this as a [Finder Service, and later asign it a keyboard shortcut][2].
daz / gulpfile.js
Last active Feb 7, 2022
Gulpfile to minify single HTML, CSS, JS file, make it a C++ string, and inject it into a C++ file. Handy for Arduino/ESP projects
View gulpfile.js
const gulp = require("gulp");
const gutil = require("gulp-util");
const inject = require("gulp-inject");
const htmlMin = require("gulp-htmlmin");
const cssMinifyOptions = true;
const jsMinifyOptions = {
mangle: {
toplevel: true
daz /
Created Oct 31, 2019 — forked from tylerlindell/
script for reducing faces programmatically with Meshlab's api
#!/usr/bin/env python
import sys
import os
import subprocess
# Script taken from doing the needed operation
# (Filters > Remeshing, Simplification and Reconstruction >
# Quadric Edge Collapse Decimation, with parameters:
# 0.9 percentage reduction (10%), 0.3 Quality threshold (70%)