Skip to content

Instantly share code, notes, and snippets.

@stellarpower
stellarpower / xtconcatenate.hpp
Last active April 5, 2024 22:15 — forked from jf99/xtconcatenate.hpp
A way to concatenate a vector of xt::xarrays
#ifndef XTCONCATENATE_HPP
#define XTCONCATENATE_HPP
#include <cstddef>
#include <stdexcept>
#include <vector>
#include <xtensor/xarray.hpp>
template <typename S>
struct ShapeIndex
@stellarpower
stellarpower / Google Maps Satellie Tile Fetcher.js
Last active April 13, 2022 14:32 — forked from praeclarum/TileSticher.cs
Downloads and stitches map tiles
// For a given latitude, longitude, and zoom, returns the URL to an image for that tile.
function tileIndex(latitude, longitude, zoom){
if ((latitude === undefined) || (longitude === undefined) || (zoom === undefined))
throw("Arguments mising in tileIndex");
var lat_rad = latitude / 180 * Math.PI;
var n = 1 << zoom;
var xtile = n * ((longitude + 180) / 360);
var ytile = n * (1 - (Math.log (Math.tan (lat_rad) + 1/Math.cos (lat_rad)) / Math.PI)) / 2;
@stellarpower
stellarpower / Dockerfile
Last active June 9, 2021 14:59 — forked from hermanbanken/Dockerfile
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@stellarpower
stellarpower / install_wormhole.bat
Last active December 17, 2019 08:18 — forked from princebot/install_wormhole.bat
Install Python magic-wormhole on Windows.
::
:: This script installs wormhole (https://github.com/warner/magic-wormhole) and
:: its prerequisites. Run this as an administrator.
::
:: Install chocolatey.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
:: Install Python 3. Python3.8 has removed time.clock which breaks autobahn on which wormhole relies
choco install -y python3 --version=3.7 --allow-downgrade