Skip to content

Instantly share code, notes, and snippets.

View mihai-vlc's full-sized avatar

Mihai Ionut Vilcu mihai-vlc

View GitHub Profile
@mihai-vlc
mihai-vlc / .vscode_launch.json
Created September 17, 2025 08:58
VSCode simple project specific extention. Place the files in the .vscode/extensions/<extention name> folder.
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
const sax = require('sax');
function escapeAttr(s) {
return s.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/"/g, '&quot;')
.replace(/\t/g, '&#x9;')
.replace(/\n/g, '&#xA;')
.replace(/\r/g, '&#xD;');
}
@mihai-vlc
mihai-vlc / init.lua
Last active August 24, 2025 13:38
Minimal neovim configuration, no plugins
vim.g.mapleader = ' '
vim.g.netrw_winsize=25
vim.g.netrw_browse_split = 4
vim.o.number = true
vim.o.wrap = false
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.showtabline = 2
vim.o.expandtab = true
@mihai-vlc
mihai-vlc / App.jsx
Last active November 23, 2023 17:28
react no build step
import React, { useState } from "https://esm.sh/react?dev";
const Title = (await importJSX("./components/Title.jsx")).default;
export default function App() {
const [count, setCount] = useState(0);
function handleClick() {
setCount((c) => c + 10);
}
@mihai-vlc
mihai-vlc / script-template.sh
Last active September 17, 2023 11:44 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
VERSION="1.0.0"
main() {
local action="${args[0]}"
@mihai-vlc
mihai-vlc / LEARN_X_IN_Y_MINUTES_VBA.md
Last active July 24, 2023 06:25
Learn X in Y minutes where X = VBA
function gtcmf {
$hash = $(git log --grep=fixup --invert-grep --max-count=1 --pretty=%h)
git commit --fixup $hash
}
function gtfix {
$hash = $(git log --grep=fixup --invert-grep --max-count=1 --pretty=%h)
git rebase --interactive --rebase-merges --autostash --autosquash $hash^
}
import { wordWrap } from "./word";
import readline from "readline";
const rl = readline.createInterface(process.stdin, process.stdout);
let i = 0;
rl.setPrompt(`Text(${i}) = `);
rl.prompt();
rl.on("line", (line) => {
@mihai-vlc
mihai-vlc / config.lua
Created December 3, 2022 10:04
lunarvim config located at $env:LOCALAPPDATA\lvim\
--[[
THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
`lvim` is the global options object
]]
-- Enable powershell as your default shell
vim.opt.shell = "pwsh.exe -NoLogo"
vim.opt.shellcmdflag =
"-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
vim.cmd [[
godoc -http=:6060 -index &
Start-Sleep -Seconds 2
Start-Process "http://localhost:6060"