Skip to content

Instantly share code, notes, and snippets.

@rauschma
rauschma / impatient-js-es2021.md
Last active August 31, 2023 07:02
ES2021 edition of “JavaScript for impatient programmers”

What is new in the ES2021 edition of “JavaScript for impatient programmers”?

Free to read online: exploringjs.com/impatient-js/

  • The exercises now run as native ESM modules on Node.js. Previously, they were run via the esm package.
  • Material on new ES2021 features:
    • String.prototype.replaceAll()
    • Promise.any()
    • Logical assignment operators
  • Underscores (_) as separators in number literals and bigint literals
@djjudas21
djjudas21 / README.md
Created December 30, 2020 15:14
MicroK8s, Ingress and MetalLB

Ingress MetalLB

Out of the box, the MicroK8s distribution of ingress-nginx installed as the MicroK8s addon ingress binds to ports 80+443 on the node's IP address using a hostPort, as we can see here:

microk8s kubectl -n ingress describe daemonset.apps/nginx-ingress-microk8s-controller
Name:           nginx-ingress-microk8s-controller
Selector:       name=nginx-ingress-microk8s
@plembo
plembo / debianvmvirtinst.md
Last active July 24, 2025 17:24
Install a Debian VM using virt-install

Installing a Debian VM with virt-install on KVM (libvirtd)

This turned out to be easier than I thought it would, especially after struggling with Ubuntu.

Both procedures use a common debian.env file to hold environment variables applied in the script.

When installing Debian always be sure to select an apt mirror when prompted, if you don't you'll regret it.

Environment variables

In a file, debian.env:

@lmwilkin
lmwilkin / Dockerfile
Created August 26, 2020 17:24
GPU enable inference container for Transformers
FROM tiangolo/uvicorn-gunicorn-machine-learning:cuda9.1-python3.7
ENV PORT 40003
ENV APP_MODULE app.api:app
ENV LOG_LEVEL debug
ENV WEB_CONCURRENCY 2
COPY ./requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir --upgrade torch transformers
RUN pip install --no-cache-dir fastapi
@joevt
joevt / pcitree.sh
Last active January 21, 2025 08:50
A bash script to produce more informative output than lspci -nntv
#!/bin/bash
# by joevt Feb 6, 2024
# Jan 22, 2023 - Updated to work in Mac OS X 10.4.
# Jan 30, 2023 - Fixed the method options.
# Apr 7, 2023 - Fixed parse of unknown prog-if and move temp files to separate tmp directory.
# Feb 6, 2024 - Fix column alignment.
#===================
if [[ $EUID -ne 0 ]]; then
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active April 25, 2025 19:23
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@swalkinshaw
swalkinshaw / tutorial.md
Last active July 20, 2025 07:39
Designing a GraphQL API
@timurcatakli
timurcatakli / webpack.config.js
Last active May 1, 2023 18:25
An Easy to Understand Webpack 4+ Configuration File with Comments
const publicPath = 'public';
// Node os module
// The os module provides a number of operating system-related utility methods.
// It can be accessed using:
const os = require('os');
// Using a single monolithic configuration file impacts comprehension and
// removes any potential for reusability.
// As the needs of your project grow, you have to figure out the means to manage
// webpack configuration more effectively.
@rueycheng
rueycheng / GNU-Make.md
Last active July 30, 2025 07:14
GNU Make cheatsheet
@andyshinn
andyshinn / Dockerfile
Created July 2, 2017 17:58
nginx serving Angular 4 application built as Docker multi-stage image
FROM node:8.1.2-onbuild as builder
ARG TARGET=production
RUN npm install @angular/cli
RUN node_modules/.bin/ng build -aot --target ${TARGET}
FROM nginx:1.13-alpine
COPY nginx.conf /etc/nginx/conf.d/
COPY --from=builder /usr/src/app/dist /usr/src/app