Skip to content

Instantly share code, notes, and snippets.

View diamondburned's full-sized avatar
🏳️‍⚧️

Diamond diamondburned

🏳️‍⚧️
View GitHub Profile
// ==UserScript==
// @name WS hack
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over Discord!
// @author You
// @match https://discord.com/*
// @grant none
// @run-at document-start
// @require https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.11/pako.min.js
@diamondburned
diamondburned / style.css
Last active March 27, 2024 07:41
freedesktop.org but readable
@-moz-document domain("freedesktop.org") {
.refentry {
max-width: 765px;
line-height: 1.5;
margin: auto;
position: relative;
}
.refentry pre {
line-height: 1.25;

This patch is carried over from Nixpkgs' pkgs/development/compilers/go/go_no_vendor_checks-1.21.patch.

It is required for Nixpkgs' buildGoModule to work with Go 1.14+.

@diamondburned
diamondburned / style.css
Created December 11, 2023 04:55
Advent of Code CSS but actually good
* {
box-sizing: border-box;
}
body {
margin: 0 auto;
padding: 1em 1.5em;
min-height: 100vh;
max-width: 800px;
min-width: auto;
116 854
81 793
42 777
33 830
36 826
49 874
85 892
74 852
96 846
99 819
@diamondburned
diamondburned / error.out
Created December 3, 2023 01:49
libacmchristmas==0.1.4 error
Traceback (most recent call last):
File "/home/diamond/Scripts/acmcsufdev/christmas-py-example/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 963, in transfer_data
message = await self.read_message()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/diamond/Scripts/acmcsufdev/christmas-py-example/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1033, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/diamond/Scripts/acmcsufdev/christmas-py-example/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1108, in read_data_frame
frame = await self.read_frame(max_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@diamondburned
diamondburned / shell.nix
Created September 12, 2023 01:11
Git Nix shell
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs; [ git ];
}

Lazer

Lazer is a Python library that provides a convenient way to expose Python functions as schemas for OpenAI chat models.

Installation

To install Lazer, simply run:

pip install lazer
@diamondburned
diamondburned / schema.docs.graphql
Created May 18, 2023 09:01
GitHub GraphQL schema snapshot at 2023-05-18T02:01:18-07:00
This file has been truncated, but you can view the full file.
directive @requiredCapabilities(
requiredCapabilities: [String!]
) on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION
"""
Marks an element of a GraphQL schema as only available via a preview header
"""
directive @preview(
"""
The identifier of the API preview that toggles this field.
#!/usr/bin/env python3
import itertools
def dfa2sat(E: list[tuple[int, int, str]], q: int, F: list[int]):
"""
Convert DFA to SAT.
Arguments:
- E: list of edges (source, target, label)