Skip to content

Instantly share code, notes, and snippets.

View wolkym's full-sized avatar

Woldemar XmbIpoB wolkym

View GitHub Profile
@wolkym
wolkym / .vimrc
Created September 18, 2017 18:14 — forked from gosukiwi/.vimrc
My vim configuration
" [ CORE ] ------------------------------------------------------------------
" Very much needed settings to provide a solid base for source code editting
" DEPENDENCIES:
" - vim-plug: For managing plugins
" - ag: The silver searcher
" - editorconfig: For projects where common configuration is important
" - SourceCodePro: Pretty font for coding
" ---------------------------------------------------------------------------
" don't make vim compatible with vi
@wolkym
wolkym / redislogger.py
Created February 28, 2017 08:34 — forked from droot/redislogger.py
Redis Log Handler in Python
import redis
import logging
class RedisLogHandler:
"""Log handler for logging logs in some redis list
"""
def __init__(self, host = None, port = None, db = 0, log_key = 'log_key'):
self._formatter = logging.Formatter()
self._redis = redis.Redis(host = host or 'localhost', port = port or 6379, db = db)
self._redis_list_key = log_key
@wolkym
wolkym / dict_to_redis.py
Created February 28, 2017 08:05 — forked from vladignatyev/dict_to_redis.py
Save Python dict to Redis hash
def dict_to_redis_hset(r, hkey, dict_to_store):
"""
Saves `dict_to_store` dict into Redis hash, where `hkey` is key of hash.
>>> import redis
>>> r = redis.StrictRedis(host='localhost')
>>> d = {'a':1, 'b':7, 'foo':'bar'}
>>> dict_to_redis_hset(r, 'test', d)
True
>>> r.hgetall('test')
@wolkym
wolkym / useful_pandas_snippets.py
Created February 14, 2017 15:21 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]
@wolkym
wolkym / .gtkrc-eclipse
Created December 9, 2016 18:41 — forked from andrioli/.gtkrc-eclipse
Config to make Eclipse Juno icons and tabs look small and nice in Linux
# Create a new file in your home directory called .gtkrc-eclipse
# call eclipse with this command:
# Gtk2 forced:
# export SWT_GTK3=0
# env GTK2_RC_FILES=/usr/share/themes/<YourTheme>/gtk-2.0/gtkrc:/home/<YourUser>/.gtkrc-eclipse '/path_to_eclipse/eclipse'
# In your Eclipse directory find the file 'e4_default_gtk.css'
# In this file there's a CSS class:
@wolkym
wolkym / optional.cpp
Created September 30, 2016 15:04
C++ optional
template<typename T>
class Option{
private:
T* some;
bool is_null;
public:
Option(T* obj_) : some(obj_), is_null(obj_ == nullptr) { }
bool isEmpty(){ return is_null;}
bool isDefined(){ return !isEmpty;}
@wolkym
wolkym / namedatalen-256.patch
Created August 25, 2016 12:52 — forked from langner/namedatalen-256.patch
Patch that increases NAMEDATALEN to 256 in postgresql-9.1.14-0ubuntu0.12.04 (use with https://gist.github.com/langner/12a032a8793c2df80f5d)
Index: postgresql-9.1-9.1.14/src/include/pg_config_manual.h
===================================================================
--- postgresql-9.1-9.1.14.orig/src/include/pg_config_manual.h 2014-10-14 16:55:38.000000000 -0400
+++ postgresql-9.1-9.1.14/src/include/pg_config_manual.h 2014-10-14 16:56:01.598940653 -0400
@@ -17,7 +17,7 @@
*
* Changing this requires an initdb.
*/
-#define NAMEDATALEN 64
+#define NAMEDATALEN 256
@wolkym
wolkym / data.table.CJ.R
Created August 19, 2016 16:12
data.table cross join
library(data.table)
dt1 = data.table(a = 1:4, b = 4:1)
dt2 = data.table(c = letters[1:4])
dt2[, dt1[], by = c]
@wolkym
wolkym / 2014-09-14.log
Created April 27, 2016 18:32 — forked from theVDude/2014-09-14.log
2014-09-14
2014-09-14 00:01:19 --> ThisFrickinSite| (~kvirc@207.144.203.163) has joined #tagpro
2014-09-14 00:01:27 --> MrJoehobo (4c100b56@gateway/web/freenode/ip.76.16.11.86) has joined #tagpro
2014-09-14 00:03:04 <-- Aniball (450669c1@gateway/web/freenode/ip.69.6.105.193) has quit (Quit: Page closed)
2014-09-14 00:03:29 --> Exquisite (180ea501@gateway/web/freenode/ip.24.14.165.1) has joined #tagpro
2014-09-14 00:03:31 Exquisite !test chaos ball
2014-09-14 00:03:32 some_bot Sorry, I cannot find "chaos ball" in my brain! Did you mean one of these: Chaos Arena, BaseBALL ?
2014-09-14 00:03:40 Exquisite !test chaos arena
2014-09-14 00:03:42 some_bot http://tagpro-maptest.koalabeast.com:8002/ (chaos arena)
2014-09-14 00:03:47 +pooppants chaos ball was fun
2014-09-14 00:04:04 <-- ThisFrickinSite (~kvirc@207.144.203.163) has quit (Ping timeout: 256 seconds)
Books (Basics):
Керниган Б., Ритчи Д. - Программирование на C (2nd ed.) (2009)
Stroustrup B. - The C++ Programming Language (2013)
Страуструп Б. - Программирование. Принципы и практика использования C++ (2011)
Мэйерс С. - Эффективное использование C++ (3rd ed.) (2006)
Meyers S. - Effective Modern C++ (2014)
Андрей Александреску - Современное проектирование на C++ (2002)
Zed A. Shaw - Learn C the Hard Way - http://c.learncodethehardway.org/book/
Books (Algorithms):