Skip to content

Instantly share code, notes, and snippets.

package main
import (
"log"
"time"
"github.com/labstack/echo/v5"
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/apis"
"github.com/pocketbase/pocketbase/core"
using System.Net.WebSockets;
using System.Text;
Uri uri = new("wss://yabu.me/");
using ClientWebSocket ws = new();
await ws.ConnectAsync(uri, default);
var req = "[\"REQ\", \"_\", {\"kinds\": [1], \"limit\": 10}]";
Console.WriteLine("< " + req);
@Hakkadaikon
Hakkadaikon / NostrSubscription.cs
Created April 29, 2024 15:22
NostrSubscriptionCSharp
class NostrSubscription
{
static void Main(string[] args)
{
string url = "wss://yabu.me";
using (var ws = new WebSocketSharp.WebSocket(url))
{
ws.OnOpen += (sender, e) =>
{
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 30, 2024 11:34
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@olange
olange / sendAllDrafts.vba
Last active April 30, 2024 11:34
Sends all draft e-mails from a specific Outlook folder
Option Explicit
Private Const VERSION As String = "0.1"
Private Const DIALOG_TITLE As String = "yourModuleName › SendAllDrafts (v" & VERSION & ")"
' Name of the subfolder of the Drafts folder, containing the draft e-mails to be sent
Private Const MAILMERGE_SUBFOLDER_NAME = "MailMerge"
' Send all messages from the MAILMERGE_SUBFOLDER_NAME subfolder
' of the Drafts folder (ignores any subfolder)
@mwhite
mwhite / git-aliases.md
Last active April 30, 2024 11:32
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@alexchexes
alexchexes / chatgpt_ui_fix.user.js
Last active April 30, 2024 11:28
ChatGPT web-interface width fix (and other UI improvements)
// ==UserScript==
// @name ChatGPT CSS fixes
// @version 2024-02-11
// @updateURL https://gist.github.com/alexchexes/d2ff0b9137aa3ac9de8b0448138125ce/raw/chatgpt_ui_fix.user.js
// @downloadURL https://gist.github.com/alexchexes/d2ff0b9137aa3ac9de8b0448138125ce/raw/chatgpt_ui_fix.user.js
// @namespace http://tampermonkey.net/
// @description Adjusts width of side bar and messages of the chatGPT web interface
// @author alexchexes
// @match https://chat.openai.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
@uwezi
uwezi / 20240309_opencv.py
Last active April 30, 2024 11:27
[video inclusion in Manim] Include video objects picture-in-picture. #manim #animate #video #opencv #videomobject
import cv2
from PIL import Image, ImageOps
from dataclasses import dataclass
@dataclass
class VideoStatus:
time: float = 0
videoObject: cv2.VideoCapture = None
def __deepcopy__(self, memo):
return self
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 30, 2024 11:26
set -e, -u, -o, -x pipefail explanation
@jjb
jjb / file.md
Last active April 30, 2024 11:26
Using Jemalloc 5 with Ruby.md

For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.

Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.

Ubuntu/Debian

FROM ruby:3.1.2-bullseye
RUN apt-get update ; \