Skip to content

Instantly share code, notes, and snippets.

View Riztazz's full-sized avatar
I may be slow to respond.

Riztazz

I may be slow to respond.
View GitHub Profile
@Riztazz
Riztazz / .cmake
Last active August 10, 2023 07:15
Copy VCPKG installed packages licenses into a folder
/*
Riztazz https://www.buymeacoffee.com/riztazz
License:
Copyright © 2023 <Riztazz>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT O
@Riztazz
Riztazz / .cpp
Last active June 20, 2023 11:01
SliderFloatWithStep for C++ ImGui. Uses SliderInt under the hood
/*
Riztazz https://www.buymeacoffee.com/riztazz
License:
Copyright © 2023 <Riztazz>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Build in CMake with these params:

CMAKE_CXX_FLAGS:STRING= -fsanitize=address  -fsanitize=leak -g
CMAKE_C_FLAGS:STRING=-fsanitize=address  -fsanitize=leak -g
CMAKE_EXE_LINKER_FLAGS:STRING=-fsanitize=address  -fsanitize=leak
CMAKE_MODULE_LINKER_FLAGS:STRING=-fsanitize=address  -fsanitize=leak

Which can be done with:

@Riztazz
Riztazz / gist:b6dd37102d28830ab506b037b34460bf
Created April 3, 2022 14:15
Unreal multiplayer online beacon: how to travel to map
If you are wondering how to convert/travel a real player onto beacon client then you don't.
Inform your clients that server with {url} is ready to play and destroy both clients and hosts, then do a normal
PlayerController->ClientTravel( {url}, ..., ... );
@Riztazz
Riztazz / .cpp
Created December 19, 2021 07:06
Compute rotation and translation to target location with given distance percentage in UnrealEngine 5
// originLoc - whos position we want to compute from
// targetLoc - what is our target position (ie. objects victim)
// distanceMod - distance between origin and target that we want to cover. 0 - 1.f where 1f is 100%
// TranslationResult - computed result, example usage: ...GetController()->SetClientLocation( TranslationResult, {} );
// RotationResult - computed rotation to targetl ocation, usage: ...GetController()->SetClientRotation( RotationResult );
// Move actor and face computed rotation, GetController()->SetClientLocation(TranslationResult, RotationResult);
// note that RotationResult is not recalculated and it might be a different after move
// if you want updated rotation, use this part to calculate new rotation
// FRotator rotationToTarget = UKismetMathLibrary::MakeRotFromXZ( Forward, FVector::UpVector );
// where Forward is ( TranslationResult - targetLocation )
@Riztazz
Riztazz / .css
Created June 24, 2021 05:19
Synology chat dark mode script
/* Remove this comment
* Change "->CHAT_ADDRESS_HERE<-" to your synology chat address and install script below for that website.
* If you're running desktop version, this will probably not work for you. I am running web version installed as an app in the browser
*/
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
INSERT INTO `gameobject_template` (`entry`, `data1`) VALUES (209646, 40446);
INSERT INTO `gameobject_template` (`entry`, `data1`) VALUES (209665, 40458);
INSERT INTO `gameobject_template` (`entry`, `data1`) VALUES (209669, 40459);
INSERT INTO `gameobject_template` (`entry`, `data1`) VALUES (209671, 40461);
INSERT INTO `gameobject_template` (`entry`, `data1`) VALUES (209774, 40461);
INSERT INTO `gameobject_template` (`entry`, `data1`) VALUES (214406, 40445);