Created by Christopher Manning
Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.
The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.
Created by Christopher Manning
Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.
The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.
we can compactingReducer, basically searches the last 50 actions for "stop" or
ServerSignature Off | |
ServerTokens Prod | |
<VirtualHost *:80> | |
ServerName plex.website.com | |
# This VirtualHost redirects everything to HTTPS on port 443. | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} | |
</VirtualHost> |
tell application "Finder" | |
-- get desktop dimensions (dw = desktop width; dh = desktop height) | |
set db to bounds of window of desktop | |
set {dw, dh} to {item 3 of db, item 4 of db} | |
end tell | |
tell application "System Events" | |
repeat with proc in application processes | |
tell proc | |
repeat with win in windows |
#!/bin/bash | |
# <bitbar.title>ac-wattage</bitbar.title> | |
# <bitbar.version>1.0</bitbar.version> | |
# <bitbar.author>Tom McKenzie</bitbar.author> | |
# <bitbar.author.github>grrowl</bitbar.author.github> | |
# <bitbar.desc>Shows the currently AC Charger wattage, if any.</bitbar.desc> | |
# Get SPPowerDataType | |
powerdata=$(system_profiler SPPowerDataType) | |
connected=$(echo "$powerdata" | grep 'Connected:' | awk 'END{print $2}') |
#!/bin/bash | |
if [[ $# -lt 2 ]] | |
then | |
echo "Usage: port-forward HOST REMOTE_PORT [LOCAL_PORT]"; | |
else | |
HOST=$1 | |
REMOTE_PORT=$2 | |
LOCAL_PORT=${3:-${REMOTE_PORT}} |
#!/bin/bash | |
function lazy_nvm { | |
unset -f nvm | |
unset -f npm | |
unset -f node | |
unset -f npx | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # linux |
--- | |
title: "Hibernate When Network Idle" | |
date: 2020-04-14T20:57:40+10:00 | |
draft: true | |
tags: | |
- linux | |
--- | |
i have a pc at home which is often on, but not so often used. i'd like it to hibernate most of the time, unless i want to use it or it is doing something itself. it's possible, stringing together a few things: |
import { jsonrepair } from "jsonrepair"; | |
export function tryParseJson<T>(json: string): T | undefined { | |
try { | |
return JSON.parse(jsonrepair(json)); | |
} catch (error) { | |
// throw new Error(`Failed to parse JSON ${error}`); | |
return undefined; | |
} | |
} |
# To use this Dockerfile, you have to set `output: 'standalone'` in your next.config.js file. | |
# From https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile | |
# FROM node:22.12.0-alpine AS base | |
FROM node:23-alpine AS base | |
# Install dependencies only when needed | |
FROM base AS deps | |
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
RUN apk add --no-cache libc6-compat |