Skip to content

Instantly share code, notes, and snippets.

View Thinkscape's full-sized avatar

Arthur Bodera Thinkscape

View GitHub Profile
@Thinkscape
Thinkscape / mtr.txt
Created July 2, 2015 10:28
mtr -c 30 --report 5.135.99.110
Start: Thu Jul 2 11:25:00 2015
HOST: Sombrero-3.local Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.100.84.1 0.0% 30 1.2 3.3 1.1 23.9 5.1
2.|-- 84.207.252.3.not-updated. 0.0% 30 1.1 1.1 0.9 2.6 0.3
3.|-- 217.112.154.169.not-updat 0.0% 30 7.2 9.4 7.0 47.8 7.5
4.|-- ??? 100.0 30 0.0 0.0 0.0 0.0 0.0
5.|-- rbx-g2-a9.fr.eu 0.0% 30 16.7 17.1 16.2 18.3 0.3
6.|-- rbx-s5-6k.fr.eu 0.0% 30 51.9 19.3 15.7 55.5 9.5
7.|-- 5.135.99.110 0.0% 30 16.1 17.4 16.0 29.4 3.2
@Thinkscape
Thinkscape / gist:4a414653a7945d315f36
Created March 10, 2015 14:52
DoctrineORMModule issue #383
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1130] Host 'REDACTED' is not allowed to connect to this MySQL server' in /Users/Thinkscape/Documents/Projects/REDACTED/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 909
PDOException: SQLSTATE[HY000] [1130] Host 'REDACTED' is not allowed to connect to this MySQL server in /Users/Thinkscape/Documents/Projects/REDACTED/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 43
Call Stack:
0.0002 227872 1. {main}() /Users/Thinkscape/Documents/Projects/REDACTED/shell:0
0.0004 231880 2. include('/Users/Thinkscape/Documents/Projects/REDACTED/public/index.php') /Users/Thinkscape/Documents/Projects/REDACTED/shell:4
0.0037 525376 3. Zend\Mvc\Application::init() /Users/Thinkscape/Documents/Projects/REDACTED/public/index.php:10
0.0605 4600776 4. Zend\Mvc\Application->bootstrap() /Users/Thinkscape/Documents/Projects/REDACTED/vendor/zendframework/
@Thinkscape
Thinkscape / flattenExceptionBacktrace.php
Last active December 28, 2023 12:28
Make any PHP Exception serializable by flattening complex values in backtrace.
<?php
function flattenExceptionBacktrace(\Exception $exception) {
$traceProperty = (new \ReflectionClass('Exception'))->getProperty('trace');
$traceProperty->setAccessible(true);
$flatten = function(&$value, $key) {
if ($value instanceof \Closure) {
$closureReflection = new \ReflectionFunction($value);
$value = sprintf(
'(Closure at %s:%s)',
@Thinkscape
Thinkscape / Ext.bugfix.GridFilterBase.js
Last active August 29, 2015 14:07
Add support for configurable filter "property"
/**
* Add support for configurable filter "property"
*/
Ext.define('Ext.bugfix.GridFilterBase', {
override: 'Ext.grid.filters.filter.Base',
config: {
/**
* @cfg {String} property
* The property name to use when creating a filter
@Thinkscape
Thinkscape / Ext.bugfix.BufferedRender.js
Created October 9, 2014 08:11
Work around trees/grids that will not render correctly in case they are hidden from the view (i.e. in a Tab) but data has changed.
/**
* Work around trees/grids that will not render correctly in case they are hidden from the view (i.e. in a Tab) but
* data has changed.
*/
Ext.define('Ext.bugfix.BufferedRenderer', {
override: 'Ext.grid.plugin.BufferedRenderer',
getLastVisibleRowIndex: function() {
var result = this.callParent(arguments);
@Thinkscape
Thinkscape / Ext.bugfix.Reader.js
Last active August 29, 2015 14:06
Fix reading of entities containing "length" property.
/**
* Fix reading of entities containing "length" property
*
* @link http://www.sencha.com/forum/showthread.php?292395-data.Reader-throwing-exception-when-model-contains-quot-length-quot-field.&p=1067807
* @link https://fiddle.sencha.com/#fiddle/at6
*/
Ext.define('Ext.bugfix.Reader', {
override: 'Ext.data.reader.Reader',
extractData: function(root, readOptions) {
@Thinkscape
Thinkscape / Ext.bugfix.GridFilterDate.js
Created September 24, 2014 11:38
Allow configurable filter date format in Ext.grid.filters.filter.Date
/**
* Allow configurable date format when creating a store filter.
*
* To set a global default app-wise, include this fix and use something like:
*
* Ext.grid.filters.filter.Date.prototype.dateWriteFormat = 'c';
*
*/
Ext.define('Ext.bugfix.GridFilterDate', {
override: 'Ext.grid.filters.filter.Date',
@Thinkscape
Thinkscape / getRandomDoctrineItem.php
Last active November 25, 2015 11:59
Get random item from Doctrine2 repository
<?php
use Doctrine\ORM\EntityManager;
/**
* Retrieve one random item of given class from ORM repository.
*
* @param EntityManager $em The Entity Manager instance to use
* @param string $class The class name to retrieve items from
* @return object
*/
@Thinkscape
Thinkscape / speedTest.php
Last active August 29, 2015 13:56
PHP-based cpu speed test. It'll attempt to detect number of cpu cores available and run PI calc.
<?php
/**
* Usage:
*
* php speedTest.php [ITERATIONS] [CONCURRENCY]
*
* ITERATIONS - (optional) Number of iterations (PI digits) to compute.
* Values above 10000 can seriously hog your machine.
* CONCURRENCY - (optional) Number of CPU cores to use. If empty,
* it's going to attempt to detect the number.
@Thinkscape
Thinkscape / tooltipGroup.js
Last active August 29, 2015 13:56
tooltip-group support for angular-strap
module.directive('tooltipGroup', [
var popoverRegistry = {};
var suspend = false; // semaphore used to prevent circular calling of hide triggers
function(){
return {
restrict : 'A',
priority : 1,
link : {
pre : function ($scope, el, attrs, formCtrl) {
// $scope.artifactPickerSelectOptions = artifactPicker.getSelectOptions();