Skip to content

Instantly share code, notes, and snippets.

View michaelneu's full-sized avatar
Build failed

Michael Neu michaelneu

Build failed
View GitHub Profile
michaelneu /
Created April 30, 2020 20:11
vscode C++ tools keep hogging memory, even though IntelliSense is configured to 1GB. Start this script and get notified when it kills the language server, before your system gets unusable
function warn {
i3-nagbar -t warning -m 'killed vscode cpp language server' > /dev/null
function kill_leak {
memory_leak=$(ps -eo pmem,pid,cmd | sort -k1 -nr | head -n1)
if [[ $memory_leak == *"cpptools-srv"* ]]; then
michaelneu / hide.css
Created April 9, 2020 15:57
A Chrome extension to remove the menubar from the Slack webapp.
.p-client.p-client--ia-top-nav {
grid-template-rows: 0 auto min-content;
.p-client.p-client--ia-top-nav > .p-top_nav {
opacity: 0.1;
.p-client.p-client--ia-top-nav > .p-top_nav:hover {
opacity: 1;
which inotifywait 2>/dev/null > /dev/null
if [[ $? != 0 ]]; then
echo "can't listen for events, install inotify-tools first"
exit 1
michaelneu /
Last active February 23, 2020 00:19
A bookmarklet to view the page source on iOS Safari - without sending your URL to a third party service.

view-source on iOS Safari - without 3rd party services

A bookmarklet to display the current page's HTML in a new tab. Supports HTML syntax highlighting and indentation, JavaScript keywords will be highlighted, too.


Before adding the bookmarklet, you need to either build view-source.js, or copy view-source.min.js to your clipboard, as we'll paste this into the bookmarklet later.

Safari apparently doesn't support adding a custom bookmarklet, so you'll need to follow these steps:

michaelneu / .dockerignore
Last active February 3, 2020 17:24
A script to build esp-idf projects inside a Docker - with writable /dev/ttyUSB* mounted inside the container
#!/usr/bin/env python3
import sys
if __name__ == "__main__":
filename = sys.argv[1] if len(sys.argv) == 2 else "main.wasm"
print("[*] Reading", filename)
with open(filename, "rb") as content_fh:
content =
michaelneu /
Created September 15, 2019 00:48
Converts all PDFs in the current folder to high-res PNGs.
for pdf in *.pdf; do
echo "converting '$pdf' to '$png_name'"
convert -density 300 "$pdf" -background white -alpha remove -alpha off "$png_name"
michaelneu /
Created August 26, 2019 11:18
Quickly create an HTTP upload form to drop files on your machine.
from flask import Flask, request
from werkzeug import secure_filename
app = Flask(__name__)
@app.route("/", methods=["GET"])
def index():
return """<!doctype html>
michaelneu / Program.cs
Created July 6, 2019 21:20
Auto clicker for Starbound during the Steam summer sale. Works in the background, simply launch Starbound, spawn sodas and you're good to go.
using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
namespace ConsoleClicker
class Program
<!DOCTYPE html>
<video playsinline autoplay></video>
<script src=""></script>