Skip to content

Instantly share code, notes, and snippets.

View monodyle's full-sized avatar
🙊
Out of money

Monody Le monodyle

🙊
Out of money
View GitHub Profile
@rxliuli
rxliuli / a-less-favorable-vue3.md
Last active April 7, 2025 21:16
Svelte5: A Less Favorable Vue3

Svelte5: A Less Favorable Vue3

Background

Svelte5 was released in October last year, touted as the best version of Svelte to date. The team was particularly proud of "runes," a reactive state system built on proxies. However, after experiencing Vue3's Composition API and SolidJS signals, I didn't feel particularly excited. This blog outlines specific issues encountered when using Svelte5 in real projects. If you're a Svelte5 enthusiast, you might want to stop reading now.

Runes Only Work in Svelte Components or .svelte.ts Files

When trying to write hooks with runes similar to React/Vue, like useCounter:

<template>
<dialog
ref="dialog"
:class="`${type}`"
class="rounded-md shadow-xl border-0 p-0 min-w-[320px] max-w-[calc(100vw - 40px)] backdrop:bg-black/50"
>
<div class="flex gap-5 py-6 px-7">
<aside>
<i class="text-lg w-[2.3rem] aspect-square flex justify-center items-center rounded-full">
<Icon v-if="type === 'info'" :icon="faInfo" />
@kashifulhaque
kashifulhaque / NvChad.md
Last active April 29, 2025 20:19
Neovim stuff with NvChad

Neovim keybinds

  • Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
  • _ (underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)
    • 0 (zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
  • $ (dollar) to move the cursor at the end of line (doesn't switch to insert mode)
  • d$ will delete from wherever your cursor is till the end of the line
  • f<character> to move cursor to the first occurrence of <character>
    • f( to move cursor to first occurence of (
  • t<character> to move cursor to upto but not on the first occurrence of <character>
  • t( to move cursor to first occurence of (
@steveruizok
steveruizok / cache.ts
Last active March 31, 2023 14:43
weak map gist
export class Cache<T extends object, K> {
items = new WeakMap<T, K>()
get<P extends T>(item: P, cb: (item: P) => K) {
if (!this.items.has(item)) {
this.items.set(item, cb(item))
}
return this.items.get(item)!
}
@huytd
huytd / wordle.md
Last active April 1, 2025 00:28
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@FbN
FbN / vite.config.js
Last active April 6, 2025 13:31
vite.config.js node built-in polyfills
// yarn add --dev @esbuild-plugins/node-globals-polyfill
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
// yarn add --dev @esbuild-plugins/node-modules-polyfill
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
// You don't need to add this to deps, it's included by @esbuild-plugins/node-modules-polyfill
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
export default {
resolve: {
alias: {
@christippett
christippett / README.md
Last active March 11, 2025 04:02
Hacker News Stylesheet

Hacker News userstyle

A modern re-styling of the Hacker News front page, including automatic light/dark mode.

Install directly with Stylus

Screenshots

HN 1

@tuhuynh27
tuhuynh27 / react-rendering.md
Last active December 3, 2024 14:24
A (Mostly) Complete Guide to React Rendering Behavior

Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)

A (Mostly) Complete Guide to React Rendering Behavior

Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.

"Render" là gì

Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.

@huytd
huytd / todo.vim
Created June 14, 2020 07:34
A Todo list syntax in Vim, with an actual checkbox
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
finish
endif
" Custom conceal