Skip to content

Instantly share code, notes, and snippets.

View xlanor's full-sized avatar
😬

jingkai. xlanor

😬
  • praying for retirement before layoffs.
  • London, United Kingdom (Ocasionally Singapore)
  • 00:56 (UTC)
View GitHub Profile
@atyuwen
atyuwen / opt_fsr.fxh
Last active May 28, 2026 06:28
An optimized AMD FSR implementation for Mobiles
//==============================================================================================================================
// An optimized AMD FSR 1.0 implementation for Mobiles
// EASU and RCAS are combined in a single pass.
// Based on https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/master/ffx-fsr/ffx_fsr1.h
// Details can be found: https://atyuwen.github.io/posts/optimizing-fsr/
// Distributed under the MIT License. Copyright (c) 2021 atyuwen.
// -- FsrEasuSampleH should be implemented by calling shader, like following:
// AH3 FsrEasuSampleH(AF2 p) { return MyTex.SampleLevel(LinearSampler, p, 0).xyz; }
//==============================================================================================================================
void FsrMobile(
@qdm12
qdm12 / main.go
Last active February 12, 2024 01:17
DNS over HTTPS server resolver under 300 lines of clean Go code
package main
import (
"bytes"
"context"
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"log"
@tbkr
tbkr / parts-list-lily58pro.md
Last active October 19, 2024 13:29
Lily58 Pro parts list

Build a custom Lily58L (Germany)

Shameless Plug of: https://gist.github.com/steven-lang/5d06ab6877926945ecbd77764e96b864 (kudos anyway)

Features

  • Lily58L is the improved version of the Lily58. New features are:
    • Rotary encoder on each half (optionally possible)
    • 12 leds can be installed for background glow
    • SK6812 Mini-E leds for per key glow (12 additional leds need to be soldered additionally)
@k-amin07
k-amin07 / VFIO.md
Last active February 7, 2026 12:44
VFIO Guide for GPU Passthrough

Introduction:

This guide is for achieving PCI-Passthrough with Intel 7700k and AMD RX 580. My host OS is Manjaro KDE edition, and guest is Windows 10.

Hardware:

Device Type Device
CPU Intel Core i7-7700K
Motherboard ASUS Prime Z270P
RAM Corsair Vengeance (DDR4 3000 MHz)
GPU (Host) Intel HD Graphics
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active December 17, 2025 20:44
Ubuntu and Debian Cloud images in Proxmox
@vinnymac
vinnymac / README.md
Last active October 13, 2020 00:25
Guide to Hackintosh (specifically for Z390i/9900K/Vega64 build)
@Ryanb58
Ryanb58 / install.md
Last active December 31, 2025 20:22
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@sthomp
sthomp / kibana_nginx.conf
Last active June 6, 2025 19:32
nginx config to proxy connections to kibana on aws
worker_processes 1;
events {
worker_connections 1024;
}
http{
server {
listen 80;
server_name localhost;
@tswaters
tswaters / git-subdirectory-tracking.md
Last active February 4, 2026 10:54
Adding subdirectory of a remote repo to a subdirectory in local repo

This is way more complicated than it should be. The following conditions need to be met :

  1. need to be able to track and merge in upstream changes
  2. don't want remote commit messages in master
  3. only interested in sub-directory of another repo
  4. needs to go in a subdirectory in my repo.

In this particular case, I'm interested in bringing in the 'default' template of jsdoc as a sub-directory in my project so I could potentially make changes to the markup it genereates while also being able to update from upstream if there are changes. Ideally their template should be a separate repo added to jsdoc via a submodule -- this way I could fork it and things would be much easier.... but, it is what it is.

After much struggling with git, subtree and git-subtree, I ended up finding this http://archive.h2ik.co/2011/03/having-fun-with-git-subtree/ -- it basically sets up separate branches from tracking remote, the particular sub-directory, and uses git subtree contrib module to pull it all togther. Following are

@JProffitt71
JProffitt71 / s3cmdclearfiles
Created February 17, 2014 04:29
Uses s3cmd to manually remove files older than specified date (##d|m|y) in a specified bucket
#!/bin/bash
# Usage: ./s3cmdclearfiles "bucketname" "30d"
s3cmd ls s3://$1 | grep " DIR " -v | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -j -f "%Y-%m-%d %H:%M" "$createDate" +%s`
olderThan=`date -j -v-$2 +%s`
if [[ $createDate -lt $olderThan ]]