Skip to content

Instantly share code, notes, and snippets.

@slava-vishnyakov
slava-vishnyakov / readme.md
Last active May 7, 2024 04:49
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@smores56
smores56 / weaver-talk.md
Last active May 7, 2024 04:49
Presentation slides for my talk about github.com/smores56/weaver

Weaver

An ergonomic arg parsing library for the Roc programming language.


Table of Contents

  • Introductions
  • Why did I want to make this library?
@MeguminSama
MeguminSama / Discord Experiments.js
Last active May 7, 2024 04:46
Discord Experiments.js
let cache; webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=r.c]);
var UserStore = Object.values(cache).find(m => m?.exports?.default?.getUser).exports.default;
var actions = Object.values(UserStore._dispatcher._actionHandlers._dependencyGraph.nodes);
var user = UserStore.getCurrentUser();
actions.find(n => n.name === "ExperimentStore").actionHandler.CONNECTION_OPEN({
type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [],
});
actions.find(n => n.name === "DeveloperExperimentStore").actionHandler.CONNECTION_OPEN();
webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";
@diego3g
diego3g / settings.json
Last active May 7, 2024 04:43
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
Architecture NVIDIA GPU Instance type Instance name Number of GPUs GPU Memory (per GPU) GPU Interconnect (NVLink / PCIe) Thermal
Design Power (TDP) from nvidia-smi
Tensor Cores (mixed-precision) Precision Support CPU Type Nitro based
Ampere A100 P4 p4d.24xlarge 8 40 GB NVLink gen 3 (600 GB/s) 400W Tensor Cores (Gen 3) FP64, FP32, FP16, INT8, BF16, TF32 Intel Xeon Scalable (Cascade Lake) Yes
Ampere A10G G5 g5.xlarge 1 24 GB NA (
@probonopd
probonopd / Wayland.md
Last active May 7, 2024 04:40
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

Windows 8 Pro Only Offline Activation RETAIL Keys [Retail Edition Only]:
slmgr.vbs -ipk 4NX96-C2K6G-XFD2G-9X4P9-4JMQH
slmgr.vbs -ipk 4NY9C-Q2VW8-84VH3-YPMDY-FF9T7
slmgr.vbs -ipk 9FN3V-HDGGV-7F8K6-FVT9H-QPBQH
slmgr.vbs -ipk BKBGN-M2HWH-3MRQ6-WTJ9X-KP73H
slmgr.vbs -ipk BP4FX-DNGD9-P3FMR-PYR6Q-T6JXV
slmgr.vbs -ipk C37NF-QYM6Y-BVFCR-WMXGV-QPBQH
slmgr.vbs -ipk 3NM39-QTK29-YGY3C-TJ2BJ-K2BQH
slmgr.vbs -ipk 8B3N2-GWPXP-3VFP2-VX69Q-QRPKV
@vilkoz
vilkoz / setup_http_server_on_android_with_termux.md
Last active May 7, 2024 04:34
setup http server on android with termux

Setting up http server on android with termux

Setting SSH server

To be able to make all procedures without pain you should have physical keyboard or just install ssh server and connect to your device shell from computer.

Folow this guide to setup ssh server.

Installing needed stuff

@g-l-i-t-c-h-o-r-s-e
g-l-i-t-c-h-o-r-s-e / flip_glb.py
Last active May 7, 2024 04:32
Batch rotate glb with Blender 3.4 and Python
"C:\Program Files\Blender Foundation\Blender 3.4\blender.exe" --background --python flip_glb.py
import os
import bpy
from math import pi
# put the location to the folder where the glb are located here in this fashion
path_to_obj_dir = os.path.join('C:\\', 'Users\\Username\\Documents\\File_Folder\\')
# get list of all files in directory
file_list = sorted(os.listdir(path_to_obj_dir))
@ahoho
ahoho / prompt_alpaca_lora.py
Last active May 7, 2024 04:28
Create a huggingface pipeline with a lora-trained alpaca
from typing import Optional, Any
import torch
from transformers.utils import is_accelerate_available, is_bitsandbytes_available
from transformers import (
AutoTokenizer,
AutoModelForCausalLM,
GenerationConfig,
pipeline,