Skip to content

Instantly share code, notes, and snippets.

@eoureo
eoureo / RunJS-Utils.mjs
Last active April 28, 2025 02:29
Module of frequently used functions in Obsidian-RunJS (https://github.com/eoureo/obsidian-runjs).
/**
* Module of frequently used functions in [Obsidian-RunJS]{@link https://github.com/eoureo/obsidian-runjs}.
*
* @RunJS RunJS/Utils
*
* modified: 2023-07-13 19:35:07
*
* async function replaceSelection(app, substr = "", substr_new = "")
* async function getSelection(app)
* async function setSelection(app, text)
@reagle
reagle / obsidian-config-copy.py
Last active May 17, 2025 14:11
Create symbolic links from source Obsidian vault config to target vaults.
#!/usr/bin/env python3
"""Create symbolic links from main Obsidian vault config to other vaults.
Obsidian configuration folder can be copied between vaults; this script
copies a configuration from a main vault to other vaults.
"""
from pathlib import Path
from shutil import copytree, rmtree
@afiodorov
afiodorov / instruction
Last active October 28, 2023 11:51
Run your own LLM & create an api endpoint for predictions
Docker Image : pytorch/pytorch
Image Runtype : jupyter_direc ssh_direc ssh_proxy
Environment : [["JUPYTER_DIR", "/"], ["-p 41654:41654", "1"]]
pip install torch bitsandbytes sentencepiece "protobuf<=3.20.2" git+https://github.com/huggingface/transformers flask python-dotenv Flask-HTTPAuth accelerate
!mv /opt/conda/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda116.so /opt/conda/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so
parameters
handsome portrait photo of (ohwx man:1.1) wearing a Gray fancy expensive suit <lora:test6-000005:1>
Negative prompt: (blue eyes, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), fat, text, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck
Steps: 30, Sampler: DPM++ SDE Karras, CFG scale: 5, Seed: 1117571876, Size: 640x720, Model hash: c0d1994c73, Model: realisticVisionV20_v20
I changed the Gray color with other colors like red blue yellow etc.
@lxe
lxe / README.md
Last active March 12, 2025 13:55
How to get oobabooga/text-generation-webui running on Windows or Linux with LLaMa-30b 4bit mode via GPTQ-for-LLaMa on an RTX 3090 start to finish.

How to get oobabooga/text-generation-webui running on Windows or Linux with LLaMa-30b 4bit mode via GPTQ-for-LLaMa on an RTX 3090 start to finish.

This guide actually works well for linux too. Just don't bother with the powershell envs

  1. Download prerequisites

  2. (Windows Only) Open the Conda Powershell.

@joshieecs
joshieecs / UniMapConfig.xml
Created February 16, 2023 22:03
Sample UniMapConfig.xml that changes the top item in the Quick FT menu to Cancel, in order to prevent double-presses from fast traveling to Vault 76. UniMap mod: https://www.nexusmods.com/fallout76/mods/1534
<?xml version="1.0" encoding="UTF-8"?>
<UniMap Creator="Unikko" Site="https://www.nexusmods.com/fallout76/mods/1534" Ver="1">
<UniMapVersion>1.0.0-Beta10</UniMapVersion>
<MapBooks>
<!-- Map Book File(s) -->
<!-- Map Book filename with path relative to the directory containing UniMap.xml -->
<!-- If the Book number is "0", skip loading. -->
<MapBook Book="1">

Here's a little CSS snippet to create a simple header to link yesterday, tomorrow, and T-1Y notes to the daily note. If you don't know what I'm talking about, you can check the @TfTHacker repo where they create a customized dashboard or @FromSergio youtube video explaining how to activate CSS customization.

Here are the steps:

  1. Copy the CSS code from the first comment below and create a new file in the ./obsidian/snippets folder. The name of the file will be the name of the snippet;
  2. In the Obsidian app, open Settings -> Appearance -> CSS Snippets and toggle the previously created snippet;
  3. Create a draft markdown file and paste the markdown from the second comment;
    1. Change the internal notes link if you want
  4. Change to Reading View en voilá!
@vedroboev
vedroboev / bridge.py
Last active July 29, 2023 20:01
A custom script for running a Stable Horde bridge inside AUTOMATIC1111's WebUi
import base64
import json
import logging
import time
from io import BytesIO
import gradio as gr
import modules.scripts as scripts
import modules.sd_samplers as samplers
import modules.shared as shared
@johanfriis
johanfriis / view.js
Last active March 5, 2025 14:18
A DataView View that implements almost the same rendering for lists that we have for tasks, and adds pagination. This version has tasks removed from output to drastically simplify the view.
if (!input?.query) {
dv.paragraph("You must pass a `query` to the view");
return;
}
const pagesWithLists = await dv.tryQuery(input.query);
const HEADER_SIZE = input?.headerSize ?? 2;
/**
@mchaker
mchaker / stable-diffusion-links.md
Last active July 28, 2024 23:57
stable-diffusion-links: useful optimizations