Skip to content

Instantly share code, notes, and snippets.


Luboš Hubáček Sekiphp

View GitHub Profile
View Show git branch name in console
# GIT bash integration
if [[ -e /usr/lib/git-core/git-sh-prompt ]]; then
source /usr/lib/git-core/git-sh-prompt
export GIT_PS1_SHOWUPSTREAM="auto"
Sekiphp / Fix changes in submodule (-dirty commits)
Created May 18, 2022
Fix changes in submodule (-dirty commits)
View Fix changes in submodule (-dirty commits)
cd submodule
git reset --hard HEAD
git clean -fd .
cd ..
git submodule update --init --recursive
View Rebase multiple commits into one
1. git rebase --interactive HEAD~10
2. pick commit and replace `pick` for "child" commits to `s` (it means squash)
3. save & force push
Sekiphp / mysql-config
Created Apr 9, 2021
Mysql command in shell: settings put to ~/.my.cnf
View mysql-config
View Update forked repository
# check if upstream is configured
git remote -v
git fetch # pull ahead commits from remote
git fetch upstream
git merge upstream/branch_name
git push
git log -n 5
View Git Aliases
git config --global 'commit -m'
git config --global status
Sekiphp / Magento1 _websiteFilter callback on collection
Created Sep 2, 2019
Filtering on collection where is used method addWebsiteNamesToResult()
View Magento1 _websiteFilter callback on collection
protected function _websiteFilter($collection, $column)
if (!$value = $column->getFilter()->getValue()) {
return $this;
$stores = Mage::app()->getWebsite($value)->getStores();
foreach ($stores as $store) {
Sekiphp / Automatically start ssh-agent on Windows
Created Jul 23, 2019
This code add to your .bashrc file. It is working for multiple sessions. Edited code of GitHub example.
View Automatically start ssh-agent on Windows
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }
agent_start () {
echo "Starting new SSH agent"
(umask 077; ssh-agent >| "$env")
. "$env" >| /dev/null ;
Sekiphp / Magento cron lister
Created Jun 18, 2019
This script lists all Magento cronjobs by this command: # clear && php /shell/cron_lister.php
View Magento cron lister
require_once __DIR__ . '/../abstract.php';
* @see
class Mage_Shell_CronLister extends Mage_Shell_Abstract
public function run()
Sekiphp / get-all-store-ids.txt
Created Apr 2, 2019
Magento 1 - get all active store IDS
View get-all-store-ids.txt
$allStores = Mage::getModel('core/store')
->addFieldToFilter('is_active', ['eq' => 1])
var_dump(implode(',', $allStores));