Skip to content

Instantly share code, notes, and snippets.

View vantm's full-sized avatar
🐛

Van Tran vantm

🐛
View GitHub Profile
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"
},
import { deburr } from 'lodash'
function strip_diacritics(str: string | null | undefined) {
if (typeof str !== 'string') {
return str
}
return deburr(str.normalize('NFD'))
}
/****** Scripting replication configuration. Script Date: 7/17/2023 2:58:30 PM ******/
/****** Please Note: For security reasons, all password parameters were scripted with either NULL or an empty string. ******/
/****** Installing the server as a Distributor. Script Date: 7/17/2023 2:58:30 PM ******/
use master
exec sp_adddistributor @distributor = N'f3953359a4d4', @password = N''
GO
exec sp_adddistributiondb @database = N'distribution', @data_folder = N'/mnt/Data', @log_folder = N'/mnt/Data', @log_file_size = 2, @min_distretention = 0, @max_distretention = 72, @history_retention = 48, @deletebatchsize_xact = 5000, @deletebatchsize_cmd = 2000, @security_mode = 1
GO