Skip to content

Instantly share code, notes, and snippets.

View duycuong87vn's full-sized avatar
🌴
On vacation

hydrogen duycuong87vn

🌴
On vacation
View GitHub Profile
@In-line
In-line / Dockerfile
Last active May 7, 2024 10:49
AMD 7900 XTX Stable Diffusion Web UI docker container (ROCM 5.5_rc4)
FROM rocm/composable_kernel:ck_ub20.04_rocm5.5_rc4
RUN mkdir /SD
# Clone SD
WORKDIR /SD
RUN git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
WORKDIR /SD/stable-diffusion-webui
RUN git reset --hard 22bcc7be428c94e9408f589966c2040187245d81
@elderica
elderica / sdrocm.md
Last active September 3, 2023 05:22
Stable Diffusion with ROCm and ArchLinux
  1. arch4edu リポジトリを追加する。
  2. paru -Syu rocm-hip-sdk rocm-opencl-sdk python-pytorch-rocm python-torchvision-rocm python-numpy yq
  3. virtualenv --system-site-packages sdenv
  4. source sdenv/bin/activate
  5. git clone https://github.com/CompVis/stable-diffusion.git && cd stable-diffusion
  6. yq '.dependencies[].pip?[]' environment.yaml | sed 's/"//g' | xargs -L1 pip install
  7. https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt からチェックポイントファイルを入手して、 models/ldm/stable-diffusion-v1/model.ckpt に置く
  8. python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms
@bernardolopes8
bernardolopes8 / BookPersister.java
Last active February 8, 2024 14:46
Jersey Pagination, Sorting, and Filtering Example
package my.application.dao;
import java.util.List;
import my.application.entity.Book;
import my.application.restutil.RequestOptions;
public interface BookPersister {
List<Book> getBooks(RequestOptions requestOptions);
}
@andreybleme
andreybleme / StoringAccessDataUsingBitmap.java
Last active March 28, 2020 06:25
andreybleme.com | Creating page visit statistics using Redis
import java.util.Random;
import redis.clients.jedis.Jedis;
public class StoringAccessDataUsingBitmap {
public void store(long userCode, String date) {
Jedis jedis = new Jedis("localhost");
String key = String.format("access:%s", date);
@forest
forest / git-workflow.md
Created February 22, 2016 18:15
Git Feature Branch Workflow

We subscribe to the Git Featrue Branch workflow, briefly described in that link.

In practice, it works as follows:

FEATURE DEVELOPMENT

Steps to Follow:

  1. Start with an updated local development branch -- by checking out the dev branch and pulling changes:
    git checkout development
    git pull origin development
@jennyd
jennyd / falcon-logging-middleware.py
Last active February 11, 2024 22:09
Falcon logging middleware
import falcon
import logging
logger = logging.getLogger(__name__)
logger.addHandler(logging.FileHandler('test.log'))
logger.setLevel(logging.INFO)
class ResponseLoggerMiddleware(object):
def process_response(self, req, resp):
logger.info('{0} {1} {2}'.format(req.method, req.relative_uri, resp.status[:3]))
@staltz
staltz / introrx.md
Last active May 18, 2024 05:17
The introduction to Reactive Programming you've been missing
@eugenp
eugenp / PaginationDiscoverabilityListener.java
Last active March 24, 2022 13:07
Pagination with REST - the Discoverability Listener full
package org.baeldung.web.hateoas;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder;
import com.google.common.base.Preconditions;