Skip to content

Instantly share code, notes, and snippets.

# install torch with CUDA support. See https://pytorch.org/get-started/locally/ for more instructions if this fails.
pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
# check if torch supports GPU; this must output "True". You need CUDA 11. installed for this. You might be able to use
# a different version, but this is what I tested.
python -c "import torch; print(torch.cuda.is_available())"
# clone web ui and go into its directory
git clone https://github.com/enryu43/anifusion-sd-webui.git
cd anifusion-sd-webui
@NyaGarcia
NyaGarcia / guard-clauses.js
Last active May 11, 2021 17:13
Refactoring a function to use guard clauses
function publishTweet(tweet) {
if (!isLoggedIn()) {
throw new Error('You need to log in before tweeting');
}
if (!tweet) {
throw new Error("Your tweet is empty, can't publish it");
}
if (!isTweetDoubleChecked()) {
throw new Error('Dont publish without double checking your tweet');
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active October 14, 2025 15:26
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@Alia5
Alia5 / transparent_sfml.cpp
Last active July 28, 2025 12:30
Transparent SFML Window
#include <SFML/Graphics.hpp>
#include <Windows.h>
#include <Dwmapi.h>
#pragma comment (lib, "Dwmapi.lib")
int main()
{
sf::RenderWindow window(sf::VideoMode(1280, 720), "Transparent Window");