Skip to content

Instantly share code, notes, and snippets.

View TorbenKoehn's full-sized avatar

Torben Köhn TorbenKoehn

View GitHub Profile
@TorbenKoehn
TorbenKoehn / address.json
Created April 22, 2022 21:07
Address Entity JSON-Schema
{
"$schema": "https://schema.stackmeister.com/entities/address",
"type": "object",
"properties": {
"id": { "type": "integer", "maxLength": 11, "x-generated": true },
"streetName": { "type": "string", "maxLength": 200 }
}
}
@TorbenKoehn
TorbenKoehn / semantic-ui-form-theme.html.twig
Created July 29, 2016 07:09
Symfony/Twig Semantic UI Form Theme
{% use 'form_div_layout.html.twig' %}
{% block form_start -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' ui form')|trim}) %}
{{- parent() -}}
{%- endblock form_start %}
{# Widgets #}
{% block form_widget_simple -%}
@TorbenKoehn
TorbenKoehn / TransformationMatrix.js
Created August 23, 2019 22:07
2D-affine matrices
export default class TransformationMatrix
{
a;
b;
c;
d;
tx;
ty;
@TorbenKoehn
TorbenKoehn / index.html
Created August 21, 2019 19:11
react-ui.ts
<div data-component="HelloWorld" data-props='{"what": "World!"}'></div>
//Inheritance:
class ApiClient extends HttpClient
{
public function getUsers(): array
{
$this->options['my_option'] = stream_context_create(); //Man kann Unfug mit der Parent-Klasse treiben
<?php
class Todo
{
private $description;
private $completed;
private $due;
public function __construct($description = '', $completed = 0, $due = 'tomorrow')
{
@TorbenKoehn
TorbenKoehn / StringUtil.php
Created August 27, 2015 14:30
StringUtil class of the Tale Framework. Standalone. Provides useful string utilities and ruby-style string inflections for PHP
<?php
/**
* Tale\StringUtil - The Tale Framework
*
* @version 1.0
* @status Beta
* @author Torben Köhn <t.koehn@outlook.com>
*
* This software is distributed under the MIT license.
* A copy of the license has been distributed with this software.
@TorbenKoehn
TorbenKoehn / Path.php
Last active May 15, 2018 12:49
Path manipulation class for PHP frameworks (not fully tested)
<?php
namespace Dwarf;
class Path extends Object implements \IteratorAggregate, \Countable {
protected $path;
public function __construct( $path ) {
@TorbenKoehn
TorbenKoehn / FastGrf.php
Created September 11, 2016 15:16
A class to quickly read Ragnarok Online's GRF Format and extract files from it. Supports version 0x200 and unencrypted files only.
<?php
class FastGrf
{
private $files;
private $path;
private $handle;
public function __construct($path)
<table>
<thead>
<tr>
<th>Header 1
<th>Header 2
<th>Header 3
<th>Header 4
<tbody>
<tr>
<td>Content 1