Skip to content

Instantly share code, notes, and snippets.

View CTimmerman's full-sized avatar

Cees Timmerman CTimmerman

View GitHub Profile

Common Media Query breakpoints:

Breakpoint Description
< 481px Mobile devices
481px — 768px iPads, Tablets
769px — 1024px Small screens, laptops
1025px — 1200px Desktops, large screens
1201px and greater Extra large screens, TV

Bootstrap breakpoints:

@jph00
jph00 / epi_sir_basic.ipynb
Created September 12, 2021 12:59
Basic SIR epidemic model
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@supermarsx
supermarsx / FixRealtekPoppingSound.ps1
Last active February 13, 2024 05:24
Fix popping sound on some Realtek sound cards, realtek audio crackling patch
# Enable Realtek driver power management, this is the default value
REG ADD "HKCU\Software\Realtek\RAVCpl64\PowerMgnt" /v "Enabled" /t REG_DWORD /d 1 /f
# Disable Realtek driver power management, sometimes fixes realtek popping sound
REG ADD "HKCU\Software\Realtek\RAVCpl64\PowerMgnt" /v "Enabled" /t REG_DWORD /d 0 /f
# Replace XXXX with the corresponding key that has "Realtek" in the "DriverDesc", find using regedit
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e96c-e325-11ce-bfc1-08002be10318}\XXXX\PowerSettings" /v "IdlePowerState" /t REG_BINARY /d "ffffffff" /f
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e96c-e325-11ce-bfc1-08002be10318}\XXXX\PowerSettings" /v "PerformanceIdleTime" /t REG_BINARY /d "ffffffff" /f
# Example if class is in 0000

Heat and power

I have district heating from a combined heat and power plant, which should be 80+% efficient. A solar air to water heat pump could be more efficient at 29% * usually 200% but sometimes 400% (For reference, traditional gas boilers only go up to 94%.) = 58% to 116%, the latter might require ground instead of air. CO2 is a relatively safe refrigerant.

According to ChatGPT: The efficiency of a typical modern steam turbine in a power plant is around 30-40%. Fuel cells can achieve efficiencies in the range of 40% to 60% or even higher for solid oxide fuel cells (SOFCs). Those and molten carbonate fuel cells (MCFCs) are used in combined hea

@CTimmerman
CTimmerman / Windows_sucks.md
Last active May 4, 2024 08:37
Windows sucks, too.

Windows sucks, too!

Audio

Apps

@CTimmerman
CTimmerman / fail.md
Last active July 9, 2024 15:34
Tech fails

If you don't learn from the past you're doomed to repeat it.

Audio

  • Dell Latitude 5501 sounds even worse than my MSI MS-16P7 due to ratting its plastic case. Interviews sound like a poor phone connection. Iron Maiden - Can I Play With Madness on the other hand is tolerable and even has some bass, almost enough for Robbie Williams - Angels, which sounds like a not-quite-tuned FM radio for the vocals (too little power), particularly noticable on U2 - Discotheque. Without "audio enhancements" disabled, its audio jack adds a rumble to videos like this. Worst audio hardware I've ever used, especially playing this. Then again, using my Logi
function _draw()
cls(8)
srand(5)
-- Iterate every 8 square pixels of the screen.
-- The `.5` is to make sure the points are at the center of each pixel.
-- We'll draw one wall of the maze in each square.
for y=.5,129,8 do
for x=.5,129,8 do
-- Progress in the rotation cycle. One rotation is [0..1]
@nhymxu
nhymxu / README-python-framework-benchmark.md
Last active July 3, 2024 12:28
Flask vs Falcon vs FastAPI benchmark
gunicorn run:app --workers=9
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker

Macbook Pro 2015 Python 3.7

Framework Server Req/s Max latency +/- Stdev
@CTimmerman
CTimmerman / index.html
Last active November 14, 2023 22:30
Hello world, React edition.
<html>
<!-- Thanks to https://medium.freecodecamp.org/learn-react-js-in-5-minutes-526472d292f4 -->
<head>
<script src="https://unpkg.com/react@15/dist/react.min.js">//React controllery stuff.</script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js">//More React controllery stuff.</script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js">//Translates JSX to JS.</script>
</head>
<body>
<div id="root">Target node for our React code.</div>
<script type="text/babel">
@CTimmerman
CTimmerman / file_downloader.py
Last active May 2, 2024 19:11
Resume HTTP download
"""Download with automatic resume.
2018-06-28 v1.0 by Cees Timmerman
2018-07-09 v1.1 Added If-Unmodified-Since header for consistency."""
import os, shutil, sys, time
import requests # python -m pip install requests
def download_file(url, local_filename=None):
if not local_filename:
local_filename = url.split('/')[-1]