Skip to content

Instantly share code, notes, and snippets.

from typing import List, TypeVar
from docutils import nodes
from docutils.nodes import Element
from sphinx import addnodes
from sphinx.application import Sphinx
from sphinx.environment.adapters.toctree import TocTree
import sphinx.environment.collectors.toctree as toctree_collector
from sphinx.transforms import SphinxContentsFilter
@asmeurer
asmeurer / svg2pdf.bash
Last active August 18, 2023 12:02 — forked from s417-lama/svg2pdf.bash
Reliable way to convert an SVG file to a PDF file using headless Chrome
#!/bin/bash
#
# Convert an SVG file to a PDF file by using headless Chrome.
#
if [ $# -ne 2 ]; then
echo "Usage: ./svg2pdf.bash input.svg output.pdf" 1>&2
exit 1
fi
@asmeurer
asmeurer / hosts
Last active August 18, 2019 00:36 — forked from joielechong/hosts
Disable Skype ads: 1.) Add hosts to your hosts file 2.) Flush DNS resolver cache (ipconfig /flushdns)
# On Windows 7, 8, 10 Hosts file is in c:\windows\system32\drivers\etc\hosts
#
# Block Skype ads
127.0.0.1 secure-sin.adnxs.com # On skype 7.*
127.0.0.1 *.adnxs.com # On skype 7.*
127.0.0.1 logi10.xiti.com # On skype 7.*
127.0.0.1 *.everesttech.net # On skype 7.*
127.0.0.1 pixel.everesttech.net # On skype 7.*
127.0.0.1 d.adroll.com # On skype 7.*
library(mgcv)
library(ggplot2)
library(dplyr)
library(XML)
library(weatherData)
us.airports.url <- 'http://www.world-airport-codes.com/us-top-40-airports.html'
us.airports <- readHTMLTable(us.airports.url)[[1]] %>%
filter(!is.na(IATA)) %>%
@asmeurer
asmeurer / raytracing.py
Last active December 30, 2016 20:04 — forked from rossant/raytracing.py
import numpy as np
import matplotlib.pyplot as plt
w = 400
h = 300
from numba import autojit
@autojit
def normalize(x):
@asmeurer
asmeurer / myem.sh
Last active December 17, 2015 19:19
#!/bin/bash
## Is emacs-jedi already running?
ps -ef | grep jedi-port.lo[g] 2>&1 >/dev/null
if [[ $? -ne 0 ]]
then
# Replace the following 3 lines with your virtualenv
cd ~/Documents/emacs-jedi/env/
source bin/activate
nohup python ~/Documents/emacs-jedi/jediepcserver.py --port-file ~/Documents/emacs-jedi/jedi-port.log &
# -*- coding: utf-8 -*-
"""
%with and %endwith magics.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import re