Skip to content

Instantly share code, notes, and snippets.

View fubits1's full-sized avatar
🦄
Unicorning

Ilja fubits1

🦄
Unicorning
View GitHub Profile
@fubits1
fubits1 / settings.json
Created October 28, 2025 09:26
VSCode (and Cursor) label pattern rules for Svelte and Astro
"workbench.editor.customLabels.patterns": {
"**/src/**/*.astro": "${filename}",
"**/src/**/*.svelte": "${filename}",
"**/src/**/*.css": "${filename}",
"**/src/stores/**/*.js": "${filename} (Store)",
"**/src/routes/+page.svelte": "Home (Page)",
"**/src/routes/**/+page.svelte": "${dirname} (Page)",
"**/src/routes/**/+layout.svelte": "${dirname} (Layout)",
"**/src/pages/**/*.astro": "${dirname}/${filename} (Page)",
"**/src/layouts/**/*.astro": "${filename} (Layout)",
@fubits1
fubits1 / nixpacks.toml
Created August 16, 2025 08:50
nixpacks with nodejs_24 (Node v24.5.0)
buildImage = 'ghcr.io/railwayapp/nixpacks:latest'
[phases.setup]
nixPkgs = ["nodejs_24", "pnpm_10"]
# node v24.5.0
nixpkgsArchive = 'cf93ceb06388f5714302b702cccf2c77f6064442'
[phases.install]
dependsOn = ["setup"]
cmd = "pnpm install --frozen-lockfile"
@fubits1
fubits1 / resumable-download.sh
Created October 21, 2024 14:49
Bash: resumable download function with curl
# add definition to ~/.bashrc / ~/.zshrc
# invoke with download <url>
download() {
url="${1:-}"
# Loop until the download is successful
while true; do
# Use curl with the -C - option to resume the download
curl -C - -O "$url"
@fubits1
fubits1 / WSL2-Forward-Ports.ps1
Created August 13, 2024 22:56
WSL2: forward ports (e.g. localhost:4321 / 0.0.0.0:5173)
# source https://jwstanly.com/blog/article/Port+Forwarding+WSL+2+to+Your+LAN/
$ports = @(80, 443, 4321, 5173);
$wslAddress = bash.exe -c "ifconfig eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'"
if ($wslAddress -match '^(\d{1,3}\.){3}\d{1,3}$') {
Write-Host "WSL IP address: $wslAddress" -ForegroundColor Green
Write-Host "Ports: $ports" -ForegroundColor Green
}
else {
@fubits1
fubits1 / TipTapEditorRunes.svelte
Last active July 17, 2024 10:11
Svelte 5 and tiptap editor default example (REPL backup just in case)
<script>
/** my REPL link:
* https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACr1Z624buRV-lbNKYckLSaOLx2vLsra2YzdpN22xTtEfqwChZiiJMDWcJTl2FEFA3qAo0D_91X99sDxBH6GHnLsuGwuyLUiaGfJc-H08h-SQi8qYcaoqvV8WlYDMaKVXuQjDSr2i56F5UPeUa4rPSkTSMyV95UkW6sEwGGrneyA-CTX1YSzFDKZah6rnOBOmp9Go6YmZE9ERlb5QTDka1UjoaEmpMyMscHw6E8pR0nOuP5FZiO1wXtMxibh2bq1f-N4ZBgBsFgqpYQFXggsJy9hZ9feJQfpJ00AxETQ8U18tqPzElH6r6WyrBkeBBkOJotZ7rL_Vc063qmm8bSgjUtS71URqKv_EdKw4rKSaKq5p3DE9rJyVMF37TOegchVPSLoqK4J3Igp0Lhx3jxUzgpxqoJzOKMqcw-_Qq6a1w7OsKnZVqjF1idla7RDOB7AwRZALB_QhaWQtqYLUSS-9qWcVKUWqB7-khRB3HMZDMGaTSNLaAkx8GZmM66YJv3rWY_bxAywP67mVXHaTpd_SzHsmK_yQ3aExbcF8zBXMpz_tDMolAG8Y6CmVtL4i6qzJ9sM1ZT1lCvBLoE9ngxFRzOs7eIes2fAHMYa-0lIEk8F7GwV9J3lswi2ircfOgZgf53DHAt8oWVNgghJsUCqYi-jrl3_7EEoxIiM-Rxch9ZK4JLFo3MNNuIw0PBAMWowBxo0qKEqNKzDpoXqrWFeR9SO-hrXP2VoZ9uCUaGyXoWAUcROTxgM84HiBUUjh65f_rhlyNljabB21AUNWP4jYrMlr1XyEwb6zhmBD971VAbZdIzFEw0RSon-EC-wA0xPYCbYYe9fQipTTnNik2yzwGaZ1E36iMQ1azpEKT_gURlx4d9-mOpR00LcKHidKnQ8rnASTiExow1NqWBmMhD-Pc9hnKuRk3oMAqcVUX_YdozhAq2j
@fubits1
fubits1 / ubuntu-bloat-removal.sh
Created March 22, 2024 16:04 — forked from NickSeagull/ubuntu-bloat-removal.sh
Updated Jan 22nd, 2024 - Simple command to remove all "bloatware" from ubuntu
sudo apt-get remove \
aisleriot \
brltty \
duplicity \
empathy \
empathy-common \
example-content \
gnome-accessibility-themes \
gnome-contacts \
gnome-mahjongg \
(function(f,h){typeof exports=="object"&&typeof module<"u"?module.exports=h():typeof define=="function"&&define.amd?define(h):(f=typeof globalThis<"u"?globalThis:f||self,f.Counter=h())})(this,function(){"use strict";function f(){}function h(t){return t()}function T(){return Object.create(null)}function p(t){t.forEach(h)}function N(t){return typeof t=="function"}function O(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Q(t){return Object.keys(t).length===0}function a(t,e){t.appendChild(e)}function P(t,e,n){t.insertBefore(e,n||null)}function V(t){t.parentNode.removeChild(t)}function m(t){return document.createElement(t)}function k(t){return document.createTextNode(t)}function S(){return k(" ")}function L(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function b(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function R(t){return Array.from(t.childNodes)}function U(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function B(t,e,
@fubits1
fubits1 / copyToClipboard.js
Last active August 22, 2022 18:15
Quarto: different approaches to have a button to trigger a JavaScript function. Use case here: copy the output from a code chunk to the clipboard; SETUP: put the .qmd and the .js files in the same folder
function copyToClipboard(domRef) {
// get DOM Element which contains the output
// i.e. ".cell-output code" to the first output chunk
const dom = document.querySelector(domRef);
// get the clean inner string of the DOM Element (no HTML)
const innerText = dom.innerText;
// with RegEx, remove [nr] and "
const cleanString = innerText.replace(/\[\d+]\s/, '').replace(/"/g, "")
// write to clipboard
navigator.clipboard.writeText(cleanString);
@fubits1
fubits1 / countries.sql
Last active August 13, 2022 12:52
SQL to create a table of country names, ISO codes, and continents (ENUM)
create type public.continents as enum (
'Africa',
'Antarctica',
'Asia',
'Europe',
'Oceania',
'North America',
'South America'
);
create table public.countries (

Keybase proof

I hereby claim:

  • I am fubits1 on github.
  • I am fubits (https://keybase.io/fubits) on keybase.
  • I have a public key ASCBPqZQmVjZKFDJNPD92EEVEXLzZow-57iZx-4msM15dgo

To claim this, I am signing this object: