Skip to content

Instantly share code, notes, and snippets.

View tonka3000's full-sized avatar
🤖

Michael tonka3000

🤖
View GitHub Profile
@sirodoht
sirodoht / Caddyfile
Last active November 16, 2024 07:17
Caddyfile for ollama with basic auth
# /etc/caddy/Caddyfile
api.example.com:443 {
route {
@options method OPTIONS
handle @options {
header Access-Control-Allow-Origin "https://clientwebsite.com"
header Access-Control-Allow-Methods "POST"
header Access-Control-Allow-Headers "authorization"
header Access-Control-Allow-Credentials true
@whiplashoo
whiplashoo / AppDelegate.swift
Created June 21, 2023 14:24
Adding a Menu Bar extra (icon) to a Flutter macOS app
import Cocoa
import FlutterMacOS
import SwiftUI
// Relevant blog post: https://blog.whidev.com/menu-bar-extra-flutter-macos-app
struct Shortcut {
var combination: String
var description: String
var createdAt: Int
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@blewert
blewert / EnumWindowZOrder.cpp
Last active June 15, 2025 11:55
[windows.h] Iterating over all desktop windows in C++, by z-order
//Find the top-most window. We need the Z-order to be
//relative to this
HWND window = GetTopWindow(GetDesktopWindow());
do
{
//Your code
}
while (window = GetWindow(window, GW_HWNDNEXT));
@bjornblissing
bjornblissing / CMakeLists.txt
Last active August 31, 2023 23:18
How to run CppCheck inside Visual Studio as a CMake custom build target.
cmake_minimum_required(VERSION 3.10)
project(MyExampleProject VERSION 1.0 LANGUAGES CXX)
add_executable(my_project main.cpp)
# Add Analyze with CppCheck target if CppCheck is installed
if(WIN32)
# Find CppCheck executable
find_program(CMAKE_CXX_CPPCHECK cppcheck NAMES cppcheck HINTS $ENV{PROGRAMFILES}/cppcheck)
@Bouni
Bouni / export.py
Created May 8, 2019 19:54
Export KNX Adresses from .knxproj file
#!/usr/bin/env python
import sys
import re
import zipfile
if len(sys.argv) != 2:
print("Please pass .knxproj file as argument")
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@nejdetckenobi
nejdetckenobi / file_upload.py
Created January 16, 2018 09:11
flask file upload via streaming
#!/usr/bin/env python
from __future__ import print_function
import os
import tempfile
import time
import flask
import psutil
##Cross compile CGO go program for Raspberry Pi on x86_64 linux
# Install cross compilation toolset
sudo apt-get install gcc-5-arm-linux-gnueabi
sudo apt-get install gcc-arm-linux-gnueabihf
# Alternatively get the cross compile toolchain from raspberry pi website as
# the standard gcc toolchain need ARMv7
git clone https://github.com/raspberrypi/tools
# Pi Zero uses /arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf
@alexellis
alexellis / k8s-pi.md
Last active April 7, 2026 15:40
K8s on Raspbian