Skip to content

Instantly share code, notes, and snippets.

View chrisEff's full-sized avatar

Christian Frenzl chrisEff

View GitHub Profile

Keychron K8 Shortcuts

Key Combo Function
fn + 1/2/3 change bluetooth channel
fn + Light light on/off
fn + left/right arrow change light color
fn + L + Light (un)lock current light effect
fn + B battery indicator
green: >70%
@chrisEff
chrisEff / numbered-table.css
Last active February 8, 2021 09:17
Numbering table rows via CSS
table {
counter-reset: rowNumber;
}
table tr td:first-child {
counter-increment: rowNumber;
}
table tr td:first-child::before {
content: counter(rowNumber);
@chrisEff
chrisEff / sinon-endswith-matcher.js
Last active October 25, 2019 14:04
Sinon does not have a built-in matcher that checks whether a string ends with another string, so here's how to build it yourself:
const foo = () => {
console.log('Chuck says hello.')
}
const sinon = require('sinon')
const consoleLogStub = sinon.stub(console, 'log')
describe('foo', () => {
it('should log a message that ends with " says hello!"', () => {