Skip to content

Instantly share code, notes, and snippets.

Avatar

Victor Laskin VictorLaskin

View GitHub Profile
@VictorLaskin
VictorLaskin / NamedTuple.h
Last active Jul 16, 2020
Named tuple for C++
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
{
@VictorLaskin
VictorLaskin / Declaration.h
Last active Apr 16, 2020
Immutable-serializable structure in C++11
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);
};
@VictorLaskin
VictorLaskin / MVJSON.cpp
Created Jul 23, 2015
MVJSON - my old lib for JSON reading / writing
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:
@VictorLaskin
VictorLaskin / Dockerfile
Created Jul 5, 2015
Compile static libs: OpenSSL and CURL with https support for Android using clang3.6 (armv7)
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
@VictorLaskin
VictorLaskin / fn_universal.cpp
Last active Apr 16, 2020
Templates as first-class citizens in C++11
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>
@VictorLaskin
VictorLaskin / listcompr.cpp
Created Feb 16, 2015
C++11: Implementation of list comprehension in SQL-like form
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;
@VictorLaskin
VictorLaskin / Dockerfile
Created Feb 3, 2015
Dockerfile which builds CURL FOR ANDROID using x86 ARCH
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 \
@VictorLaskin
VictorLaskin / aop.cpp
Last active Apr 16, 2020
C++11 functional decomposition - easy way to do AOP
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>
You can’t perform that action at this time.