Skip to content

Instantly share code, notes, and snippets.

View VictorQueiroz's full-sized avatar
🏠
Working

Victor Queiroz VictorQueiroz

🏠
Working
View GitHub Profile
@VictorQueiroz
VictorQueiroz / strict-typebox.ts
Last active September 21, 2025 00:09
Helper that can be used to build strict Typebox types.
import {
ArrayOptions,
DateOptions,
IntegerOptions,
ObjectOptions,
SchemaOptions,
Static,
StringOptions,
TBoolean,
TInteger,
@VictorQueiroz
VictorQueiroz / create-typescript-project.sh
Last active November 26, 2025 16:51
Script to create a TypeScript project with predefined subprojects.
#!/bin/bash
create_indentation_files(){
echo '{' >> .prettierrc
echo ' "tabWidth": 2,' >> .prettierrc
echo ' "objectWrap": "collapse",' >> .prettierrc
echo ' "proseWrap": "always",' >> .prettierrc
echo ' "semi": true,' >> .prettierrc
echo ' "printWidth": 70,' >> .prettierrc
echo ' "trailingComma": "none",' >> .prettierrc
@VictorQueiroz
VictorQueiroz / README.md
Last active May 25, 2025 23:20
Chromium-based project flags to work seamlessly work with Wayland.

Chromium-based project flags to work seamlessly work with Wayland.

Installation

  1. Copy code-flags.conf to the root of the "$HOME"/.config folder.
  2. Replace all *-flags.conf files, except code-flags.conf with the new flags:
find ~/.config \
  -mindepth 1 -maxdepth 1 \
-type f -and \
interface IMyWriteableSignal<T> {
(): T;
set: (value: T) => void;
update: (updater: (currentValue: T) => T) => void;
}
function myWriteableSignal<T>(initialValue: T): IMyWriteableSignal<T> {
let value = initialValue;
function signal() {
@VictorQueiroz
VictorQueiroz / isValidCPF.spec.ts
Created May 10, 2025 22:20
TypeScript function to check if a Brazilian CPF is valid or not.
isValidCPF('0') // false
@VictorQueiroz
VictorQueiroz / castTypedArray.spec.ts
Last active May 6, 2025 10:17
Converts a typed array to a different typed array type.
import test, { describe } from "node:test";
import quantizeToFloat32 from "../../quantizeToFloat32";
import castTypedArray from "./castTypedArray";
describe("asTypedArray", async () => {
const { expect } = await import("chai");
test("it should convert Float32Array to Uint8Array without data loss", () => {
const expected = new Array(48)
.fill(0.0)
@VictorQueiroz
VictorQueiroz / disable-gnome-super-key-overlay-shortcut.sh
Created March 5, 2025 19:36
Disable GNOME Super key; the default shortcut for showing the applications.
#!/bin/bash
gsettings set org.gnome.mutter overlay-key ''
@VictorQueiroz
VictorQueiroz / TYPESCRIPT.md
Created March 3, 2025 17:56
TypeScript must-know

Found a [blog post][1] describing a fix that appears to work for me, while restoring my missing history:

mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history

Afterwards, you may want to instruct zsh to re-read the history form the recovered history file

fc -R .zsh_history
@VictorQueiroz
VictorQueiroz / .zshrc
Created December 3, 2024 22:25
My ZSH configuration using Znap, Oh My ZSH, and more plugins.
## Download Znap, if it's not there yet.
[[ -r ~/Repos/znap/znap.zsh ]] ||
git clone --depth 1 -- \
https://github.com/marlonrichert/zsh-snap.git ~/Repos/znap
source ~/Repos/znap/znap.zsh # Start Znap Load Znap
# Load Oh My Zsh
znap source ohmyzsh/ohmyzsh
# znap source sorin-ionescu/prezto modules/{environment,history}