Skip to content

Instantly share code, notes, and snippets.

# 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 / MVJSON.cpp
Created July 23, 2015 08:42
MVJSON - my old lib for JSON reading / writing
/*
*
* 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 / Declaration.h
Last active April 16, 2020 23:47
Immutable-serializable structure in C++11
// 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 / listcompr.cpp
Created February 16, 2015 18:36
C++11: Implementation of list comprehension in SQL-like form
// 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 February 3, 2015 15:27
Dockerfile which builds CURL FOR ANDROID using x86 ARCH
# 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 / fn_universal.cpp
Last active July 7, 2021 09:26
Templates as first-class citizens in C++11
// 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 / aop.cpp
Last active November 17, 2021 12:28
C++11 functional decomposition - easy way to do AOP
// 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>
@VictorLaskin
VictorLaskin / Dockerfile
Created July 5, 2015 12:24
Compile static libs: OpenSSL and CURL with https support for Android using clang3.6 (armv7)
# 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"
@VictorLaskin
VictorLaskin / NamedTuple.h
Last active April 14, 2023 18:56
Named tuple for C++
// 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
{