Skip to content

Instantly share code, notes, and snippets.

View vantm's full-sized avatar
🐛
🔧🪲😄

Van Tran vantm

🐛
🔧🪲😄
View GitHub Profile
@vantm
vantm / shell.nix
Created March 6, 2026 15:35
Music shell.nix
{
pkgs ? import <nixpkgs> { },
}:
let
trimend = pkgs.writeShellApplication {
name = "trimend";
text = ''
INPUT="$1"
shift
TIMETO="$1"
import simpleImportSort from 'eslint-plugin-simple-import-sort';
const pkgs = [
// frontend packages
'^react$',
'^react/',
'^react-dom$',
'^react-dom/',
'^next$',
'^next/',
npx create-typescript-app --offline `
--directory server `
--description "The central server app" `
--preset minimal `
--exclude-contributing-docs `
--exclude-contributor-covenant `
--exclude-development-docs `
--exclude-security-docs `
--exclude-templated-with `
--add-vitest
# Install WLAN drivers
# Debloat and Tweak windows using WinUtils
# Install LenovoServiceBridge and update drivers
scoop install 7zip git
&"$env:USERPROFILE/scoop/apps/7zip/current/install-context.reg"
&"$env:USERPROFILE/scoop/apps/git/current/install-context.reg"
git config --global credential.helper manager
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAVkkS/bluHkZBk8xkqDzxelok+xA5zWtV1LUN/wVqfI vantm@vantm-idea
import { chain, isEmpty, toLower, omit, CollectionChain } from 'lodash';
const filter = '';
interface HasFilter {
filter: string
}
const filterTerms = <V extends HasFilter>(docs: CollectionChain<V>, terms: string[]) => {
let docChain = docs;
@echo off
setlocal enableextensions disabledelayedexpansion
(for %%a in (%*) do if exist "%%~a" (
pushd "%%~dpa" && ( copy /b "%%~nxa"+,, & popd )
) else (
type nul > "%%~fa"
)) >nul 2>&1
public static class EitherExtensions
{
public static Either<L, R> BindSelf<L, R>(this Either<L, R> either, Func<R, Either<L, R>> bind)
=> bindSelf(either, bind);
public static async Task<Either<L, R>> BindSelfAsync<L, R>(this Task<Either<L, R>> either, Func<R, Either<L, R>> bind)
=> bindSelf(await either, bind);
public static Either<L, R> LeftWhen<L, R>(this Either<L, R> either, Func<R, bool> pred, Func<L> createLeft)
=> leftWhen(either, pred, createLeft);
@vantm
vantm / custom-layouts.json
Last active April 1, 2024 12:24
My FancyZone custom layouts
{
"custom-layouts": [
{
"uuid": "{0E526AA1-F466-4037-AA97-065BE028DAE4}",
"name": "Wide Horizontal Monitor",
"type": "canvas",
"info": {
"ref-width": 2560,
"ref-height": 1392,
"zones": [
{
"actions": [
{
"command": { "action": "copy", "singleLine": false },
"keys": "ctrl+c"
},
{
"command": "paste",
"keys": "ctrl+v"
},