Skip to content

Instantly share code, notes, and snippets.

#include <SFML/Graphics.hpp>
class CustomWindow {
public:
CustomWindow() {
// Load images
if (!backgroundTexture.loadFromFile("background.png") ||
!buttonTexture.loadFromFile("button.png")) {
// Handle error
}
#include <Windows.h>
// Global variables
HBITMAP hBitmapTopLeftCorner;
HBITMAP hBitmapTopEdge;
// Define other bitmaps for other parts of the frame...
// Function to load bitmaps
void LoadBitmaps() {
// Load bitmaps from files or resources
#include <Windows.h>
// Global variables
HBITMAP hBitmapTopLeftCorner;
HBITMAP hBitmapTopEdge;
// Define other bitmaps for other parts of the frame...
// Function to load bitmaps
void LoadBitmaps() {
// Load bitmaps from files or resources
@antoninbouchal
antoninbouchal / .gitlab-ci.yml
Last active May 4, 2024 22:21
Deploy APP through SSH to VPS with Gitlab CI
stages:
- build
- deploy
before_script:
- |
# docker variables for name and tag of new image
export DOCKER_TAG="${CI_COMMIT_SHA:0:8}"
export DOCKER_REPO="$CI_REGISTRY_IMAGE"
export DOCKER_IMAGE="${DOCKER_REPO}:${DOCKER_TAG}"
@wojteklu
wojteklu / clean_code.md
Last active May 4, 2024 22:21
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

#include <Windows.h>
// Global variables
HBITMAP hBitmapTopLeftCorner;
HBITMAP hBitmapTopRightCorner;
HBITMAP hBitmapTopEdge;
HBITMAP hBitmapBottomLeftCorner;
HBITMAP hBitmapBottomRightCorner;
HBITMAP hBitmapBottomEdge;
HBITMAP hBitmapCenter;
#include <Windows.h>
// Global variables for bitmaps
HBITMAP hBitmapTopLeftCorner;
HBITMAP hBitmapTopRightCorner;
HBITMAP hBitmapTopEdge;
HBITMAP hBitmapBottomLeftCorner;
HBITMAP hBitmapBottomRightCorner;
HBITMAP hBitmapBottomEdge;
HBITMAP hBitmapCenter;
#include <Windows.h>
class CustomWindow {
public:
CustomWindow(HINSTANCE hInstance) : hInstance(hInstance) {}
void Create(const char* title, int width, int height) {
WNDCLASS wc = { 0 };
wc.lpfnWndProc = WindowProc;
wc.hInstance = hInstance;
#include <Windows.h>
class CustomWindow {
public:
CustomWindow(HINSTANCE hInstance) : hInstance(hInstance) {
LoadBitmaps();
}
void Create(const char* title, int width, int height) {
WNDCLASS wc = { 0 };