Skip to content

Instantly share code, notes, and snippets.

@w-e-w
w-e-w / sd-webui-txt2img-img2img-api-example.py
Last active May 20, 2024 22:15
Stable Diffusion web UI txt2img img2img api example script
from datetime import datetime
import urllib.request
import base64
import json
import time
import os
webui_server_url = 'http://127.0.0.1:7860'
out_dir = 'api_out'
@hcmiya
hcmiya / 001-proxy.md
Last active May 20, 2024 22:14
Quick example of federating with darknet instances from clearnet

Quick example of federating with Tor instances from clearnet

figure1

Install and configure Tor / Privoxy

# apt install privoxy tor
@acamino
acamino / README.md
Last active May 20, 2024 22:11
Shortcuts to Improve Your Bash & Zsh Productivity

Shortcut — Action

  • CTRL + A — Move to the beginning of the line
  • CTRL + E — Move to the end of the line
  • CTRL + [left arrow] — Move one word backward (on some systems this is ALT + B)
  • CTRL + [right arrow] — Move one word forward (on some systems this is ALT + F)
  • CTRL + U — (bash) Clear the characters on the line before the current cursor position
  • CTRL + U —(zsh) If you're using the zsh, this will clear the entire line
  • CTRL + K — Clear the characters on the line after the current cursor position
  • ESC + [backspace] — Delete the word in front of the cursor
@cmdr2
cmdr2 / Math3d.cs
Created November 11, 2021 07:34
Useful 3D math functions from the old Unity 3D wiki (which has been shut down). Source: the archived version from July, 2021 at https://web.archive.org/web/20210507045029/https://wiki.unity3d.com/index.php/3d_Math_functions
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
public class Math3d {
private static Transform tempChild = null;
private static Transform tempParent = null;
@jdupuy
jdupuy / SampleVndf_GGX.cpp
Last active May 20, 2024 22:00
Sampling Visible GGX Normals with Spherical Caps
// Helper function: sample the visible hemisphere from a spherical cap
vec3 SampleVndf_Hemisphere(vec2 u, vec3 wi)
{
// sample a spherical cap in (-wi.z, 1]
float phi = 2.0f * M_PI * u.x;
float z = fma((1.0f - u.y), (1.0f + wi.z), -wi.z);
float sinTheta = sqrt(clamp(1.0f - z * z, 0.0f, 1.0f));
float x = sinTheta * cos(phi);
float y = sinTheta * sin(phi);
vec3 c = vec3(x, y, z);

Introduction

EigenLayer introduces the possibility of re-using ethereum consensus, and IMO the most interesting usecase for that would be building a decentralized two-way and security-optimal bridge between Bitcoin and Ethereum.

All bridges rely on the security of the two chains they connect and the security of the custodian^[1] used for bridging, since if the security of any of those 3 were to fail, it would be possible to drain the bridge (eg: if its possible to double-spend on any of the two chains an attacker can redeem the same coin multiple times).

However, if a significant amount of the total ETH staked were to be restaked securing this bridge, the custodian would be piggybacking on ethereum security, so those two become the same and thus you'd remove the custodian from your list of dependencies and you're left with only having to depend on the security of the two chains, which is the theoretical ceiling of security. In other words, you'd achieve the best possible security.

But not just that, you

@qoomon
qoomon / conventional_commit_messages.md
Last active May 20, 2024 22:00
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@Fuwn
Fuwn / xp.md
Last active May 20, 2024 21:59
Windows XP All Editions Universal Product Keys Collection.

Although Microsoft does not support Windows XP updates any more, I’m sure there are still many users using it due to their personal habits or job demands. Therefore XP’s product keys may be necessary even now, and Fuwn provided you with the most comprehensive Windows XP product keys here, just in order to provide some convenience.

The following CD-KEYs are official and original from Microsoft, mainly used for Windows XP Professional Service Pack 2/3 VOL/VLK system images which are the easiest ones to find on the Internet. Their biggest advantage is your Windows XP will be activated after using these CD-KEYs to complete installation.

// Windows XP Pro Product Keys //