Skip to content

Instantly share code, notes, and snippets.

View pperehozhih's full-sized avatar

Pavel Perehozhih pperehozhih

View GitHub Profile
cmake_minimum_required(VERSION 3.13)
project(test)
set(CMAKE_CXX_STANDARD 17)
set(scpm_server_branch "develop")
include(scpm.cmake)
scpm_install(imgui 1.67)
scpm_install(expat R_2_2_5)
add_executable(${PROJECT_NAME} main.cpp)
class Connection {
public:
virtual void OnData(uint8_t* data, size_t size) = 0;
void Write(uint8_t* data, size_t size);
};
struct Foo {
int getA() const { return a; }
private:
int a = 10;
friend class Bar;
};
class Bar {
Bar(Foo* instance):instance(instance){}
Foo* operator ->() {
@pperehozhih
pperehozhih / build_android_llvm.sh
Last active December 26, 2017 15:46
Build android toolchain
#!/bin/sh
git clone http://llvm.org/git/llvm.git
cd llvm/tools
git clone http://llvm.org/git/clang.git
cd ..
cd projects
git clone http://llvm.org/git/compiler-rt.git
cd ..
mkdir build
cd build
@pperehozhih
pperehozhih / build_clang.sh
Last active December 26, 2017 15:06
build_clang.sh
#!/bin/sh
git clone http://llvm.org/git/llvm.git
cd llvm/tools
git clone http://llvm.org/git/clang.git
cd clang/tools
git clone http://llvm.org/git/clang-tools-extra.git extra
cd ../../..
cd projects
git clone http://llvm.org/git/compiler-rt.git
cd ..
@pperehozhih
pperehozhih / nginx.conf
Created August 4, 2017 11:06
custom response
error_page 400 403 404 405 =200 @40*_xml;
location @40*_xml {
default_type application/xml;
return 200 '<country  technical_work=\'{"notify_start":1501834800,"work_start":1501835400,"work_end":1501836300}\' server_time=\'1501835409\'>
          <field></field>
          <messages>
            <message code=\'technical_works\' />
          </messages>
        </country>';
}
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=nginx
PIDFILE=./obj/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=./obj/nginx
#include <functional>
#include <iostream>
void test() {
}
void test2() {
}
#include <functional>
#include <iostream>
void test() {
}
void test2() {
}
VBoxManage modifyvm "<docker vm name>" --natpf1 "tcp-port8080,tcp,,8080,,8080";
VBoxManage modifyvm "<docker vm name>" --natpf1 "udp-port8080,udp,,8080,,8080";
VBoxManage modifyvm "<docker vm name>" --natpf1 "tcp-port9933,tcp,,9933,,9933";
VBoxManage modifyvm "<docker vm name>" --natpf1 "udp-port9933,udp,,9933,,9933";