Skip to content

Instantly share code, notes, and snippets.

@valmat
valmat / 1tb.sh
Created January 28, 2015 15:56
Script to auto mount external device.If for some reason you do not want to use the fstab file, this script will be a resolve
#!/bin/sh
#
#
# Script to auto mount external device
# If for some reason you do not want to use the fstab file, this script will be a resolve
#
@valmat
valmat / strjoin.cpp
Created November 23, 2014 17:15
Optimized string concatenation
#include <iostream>
#include <string>
/**
* Optimized aggregating strings
* used Args pack
*/
template <unsigned short size>
struct StrJoinInitializer
{
@valmat
valmat / tolist.cpp
Last active February 13, 2018 07:29
vector to variables list. destructuring assign; variable destructuring.
/**
* This is a helper class.
* It can be used only inside the function ListInitializer tolist(Args&& ...args)
* ListInitializer list(Args&& ...args)
* In all other cases, use it not possible
* size is the number of arguments with which the constructor was called
*/
template<typename DataType, unsigned size>
class ListInitializer
{