Skip to content

Instantly share code, notes, and snippets.

View brannow's full-sized avatar

Benjamin brannow

  • Magdeburg, Germany
  • 19:01 (UTC +02:00)
View GitHub Profile
<?php declare(strict_types=1);
function curlSingle(string $url, callable $block)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$result = curl_exec($ch);
$chInfo = curl_getinfo($ch);
if ($chInfo['http_code'] === 200) {
@brannow
brannow / notice_benchmark.php
Last active May 7, 2018 15:38
Performance lost form invalid array offests and indexes
<?php declare(strict_types=1);
// disable error logging
error_reporting(0);
// disable error display
ini_set("display_errors", '0');
function generateSmallNumericTestArray(): array
{
$ta = [];
@brannow
brannow / TempSensor.cs
Created January 22, 2018 15:05
C# USB Temperature Sensor Tester Interface for DS18B20
// see: https://github.com/mikeobrien/HidLibrary/tree/master/src/HidLibrary
using HidLibrary;
using System;
using System.Linq;
using System.Runtime.InteropServices;
namespace Environment.HardwareData.SensorData
{
class TempSensor
{
@brannow
brannow / TCASelectItems_performance_increase_IRRE.patch
Created November 1, 2017 10:58
TYPO3 8.7 IRRE Performance Increase
Index: cms/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- cms/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php (revision )
+++ cms/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php (revision )
@@ -43,6 +43,11 @@
continue;
}