Skip to content

Instantly share code, notes, and snippets.

View chromedays's full-sized avatar
🏠
Working from home

chromedays chromedays

🏠
Working from home
View GitHub Profile
@zhaojunmeng
zhaojunmeng / Setup_Slim.bat
Last active July 11, 2024 12:20
Call Setup.bat in Unreal Engine Source, add multithread, local download cache and exclude list
@REM You can use --dry-run to just print what will be downloaded.
@REM You can use --cache to specify a custom path for the download cache.
@REM call Setup.bat --dry-run --threads=%NUMBER_OF_PROCESSORS% --cache=C:\Code\Cache\ue-gitdeps ^
call Setup.bat --threads=%NUMBER_OF_PROCESSORS% --cache=C:\Code\Cache\ue-gitdeps ^
--exclude=HoloLens ^
--exclude=Linux ^
--exclude=linux-64 ^
--exclude=linux32 ^
--exclude=linux64 ^
// Estimating CPU frequency...
// CPU frequency: 4.52 GHz
// sum1: value = 15182118497126522709, 0.31 secs, 5.14 cycles/elem
// sum2: value = 15182118497126522709, 0.17 secs, 2.93 cycles/elem
#define RW(x) asm("" : "+r"(x))
typedef struct Node {
u64 value;
struct Node *next;
@timlinux
timlinux / README.md
Last active April 10, 2024 19:28
Linux on Lenovo Thinkpad P14s with AMD Processor

Thinkpad P14s AMD Edition Review (Running Fedora)

These are my installation etc. notes for running Linux on my new Thinkpad P14s laptop with 32GB RAM, 1TB SDD and 8 Core, 16 Thread AMD CPU.

Detailed specs

Here is what they quoted as the specs after I confirmed my order:

State of Roblox graphics API across all platforms, with percentage deltas since EOY 2020. Updated December 31 2021.

Windows

API Share
Direct3D 11+ 92% (+3%)
Direct3D 10.1 5% (-2%)
Direct3D 10.0 3% (-0.5%)
@TheSpydog
TheSpydog / sdl2_metal_clearscreen.m
Last active June 6, 2023 12:31
SDL_Metal Clear Screen Example
/* Requires >= SDL 2.0.11 (not yet released)
* Also requires a patch that has not yet been merged:
* https://bugzilla.libsdl.org/show_bug.cgi?id=4796
*/
#include <SDL.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
int main(int argc, char **argv) {
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <d3d12.h>
#include <dxgi1_2.h>
#include <dxgi1_3.h>
#include <dxgi1_4.h>
#include <d3dcompiler.h>
#define ARRAY_COUNT(Array) (sizeof(Array)/sizeof((Array)[0]))
@yushroom
yushroom / macos_imgui_metal.mm
Last active January 18, 2022 18:19
Programmatically create a cocoa window without nib/xib/storyboard in C++ and render ImGui with metal support
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <MetalKit/MetalKit.h>
#include <imgui.h>
#include <imgui_impl_metal.h>
#include <imgui_impl_osx.h>
@interface Renderer : NSObject<MTKViewDelegate>
-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
@intinig
intinig / .clang-format
Last active January 13, 2024 11:56
.clang-format for UE4
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
@mbinna
mbinna / effective_modern_cmake.md
Last active July 25, 2024 18:43
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft