Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View hhrhhr's full-sized avatar

Dmitry Zaitsev hhrhhr

  • Russia, Veliky Novgorod
View GitHub Profile
@hhrhhr
hhrhhr / mass_convert_bz.cmd
Last active April 26, 2021 19:14
Subnautica Below Zero map maker
@echo off
rem ==== start of user settings ====
rem minimum level (0...24)
set LEVEL=16
rem input raw files from AssetStudio (https://github.com/Perfare/AssetStudio)
set MESH_DIR=h:\raw
@hhrhhr
hhrhhr / mod_dds_header.lua
Last active August 13, 2021 20:48
RP6L unpacker. Usage: rp6l.lua <filename.rpack> [output_directory]
assert(_VERSION == "Lua 5.3")
-- DDS header [32]
_fourcc = 1; _size = 2; _flags = 3; _height = 4
_width = 5; _pitch = 6; _depth = 7; _mipmaps = 8
-- reserved [44]
-- 9 10 11 12
-- 13 14 15 16
-- 17 18 19
-- DDSPixelFormat [32]
/********************************************************************
* *
* Curve Rasterizing Algorithm *
* *
********************************************************************/
/**
* @author Zingl Alois
* @date 22.08.2016
* @version 1.2
@hhrhhr
hhrhhr / DefaultEngine.ini
Last active February 13, 2020 09:24
Satisfactory CL#114192 (no EpicPortal). Save as ...\FactoryGame\Config\NoRedist\DefaultEngine.ini
[ConsoleVariables]
r.XGEShaderCompile=1
t.FPSChart.OpenFolderOnDump=0
r.SceneRenderTargetResizeMethod=2
r.XGEShaderCompile.Mode=1
net.UseAdaptiveNetUpdateFrequency=0
[EnumRemap]
TEXTUREGROUP_Project01.DisplayName=UI Streamable
@hhrhhr
hhrhhr / gcp2gdal.lua
Last active August 27, 2019 08:55
converter for gcp list from M2_LRPT_Decoder for use with GDAL
---------+---------+---------+---------+---------+---------+---------+---------+
--[[ arg[1] - input.gcp
-- arg[2] arg[3] - sparse coff [50 [200]]
--]]
local gpcs = "-gcp %d %d %f %f"
local xcoff = arg[2] and tonumber(arg[2]) or 50
local ycoff = arg[3] and tonumber(arg[3]) or 200
local gcp, grid = {}, {}
@hhrhhr
hhrhhr / 02_test_oqpsk_80k.s.dot.csv
Last active August 25, 2019 23:17
данные полученные от парсера .70 файлов
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 14 columns, instead of 9. in line 6.
t0,t1,year,day,t2,t3,qw,qx,qy,qz,t4,x,y,z
59875.193246159,115144674,2016,1332,115144675,115144673,0.87963420152664,0.0029127567540854,-0.4421321451664,0.17536918818951,115144674,5512346.96875,1439218.15625,4384659.34375
59876.290553864,115144675,2016,1332,115144676,115144674,0.87986153364182,0.0028256245423108,-0.44168135523796,0.17536626756191,115144675,5508479.65625,1436331.6875,4390448.3125
59877.387861916,115144677,2016,1332,115144678,115144676,0.88031709194183,0.0026429765857756,-0.44077056646347,0.17537426948547,115144677,5500726.03125,1430555.8125,4402012.25
59879.657392149,115144678,2016,1332,115144679,115144677,0.88054269552231,0.0025392328388989,-0.44031548500061,0.17538639903069,115144678,5496839.71875,1427666.4375,4407787.0
59880.161369557,115144679,2016,1332,115144680,115144678,0.88077187538147,0.0024503299500793,-0.43985557556152,0.17539101839066,115144679,5492947.21875,1424776.0625,4413557.1875
59881.258677249,115144680,2016,1332,115144681,115144679,0.880999147892,0.0023637062404305,-0.43940424
@hhrhhr
hhrhhr / appid70_to_csv.lua
Last active August 25, 2019 23:16
парсер .70 файлов в текстовое представление
-- 1 2 3 4 5 6 7 8
---------+---------+---------+---------+---------+---------+---------+---------+
--[[ constants ]]
local YEAR = 2016 -- 1451509200
local EPOCH = os.time({year = YEAR, month = 1, day = 0, hour = 0})
--[[ funcs ]]
@hhrhhr
hhrhhr / main.c
Last active August 14, 2019 23:31
save 8-bit grayscale channels
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "channel.h"
#include "correlator.h"
#include "diff.h"
#include "file.h"
#include "options.h"
@hhrhhr
hhrhhr / stream_parser.lua
Created July 27, 2019 20:41
парсер медиапотока с BB-M2
--[[
lua strea_parser.lua <input> [output]
output - путь к выходному файлу без расширения
]]
assert("Lua 5.3" == _VERSION)
assert(arg[1], "\n\n[ERROR] no input file\n\n")
local r
local function uint8() return string.unpack("B", r:read(1)) end
local function uint16() return string.unpack("H", r:read(2)) end
local function uint32() return string.unpack("I4", r:read(4)) end
@hhrhhr
hhrhhr / omiga_generator.lua
Created April 12, 2019 06:42
Omiga's cards generator
--[[ sym num bits
top: RB 2 1
left: /\<> 4 2
right: /\<> 4 2
bottom: RB 2 1
total: 64 6
]]
local MULT = 1
local CARD_NUM = 2^(1+2+2+1) -- =2*4*4*2
local CARD_IN_ROW = 6