Skip to content

Instantly share code, notes, and snippets.

View BlurryLight's full-sized avatar
🎯
Focusing on RealtimeRendering

BlurryLight BlurryLight

🎯
Focusing on RealtimeRendering
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BlurryLight
BlurryLight / TAA.hlsl
Created May 12, 2022 09:35
Unity Builtin Pipeline Simple TAA
#ifndef TAA_SIMPLE_HLSL
#define TAA_SIMPLE_HLSL
// https://github.com/Unity-Technologies/FPSSample/blob/master/Packages/com.unity.postprocessing/PostProcessing/Shaders/Builtins/TemporalAntialiasing.shader
// https://github.com/Unity-Technologies/PostProcessing/blob/v2/PostProcessing/Shaders/Builtins/TemporalAntialiasing.shader
#include "UnityCG.cginc"
Texture2D _MainTex;
// Vector4(1 / width, 1 / height, width, height)
float4 _MainTex_TexelSize;
@BlurryLight
BlurryLight / future.h
Created April 9, 2022 16:52
promise_future
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@BlurryLight
BlurryLight / utf8_16cvt.cc
Created April 6, 2022 16:31
utf8 utf16 convert
std::string utf16_to_utf8(std::u16string const &s) {
std::wstring_convert<
std::codecvt_utf8_utf16<char16_t, 0x10ffff,
std::codecvt_mode::little_endian>,
char16_t>
cnv;
std::string utf8 = cnv.to_bytes(s);
if (cnv.converted() < s.size())
throw std::runtime_error("incomplete conversion");
return utf8;
@BlurryLight
BlurryLight / convert_csv_excel.py
Created April 2, 2022 13:27
convert csv excel
import win32com.client as win32
from win32com.client import constants
from pathlib import Path
excel = win32.gencache.EnsureDispatch('Excel.Application') # office
# excel = win32.gencache.EnsureDispatch('ket.Application') # wps
excel.Visible = False
input_path = Path("input.csv").absolute()
output_path = Path(".").absolute()
csv = excel.Workbooks.Open(str(input_path))
@BlurryLight
BlurryLight / CMakePresets.json
Created March 24, 2022 15:55
CMakePresets.json(vcpkg + MSVC + gcc + clang)
{
"version": 3,
"configurePresets": [
{
"name": "base",
"description": "For more information: http://aka.ms/cmakepresetsvs",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"installDir": "${sourceDir}/install/${presetName}",
@BlurryLight
BlurryLight / profile.ps1
Last active March 10, 2022 11:32
profile
function Invoke-Environment {
# from https://github.com/majkinetor/posh/blob/master/MM_Admin/Invoke-Environment.ps1
param
(
# Any cmd shell command, normally a configuration batch file.
[Parameter(Mandatory=$true)]
[string] $Command
)
$Command = "`"" + $Command + "`""
C++ 1 hr 28 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Šβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 51.5%
HLSL 50 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 29.6%
C 31 mins β–ˆβ–ˆβ–ˆβ–Šβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 18.3%
Objecti... 0 secs β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0.3%
INI 0 secs β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0.2%
@BlurryLight
BlurryLight / gist:4b4326be785eeeb53baa73030a2bd8e8
Created May 27, 2020 12:22
linux-disable/enable-laptop-internal-keyboard
#!/usr/bin/env python
#encoding: utf-8
import subprocess
import sys
keyboard_id = subprocess.check_output("xinput list | grep 'AT Translated Set' | cut -f2 | cut -d'=' -f2",shell=True).decode('utf-8').strip('\n')
master_keyboard_id = subprocess.check_output("xinput list | grep 'master keyboard' | cut -f2 | cut -d'=' -f2",shell=True).decode('utf-8').strip('\n')
if len(sys.argv) > 1:
if(sys.argv[1] == 'detach'):
function LookupDate(input)
local fmt
if input == '' then
fmt = "%YεΉ΄%m月%dζ—₯"
elseif input == 't' then
fmt = "%Y-%m-%d %H:%M:%S"
elseif input == 'd' then
fmt = "%Y-%m-%d"
end