Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions docs/c++/cpp-basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// ...existing code...
# C++ Tech Stack

Brief, practical tech stack and examples for modern C++ projects (aligned with CONTRIBUTING.md style).

## What is this tech stack?
A curated set of compilers, build tools, libraries, testing and CI tools commonly used for developing reliable, cross-platform C++ applications and libraries.

## Core Components

- Compilers
- GCC (g++)
- Clang (clang++)
- MSVC (cl.exe) β€” Windows
- Build systems
- CMake (recommended)
- Meson, Bazel (alternatives)
- Package managers
- Conan, vcpkg
- Testing
- Catch2, GoogleTest
- Formatting & linting
- clang-format, clang-tidy
- Debugging & profiling
- gdb, lldb, Visual Studio Debugger, valgrind, perf
- Static analysis
- cppcheck, clang-tidy, clang-analyzer
- CI/CD
- GitHub Actions, GitLab CI, Azure Pipelines
- IDEs & Editors
- Visual Studio Code (with C/C++ extension), CLion, Visual Studio, Qt Creator

## Basic Example

Hello world (file: src/main.cpp)
```cpp
#include <iostream>

int main() {
std::cout << "Hello, C++ tech stack!\n";
return 0;
}
```
Expected output:
```
Hello, C++ tech stack!
```

## Minimal CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.16)
project(hello_cpp LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
add_executable(hello src/main.cpp)
```

## Example unit test (Catch2)
```cpp
// tests/test_example.cpp
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>

int add(int a, int b) { return a + b; }

TEST_CASE("addition works") {
REQUIRE(add(2,3) == 5);
}
```

## CI snippet (GitHub Actions - build & test)
```yaml
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential cmake
- name: Configure
run: cmake -S . -B build
- name: Build
run: cmake --build build --config Release
- name: Test
run: ctest --test-dir build --output-on-failure
```

## File organization
```
project/
β”œβ”€ src/
β”‚ └─ main.cpp
β”œβ”€ include/
β”‚ └─ project/
β”œβ”€ tests/
β”‚ └─ test_example.cpp
β”œβ”€ CMakeLists.txt
└─ .github/workflows/ci.yml
```

## Common Pitfalls
- Undefined behavior (use sanitizers: -fsanitize=address,undefined,leak)
- Mixing ABIs or incompatible compiler flags
- Missing header guards / pragma once issues
- Manual memory mistakes β€” prefer smart pointers and RAII

## Best Practices
- Use modern C++ (RAII, smart pointers, move semantics, constexpr, spans)
- Keep headers minimal; prefer pimpl or modules for large projects
- Enforce style with clang-format and checks in CI
- Write unit tests and run sanitizers in CI
- Use CMake modern targets and interface libraries (target_include_directories / target_compile_features)

## Related Topics
- C++ core guidelines β€” https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
- CMake documentation β€” https://cmake.org/documentation/
- Conan β€” https://conan.io
- Catch2 β€” https://github.com/catchorg/Catch2

## References
- cppreference: https://en.cppreference.com
- Sanitizers & Undefined Behavior: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
124 changes: 124 additions & 0 deletions docs/c-sharp/c-sharp-basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# C# Tech Stack

Brief, practical tech stack and examples for modern C#/.NET projects (aligned with CONTRIBUTING.md style).

## What is this tech stack?
A concise set of SDKs, frameworks, tools and practices for building cross-platform .NET applications: web, APIs, libraries, and CLI tools.

## Core Components
- Runtime / SDK
- .NET SDK (dotnet 6, 7, 8+)
- Frameworks
- ASP.NET Core, MAUI, Blazor
- Build & tooling
- dotnet CLI, MSBuild
- Package manager
- NuGet
- Testing
- xUnit, NUnit, MSTest
- Formatting & linting
- dotnet format, StyleCop.Analyzers, EditorConfig
- Debugging & profiling
- Visual Studio debugger, dotnet-trace, dotnet-counters, JetBrains dotTrace
- Static analysis
- Roslyn analyzers, SonarQube
- CI/CD
- GitHub Actions, Azure Pipelines, GitLab CI
- IDEs
- Visual Studio, VS Code (C# extension), Rider

## Basic Example

Program.cs
```csharp
using System;

class Program {
static void Main() {
Console.WriteLine("Hello, .NET!");
}
}
```
Expected output:
```
Hello, .NET!
```

## Minimal .csproj
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
```

## Example unit test (xUnit)
```csharp
// tests/CalculatorTests.cs
using Xunit;

public class Calculator {
public int Add(int a,int b) => a + b;
}

public class CalculatorTests {
[Fact]
public void Add_Works() {
var c = new Calculator();
Assert.Equal(5, c.Add(2,3));
}
}
```

## CI snippet (GitHub Actions)
```yaml
name: .NET CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- run: dotnet restore
- run: dotnet build --configuration Release --no-restore
- run: dotnet test --no-build --verbosity normal
```

## File organization
```
project/
β”œβ”€ src/
β”‚ └─ ProjectName/
β”‚ β”œβ”€ Program.cs
β”‚ └─ ProjectName.csproj
β”œβ”€ tests/
β”‚ └─ ProjectName.Tests/
β”œβ”€ .github/workflows/
└─ README.md
```

## Common Pitfalls
- Mixing target frameworks or incompatible package versions
- Ignoring nullable reference warnings
- Heavy synchronous I/O on ASP.NET threads
- Leaking DI scopes or disposing shared services

## Best Practices
- Prefer async/await for I/O
- Use DI and small services
- Enable analyzers and treat warnings as errors in CI
- Pin package versions for libraries
- Write unit and integration tests; run them in CI

## Related Topics
- ASP.NET Core Docs β€” https://learn.microsoft.com/aspnet/core
- .NET API Browser β€” https://learn.microsoft.com/dotnet/api

## References
- https://dotnet.microsoft.com
- xUnit: https://xunit.net
83 changes: 83 additions & 0 deletions docs/css/css-basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# CSS Tech Stack

Practical CSS toolset and examples for modern styling workflows (aligned with CONTRIBUTING.md style).

## What is this tech stack?
A set of preprocessors, tooling, linters and frameworks to write maintainable, responsive and performant styles.

## Core Components
- Languages & extensions
- CSS3, Sass/SCSS, Less, PostCSS
- Utility frameworks
- Tailwind CSS (optional)
- Build & tooling
- PostCSS, Autoprefixer, Vite, webpack
- Linting & formatting
- stylelint, Prettier
- Testing & QA
- visual regression (Percy), cross-browser testing, Lighthouse
- Performance
- critical CSS, purgecss / content scanning (Tailwind purge)
- Debugging
- DevTools (Chrome/Firefox), source maps
- Editors
- VS Code (CSS support, emmet)

## Basic Example

styles.css
```css
:root {
--brand: #0a84ff;
}

body {
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
margin: 0;
color: #111;
background: #fff;
}

.header {
background: var(--brand);
color: #fff;
padding: 1rem;
}
```
Expected: simple page with a blue header styled by .header.

## Example (Sass)
```scss
$brand: #0a84ff;

.header {
background: $brand;
color: #fff;
padding: 1rem;
@media (min-width: 768px) {
padding: 1.5rem;
}
}
```

## Build snippet (PostCSS + Autoprefixer)
- Install: npm install postcss postcss-cli autoprefixer
- Run: npx postcss src/styles.css -o dist/styles.css

## Common Pitfalls
- Overly specific selectors that hurt reuse
- Not using CSS variables for theme values
- Large unused CSS shipped to production
- Relying on !important to fix specificity issues

## Best Practices
- Use logical properties and CSS variables
- Keep small, reusable component styles
- Run stylelint and Prettier in CI
- Purge unused CSS in production builds
- Prefer layout with Flexbox / Grid, avoid heavy nesting

## Related Topics
- MDN CSS docs β€” https://developer.mozilla.org/en-US/docs/Web/CSS
- Tailwind β€” https://tailwindcss.com
- stylelint β€” https://stylelint.io
Loading
Loading