Skip to content

Instantly share code, notes, and snippets.

View chrisleekr's full-sized avatar

Chris Lee chrisleekr

View GitHub Profile
@m0rph03nix
m0rph03nix / Dockerfile
Last active May 9, 2024 01:47
Run Whisper.cpp in docker with mic audio streaming
FROM debian:11.7-slim AS build
RUN apt-get update \
&& apt-get install -y libsdl2-dev alsa-utils g++ make wget
RUN mkdir /whisper && \
wget -q https://github.com/ggerganov/whisper.cpp/tarball/master -O - | \
tar -xz -C /whisper --strip-components 1
WORKDIR /whisper
@sindresorhus
sindresorhus / esm-package.md
Last active July 23, 2024 10:30
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
#!/bin/bash
#
# This script is for Arch Linux to configure XRDP for enhanced session mode
#
# The configuration is adapted from the Ubuntu 16.04 script.
#
# Script adapted from https://github.com/microsoft/linux-vm-tools
#
'use strict';
const puppeteer = require('puppeteer');
(async () => {
/* PRECONDITION:
0. download ublock, I used https://github.com/gorhill/uBlock/releases/download/1.14.19b5/uBlock0.chromium.zip
1. run $PATH_TO_CHROME --user-data-dir=/some/empty/directory --load-extension=/location/of/ublock
2. enable block lists you want to use
*/
@tterb
tterb / README-badges.md
Last active July 3, 2024 13:47
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@indivisible
indivisible / backbrightness.py
Created July 3, 2017 20:24
ACPI backlight to panel gamma converter for Alienware 13 R3 OLED
#!/usr/bin/env python3
# based on:
# https://gist.github.com/joel-wright/68fc3031cbb3f7cd25db1ed2fe656e60
import os
import time
from pathlib import Path
from functools import lru_cache

Problem

In Arch Linux mkinitcpio -p linux

shows

Possibly missing firmware for module: aic94xx
 Possibly missing firmware for module: wd719x
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 23, 2024 10:19
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@jefffederman
jefffederman / naming-git-branches.md
Last active February 12, 2024 08:39
Naming `git` branches

Naming git branches

tldr; {type}/{group[optional]}/short-form-of-what-it-does

HCM developers consistently use dash-delimited branch names. About half also use f/ and b/ prefixes ('feature' and 'bug', respectively).

I suggest we continue our current practices, specifically:

  • a branch should start with a prefix indicating its type: feature/, bug/, chore/, or hotfix/
  • prefer the whole word to the one letter abbreviation, the clarity outweighs the cost of the extra characters