Skip to content

Instantly share code, notes, and snippets.


Matthias Gutjahr mattsches

View GitHub Profile
View laravel facades

Found an example there is a thing in laravel called FormRequest. Sometimes, I need extra validation. So I need to use some service there somehow. What options I have

  1. facade
  2. service locator via app() global function
  3. I also have instance of container there via $this->container

which one is the best here? I suppose instance of container

I can't do constructor injection. Why? Because for me, it seams that there are too many arguments on the __construct method

mattsches / configuration.yaml
Created May 8, 2017
Beispiel für RESTful Sensor in Home Assistant zur Abfrage des API
View configuration.yaml
- platform: rest
value_template: >
{% if value_json is sequence %}
{% set sensor = value_json | last %}
{% else %}
{% set sensor = value_json %}
{% endif %}
{% for sdv in sensor.sensordatavalues %}
View luftdatenapi.php
* Class LuftdatenApi
class LuftdatenApi
const BASE_URL = '';
mattsches / Album.php
Created Apr 24, 2016
Example entity for DoctrineRestDriver issue
View Album.php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
* This annotation marks the class as managed entity:
* @ORM\Entity
mattsches / .filelist.txt
Created Dec 13, 2015
Liste von PHP-Dateien der Fotoverwaltung Lychee, die von Phan in dieser Reihenfolge eingelesen werden sollen.
View .filelist.txt
mattsches / cors-test.html
Created Sep 20, 2015
Test page with description on how to test my pull request to the Calendar+ OwnCloud app.
View cors-test.html
<!DOCTYPE html>
<meta charset="utf-8" />
<title>OwnCloud Calendar+ CORS Test</title>
<script type="text/javascript">
var calendarICS = "###CALENDARICSURL###",
request = new XMLHttpRequest();'GET', calendarICS, true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
mattsches / php_functions_frequencies.json
Created Mar 15, 2015
Frequency of internal PHP functions found on GitHub
View php_functions_frequencies.json

Keybase proof

I hereby claim:

  • I am mattsches on github.
  • I am mattsches ( on keybase.
  • I have a public key whose fingerprint is F4D4 C888 055A 44C3 A5C3 33AB A8E6 AF25 C59F 4A27

To claim this, I am signing this object:

mattsches / fritzbox.ini
Created Nov 1, 2013
Sample Config, um mit der FRITZ!Box 7320 (Firmware-Version: 100.05.51) einen VPN-Tunnel aufzubauen. Mehr in meinem Blogpost unter!Box-7320-und-Linux.html
View fritzbox.ini
vpncfg {
connections {
enabled = yes;
conn_type = conntype_user;
name = "MEINVPN";
always_renew = no;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip =;
local_virtualip =;
mattsches /
Last active Dec 20, 2015 — forked from onli/
Added charset to connection adapter
use Zend\Db\Sql\Sql;
use Zend\Db\Sql\Select;
use Zend\Db\Adapter\Adapter;
$result = null;
* Tells the DB Layer to start a DB transaction.
* @access public