Skip to content

Instantly share code, notes, and snippets.

View palapapa's full-sized avatar

palapapa palapapa

  • Taiwan
  • 01:45 (UTC +08:00)
View GitHub Profile
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│( ● ) Thinking... │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
send q or ctrl+c to exit | send "/clear" to reset | send "/help" for commands | press enter to send — 0% context left
Failed to parse toolCall.arguments: {"command": ["bash", "-lc", "apply_patch << 'EOF'\n*** Begin Patch\n*** Add File: src/components/excerpt-section.tsx\n+import Link from 'next/link';\n+import { SectionHeading } from '@/components/section-heading';\n+import { Card, CardContent } from '@/components/ui/card';\n+import { BookCTA } from '@/components/book-cta';\n+import { Button } from '@/components/ui/button';\n+import { Info, BookMarked } from 'lucide-react';\n+\n+
@OrionReed
OrionReed / dom3d.js
Last active May 15, 2025 11:15
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; // ¯\\_(ツ)_/¯
"""
A simple script to install everything
"""
from subprocess import Popen
from string import ascii_lowercase
MAX_LENGTH = 100
ALLOWED_CHARACTERS = ascii_lowercase + '-'
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"comment.line",
"constant",
"constant.character",
@SamratSahoo
SamratSahoo / convolution.py
Last active May 3, 2025 10:47
2D Convolution Implementation with NumPy
def convolve2D(image, kernel, padding=0, strides=1):
# Cross Correlation
kernel = np.flipud(np.fliplr(kernel))
# Gather Shapes of Kernel + Image + Padding
xKernShape = kernel.shape[0]
yKernShape = kernel.shape[1]
xImgShape = image.shape[0]
yImgShape = image.shape[1]
@achimmihca
achimmihca / AnchorsToCornersMenuItems.cs
Last active May 25, 2024 18:25
Unity3D Editor script that adds MenuItem to move the anchors of a RectTransform to its corners.
using UnityEditor;
using UnityEngine;
public static class AnchorsToCornersMenuItems
{
// Hotkey: Alt+A
[MenuItem("Tools/Anchors to Corners (RectTransform)/Width and Height &a")]
public static void MoveAnchorsToCorners()
{
EditorUtils.GetSelectedComponents<RectTransform>().ForEach(it =>
@CrendKing
CrendKing / browser-font-fallback.md
Last active May 11, 2025 15:16
browser-font-fallback.md

This document records my conclusions of experimenting Firefox 68 and Chromium 74 font fallback mechanism on Windows, as dated of the writing time.

Definition of font fallback

Both Firefox and Chromium allow users to configure the desired fonts used for displaying HTML in various languages. The HTML language is specified in the <html lang={lang}> tag. For instance, a Chinese webpage could be written as <html lang="zh"> or more specifically <html lang="zh-CN">. English webpage is <html lang="en"> or simplify lefting out the lang tag (although strongly discouraged by the W3C standard). The per-script font setting in Chromium is unlocked with the Advanced Font Settings extension.

When the webpage specify the font list to be used for certain element in CSS, the browsers will first search its font cache for