Skip to content

Instantly share code, notes, and snippets.

TuringMachinegun / mb.el
Created September 7, 2020 14:48
Post markdown with images to in emacs
(require 'request)
(setq mb-emacs-app-token "123456789") ;; create this in account -> app tokens -> edit apps
(setq mb-micropub-endpoint "")
(setq mb-destination-address "")
(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.