Skip to content

Instantly share code, notes, and snippets.

View SirLynix's full-sized avatar
😺
Meow

Jérôme Leclercq SirLynix

😺
Meow
View GitHub Profile
@SaschaWillems
SaschaWillems / vk.cpp
Last active November 23, 2023 10:02
Multiple Vulkan buffer binding points
Shader
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec3 inColor;
layout (location = 2) in vec3 inPosB;
layout (location = 3) in vec3 inColorB;
...
Application
@zwh8800
zwh8800 / datetime.lua
Last active February 21, 2023 10:28
lua ISO 8601 datetime parser - https://repl.it/IQuI/5
function parse_json_date(json_date)
local pattern = "(%d+)%-(%d+)%-(%d+)%a(%d+)%:(%d+)%:([%d%.]+)([Z%+%-])(%d?%d?)%:?(%d?%d?)"
local year, month, day, hour, minute,
seconds, offsetsign, offsethour, offsetmin = json_date:match(pattern)
local timestamp = os.time{year = year, month = month,
day = day, hour = hour, min = minute, sec = seconds}
local offset = 0
if offsetsign ~= 'Z' then
offset = tonumber(offsethour) * 60 + tonumber(offsetmin)
if xoffset == "-" then offset = offset * -1 end