Skip to content

Instantly share code, notes, and snippets.

View DuckyBlender's full-sized avatar

DuckyBlender

  • Poland
  • 11:07 (UTC +02:00)
View GitHub Profile
@santosh
santosh / printflush.py
Created March 25, 2013 09:18
This script demonstrate the `flush` argument of print() function.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from __future__ import print_function
from time import sleep
string = "The words in this sentence should appear letter by letter."
print("Please wait if you don't see another sentence appearing below.", end="\n\n")
@HaleTom
HaleTom / print256colours.sh
Last active May 23, 2025 15:45
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@Anubhav1603
Anubhav1603 / examples.md
Last active April 19, 2025 13:39
Code examples of discord.py rewrite

discord.py code examples

Preface

Introduction

I am making this gist to show some examples of stuff you can do with discord.py, and also because the amount of up-to-date examples online is rather limited.

This will not be a guide for learning how to use the basics of the wrapper, but merely showing some code to get a better understanding of some of the things discord.py can do. I will therefore assume that anybody looking at this will understand the basics of both python and the wrapper in question.

I will also assume that asyncio, discord.ext commands and discord are installed and imported, and that the commands.Bot instance is stored in the variable bot.

@Artefact2
Artefact2 / README.md
Last active July 4, 2025 01:06
GGUF quantizations overview

Which GGUF is right for me? (Opinionated)

Good question! I am collecting human data on how quantization affects outputs. See here for more information: ggml-org/llama.cpp#5962

In the meantime, use the largest that fully fits in your GPU. If you can comfortably fit Q4_K_S, try using a model with more parameters.

llama.cpp feature matrix

See the wiki upstream: https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix

@ariG23498
ariG23498 / flux-dev-under-8gbs.py
Created October 20, 2024 09:01
Run FLUX Dev under 8gbs of VRAM.
# Taken from: https://gist.github.com/sayakpaul/23862a2e7f5ab73dfdcc513751289bea
from diffusers import FluxPipeline, FluxTransformer2DModel
from transformers import T5EncoderModel
import torch
import gc
def flush():
gc.collect()