Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tmotyl's full-sized avatar

Tymoteusz Motylewski tmotyl

View GitHub Profile
@tmotyl
tmotyl / gist:9326858
Last active August 29, 2015 13:56
running vfsStream unit tests on hhvm
vagrant@vagrant-ubuntu-saucy-64:~/www/vfsStream2$ hhvm --version
HipHop VM 2.5.0-dev+2014.03.02 (rel)
Compiler: heads/master-0-g1bec21ab61a63c2566f74aa2d33685c41b094877
Repo schema: 000646af7d947de73424840e621fc2e8e1a64505
Segmentation fault (core dumped)
vagrant@vagrant-ubuntu-saucy-64:~/www/vfsStream2$
vagrant@vagrant-ubuntu-saucy-64:~/www/vfsStream2$ hhvm phpunit.phar -c phpunit.xml.dist
PHPUnit 3.7.32 by Sebastian Bergmann.
@tmotyl
tmotyl / hhvmTYPO3compat
Created April 28, 2014 08:15
Comment out some methods from TYPO3 interfaces for HHVM compatibility
diff --git a/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageInterface.php b/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageInterface.php
index ad41b07..3cd087b 100644
--- a/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageInterface.php
+++ b/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageInterface.php
@@ -34,7 +34,7 @@ interface PackageInterface {
* @param \TYPO3\Flow\Core\Bootstrap $bootstrap The current bootstrap
* @return void
*/
- public function boot(\TYPO3\Flow\Core\Bootstrap $bootstrap);
+// public function boot(\TYPO3\Flow\Core\Bootstrap $bootstrap);
@tmotyl
tmotyl / testResults
Created April 28, 2014 09:19
TYPO3 on HHVM test results
vagrant@vagrant-ubuntu-saucy-64:~/www/TYPO3.CMS$ hhvm ./bin/phpunit -c typo3/sysext/core/Build/UnitTests.xml
PHPUnit 3.7.35 by Sebastian Bergmann.
Configuration read from typo3/sysext/core/Build/UnitTests.xml
...............................................EEFEEEEEEEE.EE 61 / 6458 ( 0%)
FFFFFFFFFFFFFFFFFFFFFFFF............FFFFFFFFFFFFFFFFFFFFFFFFE 122 / 6458 ( 1%)
EEEEE.EESSSSSSSSSSSSSS...............SSSSSSSSSSSSSSSSSSSSSSSS 183 / 6458 ( 2%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS............................ 244 / 6458 ( 3%)
.........SSSSSSSSSSSSSSSSSSSSSSSSSS.......................... 305 / 6458 ( 4%)
@tmotyl
tmotyl / hhvm_test_runner_TYPO3_results
Created May 9, 2014 14:14
HHVM test runer results for TYPO3
This file has been truncated, but you can view the full file.
Script running...Be patient as some frameworks take a while with a debug build of HHVM
typo3 already installed.
0 files were blacklisted (auto fail) typo3...
0 files were clownylisted (no-op/no run) typo3...
Using phpunit xml file in: /home/vagrant/dev/hhvm/hphp/test/frameworks/framework_downloads/typo3/typo3/sysext/core/Build/UnitTests.xml
General test command for: typo3 is: hhvm -v Repo.Local.Mode=-- -v Repo.Central.Path=/tmp/framework-testxt0FPh --config /home/vagrant/dev/hhvm/hphp/test/frameworks/config.hdf --config /home/vagrant/dev/hhvm/hphp/test/frameworks/php.ini /home/vagrant/dev/hhvm/hphp/test/frameworks/framework_class_overrides/../framework_downloads/typo3/bin/phpunit --debug -c /home/vagrant/dev/hhvm/hphp/test/frameworks/framework_downloads/typo3/typo3/sysext/core/Build/UnitTests.xml 2>&1
typo3: running. Comparing against 3043 tests
Comparing test suite with previous run. Green . (dot) means test result same as previous. A  green F means we have gone from fail to
@tmotyl
tmotyl / uniqid
Last active August 29, 2015 14:02
Uniqid performance
$start = microtime(true);
for ($i = 0; $i < 50000; $i++) { uniqid("NEW"); }
$stop = microtime(true);
$result = $stop-$start;
echo "50000: " . $result . "s\n";
echo "1op " . $result / 50000 . "s\n";

Paths

/var/www/site/ /var/www/site/app /var/www/site/web - webroot

Configuration and ports:

@tmotyl
tmotyl / gist:d2c26fcc2f3776f99b68
Last active August 29, 2015 14:23
Magento EAV health check
#Check if product eav tables contain values only for product entity_type_id =10 (no results == OK)
SELECT 'catalog_product_entity_datetime', entity_type_id, attribute_id, value FROM catalog_product_entity_datetime
where entity_type_id <> 10
union SELECT 'catalog_product_entity_decimal', entity_type_id, attribute_id, value FROM catalog_product_entity_decimal
where entity_type_id <> 10
union SELECT 'catalog_product_entity_int', entity_type_id, attribute_id, value FROM catalog_product_entity_int
where entity_type_id <> 10
union SELECT 'catalog_product_entity_text', entity_type_id, attribute_id, value FROM catalog_product_entity_text
where entity_type_id <> 10
C{
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <arpa/inet.h>
}C
C{
//
// This is a hack from Igor Gariev (gariev hotmail com):
@tmotyl
tmotyl / 0_reuse_code.js
Created July 14, 2016 16:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tmotyl
tmotyl / integrity checks
Last active November 22, 2016 12:32
TYPO3 database integrity check
1. t3_origuid should not be equal to uid of the record
- potential fix - if a record has l10n_parent set, set t3_origuid set to the value of l0n_parent
2. l10n_parent should contain uid of record in default language only
3. // pid != pid parent
//uid == l10n_parent
//record in default language having l18n set
live records with t3ver_oid set ?