Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am env25 on github.
  • I am env25 (https://keybase.io/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
eNV25 / width.go
Last active Jun 4, 2021
`wcwidth` implementation for Go. Uses the `unicode` and `golang.org/x/text/width` packages.
View width.go
package textwidth
import (
"unicode"
"golang.org/x/text/width"
)
// IsComb returns true if r is a Unicode combining character. Alias of:
//
@eNV25
eNV25 / main.go
Created May 18, 2021
tcell ChannelEvents examples
View main.go
package main
import (
"fmt"
"os"
"strings"
"github.com/gdamore/tcell/v2"
"github.com/gdamore/tcell/v2/encoding"
"github.com/mattn/go-runewidth"
@eNV25
eNV25 / eruda.user.js
Last active Apr 30, 2022
Eruda DevTools UserScript
View eruda.user.js
// ==UserScript==
// @name Eruda Loader
// @description Load and setup Eruda, DOM plugin included
// @namespace https://eruda.liriliri.io/
// @match *://*/*
// @exclude-match https://eruda.liriliri.io/*
// @require https://unpkg.com/eruda
// @require https://unpkg.com/eruda-dom
// @grant none
// @run-at document-idle
@eNV25
eNV25 / fibonacci-generator.js
Last active May 17, 2021 — 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
eNV25 / hp-bios-update.md
Last active Aug 29, 2022
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux
View hp-bios-update.md

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

The easiest way to should be to use [HP PC HARDWARE DIAGNOSTICS 4-IN-1 USB KEY][hp-usb-key]. You should use this option if your BIOS/UEFI does not have a "BIOS update" option.

Unfortunately HP's automatic tool only runs on Windows, but it is possible to make a USB key formatted manually by running the self-extracting executable on Wine. You cannot simply extract the executable using 7-zip because the executable needs to do some file generation.

@eNV25
eNV25 / foreach.h
Created Apr 24, 2021
foreach implementation for c
View foreach.h
#define foreach(item, array) \
for ( \
int _i_ = -1, _k_ = 0, \
_size_ = ((sizeof(array)/sizeof(0[array])) / \
((size_t)(!(sizeof(array) % sizeof(0[array]))))); \
_i_ != _size_ ; \
_k_ = !_k_, _i_++ \
) for (item = array[_i_]; _k_; _k_ = !_k_)
@eNV25
eNV25 / freezer-bin.diff
Created Apr 17, 2021
fixed PKGBUILD for freezer
View freezer-bin.diff
diff --git a/PKGBUILD b/PKGBUILD
index f59da3b..ed010c0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,33 +1,22 @@
# Maintainer: Xandar Null <xandar.null@gmail.com>
pkgname=freezer-bin
+_pkgname_=freezer
pkgver=1.1.18
@eNV25
eNV25 / state_machine.c++
Last active Apr 17, 2021
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; }