Skip to content

Instantly share code, notes, and snippets.

@mslabko
mslabko / vb-speedup
Last active February 27, 2017 09:37
VirtualBox speed up settings
# mage.dev - name of your VM (from cli it can be retrieve by: VBoxManage list vms)
# halt VM if running
# run the folloving commands
# run VM
VBoxManage setextradata "mage.dev" VBoxInternal/TM/TSCMode RealTSCOffset
VBoxManage setextradata "mage.dev" VBoxInternal/CPUM/SSE4.1 1
VBoxManage setextradata "mage.dev" VBoxInternal/CPUM/SSE4.2 1
@mslabko
mslabko / magento_command_autocomplete.sh
Created September 8, 2016 11:18
Make magento CLI tool usage with autocomplete
###
#
# Make magento CLI tool usage with autocomplete
# Based on https://github.com/bamarni/symfony-console-autocomplete
#
##
# Step 1
composer global require bamarni/symfony-console-autocomplete
@mslabko
mslabko / sql_profiling.php
Last active August 17, 2021 21:43
Enable sql profiling for Magento2
<?php
/**
* Enable sql profiling for each page.
*
* Put code to index file in two parts
*/
// place it BEFORE application run
$profiler = \Magento\Framework\App\ObjectManager::getInstance()
->get('Magento\Framework\App\ResourceConnection')
@mslabko
mslabko / Remove remotes branch merged to mainline
Last active July 14, 2016 08:03
Mass delete branches from repo which already included in mainline
by @kandy
git branch -a --merged mainline/develop|grep 'remotes/origin/'|grep -v 'master'|grep -v 'develop'|sed 's/ remotes\/origin\///' |xargs -n1 -I % git push origin :%
@mslabko
mslabko / enum.py
Created April 7, 2011 08:17 — forked from GrAndSE/enum.py
ChoiceEnum is useful class to work with choices field ​​in Django. See http://docs.djangoproject.com/en/1.3/ref/models/fields/#choices
class Enum(object):
"""Unmodifiable enumeration class supports both sequential and named
creation:
>>> e = Enum('ZERO', 'ONE', TWO=2, FIVE=5)
>>> e.ZERO
0
>>> e.ONE
1
>>> e.FIVE