Skip to content

Instantly share code, notes, and snippets.

View markusdosch's full-sized avatar

Markus Dosch markusdosch

View GitHub Profile
@markusdosch
markusdosch / main.py
Last active October 20, 2021 07:11
Minimal Python Webserver
"""
# Minimal Python Webserver (adopted from https://de.wikipedia.org/wiki/Socket_(Software)#Server)
## Notes
- It does not close the socket on exit (e.g. on interrupt) => it may take some time until the OS releases the port for reuse.
- It does not speak HTTP yet - you need to implement it yourself.
- It does not read the full client request, just the first 1024 bytes. Then, it sends its answer. When implementing HTTP, you need to first read all headers (=> until you receive `\r\n\r\n` = blank line). Using the headers, you need to identify whether a message body will follow. In the easiest case (other cases are out of scope for here), a `Content-Length` header signalizes how many bytes of message body will follow. With this number, you know how many bytes you need to read to receive the full request.
- Don't name the file `socket.py`. This will result in a (Python-specific) error.
@markusdosch
markusdosch / refined-confluence.user.js
Last active August 5, 2020 08:51
Refined Confluence: Search in current Confluence space by default (and not in all spaces) & only search for pages (not all types of results)
// ==UserScript==
// @name refined-confluence
// @namespace https://markusdosch.com/
// @version 0.1
// @downloadURL https://gist.githubusercontent.com/markusdosch/3e00a2e5741390d3c1328e4050dff6fd/raw/
// @updateURL https://gist.githubusercontent.com/markusdosch/3e00a2e5741390d3c1328e4050dff6fd/raw/
// @description Refined Confluence: Search in current Confluence space by default (and not in all spaces) & only search for pages (not all types of results)
// @author Markus Dosch
// @match https://confluence.check24.de/*
// @grant none
@markusdosch
markusdosch / refined-confluence.js
Created August 5, 2020 08:09
Refined Confluence: Automatically select the search filter to search in current Confluence space
// ==UserScript==
// @name refined-confluence
// @namespace https://markusdosch.com/
// @version 0.1
// @description Refined Confluence: Automatically select the search filter to search in current Confluence space
// @author Markus Dosch
// @match https://confluence.*.de/*
// @grant none
// ==/UserScript==
@markusdosch
markusdosch / kicktipp-data-export.user.js
Last active June 4, 2021 18:20
Kicktipp Data Export with Ctrl+Shift+K (Tampermonkey Userscript)
// ==UserScript==
// @name Kicktipp Data Export
// @namespace http://tampermonkey.net/
// @version 0.3
// @downloadURL https://gist.github.com/markusdosch/9c8f12864d36f9b2301774c2f4aacc8c/raw/
// @updateURL https://gist.github.com/markusdosch/9c8f12864d36f9b2301774c2f4aacc8c/raw/
// @description Export all Kicktipp data with Ctrl+Shift+K when on Export page
// @author Markus Dosch
// @match https://www.kicktipp.de/*/spielleiter/datenexport
// @grant none
@markusdosch
markusdosch / Nuclino-SidebarToggleShortcut.user.js
Last active January 24, 2018 13:27
Nuclino SidebarToggle Ctrl+Shift+H Shortcut (Tampermonkey Userscript)
// ==UserScript==
// @name Nuclino SidebarToggle Ctrl+Shift+H
// @namespace http://tampermonkey.net/
// @version 0.4.8
// @downloadURL https://gist.github.com/muellermarkus/7709efc76b3bf65aa24d4966889575fe/raw/
// @updateURL https://gist.github.com/muellermarkus/7709efc76b3bf65aa24d4966889575fe/raw/
// @description Adds a Sidebar Toggle functionality to the Nuclino webapp (press "Ctrl+Shift+H" to toggle)
// @author Markus Mueller
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
@markusdosch
markusdosch / ethereum-workshop.md
Last active July 7, 2016 09:17
Ethereum Workshop (Hack&Talk, 6.07.2016)

Keywords

geth, Solidity (like JS), truffle compile (compiles *.sol files to .js), truffle deploy, morden.ether.camp for transaction & account visualization,...

@markusdosch
markusdosch / glfw-opengl-learnings.md
Last active January 16, 2019 00:49
GLFW & OpenGL learnings

General Introduction into OpenGL

GLFW windows by default use double buffering. That means that each window has two rendering buffers; a front buffer and a back buffer. The front buffer is the one being displayed and the back buffer the one you render to.

When the entire frame has been rendered, the buffers need to be swapped with one another, so the back buffer becomes the front buffer and vice versa.

glfwSwapBuffers(window);
@markusdosch
markusdosch / continuous-deployment-gitlab-ci.md
Last active May 6, 2016 16:58
Continuous Deployment with Gitlab CI / Gitlab Runner