Skip to content

Instantly share code, notes, and snippets.

View govert's full-sized avatar

Govert van Drimmelen govert

  • Excel-DNA
  • Johannesburg, South Africa
View GitHub Profile
@timvieira
timvieira / simple-backprop.py
Last active May 14, 2022 04:32
Simple example of manually performing "automatic" differentiation.
"""
Simple example of manually performing "automatic" differentiation
"""
import numpy as np
from numpy import exp, sin, cos
def f(x, with_grad=False):
# Need to cache intermediates from forward pass (might not use all of them).
a = exp(x)
@akarpov89
akarpov89 / InterpolatedParsing.cs
Created October 1, 2021 14:58
Interpolated parsing technique
using System.Runtime.CompilerServices;
using static ParsingExtensions;
string input = "Name: Andrew; Age: 31";
string? name = null;
int age = 0;
if (input.TryParse($"Name: {Placeholder(ref name)}; Age: {Placeholder(ref age)}"))
{
@TalalMash
TalalMash / ytdl.sh
Last active June 28, 2025 17:08
yt-dlp archiver with resolution limit, thumbnail and metadata embeds
#!/bin/sh
#Youtube playlist/video archiver, downloads changes on subsequent run, keeps track in archive.txt file.
#Install yt-dlp from pip: pip install yt-dlp --break-system-packages
#Reopen terminal, run `sh ytdl.sh https://playlistvideourlhere <optional command>`
#Use cookies and remove sleep-interval max-sleep-interval for much faster playlist parsing and speeds.
# --cookies ${COOKIES} \
#https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc
@TalalMash
TalalMash / Hijacking Wi-Fi Direct for Seamless Wi-Fi Onboarding without using BLE.md
Last active July 12, 2025 21:25
Hijacking Wi-Fi Direct for Seamless Wi-Fi Onboarding without using BLE

Hijacking Wi-Fi Direct for Seamless Wi-Fi Onboarding without using BLE

SoftAP multi-role Issues (AP + Managed)

Acting as access point and client at the same time

In captive portal applications, specifically when using Wi-Fi onboarding flow over the same Wi-Fi adapter:

  • Windows, iOS and macOS will retry during the disconnection while scanning the same SSID, which works well if the authentication succeeds and connection is established in less than 5 seconds. Otherwise, the user has to be instructed to manually reconnect, breaking UX flow.

  • Android, GNOME, and ChromeOS will disconnect if their connectivity check endpoint does not return 204 at any time during the short period of disconnection.