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 / 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"
(function() {
// restore the native console object
var i = document.createElement('iframe');
i.style.display = 'none';
document.body.appendChild(i);
window.console = i.contentWindow.console;
var script = document.createElement("script");
script.src = "https://unpkg.com/[email protected]/axe.min.js";
script.onload = function () {
# For documentation, see https://www.sumatrapdfreader.org/settings/settings3-3-1.html
MainWindowBackground = #555555
EscToExit = false
ReuseInstance = true
UseSysColors = false
RestoreSession = true
TabWidth = 350
FixedPageUI [
@mihai-vlc
mihai-vlc / README.md
Created July 10, 2022 11:23
Attempt to reload dll in a golang program

I found that when we attempt to use the DLL generated by GO we get the following error:

fatal error: bad sweepgen in refill

runtime stack:
runtime.throw({0x807f8e?, 0xc0000c3df8?})
        C:/Program Files/Go/src/runtime/panic.go:992 +0x76
runtime.(*mcache).refill(0x271caaf0a28, 0x2)
        C:/Program Files/Go/src/runtime/mcache.go:156 +0x1ec