View NamedTuple.h
// Named tuple for C++ | |
// Example code from http://vitiy.info/ | |
// Written by Victor Laskin (victor.laskin@gmail.com) | |
// Parts of code were taken from: https://gist.github.com/Manu343726/081512c43814d098fe4b | |
namespace foonathan { | |
namespace string_id { | |
namespace detail | |
{ |
View Declaration.h
// Immutable serialisable data structures in C++11 | |
// Example code from http://vitiy.info/immutable-data-and-serialisation-in-cpp11/ | |
// Written by Victor Laskin (victor.laskin@gmail.com) | |
class ScheduleItemData : public IImmutable { | |
public: | |
const time_t start; | |
const time_t finish; | |
SERIALIZE_JSON(ScheduleItemData, start, finish); | |
}; |
View MVJSON.cpp
/* | |
* | |
* Compact JSON format parsing lib (native cross-platform c++) | |
* | |
* Copyright (C) 2013 Victor Laskin (victor.laskin@gmail.com) | |
* Details: http://vitiy.info/?p=102 | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: |
View Dockerfile
# THIS DOCKERFILE TRIES TO COMPILE CURL/OPENSSL FOR ANDROID | |
# | |
# 5 july 2015 | |
# | |
# More detals could be found here: | |
# http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/ | |
FROM ubuntu | |
MAINTAINER Victor Laskin "victor.laskin@gmail.com" |
View Dockerfile
# Dockerfile for COMPILATION C++ into JS using EMSCRIPTEN | |
FROM stackbrew/ubuntu:saucy | |
MAINTAINER "Victor Laskin" | |
RUN apt-get update | |
RUN apt-get install -y --no-install-recommends \ | |
wget curl apache2 \ | |
ca-certificates git build-essential make cmake scons \ | |
python nodejs default-jre-headless clang-3.4 llvm-3.4 |
View fn_universal.cpp
// Templates as first-class citizens in C++11 | |
// Example code from http://vitiy.info/templates-as-first-class-citizens-in-cpp11/ | |
// Written by Victor Laskin (victor.laskin@gmail.com) | |
#include <iostream> | |
#include <algorithm> | |
#include <functional> | |
#include <vector> | |
#include <tuple> |
View listcompr.cpp
// List comprehension in C++11 in form of SQL-like syntax | |
// Example code from http://vitiy.info/cpp11-writing-list-comprehension-in-form-of-sql/ | |
// Written by Victor Laskin (victor.laskin@gmail.com) | |
#include <iostream> | |
#include <functional> | |
#include <vector> | |
#include <future> | |
#include <algorithm> | |
using namespace std; |
View Dockerfile
# THIS DOCKERFILE TRIES TO COMPILE CURL FOR ANDROID x86 ARCH | |
# Description - http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/ | |
FROM ubuntu | |
MAINTAINER Victor Laskin "victor.laskin@gmail.com" | |
# Install compilation tools | |
RUN apt-get update && apt-get install -y \ |
View aop.cpp
// This is example from | |
// http://vitiy.info/c11-functional-decomposition-easy-way-to-do-aop/ | |
// by Victor Laskin | |
#include <iostream> | |
#include <functional> | |
#include <map> | |
#include <vector> | |
#include <memory> | |
#include <chrono> |