Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathias Soeken msoeken

View GitHub Profile
@msoeken
msoeken / BlogAdvent.csproj
Created Dec 4, 2020
Emulation in Q# (Advent calendar blog post, supplemental material)
View BlogAdvent.csproj
<Project Sdk="Microsoft.Quantum.Sdk/0.14.2011120240">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetPlatform>x64</TargetPlatform>
<LanguageVersion>9.0</LanguageVersion>
</PropertyGroup>
</Project>
View getpaper.py
# Download papers from pre-print archives
#
# Usage (e.g.): python getpaper.py 1308.4134 quant-ph/0008033 2019/854 TR20-021
from collections import namedtuple
import colorama
from colorama import Fore, Style
import os.path
import re
import sys
@msoeken
msoeken / toggle-term.el
Last active Aug 28, 2021
Toggle between current buffer and terminal in emacs
View toggle-term.el
(defun toggle-term ()
"Toggles between terminal and current buffer (creates terminal, if none exists)"
(interactive)
(if (string= (buffer-name) "*ansi-term*")
(switch-to-buffer (other-buffer (current-buffer)))
(if (get-buffer "*ansi-term*")
(switch-to-buffer "*ansi-term*")
(progn
(ansi-term (getenv "SHELL"))
(setq show-trailing-whitespace nil)))))