Skip to content

Instantly share code, notes, and snippets.

View sbmueller's full-sized avatar
🌍
Working Remotely

Sebastian Müller sbmueller

🌍
Working Remotely
View GitHub Profile
@sbmueller
sbmueller / .nvim.lua
Created April 11, 2024 08:38
Project-specific neovim configuration (exrc)
-- nvim-lint settings
local lint = require("lint")
-- Add an additional generic linter
vim.api.nvim_create_autocmd(
{"BufWritePost"},
{
group = "Fixers",
pattern = "*",
callback = function()
lint.try_lint("cspell") -- generic spell check
@sbmueller
sbmueller / cclangd
Created July 14, 2022 07:54
Wrapper around clangd that executes the server on host or in a docker container - from https://github.com/neovim/nvim-lspconfig/wiki/Running-language-servers-in-containers
#! /bin/sh
# The name of the container to run `clangd` in must be passed as the first and only argument
[ "$#" -ne 1 ] && echo "Container name required as first and only argument" >&2 && exit 1
CLANGD_ARGS="--clang-tidy --background-index --all-scopes-completion --header-insertion=iwyu --suggest-missing-includes --completion-style=detailed"
PATH_MAPPINGS="host=docker,host=docker" # change me
# Verify that a contianer by this name actually exists, and is running
if [ -z "$(docker ps -q -f name=$1 -f status=running)" ]; then
@sbmueller
sbmueller / create_cert.sh
Created February 10, 2019 11:38
Create SSL root certificate for Fritz!Box
#!/bin/sh
# solution found at
# https://github.com/webpack/webpack-dev-server/issues/854
# replace [IP] with the correct ip address
# assumes you have macports openssl installed. Alter -config path if needed.
openssl req \
-newkey rsa:2048 \
-x509 \
@sbmueller
sbmueller / Makefile
Created April 29, 2018 10:07
Basic Makefile for latexmk
FILENAME = letter
${FILENAME}.pdf: ${FILENAME}.tex
latexmk -pdf -outdir=latex ${FILENAME}.tex
cp latex/${FILENAME}.pdf ./
clean:
latexmk -CA
@sbmueller
sbmueller / fft_comparer.py
Created February 16, 2018 20:56
Comparison of different FFT implementations in Python
#/usr/bin/env python3
import numpy as np
from scipy import fftpack
import pyfftw
import unittest
import time
class Timer:
def __enter__(self):
@sbmueller
sbmueller / hellomodule.cpp
Created December 21, 2017 14:13
Basic C++ Python Extension
/*
This file will create a python module named `hello` (l. 42)
It's important that the project is set to output a file named
`hello.pyd` which must be identical to the module name.
Python will then search for the method `PyInit_hello(void)`
and call it. There, `PyModule_Create` must be called with
a `struct PyModuleDef` as argument.
Within there, the module's methods are defined. This is done
@sbmueller
sbmueller / convert.c
Created November 2, 2017 13:23
Recursive number base converter
#include <stdio.h>
int convert(int number, unsigned int base) {
if(number == 0) {
return number;
}
return number % base + 10*convert(number/base, base);
}
@sbmueller
sbmueller / keybase.md
Created February 25, 2017 08:54
Keybase Identification

Keybase proof

I hereby claim:

  • I am sbmueller on github.
  • I am sbmueller (https://keybase.io/sbmueller) on keybase.
  • I have a public key whose fingerprint is 17E7 FD02 7AB1 951A 71C0 461F 9FFB D55D DC2A A3EE

To claim this, I am signing this object: