Skip to content

Instantly share code, notes, and snippets.

@airtonix
airtonix / Microsoft.PowerShell_profile.ps1
Created January 8, 2024 03:10
Portforward one or more ports to WSL2
#
# ~/Documents/Powershell/Microsoft.PowerShell_profile.ps1
#
# get reference to the profile file dir
$HEREDIR = Split-Path -Parent $MyInvocation.MyCommand.Path
# add this directory/bin
$env:PATH += ";${HEREDIR}\bin"
@airtonix
airtonix / .envrc
Last active December 14, 2023 06:31
source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="
use devenv

Regular Markdown here.

![[firstDiagram.png]]

@startuml firstDiagram

Alice -> Bob: Hello
Bob -> Alice: Hi!
@airtonix
airtonix / DisableAutoScroll.js
Created September 26, 2023 02:19
Disable autoscroll UserScript
// ==UserScript==
// @name Disable Auto Scroll
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disable mouse middle button completely. As a result it does not activate browser auto scroll. Open hyperlink in a new tab with middle button click still works.
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
@airtonix
airtonix / README.md
Last active August 13, 2023 08:40
General Purpose ASDF bootstrapper

ASDF Bootstrapper

faceroll tooling management.

Auto install plugins for tooling described in a .tool-versions file, then install the tooling.

First steps

  • copy setup.sh into the root of your project
# #!/usr/bin/env python3
# # code: language=python3 insertSpaces=true tabSize=4
# Install:
# - put in ~/.local/bin/slack-musi-status
# - chmod +x ~/.local/bin/slack-musi-status
# - install python 3.10.10 or better
# - pip install dbus-python
#
# Linux: Create a Systemd Unit
> import dynamic from "next/dynamic";
>
> import { createAdmin } from "../../../services/Cms/ClientAdminUi";
>
> const Blank = () => <></>;
>
> export const AdminPageContainer = dynamic(
> async () => {
> if (typeof window === "undefined") return Blank;
> await createAdmin();
@airtonix
airtonix / 01_README.md
Last active March 14, 2023 23:30
zinit with fzf-tab

zsh, zinit with fzf-tab

image

image

@airtonix
airtonix / 01_README.md
Last active October 9, 2023 21:58
NetlifyCMS Github Auth with NextJS and Vercel
  1. drop all the files included (replacing _ with /)

  2. create three apps in github oauth settings: Local DEV, Staging, Prod

    1. https://github.com/settings/applications/new
    2. fillout the details: don't worry too much right now you can change all these later
      • name: ☝️
      • home page: your url (http://localhost:3000, https://staging.your.doma.in, https://your.doma.in)
      • description: whatever... but the user will see this
      • authorization callback url: as above but with /api/callback : (http://localhost:3000/api/callback, https://staging.your.doma.in/api/callback, https://your.doma.in/api/callback)
  3. on the application detail page:

@airtonix
airtonix / Blanket.tsx
Last active February 4, 2023 04:50
modal scroll lock that doesn't cause layout reflow or jitter.
import type { PropsWithChildren } from "react";
import { useBlanket } from "./useBlanket";
export function Blanket({ children }: PropsWithChildren) {
const { isOpen, setIsOpen, zIndex, color } = useBlanket();
return (
<>
{isOpen && (
<div