Skip to content

Instantly share code, notes, and snippets.

View d-schmidt's full-sized avatar
Coding from home

David Schmidt d-schmidt

Coding from home
  • Germany
View GitHub Profile
d-schmidt /
Last active February 7, 2021 13:58 — forked from justinschuldt/
Directions for setting up a RaspberryPi 4 to act as a generic USB webcam


Webcam parts:

  • Raspberry Pi 4
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2021-01-11

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
  • Google Hangouts via Chrome
d-schmidt / read-google-play-music-playlist-to-csv.js
Last active November 8, 2020 12:34
How to convert a Google Play Music Playlist to CSV
// open playlist or album
// paste this into the console in dev tools (F12) of browser:
var seenSongs = {};
var seenSongTitles = {};
var playlistTable = document.querySelectorAll('.song-table tbody')[0];
function printSongs() {
let playlist = playlistTable.querySelectorAll('');
for(let i = 0; i < playlist.length; i++) {
let l = playlist[i];
import csv
import requests
import glob
# Quick and dirty script to convert a CSV file of album names to a Spotify playlist
AUTH = "Bearer xxxxxxxx" # Fill in with OAUTH token
PLAYLIST = "" # fill in
d-schmidt / gist:ad821748cdcbb128ea365ba32a365389
Created January 22, 2020 16:56
how to disable nvidia ansel
can't uninstall, only deactivate
in admin cmd:
NvCameraEnable.exe off
d-schmidt /
Last active May 3, 2019 19:36 — forked from fxsjy/
SimpleAuthServer: A IPv6 Python 3 SimpleHTTPServer with authentication
import base64
from http.server import HTTPServer
from http.server import SimpleHTTPRequestHandler
import socket
key = base64.b64encode(b"user:password")
class HTTPServerV6(HTTPServer):
address_family = socket.AF_INET6
d-schmidt /
Created July 18, 2018 20:33
A random Python list iterator without shuffle using the linear congruential generator (LCG) algorithm. A pseudorandom number generator producing all numbers < len(list) with a period == len(list) is created.
import random
import warnings
def __prime_factors(n):
Returns all the prime factors of a positive integer
factors = []
d = 2
d-schmidt /
Last active July 18, 2018 19:35
Simple HTML parsing with python requests and lxml
import requests
import lxml.html
t = requests.get("").text
html = lxml.html.fromstring(t)
links = html.xpath("//span/span[@class='pretty-bg']/a")
for link in links:
d-schmidt /
Last active November 15, 2021 04:51
request a praw reddit oauth authcode and refresh token
#!/usr/bin/env python3
import sys
import http.server
from urllib.parse import urlparse
import praw
import time
d-schmidt / OpenWithSublimeText3.cmd
Last active February 27, 2017 21:52 — forked from mrchief/
Add "Open with Sublime Text 3" to Windows Explorer Context Menu of folders
@echo off
SET st3Path=c:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
d-schmidt / rangemap.go
Last active May 4, 2021 06:06
Simple golang RangeMap implementation for sorted, not overlapping ranges of integers (like IP address ranges). Elements are found using binary search.
package main
import (
type Range struct {
L int
U int