Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Klingenberg ktomk

  • lastflood GmbH (et al.)
View GitHub Profile
@ktomk
ktomk / bitbucket_load_all_diffs.js
Created Oct 1, 2019 — forked from asev/bitbucket_load_all_diffs.js
Bitbucket load all diffs in pull request
View bitbucket_load_all_diffs.js
/* Add this line to bookmarks and use when you see
* "Oops! You've got a lot of code in this diff and it couldn't load with the page."
* on a pull request at Bitbucket.
*/
javascript:(function(){[].forEach.call(document.querySelectorAll(".load-diff"),function(a){a.click()})})();
View phpunit-5-class-names.txt
PHPUnit_Extensions_TicketListener
PHPUnit_Extensions_PhptTestSuite
PHPUnit_Extensions_TestDecorator
PHPUnit_Extensions_RepeatedTest
PHPUnit_Extensions_PhptTestCase
PHPUnit_Extensions_GroupTestSuite
PHPUnit_Util_Printer
PHPUnit_Util_Test
PHPUnit_Util_Configuration
PHPUnit_Util_Blacklist
View git-fix-executables.sh
#!/bin/bash
#
# de-execute all executable files that are either zero width or don't have a shebang (Magic Line)
#
# note: no explicit non-binary check ( -not -exec grep -vIq . "{}" \; )
#
echo -n "before: "; find . \( -name '.git' -o -name 'bin' \) -prune -o -type f -executable -print | wc -l
find . \( -name '.git' -o -name 'bin' \) -prune -o -type f -executable \
@ktomk
ktomk / EXAMPLE
Last active Feb 28, 2017
check di.xml files for wrongfully FQCNs
View EXAMPLE
$ php -f magento2/check.php -- magento2/www
magento2/www/vendor/magento/module-wishlist/etc/di.xml (3):
- /config/preference[1]/@type on line 9: \Magento\Wishlist\Model\AuthenticationState
- /config/preference[2]/@type on line 10: \Magento\Wishlist\Controller\WishlistProvider
- /config/type[3]/plugin/@type on line 22: \Magento\Wishlist\Controller\Index\Plugin
magento2/www/vendor/magento/module-catalog/etc/di.xml (7):
- /config/type[43]/plugin/@type on line 382: \Magento\Catalog\Model\Plugin\ShowOutOfStockConfig
- /config/preference[40]/@type on line 459: \Magento\Catalog\Model\ProductLink\Attribute
- /config/preference[44]/@type on line 463: \Magento\Catalog\Model\CategoryLinkManagement
- /config/preference[47]/@type on line 466: \Magento\Catalog\Model\CategoryLinkRepository
@ktomk
ktomk / git-bl.sh
Last active Apr 20, 2016
gitbl - git branch list : review all non master / develop branches, sortable-by-time
View git-bl.sh
#!/bin/bash
git_list_branches()
{
git branch | awk -F ' +' '! /^\(no branch\)|master|develop$/ {print $2}' | sort
}
git_contains_branches()
{
git branch --contains "${1}" | awk -F ' +' '! /^\(no branch\)$/ {print $2}' | sort
View PHPUnit_ExceptionTrap.php
<?php
class PHPUnit_ExceptionTrap
{
/**
* @var PHPUnit_Framework_TestCase
*/
private $testCase;
/**
@ktomk
ktomk / download.sh
Last active Nov 4, 2015 — forked from tkn98/download.sh
download job for not yet mirrored magento installs
View download.sh
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
wget -nc https://github.com/OpenMage/magento-mirror/archive/1.9.1.1.zip
wget -nc https://github.com/OpenMage/magento-mirror/archive/1.9.1.0.zip
wget -nc https://github.com/OpenMage/magento-mirror/archive/1.9.0.1.zip
wget -nc https://github.com/OpenMage/magento-mirror/archive/1.8.1.0.zip
wget -nc https://github.com/ktomk/magento-mirror/archive/1.8.0.0.zip
wget -nc https://github.com/OpenMage/magento-mirror/archive/1.9.1.1.tar.gz
@ktomk
ktomk / session_id_validator_fragment.php
Created Oct 7, 2011
Validate a PHP session id string
View session_id_validator_fragment.php
<?php
/**
* validate string session id
*
* @see http://www.devnetwork.net/viewtopic.php?f=34&t=88685#p520259
*
* @param string $sessionId
* @return bool
*/
public function isValidId($sessionId)
@ktomk
ktomk / valid_utf8_bytes.php
Created Oct 4, 2011
filter valid utf-8 byte sequences
View valid_utf8_bytes.php
<?php
/**
* filter valid utf-8 byte sequences
*
* take over all valid bytes, drop an invalid sequence until first
* non-matching byte, start over at that byte.
*
* @param string $str
* @return string
*/
@ktomk
ktomk / str_ureplace.php
Created Jul 6, 2011
str_ureplace - str_replace with callback functions
View str_ureplace.php
<?php
/**
* str_ureplace
*
* str_replace like function with callbacks for replacement(s).
*
* @param string|array $search
* @param callback|array $replace
* @param string|array $subject
* @param int $replace_count
You can’t perform that action at this time.