Skip to content

Instantly share code, notes, and snippets.

@TuringMachinegun
TuringMachinegun / mb.el
Created September 7, 2020 14:48
Post markdown with images to micro.blog in emacs
(require 'request)
(setq mb-emacs-app-token "123456789") ;; create this in account -> app tokens -> edit apps
(setq mb-micropub-endpoint "https://micro.blog/micropub")
(setq mb-destination-address "https://your.micro.blog")
(setq mb-image-upload-timeout 20) ;; seconds
(defun mb-get-media-endpoint ()
(cdr (assoc "media-endpoint"
(let (result)
from __future__ import division
import numpy as np
def sliding_window(arr, window_size, step=0):
"""Assuming a time series with time advancing along dimension 0,
window the time series with given size and step.
:param arr : input array.
:type arr: numpy.ndarray
:param window_size: size of sliding window.