Skip to content

Instantly share code, notes, and snippets.

eNV25 / build.zig
Last active August 3, 2023 13:03
build.zig installArtifact(), install build shared object, executable or object to custom location
View build.zig
const std = @import("std");
pub fn build(b: * !void {
const target = b.standardTargetOptions(.{});
const mode = b.standardReleaseOptions();
const lib = b.addSharedLibrary("plugin", "src/plugin.zig", .unversioned);
View timesync.service
# /etc/systemd/system/timesync.service
Description=time sync using HTTP Date header
ExecStart=/bin/bash -c '{ exec {sleep}<> <(:); while ! : >/dev/tcp/; do read -r -t 1 -u $$sleep; done; } 2>/dev/null; true'
ExecStart=/bin/bash -c 'timedatectl set-time "$(date +"%%Y-%%m-%%d %%H:%%M:%%S %%Z" -d"$(curl -sSI | grep -i "Date: " | cut -d" " -f2-)")"'

Keybase proof

I hereby claim:

  • I am env25 on github.
  • I am env25 ( on keybase.
  • I have a public key ASDE5jYkU8sq2BQfR6Pv-6wYAW68ifCPPbkv6xfknPM8ego

To claim this, I am signing this object:

View github-vscode-dark.conf
color0 #000000
color1 #d81029
color2 #00c172
color3 #e2e800
color4 #1571ce
color5 #c824c2
color6 #00aad1
color7 #e5e5e5
color8 #666666
color9 #fe3646
eNV25 / width.go
Last active January 12, 2024 11:44
`wcwidth` implementation for Go. Uses the `unicode` and `` packages.
View width.go
package textwidth
import (
// IsComb returns true if r is a Unicode combining character. Alias of:
eNV25 / main.go
Created May 18, 2021 17:35
tcell ChannelEvents examples
View main.go
package main
import (
eNV25 / fibonacci-generator.js
Last active May 17, 2021 07:35 — forked from jfairbank/fibonacci-generator.js
Fibonacci ES6 Generator
View fibonacci-generator.js
export function *fibonacci(n) {
const infinite = !n && n !== 0;
let current = 0n;
let next = 1n;
while (infinite || n--) {
yield current;
[current, next] = [next, current + next];
eNV25 /
Last active February 9, 2024 10:37
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

To update the BIOS/UEFI firmware requires HP-specific files in the EFI System Partition, also referred to as ESP.

On a Linux system, the ESP is typically mounted on /boot/efi or /efi. Whithin you should also find a EFI directory, e.g. /boot/efi/EFI or /efi/EFI. This article assumes that the ESP is mounted on /efi and that the /efi/EFI directory exists. You can replace that with the mount point your system uses.

The HP-specific files are located in /efi/EFI/HP or /efi/EFI/Hewlet-Packard. These files typically come preinstalled in HP Windows PCs. If you have these files you could skip Install HP-specific files.

eNV25 / freezer-bin.diff
Created April 17, 2021 19:03
fixed PKGBUILD for freezer
View freezer-bin.diff
diff --git a/PKGBUILD b/PKGBUILD
index f59da3b..ed010c0 100644
@@ -1,33 +1,22 @@
# Maintainer: Xandar Null <>
eNV25 / state_machine.c++
Last active April 17, 2021 19:09
State machine where each state is represented by a function.
View state_machine.c++
#include "state_machine.h"
#include <iostream>
using namespace std;
struct StateFn {
State f;
StateFn(State p) : f(p) {}
operator State(void) { return f; }