Skip to content

Instantly share code, notes, and snippets.

View kalkun's full-sized avatar

Jesper Henrichsen kalkun

  • Pluto Technologies
  • 05:10 (UTC +02:00)
View GitHub Profile
@japsu
japsu / mac_m1_create_venv.zsh
Last active September 4, 2021 05:41
Install `numpy` and `scipy` on M1 Mac (Python 3.9 from Homebrew)
#!/bin/zsh
# Creates a virtual environment and installs requirements while taking into account
# the apparent lack of a binary wheel for scipy on M1 Mac.
set -ueo pipefail
if [ "$(uname -m)" != "arm64" ]; then
echo "WARNING: You should not need this script as you are not running an M1 Mac." > /dev/fd/2
fi
@SzieberthAdam
SzieberthAdam / st_extend.sql
Created January 29, 2018 08:37
PostGIS function to extend a linestring
CREATE OR REPLACE FUNCTION st_extend (
geom geometry,
head_rate double precision,
head_constant double precision,
tail_rate double precision,
tail_constant double precision)
RETURNS geometry AS
$BODY$
-- Extends a linestring.
-- First segment get extended by length * head_rate + head_constant.
@sgmccli
sgmccli / gist:33c9e513985e5f0042eed0d35ae76589
Last active July 21, 2022 04:50
pgtap-0.97.0.sql compiled on Mac OSX
-- This file defines pgTAP, a collection of functions for TAP-based unit
-- testing. It is distributed under the revised FreeBSD license.
--
-- The home page for the pgTAP project is:
--
-- http://pgtap.org/
CREATE OR REPLACE FUNCTION pg_version()
RETURNS text AS 'SELECT current_setting(''server_version'')'
LANGUAGE SQL IMMUTABLE;