Skip to content

Instantly share code, notes, and snippets.

View versedi's full-sized avatar
🎯
Focusing

versedi

🎯
Focusing
View GitHub Profile
@versedi
versedi / SublimeStuffCollection.md
Last active November 17, 2015 13:13
Sublime-Settings.md

My personal Sublime settings

User settings

{
	"always_show_minimap_viewport": true,
	"auto_complete_delay": 20,
	"auto_complete_selector": "source, text, file",
	"auto_complete_triggers":
	[

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@versedi
versedi / MageSnippets.php
Last active December 21, 2015 21:09
Magento PHP Snippets
#Debug Layout
<?php Zend_Debug::dump($this->getLayout()->getUpdate()->getHandles()); ?>
##Get Locale Code
<?php echo strtolower(Mage::getStoreConfig('general/country/default')); ?>
## Get Skin URL
<?php echo $this->getSkinUrl('images/logo.png'); ?>
@versedi
versedi / netbeans-macros.md
Last active August 29, 2015 14:23
Magento Netbeans Macro / Code Templates

Macro

Translate *.phtml

cut-to-clipboard "<?php echo $this->__('" paste-from-clipboard "') ?>"

Echo string *.phtml

cut-to-clipboard "<?php echo " paste-from-clipboard " ?>"
@versedi
versedi / .sh
Created August 5, 2015 13:38
Cygwin + git + Sublime Text 3 commit message
#Remember to have environment variable in Windows set also to /usr/local/bin
#File /usr/local/bin/subl with chmod +x, content:
#!/bin/bash
/cygdrive/c/Program\ Files/Sublime\ Text\ 3/sublime_text.exe `cygpath -w $PWD/.git/COMMIT_EDITMSG` -w
#File ~/.gitconfig
[core]
...
editor = subl -w
...
@versedi
versedi / pullrepos.sh
Last active August 29, 2015 14:27
Update multiple repositories in subdirectories
#!/bin/bash
find ~me/projects/ -type d -name .git \
| xargs -n 1 dirname \
| sort \
| while read line; do echo $line && cd $line && git pull; done
#If above ain't working (cygwin had some problems with syntax)
@versedi
versedi / Php-fixers.md
Last active August 29, 2015 14:27
Cygwin + Conemu + Sublime + XAMPP + PHPCS/PHPMd/PHPCBF

Install XAMPP
Configure PEAR to work with XAMPP
Install into e:/xampp/php
phpcs.bat
phpmd.bat
phpcbf.bat

Install standards into e:/xampp/php/pear/php/codesniffer/standards

~/.bash_aliases

@versedi
versedi / phpcs.sublime-settings
Last active August 29, 2015 14:27
phpcs.sublime.settings
{
// Plugin settings
// Turn the debug output on/off
"show_debug": true,
// Which file types (file extensions), do you want the plugin to
// execute for
"extensions_to_execute": ["php"],
@versedi
versedi / sublime-keymap-polish-characters-fix
Last active November 23, 2015 07:36
Sublime polish latin extended characters fix
[
{ "keys": ["alt+c"], "command": "insert_snippet", "args": {"contents": "ć"} },
{ "keys": ["ctrl+alt+c"], "command": "insert_snippet", "args": {"contents": "ć"} },
{ "keys": ["ctrl+shift+alt+c"], "command": "insert_snippet", "args": {"contents": "Ć"} },
{ "keys": ["alt+s"], "command": "insert_snippet", "args": {"contents": "ś"} },
{ "keys": ["ctrl+alt+s"], "command": "insert_snippet", "args": {"contents": "ś"} },
{ "keys": ["ctrl+shift+alt+s"], "command": "insert_snippet", "args": {"contents": "Ś"} },
{ "keys": ["alt+l"], "command": "insert_snippet", "args": {"contents": "ł"} },
{ "keys": ["ctrl+alt+l"], "command": "insert_snippet", "args": {"contents": "ł"} },
{ "keys": ["ctrl+shift+alt+l"], "command": "insert_snippet", "args": {"contents": "Ł"} }
[
{ "keys": ["ctrl+d"], "command": "duplicate_line" },
{ "keys": ["ctrl+Shift+d"], "command": "find_under_expand" },
{ "keys": ["ctrl+pagedown"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+pageup"], "command": "prev_view_in_stack" },
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
{ "keys": ["ctrl+y"], "command": "redo"},