Skip to content

Instantly share code, notes, and snippets.

View robertosw's full-sized avatar

Robert Oswald robertosw

  • Dresden, Germany
  • 11:20 (UTC +02:00)
View GitHub Profile
@tanmaypatel
tanmaypatel / isDocumentLoaded.js
Created February 16, 2014 07:39
How to check if an HTML page is already loaded. Even after "load" event has dispatched!
/* This has been supported in IE and webkit for a long time. It was added to Firefox in 3.6. Here's the spec (http://www.w3.org/TR/html5/dom.html#dom-document-readystate). "loaded" is for older Safari browsers.*/
if (document.readyState == "complete" || document.readyState == "loaded")
{
// document is already ready to go
}
/* If you want to know when the page has been parsed, but all subresources have not yet been loaded, you can add the "interactive" value: */
if (document.readyState == "complete"
|| document.readyState == "loaded"
|| document.readyState == "interactive") {
@andrebrait
andrebrait / keychron_linux.md
Last active April 24, 2025 05:27
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.