Skip to content

Instantly share code, notes, and snippets.

@vmaks
vmaks / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vmaks
vmaks / PyCharm_icon_Unity_Ubuntu.txt
Last active August 29, 2015 14:14
PyCharm icon in the Unity dash board in an Ubuntu
#######################################################################
Add PyCharm Community icon in Ubuntu
#######################################################################
1) Firstly unlock an old icon for the previous PyCharm version from the Unity dash board.
2) Extract archive with a new PyCharm version (for example "pycharm-community-3.4.1.tar.gz") in the home ("user/home") folder;
3) Go to a bin folder ("/home/maks/pycharm-community-3.4.1/bin");
4) Open Terminal in the bin folder and enter the command below:
sudo ./pycharm.sh
@vmaks
vmaks / install_gcc_g++_4.8_ubuntu_12.04.txt
Last active November 25, 2022 17:08
How to install gcc-4.8 and g++-4.8 on Ubuntu 12.04
# link: http://askubuntu.com/questions/271388/how-to-install-gcc-4-8?newreg=6c2b1c109685438c8bc7b37a87cefb21
# link to the repository: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=precise
# Open a terminal(Ctrl+Alt+t) and run the following commands:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
# install gcc
sudo apt-get install gcc-4.8
@vmaks
vmaks / gist:a5116361136ac3e4843f
Last active August 29, 2015 14:14
PEP 8 - Style Guide for Python Code
# link : https://www.python.org/dev/peps/pep-0008/#code-lay-out
# Indentation. Use 4 spaces
# Aligned with opening delimiter.
foo = long_function_name(var_one, var_two,
var_three, var_four)
# No extra indentation.
if (this_is_one_thing and
@vmaks
vmaks / test_graphviz
Last active August 29, 2015 14:14
install "PlantUML" for PyCharm Community Edition
# Due to lack support of "Class Diagram/View" in the PyCharm Community Edition you could install "PlantUML integration" plugin to create a # class diagram by yourself.
# https://www.jetbrains.com/pycharm/features/editions_comparison_matrix.html
# Install "PlantUML integration" plugin for PyCharm Community Edition through "Settings/Plugins"
https://plugins.jetbrains.com/plugin/7017
# Install "graphviz" and "libgraphviz4", that requires for "graphviz"
# Add repository for "libgraphviz4"
http://www.graphviz.org/Download..php
@vmaks
vmaks / gist:f1a541bf9bb9c7ff5229
Created February 14, 2015 18:31
PyCharm debug show frame
http://forum.jetbrains.com/thread/PyCharm-1675
http://blog.jetbrains.com/pycharm/2012/08/gevent-debug-support/
Enable Gevent support.
In recent versions of PyCharm, the option has moved to the main settings dialog. You can enable it under Settings | Python Debugger | Gevent compatible debugging.
@vmaks
vmaks / gist:17ab06089186d5c1b3bf
Last active August 26, 2018 18:45
python super TypeError: must be type, not classobj
If you face with an error like this while use "super":
"TypeError: must be type, not classobj"
link:
http://stackoverflow.com/questions/489269/python-super-raises-typeerror-why
Solution: add inheratence from the "object" class in the base class.
class Class1(object):
def __init__(self):
@vmaks
vmaks / gist:79fac700f429dc4294a3
Created February 28, 2015 19:19
Python class property([fget[, fset[, fdel[, doc]]]])
# link: https://docs.python.org/2/library/functions.html
class C(object):
def __init__(self):
self._x = None
@property
def x(self):
"""I'm the 'x' property."""
return self._x
@vmaks
vmaks / gist:7b33267a28010dc10c1a
Created March 1, 2015 12:40
Python __debug__
__debug__
# This constant is true if Python was not started with an -O option. See also the assert statement.
# link: https://docs.python.org/2/library/constants.html
@vmaks
vmaks / djini_windows.md
Last active April 26, 2016 18:53
djini_windows

For windows only!

Install guide

  1. Install MinGW (http://www.mingw.org/) or Git (https://git-scm.com/). That is you will get "sh.exe".

  2. Add path to the system variables: System / Advanced System Settings / Enviroment Variables.