Skip to content

Instantly share code, notes, and snippets.

View hidoos's full-sized avatar
🏠
Working from home

hong lan hidoos

🏠
Working from home
  • GuiYang, China
View GitHub Profile
@benpsnyder
benpsnyder / README.md
Last active June 17, 2026 12:53
Drizzle ORM + Effect v4 — Bun + pnpm v11 patch for drizzle-orm@1.0.0-beta.20 with effect@4.0.0-beta.42

Drizzle ORM + Effect v4 — Bun and pnpm v11 patch

Status: Working patch for the exact combo drizzle-orm@1.0.0-beta.20 + drizzle-kit@1.0.0-beta.20 + effect@4.0.0-beta.42 + @effect/sql-pg@4.0.0-beta.42 Tested package managers: bun@1.3.12, pnpm@11.0.0-rc.0 Context: drizzle-team/drizzle-orm#5484 (unmerged PR), drizzle-team/drizzle-orm#5414 Scope: This gist is intentionally version-specific. If you move to a different Drizzle beta or different Effect beta, re-test or regenerate the patch.

Drizzle ORM 1.0 ships a built-in Effect integration at drizzle-orm/effect-postgres, but the published drizzle-orm@1.0.0-beta.20 package targets Effect v3 APIs. This patch updates that integration to work with Effect v4 for the exact versions above.

The patch file in this gist is manager-neutral. The patch contents work with both Bun and pnpm v11. What differs is only where

@alexfazio
alexfazio / .claude--skills--hook-development--SKILL.md
Created January 8, 2026 13:37
Claude Code Hook Development Skill - Install to .claude/skills/hook-development/

name: Hook Development description: >- This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "implement agent hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", "frontmatter hooks", "scoped hooks", "once: true", or mentions hook events (PreToolUse, PostToolUse, Stop,

@moonflame
moonflame / DatetimePicker_bug.js
Last active June 23, 2020 09:00
DatetimePicker bug (Vant Weapp)
Page({
data: {
currentDate: new Date().getTime(),
minDate: new Date().getTime()
},
onInput(event) {
this.setData({
currentDate: event.detail,
});

2.6 Internal Change: Reverting nextTick to Always Use Microtask

The Original Problem

When Vue detects data mutation, it asynchronously defer DOM updates to the next "tick" so that multiple mutations trigger only one update cycle. In versions before 2.5, Vue has been deferring updates using what is known as the "Microtask" (as explained in this blog post).

This works fine in most situations, but we discovered an edge case:

  1. Given two nested elements, "outer" and "inner";
  2. "inner" has a click event handler which triggers an update
@Ariex
Ariex / Promise.allInOrder.js
Last active February 17, 2022 07:31
Promise.allInOrder
// v3 is shorter than v2, and achieve same goal
(()=>{
let Deferred = function(){
let resolver, rejector,
promise = new Promise((resolve, reject)=>{
resolver = resolve;
rejector = reject;
});
promise.resolve = d=>resolver(d);
promise.reject = d=>rejector(d);
@JoeNoPhoto
JoeNoPhoto / Add,Remove, and Increment,Avoiding Array Mutations with concat(), slice(), and ...spread.js
Last active March 7, 2026 22:56
(ES6) Avoiding Array Mutations with concat(), slice(), and ...spread
const addCounter = (list) => {
return [...list, 0];
};
const removeCounter = (list, index) => {\
return [
...list.slice(0, index),
...list.slice(index + 1)
];
};
anonymous
anonymous / dabblet.css
Created January 14, 2014 15:26
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
:root {
background-color: #6374AB;
padding: 50px;
}
ul{
background:yellow;
margin:0;
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 20, 2026 04:10
A badass list of frontend development resources I collected over time.
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
'use strict';
var moment = require('moment');
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};