Skip to content

Instantly share code, notes, and snippets.

View croensch's full-sized avatar
🤠
out there

croensch

🤠
out there
  • Hella Gutmann Solutions
  • Freiburg im Breisgau, Germany
View GitHub Profile
@croensch
croensch / all.php
Last active December 8, 2022 21:48
PHP haltig engine warnings to PHPStan levels
<?php
/**
* https://wiki.php.net/rfc/engine_warnings
*/
// old-Level: Message > new-Level | phpstan-level
#$o = null;
// Warning: Creating default object from empty value > Error: Attempt to assign property "p" on null | 2
#$o->p = 0;

XML Schema Best Practices for Databinding

empty elements

Most programming languages implement unitialized values as NULL, ZERO, random data, something special (JavaScript: undefined) or an empty string. In XML an element can be empty in two ways and in DOM the textContent property is an empty string for both.

Valid examples:

<TodoItem/>
@croensch
croensch / 20200210.txt
Last active March 10, 2020 00:37
amazon-linux-extras
0 ansible2 available \
[ =2.4.2 =2.4.6 =2.8 =stable ]
1 *emacs=latest enabled [ =25.3 ]
2 httpd_modules available [ =1.0 ]
3 memcached1.5 available \
[ =1.5.1 =1.5.16 =1.5.17 ]
4 *nginx1.12=latest enabled [ =1.12.2 ]
5 postgresql9.6 available [ =9.6.6 =9.6.8 ]
6 postgresql10 available [ =10 ]
7 *python3=latest enabled [ =3.6.2 ]

Anzeigen

Eine Route und Template show erstellen mit

  • Titel als <H/>
  • Inhalt als <div/>

Die ID soll übergeben (/show/1) und geladen (SELECT * FROM page WHERE id = 1) werden.

Speichern

@croensch
croensch / Dockerfile
Created January 30, 2019 08:25
uopz101
FROM amazonlinux:2
RUN amazon-linux-extras install epel
RUN amazon-linux-extras install php7.2=7.2.13
RUN yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm && \
yum install -y yum-utils && \
yum-config-manager --enable remi-safe
RUN yum install -y --enablerepo=remi-php72 php-mbstring php-pecl-libsodium
RUN yum install -y --enablerepo=remi-php72 php-pecl-uopz-5.1.0
@croensch
croensch / c.php
Last active January 24, 2018 21:14
<?php
$c = curl_init();
curl_setopt_array($c, array(
CURLOPT_URL => $argv[1],
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_VERBOSE => true
));
$r = curl_exec($c);
if (curl_errno($c)) {
die(curl_error($c));
@croensch
croensch / create.cmd
Created July 24, 2012 20:58
FLVExtract/MP4Creator: create (FLV to AAC to M4A)
@echo off
SETLOCAL EnableDelayedExpansion
SET TOOL=mp4creator.exe
SET WD=%CD%
SET /P WD="%WD%\"
FOR /R "%WD%" %%F IN (*.aac) DO (
echo ================================================================
echo %%~dpnF.m4a
echo ----------------------------------------------------------------
%~dp0%TOOL% -create="%%~dpnF.aac" "%%~dpnF.m4a"
@croensch
croensch / firebug-console-dummy.js
Created June 21, 2012 09:05
Firebug Console Dummy
/**
* Firebug Console
*/
(function (window) {
"use strict";
if (window.console) {
return;
}
function fn() {
}
@croensch
croensch / FirebugDoctrineLogger.php
Created June 12, 2012 12:27 — forked from snichme/gist:789589
A Doctrine logger for FireBug(FirePHP)
<?php
/**
* Doctrine logger for FireBug
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Magnus Andersson <mange@mange.name>
* @author Christoph Roensch
*
* @link https://gist.github.com/2917214
*/