Skip to content

Instantly share code, notes, and snippets.

View madduci's full-sized avatar

Michele Adduci madduci

View GitHub Profile
version: '3.3'
services:
db:
image: mongo:latest
container_name: mongo
expose:
- "27017"
chat:
image: rocket.chat:latest
container_name: rocket
@madduci
madduci / server.py
Last active September 25, 2019 07:44
Python3 HTTPS Server
#!/usr/bin/python3
from http.server import HTTPServer, SimpleHTTPRequestHandler
import socket
import ssl
import socketserver
listen_addr = 'test.de'
listen_port = 4443
server_cert = './ssl/server-crt.pem'
@madduci
madduci / CMakeManifest.txt
Created October 18, 2016 13:00 — forked from bjornblissing/CMakeManifest.txt
CMake script to add manifest to exe-file
# Amend manifest to tell Windows that the application is DPI aware (needed for Windows 8.1 and up)
IF (MSVC)
IF (CMAKE_MAJOR_VERSION LESS 3)
MESSAGE(WARNING "CMake version 3.0 or newer is required use build variable TARGET_FILE")
ELSE()
ADD_CUSTOM_COMMAND(
TARGET ${TARGET_TARGETNAME}
POST_BUILD
COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\dpiawarescaleing.manifest\" -inputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1 -outputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1
COMMENT "Adding display aware manifest..."
@madduci
madduci / memory.cpp
Created February 6, 2015 07:21
Modern C++ - Memory
#include <iostream>
#include <memory>
void classic_cpp()
{
std::cout << "***Classic C++***" << std::endl;
/*Classic C++*/
int *x = new int(10);
std::cout << "value of x: " << *x << " ---- address of x: " << x << std::endl;
*x = 100;
@madduci
madduci / caesar.cpp
Last active August 29, 2015 14:13
Caesar Code
#include <iostream>
#include <string> //usiamo std::string
#include <cctype> //usato per std::isalnum
#include <algorithm> //usato per std::transform ed std::erase
using namespace std;
//la chiave di default
int key{3};
@madduci
madduci / main.cpp
Last active August 29, 2015 14:12
Playing with vector
#include <iostream>
#include <vector>
int main()
{
std::vector<int> int_array; //array of integers, empty
std::vector<double> double_array_1; //array of doubles, empty
std::vector<double> double_array_2(10); //array of doubles, containing 10 elements initialized with 0.0
std::vector<double> double_array_3(10, 2.5f);//array of doubles, containing 10 elements initialized with 2.5
std::vector<double> double_array_4 {1.0, 2.0, 3.0, 4.0, 5.0}; //array initialized with some values
@madduci
madduci / project_props.cmake
Created December 24, 2014 09:17
Enabling C++11 features
#Enables C++11 features
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "-std=gnu++11")
ENDIF()
SET(CMAKE_COLOR_MAKEFILE ON)
@madduci
madduci / main.cpp
Last active August 29, 2015 14:12
Playing with variables
/*
Author: Michele Adduci <info@micheleadduci.net>
*/
#include <iostream>
#include <cmath>
int main()
{
std::cout << "The result of 3*3 is " << 3*3 << std::endl;
int var_a = 3*3;
@madduci
madduci / main.cpp
Created December 16, 2014 11:18
Modern C++ - Applications/DemoApp1/main.cpp
#include <iostream>
int main()
{
std::cout << "Hello world - DemoApp 1" << std::endl;
return 0;
}
@madduci
madduci / CMakeLists.txt
Last active August 29, 2015 14:11
Modern C++ - Applications/DemoApp1/CMakeLists.txt
cmake_minimum_required(VERSION 2.8.11)
set(APPLICATION_NAME "${PROJECT_PREFIX_NAME}_demoapp_one")
project(${APPLICATION_NAME} CXX)
#Suppressing CMAKE 3.0 warnings
if(POLICY CMP0043)
cmake_policy(SET CMP0043 OLD)
endif()