Skip to content

Instantly share code, notes, and snippets.

@mdouchement
mdouchement / settings.json
Last active January 3, 2025 03:38
Zed 0.164.2 Editor configuration for Golang
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
// Other guide: https://www.kevnu.com/en/posts/10
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
@slimbuck
slimbuck / webgpu_metal_capture.txt
Created May 13, 2024 08:47
Capturing WebGPU metal trace on MacOS
1) Clone and build WebKit
git clone https://github.com/WebKit/WebKit.git WebKit
cd WebKit
Tools/Scripts/build-webkit -cmakeargs="-DENABLE_WEBGPU_BY_DEFAULT=1" --debug
2) Run your app
__XPC_METAL_CAPTURE_ENABLED=1 Tools/Scripts/run-minibrowser --debug --url http://localhost:5000/index.html#/loaders/gsplat
@bilobom
bilobom / gist:8076d2d4ff6bda55fc2a13aa5e803eea
Last active January 3, 2025 03:37
codemirror6 react custom autocomplete

In this gist we add Custom HTML and JSON autocomplete without overriding the original autocomplete. Each language support in code mirror exports nameLanguage (eg: htmlLanguage) to allow you to add custom autocomplete.

import React, { useMemo } from 'react'
import CodeMirror from '@uiw/react-codemirror'
import { json, jsonLanguage } from '@codemirror/lang-json'
import { html, htmlLanguage } from '@codemirror/lang-html'
import { syntaxTree } from '@codemirror/language'
@aaronsb
aaronsb / readme.md
Last active January 3, 2025 03:36
Rhino3D 7 on Linux

Install Rhino 7 on Ubuntu based OS (KDE on Ubuntu Noble in this case) I used Wine 9.10 (Staging)

This assumes a non existant wine prefix or even a wine installation. If you have an existing wine prefix there may be things that interfere with this guide.

  • Start by installing wine and some required adjacent libraries.

sudo apt install wine wine32 winetricks mono-complete winbind

  • Initialize your default Wine environment (which will be located under ~/.wine
@WolframRavenwolf
WolframRavenwolf / amy-reasoning-prompt.md
Created December 24, 2024 19:36
Amy's Reasoning Prompt

As an adaptive AI polymath, Amy possesses expert knowledge in every field and can provide accurate, detailed, insightful information on any topic. She is able to learn, reason, think independently, and continuously expand her capabilities to better understand and assist her user. She is happy to help with analysis and problem-solving, question answering, math, coding, creative writing, teaching, general discussion, and all sorts of other tasks. She is ready to take on any question or topic, drawing upon her vast knowledge base and reasoning skills to provide expert, in-depth, truthful answers.

Before providing any substantive response, Amy will always check:

  • Are additional information or context needed?
  • Are follow-up questions required?
  • What specific details would help provide the best possible answer?

If any of these apply, Amy will proactively ask for clarification before proceeding with her response.

1. 常用药物

感冒/发烧类

  • 布洛芬(退烧、止痛)
  • 对乙酰氨基酚(泰诺)

抗病毒/流感类

  • 奥司他韦(达菲,需处方)

消炎类

  • 阿莫西林(需处方)
  • 红霉素软膏(外用)
@neno-tech
neno-tech / code.gs
Created May 20, 2021 02:46
CRUD Web App Full 2021
var sheetID = 'xxx'//แก้จุดที่1
function doGet(e) {
if (!e.parameter.page || e.parameter['page']=='index') {
var htmlOutput = HtmlService.createTemplateFromFile('index')
htmlOutput.message = '';
return htmlOutput.evaluate()
.setTitle("web app")
.addMetaTag('viewport', 'width=device-width , initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
@Alia1234567
Alia1234567 / intro.md
Created January 3, 2025 03:22
Introduction to C++

C++ Overview

C++ is a high-performance, general-purpose programming language created by Bjarne Stroustrup, initially as an enhancement to the C programming language. It incorporates object-oriented programming (OOP) features, allowing developers to create complex software with efficient memory management and system-level control.

Key Features:

  • Object-Oriented Programming (OOP): C++ supports classes, objects, inheritance, polymorphism, abstraction, and encapsulation, allowing developers to build reusable and maintainable code.

  • Low-Level Manipulation: C++ provides direct access to memory management through pointers, making it suitable for system-level programming (e.g., operating systems, embedded systems).

@jordymeow
jordymeow / sse.php
Created May 27, 2023 01:28
SSE (Server-Sent Events) with PHP and JS / Streaming with PHP
<?php
// Various links
// https://serverfault.com/questions/488767/how-do-i-enable-php-s-flush-with-nginxphp-fpm
// https://stackoverflow.com/questions/72394213/nginx-configuration-for-server-sent-event
// https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate
// https://qiita.com/okumurakengo/items/cbe6b3717b95944083a1 (in Japanese)
// If '?SSE' is set, send Server-Sent events, otherwise we'll display the page.
if ( isset( $_GET['SSE'] ) ) {
@openstrike
openstrike / stretchoid.lis
Last active January 3, 2025 03:20
Stretchoid IP addresses at Azure
# Stretchoid are now at Azure. You could block all of Azure and very
# little of value would be lost. However, if you fancy being just a
# touch more circumspect, here is a list of some of the stretchoid IP
# addresses at time of posting
4.151.33.202
4.151.33.203
4.151.36.112
4.151.36.113
4.151.36.250
4.151.36.251