Skip to content

Instantly share code, notes, and snippets.

View dolinenkov's full-sized avatar
🐈

Filipp Dolinenkov dolinenkov

🐈
  • Russia, Kaliningrad
View GitHub Profile
@dolinenkov
dolinenkov / regex.hpp
Created May 29, 2016 15:26
Regular expression for parsing URL parts: - Schema - Login - Password - Hostname - Port - Resource address - Parameters - Anchor
const char URL_PARSE_REGEX[] =
"(?:([[:alnum:]]{3,}):\\/\\/)?"
"(?:((?:[[:alnum:]$_.+!*'(),\\-]|\\%[[:xdigit:]]{2})*)?"
":?((?:[[:alnum:]$_.+!*'(),\\-]|\\%[[:xdigit:]]{2})*)?@)?"
"((?:[[:alnum:]$_.+!*'(),\\-]|\\%[[:xdigit:]]{2})*)?"
"(?::([1-9]\\d{0,4})?)?"
"(?:((?:\\/(?:[[:alnum:]$_.+!*'(),\\-]|\\%[[:xdigit:]]{2})+)*)"
"(\\?(?:[[:alnum:]$_.+!*'(),\\-]|\\%[[:xdigit:]]{2})+"
"(?:=(?:[[:alnum:]$_.+!*'(),\\-]|\\%[[:xdigit:]]{2})*)?"
"(?:&(?:[[:alnum:]$_.+!*'(),\\-]|\\%[[:xdigit:]]{2})*"
@dolinenkov
dolinenkov / future_apply.hh
Created September 17, 2018 11:17
Implementation of a C++17 feature - `std::apply` - in C++11 standard
/*
Implementation of a C++17 feature - `std::apply` - in C++11 standard
*/
#ifndef FUTURE_APPLY_HH
#define FUTURE_APPLY_HH
#include <tuple>
#include <utility>
#include <type_traits>
@dolinenkov
dolinenkov / jsw.h
Created September 21, 2018 05:57
lightweight wrapper for jansson
#pragma once
#include <type_traits>
#include <string>
#include <jansson.h>
namespace jsw
{
namespace detail
{
@dolinenkov
dolinenkov / jql.py
Created September 24, 2018 19:36
query jira issues and make a report - python2
#!/usr/bin/env python2
import jira
import datetime
class Reporter:
JIRA_URL = 'https://jira.somecompany.com'
@dolinenkov
dolinenkov / CMakeLists.txt
Last active November 30, 2018 21:23
CMake - externals script
# note: the following environment variables should be set for this script to work correctly:
# SDL2_DIR -> SDL2 installation root (cmake)
# GLEW_DIR -> GLEW installation root (cmake)
# GLM_DIR -> GLM installation root (cmake)
# LUA_DIR -> Lua installation root (no cmake)
# ENTT
# cmake configuration files are required!
message(STATUS "[externals] setting up...")
message(STATUS "[externals] SDL2 -> ${SDL2_DIR}")
#pragma once
#include <algorithm> // std::max
namespace SimplePhil {
namespace Impl {
template<class... Types>
struct TypeListNode;
#pragma once
#include <algorithm>
#include <type_traits>
#include "TypeList.hh"
namespace SimplePhil {
template<class... Args>
class Variant {
#ifndef __MODEL_FORMAT_HH__
#define __MODEL_FORMAT_HH__
#if !defined(__cplusplus)
#error "C++11 conformant compiler is required"
#endif
#include <cstdint>
#include <cstdio>
@dolinenkov
dolinenkov / custom.css
Last active July 4, 2019 07:27
Slack black theme (author github: Nockiro)
/*
Copyright 2017 Bryan Keller (https://github.com/widget-)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
#include <tuple>
#include <string>
#include <string>
#include <sstream>
#include <iostream>
#include <map>
namespace class_info {
struct String {