Skip to content

Instantly share code, notes, and snippets.

View michidk's full-sized avatar
🐳
🐳🐳

Michael Lohr michidk

🐳
🐳🐳
View GitHub Profile
use portaudio as pa;
use anyhow::Result;
fn main() -> Result<()> {
let pa = pa::PortAudio::new()?;
let mut settings = pa.default_output_stream_settings(1, 44_100.0, 64u32)?;
settings.flags = pa::stream_flags::CLIP_OFF;
let mut phase = 0.0;
@michidk
michidk / deploy.yml
Last active April 7, 2021 13:03
GitHub deploy to branch
name: Deploy LaTeX document
on:
push:
branches:
- master
jobs:
build_resume:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
@michidk
michidk / .gitlab-ci.yml
Last active April 7, 2021 13:02
Gitlab deploy to branch
stages:
- build
- deploy
build:
stage: build
image: node:11
before_script:
- npm install --progress=false --unsafe-perm
script:
- npm run build
@michidk
michidk / bdrf.sprj
Last active March 14, 2021 14:41
SHADERRed BRDF Shader
<?xml version="1.0"?>
<project version="2">
<pipeline>
<pass name="BRDF" type="shader" active="true" patchverts="1">
<shader type="vs" path="shaders\vertex.vk" entry="main" />
<shader type="ps" path="shaders\fragment.vk" entry="main" />
<inputlayout>
<item value="Position" semantic="POSITION" />
<item value="Normal" semantic="NORMAL" />
<item value="Texcoord" semantic="TEXCOORD0" />
@michidk
michidk / gist:0425ab84d006db50ca3f26821d8747ad
Last active July 3, 2020 11:53
Drone Betaflight Config
# version
# Betaflight / STM32F411 (S411) 4.2.0 Jun 14 2020 / 03:04:43 (8f2d21460) MSP API: 1.43
# config: manufacturer_id: MTKS, board_name: MATEKF411, version: be0c9205, date: 2020-01-15T19:44:32Z
# start the command batch
batch start
board_name MATEKF411
manufacturer_id MTKS
@michidk
michidk / timezones.json
Created May 31, 2020 20:37
Timezone to coordinates lookup table
{
"Africa/Abidjan": {
"latitude": 51.9,
"longitude": -40.2
},
"Africa/Accra": {
"latitude": 53.3,
"longitude": -13
},
"Africa/Addis_Ababa": {
@michidk
michidk / sevdesk-api.py
Last active April 17, 2019 08:18
Medium: sevDesk API
# we use the requests and json package
import requests
import json
# define request headers
headers = {'Authorization': '<your API-token here>',
'Content-Type': 'application/x-www-form-urlencoded'}
# we got the url from the swagger documentation.
# it's also possible to pass parameters as '?limit=10&embed=contact' to the url, to limit the response array or to embed referenced objects
@michidk
michidk / Dockerfile
Created January 7, 2019 08:30
Kalidocker
FROM kalilinux/kali-linux-docker
RUN apt-get update -y --fix-missing
RUN apt-get upgrade -y ; apt-get autoremove -y
ENV TZ=Europe/Berlin
CMD tail -f /dev/null
@michidk
michidk / apacheds-deployment.yaml
Last active January 22, 2022 10:58
Kubernetes Apacheds
apiVersion: apps/v1
kind: Deployment
metadata:
name: apacheds
labels:
app: apacheds
spec:
replicas: 1
selector:
matchLabels:
@michidk
michidk / nginx.yaml
Created September 20, 2018 09:01
k8-nginx
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx
spec:
selector:
matchLabels:
run: my-nginx
replicas: 1
strategy: