Skip to content

Instantly share code, notes, and snippets.

View jthomaschewski's full-sized avatar

Janek Thomaschewski jthomaschewski

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jthomaschewski on github.
* I am janek (https://keybase.io/janek) on keybase.
* I have a public key whose fingerprint is 8374 414F 9366 0571 8B19 72F0 03FD 6A82 57CD 72C2
To claim this, I am signing this object:
@jthomaschewski
jthomaschewski / detectDarkMode.js
Created September 22, 2019 14:03
Detect Browser Dark Mode in JS & CSS
// check if browser/os is set to dark mode
function prefersDark() {
return window.matchMedia('(prefers-color-scheme: dark)').matches
}
// listen for dark mode change in browser/os:
const queryDark = window.matchMedia('(prefers-color-scheme: dark)')
queryDark.addListener(mediaQuery => {
const prefersDark = mediaQuery.matches
if (prefersDark) {
@jthomaschewski
jthomaschewski / _directives.graphql
Created October 22, 2018 08:54
Lighthouse GraphQL Directives (WIP)
# Scalar directives
directive @scalar(class: String!) on SCALAR
# ENUM directives
directive @enum(value: ID!) on ENUM_VALUE
# Union directives
directive @union(resolver: String!) on UNION
@jthomaschewski
jthomaschewski / Makefile
Created April 3, 2018 19:19 — forked from t-8ch/Makefile
minimal mutter application with window management
CFLAGS=$(shell pkg-config --cflags libmutter-2) -Wl,-rpath,/usr/lib/mutter
LDLIBS=$(shell pkg-config --libs libmutter-2)
all: main