Skip to content

Instantly share code, notes, and snippets.

View PSyton's full-sized avatar

Pavel V. Sysolyatin PSyton

  • 2Gis
  • Russia, Novosibirsk
View GitHub Profile
@PSyton
PSyton / kebase.md
Last active April 29, 2019 09:29
kebase.md

Keybase proof

I hereby claim:

  • I am psyton on github.
  • I am psyton (https://keybase.io/psyton) on keybase.
  • I have a public key ASA1muXb3p4nwychRM-VeAvgTRw68AfwpkiAHksAFBsttgo

To claim this, I am signing this object:

@PSyton
PSyton / rw_spin_lock.h
Created June 21, 2018 01:12 — forked from yizhang82/rw_spin_lock.h
portable lock-free reader/writer lock for C++
class rw_spin_lock
{
public:
rw_spin_lock()
{
_readers = 0;
}
public:
void acquire_reader()
@PSyton
PSyton / Dockerfile
Created July 15, 2017 00:22
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"
@PSyton
PSyton / uri.js
Created July 28, 2014 03:45 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@PSyton
PSyton / gist:5882418
Created June 28, 2013 04:15
Настройка git на чистой Win системе
Добавить пути для p4merge.exe и sublime_text.exe в Path.
git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""
git config --global core.editor "sublime_text.exe -w -n"
@PSyton
PSyton / str_switch.hpp
Created January 23, 2013 04:17
String switch C++11
#ifndef STR_SWITCH_H
#define STR_SWITCH_H
#include <string>
#define SWITCH(str) switch(s_s::str_hash_for_switch(str))
#define CASE(str) static_assert(s_s::str_is_correct(str) && (s_s::str_len(str) <= s_s::MAX_LEN),\
"CASE string contains wrong characters, or it`s length is greater than 10");\
case s_s::str_hash(str, s_s::str_len(str))
#define DEFAULT default
@PSyton
PSyton / base_enum.h
Created July 6, 2012 05:56
Constant string enums in C++
#pragma once
#include <string>
#include <boost/unordered_map.hpp>
namespace enum_base {
template <class T>
class BaseEnum
{
protected: