Skip to content

Instantly share code, notes, and snippets.

View lilianmoraru's full-sized avatar

Lilian Anatolie Moraru lilianmoraru

View GitHub Profile
@lilianmoraru
lilianmoraru / setup_vagga.sh
Last active May 20, 2019 22:26
Script to setup vagga on Debian based systems
#! /bin/sh
red_color="\033[1;31m"
green_color="\033[1;32m"
no_color="\033[0m"
throw_error() {
if [ ! -z "$1" ]; then
printf "${red_color}$1${no_color}\n"
fi
@lilianmoraru
lilianmoraru / main.cpp
Last active August 29, 2015 14:05
C++11 Example
//For demonstration purposes we move reverse into a separate function
// In C++98 - this would make a deep copy then throw the original
// In C++11 - It will detect that a temporary is passed. It uses move semantics automatically.
// Copies the pointer and takes ownership of the buffer.
// Doesn't do a shallow copy or deep copy.
// There is no need to implicitly tell the compiler what to do with a temporary data,
// it's error prone while the compiler knows
// better and the case is very simple for the compiler to detect.
// If the user wants, he can tell it explicitly with "string&& s"
string reverse_string(string s) {