Skip to content

Instantly share code, notes, and snippets.

View bw2012's full-sized avatar
🐈
Coding for food

Konstantin Ivanov bw2012

🐈
Coding for food
View GitHub Profile
@bw2012
bw2012 / udp_server.pas
Created September 3, 2023 11:15
pascal udp server
program UdpServer;
uses Sockets;
const
UDPPackLen = 512;
var
MasterSocket : Longint;
@bw2012
bw2012 / cpp_interactive_terminal.cpp
Last active December 23, 2022 21:10
Sample color console for C/C++
// https://stackoverflow.com/questions/4053837/colorizing-text-in-the-console-with-c
#include <iostream>
#include <string>
int main(int argc, char ** argv){
printf("\n");
printf("\x1B[31mTexting\033[0m\t\t");
printf("\x1B[32mTexting\033[0m\t\t");
@bw2012
bw2012 / gist:4721949791ad5d73445b58ccead6a54c
Created December 17, 2022 17:40
UE5 UE4 visualize occluded objects
Editor only console command: r.visualizeOccludedPrimitives 1
This will render a green bounds box for any objects that are occluded.
Adjusting the bounds scale will increase the green bounding box and can cause the mesh to be rendered even when it’s not in view.
https://forums.unrealengine.com/t/how-does-object-occlusion-and-culling-work-in-ue4/334141
1. set Dynamic Global Illumination Method to "None"
2. set Reflection Method to "None"
3.4set Shadow Map Method to "Shadow Map"
4. set Default RHI to "DirectX 11"
5. turn off Ray Tracing Shadows
push di
push si
push cx
mov cx,(number of bytes to move)
lea di,(destination address)
lea si,(source address)
rep movsb
pop cx
pop si
pop di
@bw2012
bw2012 / .gitconfig
Created March 15, 2020 19:22
git lg
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@bw2012
bw2012 / gist:8132267969a8c4abbf99915a8d562c49
Created February 20, 2020 15:45
VirtualBox changing screen resolution of Mac OS guest
VBoxManage setextradata "High Sierra" VBoxInternal2/EfiGraphicsResolution 1920x1080
@bw2012
bw2012 / gist:e7acfec738825b7e1683743d6fbfbce3
Created April 11, 2019 18:20
git squash branch to one commit
git checkout master
git merge --squash [branch]
git add .
git commit
@bw2012
bw2012 / http_download.cpp
Created April 6, 2019 19:41
C++ http download file
#include <iostream>
#include <stdio.h>
#include <sys/socket.h>
//#include <stdlib.h>
#include <netinet/in.h>
#include <string.h>
#include <netdb.h>
#include <arpa/inet.h>
//#include <unistd.h>
@bw2012
bw2012 / ue4_enable_c++17.txt
Last active March 6, 2023 07:44
How to enable C++17 in UE4 and Visual Studio 2017
Tested with UE 4.21
1. Open your UE4 engine folder [Program files or something else you like]\Epic Games\UE_4.21\Engine\Source\Programs\UnrealBuildTool
2. Open file Epic Games\UE_4.21\Engine\Source\Programs\UnrealBuildTool\Platform\Windows\VCToolChain.cs
3. Find method void AppendCLArguments_CPP(CppCompileEnvironment CompileEnvironment, List<string> Arguments)
4. Add Arguments.Add("/std:c++17"); to begin of method
5. Open Epic Games\UE_4.21\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj in MSVS 2017
6. Rebuild UnrealBuildTool
7. Open your project and rebuild it
8. Enjoy c++17 features