Skip to content

Instantly share code, notes, and snippets.

@mdynnl
mdynnl / dump.md
Created November 17, 2024 20:48
solid reactivity brain dump

corrections are welcomed as my understanding of solid reactiviy is limited

(sources) signals are the sources of truth.

(pure derivations) we derives values from signals by storing computations from signals using functions, or memos(lazy/eager) if we want to be efficient by calculating only when necessary then we need to actually show the values, and we do it using render effects, which are also pure from the viewpoint of the system

(impure derivations)

@mdynnl
mdynnl / class-intellisense.js
Created May 21, 2024 04:39
A workaround to support for classes inside css files in TailwindCSS Intellisense
const path = require("path");
const fs = require("fs");
const stack = new Error().stack;
const isExtension = process.title.includes("Code Helper (Plugin)") || stack.includes("dist/server.js");
/**
* @param {import("tailwindcss/types/config").PluginAPI} api
*/
module.exports = function handler(api) {
if (!isExtension) return;
@mdynnl
mdynnl / babel-plugin-solid-mdx.js
Created May 7, 2023 16:28
A babel plugin to transform mdx jsx output for solid
/**
* @typedef {string | RegExp | ((v: string) => boolean)} Predicate
*/
import { extname } from "path";
import { types as t } from "@babel/core";
/**
* @returns {import("@babel/core").PluginObj}
*/
@mdynnl
mdynnl / bspwm
Last active January 24, 2021 16:57
bspwm, sxhkd: pin a node to (a) desktop(s)
#!/bin/bash
ROOT=/tmp/work
mkdir -p $ROOT
cd $ROOT
clean(){
ls . | while read n
do bspc node $n -g sticky=off -g hidden=off
done
rm -rf $ROOT