Skip to content

Instantly share code, notes, and snippets.

View Sekiphp's full-sized avatar

Luboš Hubáček Sekiphp

View GitHub Profile
@Sekiphp
Sekiphp / update_repo.sh
Last active September 27, 2018 08:27
Cleanup of remote developer repository
#!/bin/bash
clear
git fetch
git reset --hard
git checkout master
git checkout -- .
git clean -fd .
rm -rf media
git pull
@Sekiphp
Sekiphp / gist:33ae83e0713dd95cefc90c076cff73da
Created September 3, 2018 12:52
GIT: Number of changed rows
git diff --stat HEAD
git config --list
git remote -v
git remote set-url origin https://_LOGIN_@bitbucket.org/_PATH/TO/REPOSITORY_.git
$ git remote -v
$ git remote set-url origin https://login@bitbucket.org/organization/repository
User@DESKTOP-QSKO7HF MINGW64 /c/useful-scripts (master)
$ echo "alias gch=/c/useful-scripts/git/commit_helper.sh" >> ~/.bashrc
$ echo "alias gbu=/c/useful-scripts/git/branch_update.sh" >> ~/.bashrc
$ echo "alias gbc=/c/useful-scripts/git/branch_create.sh" >> ~/.bashrc
$ echo "alias gcb=/c/useful-scripts/git/branch_create.sh" >> ~/.bashrc
User@DESKTOP-QSKO7HF MINGW64 /c/useful-scripts (master)
$ cat ~/.bashrc
alias gch=/c/useful-scripts/git/commit_helper.sh
alias gbu=/c/useful-scripts/git/branch_update.sh
@Sekiphp
Sekiphp / gist:e82bf56427af6bd2106796d2d0f9a994
Created November 23, 2018 15:11
Count of lines in current dir
find . -type f | xargs cat | wc -l
tail -n0 -f ../logs/error.log | sed 's/\\n/\n/g'
var sumAdd = 0;
var sumRemoved = 0;
jQuery('.lines-added').each(function() {
sumAdd += parseInt((jQuery(this).html()), 10);
});
jQuery('.lines-removed').each(function() {
sumRemoved += parseInt((jQuery(this).html()), 10);
});
console.log(sumAdd);
console.log(sumRemoved);
@Sekiphp
Sekiphp / get-all-store-ids.txt
Created April 2, 2019 09:59
Magento 1 - get all active store IDS
$allStores = Mage::getModel('core/store')
->getCollection()
->addFieldToFilter('is_active', ['eq' => 1])
->getAllIds();
var_dump(implode(',', $allStores));
@Sekiphp
Sekiphp / Magento cron lister
Created June 18, 2019 08:56
This script lists all Magento cronjobs by this command: # clear && php /shell/cron_lister.php
<?php
require_once __DIR__ . '/../abstract.php';
/**
* @see https://gist.github.com/werdan/5827225
*/
class Mage_Shell_CronLister extends Mage_Shell_Abstract
{
public function run()