Skip to content

Instantly share code, notes, and snippets.

Vladimir Chub vartagg

  • Krasnoyarsk
View GitHub Profile
@vartagg
vartagg / !Profiler.hx
Created Aug 29, 2017 — forked from hamaluik/!Profiler.hx
Simple Haxe Profiler
View !Profiler.hx
package ;
import haxe.ds.StringMap;
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Printer;
import haxe.macro.Type.ClassType;
import neko.Lib;
using haxe.macro.ExprTools;
@vartagg
vartagg / gist:b8e477e34ff8ff7385bf
Created Nov 13, 2014
Updating edx-platform error
View gist:b8e477e34ff8ff7385bf
root@EVBYMINSD4C73:/# sudo /edx/bin/update edx-platform master
/edx/app/edx_ansible/venvs/edx_ansible/bin/python: /usr/local/lib/libcrypto.so.1.0.0: no version information available (required by /edx/app/edx_ansible/venvs/edx_ansible/bin/python)
/edx/app/edx_ansible/venvs/edx_ansible/bin/python: /usr/local/lib/libssl.so.1.0.0: no version information available (required by /edx/app/edx_ansible/venvs/edx_ansible/bin/python)
[WARNING]: It is unneccessary to use '{{' in loops, leave variables in loop
expressions bare.
PLAY [Deploy edxapp] **********************************************************
GATHERING FACTS ***************************************************************
View lazy_dict.py
from copy import copy
class LazyDict(dict):
"""
A dict class with default value for unfound keys
>>> ldict = LazyDict(0)
>>> ldict
{}
@vartagg
vartagg / extra_utils.py
Created Mar 22, 2014
Различные утилиты
View extra_utils.py
def deep_dict_merge(a, b):
"""
Объединение словарей, которые могут содержать внутри
себя другие словари. При совпадении ключей приоритет
имеет словарь b (предполагается, что он содержит более актуальные данные).
:param a: dict
:param b: dict
>>> a = {1: {'a': 'A'}, 2:{'b': 'B'}}
>>> b = {2:{'c': 'C'}, 3: {'d': 'D'}}
You can’t perform that action at this time.