Skip to content

Instantly share code, notes, and snippets.

View madduci's full-sized avatar

Michele Adduci madduci

View GitHub Profile
@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 / 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 / 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 / usc_parser.py
Created October 21, 2017 13:04
Conversion of Ground Truth data for the USC dataset
import sys
import glob
import os
import argparse
import xml.etree.ElementTree
# dlib output format: <image file='*.jpg'><box top='' left='' width='' height=''/> </image>
# USC format: <Object><Rect x="142" y="22" width="28" height="73"/></Object>
version: '3.3'
services:
db:
image: mongo:latest
container_name: mongo
expose:
- "27017"
chat:
image: rocket.chat:latest
container_name: rocket
@madduci
madduci / packages.ps1
Created December 13, 2017 14:55
Common used packages for Windows
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y flashplayerplugin firefox 7zip.install vlc notepadplusplus.install paint.net malwarebytes teamviewer foxitreader
@madduci
madduci / introrx.md
Created February 2, 2018 11:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@madduci
madduci / sign.sh
Created April 18, 2018 08:46 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
@madduci
madduci / tutorial.md
Created July 17, 2018 10:00 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@madduci
madduci / sorting.sh
Last active September 17, 2019 20:20
Sorting files in folders
#!/bin/bash
readonly INPUT_FOLDER="${1}"
cd ${INPUT_FOLDER}
find . -type f -print0 | while read -d $'\0' file
do
information=$(ls -lt --time-style=+%b-%Y "${file}")
filedate=$(echo "${information}" | awk '{print $6}')
filename=$(echo "${information}" | awk '{print $7}' )