Skip to content

Instantly share code, notes, and snippets.

View DarcJC's full-sized avatar

Darc Z. DarcJC

View GitHub Profile
@DarcJC
DarcJC / bottle.py
Created February 23, 2024 06:20
A bottle to catch any http request sent to it
from http.server import BaseHTTPRequestHandler, HTTPServer
import socket
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.return_request()
def do_POST(self):
self.return_request()
// ==UserScript==
// @name NVPro sucks
// @namespace darc.pro
// @version 0.1
// @description Help fool nvidia nvpro sample load javascript file!
// @author DarcJC
// @match https://nvpro-samples.github.io/vk_raytracing_tutorial_KHR/
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.io
// @updateURL https://gist.githubusercontent.com/DarcJC/25b365a8bfab7a0e6a400c101c076619/raw
// @downloadURL https://gist.githubusercontent.com/DarcJC/25b365a8bfab7a0e6a400c101c076619/raw
From 3d69159c4ed9cab8402718146be8dde12e537163 Mon Sep 17 00:00:00 2001
From: DarcJC <me@darc.pro>
Date: Sat, 22 Apr 2023 01:58:37 +0800
Subject: [PATCH] feat: add cartoon shading model
---
Engine/Shaders/Private/BasePassCommon.ush | 4 +-
.../Shaders/Private/BasePassPixelShader.usf | 24 ++++++++--
.../ClusteredDeferredShadingPixelShader.usf | 3 ++
.../Shaders/Private/DeferredShadingCommon.ush | 12 ++++-
{
"description": "Setting of dfm.realsiclua",
"properties": {
"IntelliSense": {
"properties": {
"traceBeSetted": {
"$ref": "#/properties/IntelliSense.traceBeSetted"
},
"traceFieldInject": {
"$ref": "#/properties/IntelliSense.traceFieldInject"
@DarcJC
DarcJC / loader.py
Last active August 2, 2021 11:49
Casbin Policy Auto Reloader
"""
Current version(1.1.7) of AsyncCasbin doesn't support any async orm adapter,
it means adapter such as casbin_tortoise_adapter wouldn't work with the SyncedEnforcer class
(you will recieve "... was never awaited" if you use it ).
So we could just use common Enforcer, and reload the policy periodically(the strategy SyncedEnforcer choose).
"""
import casbin
import casbin_tortoise_adapter
@DarcJC
DarcJC / main.py
Created July 19, 2021 16:12
simple Database URI parser
import os
import re
from pony.orm import Database
class DatabaseURI:
"""
DB url parser for PonyORM.
Sample usage: