Skip to content

Instantly share code, notes, and snippets.

@jbrains
jbrains / 1-GraftNextCommitIfAny.sh
Last active July 23, 2017 17:56
Extract subproject from git repository by grafting commits onto the corresponding files
# CONTRACT
# SOURCE_SUBPRPOJECT_ROOT points to the "same" directory tree
# as TARGET_PROJECT_ROOT. We're extracting the directory tree
# at SOURCE_SUBPROJECT_ROOT into TARGET_PROJECT_ROOT.
#
# There must be a single, linear history in the SOURCE repository.
# Graft the current commit into the target
pushd "$SOURCE_SUBPROJECT_ROOT"
commit_comment="$(git log -1 --pretty=%B)"
@Schrank
Schrank / getMagentoPatches.php
Created November 1, 2015 20:51
Download all magento patches (once), and sort them into the correct directory, so you have all patches for a single version by hand.
class PatchDownloader
{
/**
* @var string
*/
private $infoUrl = "https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/filter/version/";
/**
* @var string
*/
private $downloadUrl = "https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/file/";
@piotrekkaminski
piotrekkaminski / gist:9bc45ec84028611d621e
Last active August 8, 2023 08:38
How to automatically download patches and release of Magento
1) First you need to generate download token. Login to your account on magento.com and generate it in Account Settings->Downloads Access Token
2) You will need your MAGEID as well. It is shown at the top-left in your account page.
3) curl -k https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/help
4) Profit!
@amenk
amenk / gist:68bd91e9dfc469891f1f
Created October 29, 2014 14:01
Make PHP Fatal Errors Clickable to Jump to the File in PHPStorm
xdebug.file_link_format="javascript:var rq = new XMLHttpRequest(); rq.open(\"GET\", \"http://localhost:8091?message=%f:%l\", true); rq.send(null);"
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
@mathiasverraes
mathiasverraes / phplint.sh
Created July 12, 2012 07:42
Recursive PHP Lint script
#!/bin/bash
for file in `find .`
do
EXTENSION="${file##*.}"
if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ]
then
RESULTS=`php -l $file`