Skip to content

Instantly share code, notes, and snippets.

View maddouri's full-sized avatar

Yassine MADDOURI maddouri

View GitHub Profile
@barbarbar338
barbarbar338 / server.ps1
Created December 31, 2023 07:13
A simple PowerShell HTTP server script that supports static file hosting, server-side executions and static routes.
$Port = 8080;
$StaticDir = "./public";
$Listener = New-Object System.Net.HttpListener;
$Listener.Prefixes.Add("http://localhost:$Port/");
$Listener.Start();
If ($Listener.IsListening) {
@robotdad
robotdad / vs_cpp_winget.md
Last active August 14, 2025 10:17
Installing VS C++ workloads with winget

This is a short outline of how to install the C++ workload with Visual Studio or the build tools using winget.

To find VS releases with winget use search. winget search buildtools

The install command will install the VS installer with the core of the selected product installed. That isn't much. So if you use either of these commands to insll VS or the build tools you will need to launch the VS installer afterwards and select the relevant C++ workloads you need.

winget install Microsoft.VisualStudio.2022.BuildTools

winget install Microsoft.VisualStudio.2022.Community
@maddouri
maddouri / cd_without_writing_cd.bashrc.sh
Created September 10, 2019 17:45
cd just by typing the directory's path in bash 🔥
# https://unix.stackexchange.com/a/37182/140618
shopt -s autocd
@MattPD
MattPD / cpp.std.coroutines.draft.md
Last active July 16, 2025 09:11
C++ links: Coroutines (WIP draft)
@Mike-Devel
Mike-Devel / Boostdep.png
Last active November 29, 2019 18:35
Boost dependency graph with cmake coloring
Boostdep.png
@maddouri
maddouri / on_scope_exit.hpp
Last active July 27, 2019 19:56
Neat C++11 scope guard inspired by Andrei Alexandrescu's CppCon 2015 talk about declarative control flow
#pragma once
#include <cstdint>
#include <exception>
#include <type_traits>
#include <utility>
// Usage
// ON_SCOPE_EXIT <callable> ;
// ON_SCOPE_EXIT_FAIL <callable> ;
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active August 23, 2025 13:49 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active August 22, 2025 02:46
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@norlin
norlin / UE5-Project.sublime-build
Last active May 22, 2025 21:46
Build system for Unreal Engine projects for Sublime Text
{
"cmd": [
// Default path for UE 5
"C:/Program Files/Epic Games/UE_5.0/Engine/Build/BatchFiles/Build.bat",
// Build configuration is set to "Development" by default
"Development",
// The platform is set to Win64 by default
"Win64",
"-Project",
// The Sublime project name must match the Unreal project filename
@jessfraz
jessfraz / boxstarter.ps1
Last active June 23, 2025 13:25
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt: