Skip to content

Instantly share code, notes, and snippets.

View alexandrov-va's full-sized avatar
🐺

Vladimir alexandrov-va

🐺
View GitHub Profile
@Trass3r
Trass3r / CMakeLists.txt
Created March 1, 2020 19:16
template for OpenGL with CMake, Conan, glad and glfw
cmake_minimum_required(VERSION 3.16)
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "")
project(cppgl)
set(CMAKE_CXX_STANDARD 20)
if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
@dmmeteo
dmmeteo / 1.srp.py
Last active January 27, 2025 12:38
SOLID Principles explained in Python with examples.
"""
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
"""
class Animal:
def __init__(self, name: str):
@longlostnick
longlostnick / uploads_controller.rb
Created June 17, 2014 18:20
Rails JSON file upload with carrierwave (from base64 string)
class Api::UploadsController < ApiController
def create
@upload = Upload.new(upload_params)
ensure
clean_tempfile
end
private