Skip to content

Instantly share code, notes, and snippets.

@flishwang
flishwang / vllm_monkey_patch.py
Created July 4, 2025 04:14
vllm_monkey_patch
import torch
from vllm.v1.worker.gpu_worker import Worker, logger
from vllm.device_allocator.cumem import CuMemAllocator
from vllm.v1.kv_cache_interface import KVCacheConfig
from vllm.utils import GiB_bytes
from typing import Optional
import gc
from vllm.device_allocator.cumem import libcudart, is_pin_memory_available, unmap_and_release
@rxaviers
rxaviers / gist:7360908
Last active July 15, 2025 11:22
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:

iOS restrictions re: bringing up the keyboard on programmatic focus

I can't find exact specifications on this, but it seems that iOS restricts bringing up the keyboard via programmatically focusing on <input>. It only brings up the keyboard in response to explicit user interaction.

  1. iOS focus on input field only brings up keyboard when called inside a click handler.
  2. It doesn’t work if the focus is async.

This presents a curious problem when you want to autofocus an input inside a modal or lightbox, since what you generally do is click on a button to bring up the lightbox, and then focus on the input after the lightbox has been opened. Without anything fancy, it actually works ok. The problem shows up when you try to add something fancy like a setTimeout or a promise.then(). I don't know why people would want to use a setTimeout here, but waiting for a promise is actually a pretty common use case. E.g. we try to batch dom manipulations like getting a lightbox to show up inside `requestAnimati

@ektogamat
ektogamat / HolographicMaterial.js
Last active July 15, 2025 11:21
HolographicMaterial for React Three Fiber
/**
* Holographic material component by Anderson Mancini - Dec 2023.
* Dec 7th - Added useMemo for better performance
*/
import React, { useRef, useMemo } from 'react'
import { shaderMaterial } from '@react-three/drei'
import { extend, useFrame } from '@react-three/fiber'
import {
Color,
description model tools
4.1 Beast Mode v3
GPT-4.1
changes
codebase
editFiles
extensions
fetch
findTestFiles
githubRepo
new
problems
runCommands
runNotebooks
runTasks
runTests
search
searchResults
terminalLastCommand
terminalSelection
testFailure
usages
vscodeAPI

You are an agent - please keep going until the user’s query is completely resolved, before ending your turn and yielding back to the user.

Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.

@saikotek
saikotek / OBSIDIAN-SYNC-SETUP.md
Last active July 15, 2025 11:16
Easy setup Obsidian Sync (or Livesync or Remotely Save) with Git

Setting Up Obsidian Sync (or Livesync or Remotely Save) with Separate Git Backup

This guide describes how to set up an Obsidian vault that syncs across devices while maintaining a separate Git backup without interfering with the sync mechanism. This guide should work with either official Obsidian Sync solution or with unofficial sync plugins like Obsidian Livesync or Remotely Save.

Prerequisites

  • Git installed on your system
  • Obsidian installed
  • Either Obsidian Sync subscription or LiveSync plugin configured
  • Basic familiarity with command line
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active July 15, 2025 11:20
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for non-video, non-activity quests! For stream/play quests use the desktop app!

Note

When doing stream quests, you need at least 1 other account in the vc!

How to use this script:

  1. Accept a quest under Discover -> Quests
@fnky
fnky / ANSI.md
Last active July 15, 2025 11:10
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@achetronic
achetronic / get-docker-image-tag-by-sha.sh
Created July 2, 2022 19:19
Find the tag of a Docker image having only the SHA256
#!/bin/bash
SHA256_HASH="5bb4faffc8b35e2702b2ffa78e982b979d7b66db29bd55b0c58de8fa745df661"
for i in {1..1000}
do
echo "Looking into page: $i"
curl "https://registry.hub.docker.com/v2/repositories/apache/superset/tags/?page=$i" \
| jq '.results[] | select(.["images"][]["digest"] == "sha256:'${SHA256_HASH}'")'
@NickMercer
NickMercer / ExampleNonUIMonoBehaviour.cs
Created July 14, 2022 00:55
UIToolkitRaycastChecker is a script for Unity UIElements to replicate the EventSystem.current.IsPointerOverGameObject() functionality for UI Elements.
using UnityEngine;
public class ExampleNonUIMonoBehaviour : MonoBehaviour
{
private void Start()
{
//Example of how to check for a position. This is the equivalent of EventSystem.current.IsPointerOverGameObject() except for UI Elements.
if (UIToolkitRaycastChecker.IsPointerOverUI())
{
//I'm under a part of the UI that's set to block raycasts! Don't try to raycast or something.