Skip to content

Instantly share code, notes, and snippets.

View Innei's full-sized avatar
💭
Coding with cloud.

Innei Innei

💭
Coding with cloud.
View GitHub Profile
@ljw1004
ljw1004 / you_are_not_right.sh
Last active August 25, 2025 00:22
A UserPromptSubmit hook for Claude Code to stop it saying "You're right"
#!/bin/bash
set -euo pipefail
trap 'echo "at line $LINENO, exit code $? from $BASH_COMMAND" >&2; exit 1' ERR
# This is a Claude Code hook to stop it saying "you are right".
#
# Installation:
# 1. Save this script and chmod +x it to make it executable.
# 2. Within Claude Code, /hooks / UserPromptSubmit > Add a new hook (this file)
#
@dillionverma
dillionverma / lucide-react.d.ts
Last active August 12, 2025 17:29
How to stop @radix-ui, next/router and lucide-react auto-imports
declare module 'lucide-react' {
export * from 'lucide-react/dist/lucide-react.suffixed'
}
@stephancasas
stephancasas / IntelligenceLightView.swift
Created February 12, 2025 23:25
A basic SwiftUI expression of the native Apple Intelligence NSIntelligenceUILightView
//
// IntelligenceLightView.swift
//
// Created by Stephan Casas on 2/12/25.
//
import SwiftUI
import AppKit
struct IntelligenceLightView: NSViewRepresentable {
@alexzhang1030
alexzhang1030 / webrtc-note-draft.md
Last active June 13, 2024 03:21
WebRTC Note Draft

WebRTC

目前仅存储有关 DataChannel 的信息

通信模型

在进行 WebRTC 通信时,节点间会按照如下顺序获取对方的地址:

  • 如果双端在同一个内网,直接用内网IP通信;
  • 通过 STUN 服务器,为双端构造可以直接访问的地址,打造一条可以穿透 NAT 的通路,俗称“打洞”;
@OrionReed
OrionReed / dom3d.js
Last active August 15, 2025 09:46
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@sxzz
sxzz / GitHub.sh
Last active November 5, 2023 09:03
GitHub CLI scripts
# Get the owner of the repository to which you contributed (Pull Requests)
gh api graphql --paginate -f query='
query($endCursor: String) {
user(login: "username") {
pullRequests(first: 100, after: $endCursor, states: MERGED) {
nodes { repository { owner { login } } }
pageInfo {
hasNextPage
endCursor
import Cocoa
import MediaPlayer
let bundle = CFBundleCreate(kCFAllocatorDefault, NSURL(fileURLWithPath: "/System/Library/PrivateFrameworks/MediaRemote.framework"))
let MRMediaRemoteRegisterForNowPlayingNotificationsPointer = CFBundleGetFunctionPointerForName(
bundle, "MRMediaRemoteRegisterForNowPlayingNotifications" as CFString
)
typealias MRMediaRemoteRegisterForNowPlayingNotificationsFunction = @convention(c) (DispatchQueue) -> Void
let MRMediaRemoteRegisterForNowPlayingNotifications = unsafeBitCast(MRMediaRemoteRegisterForNowPlayingNotificationsPointer, to: MRMediaRemoteRegisterForNowPlayingNotificationsFunction.self)
@sindresorhus
sindresorhus / esm-package.md
Last active August 25, 2025 12:05
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active August 26, 2025 07:03
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized