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 / 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')
{
<table>
<thead>
<tr>
<th>Header 1
<th>Header 2
<th>Header 3
<th>Header 4
<tbody>
<tr>
<td>Content 1
@TorbenKoehn
TorbenKoehn / gulpfile.js
Created October 28, 2016 10:27
An example gulpfile.js to use Tale Jade with WordPress (or similar template engines)
var gulp = require('gulp'),
exec = require('gulp-exec');
var templateFiles = [
'wp-content/themes/my-theme/index.jade',
'wp-content/themes/my-theme/page.jade',
'wp-content/themes/my-theme/page-single.jade',
'wp-content/themes/my-theme/archive.jade',
//All other template files
var deferred = Q.defer();
FS.readFile("foo.txt", "utf-8", function (error, text) {
if (error) {
deferred.reject(new Error(error));
} else {
deferred.resolve(text);
}
});
return deferred.promise;
function getAllProducts()
{
var p = new Promise(),
page = 1,
results = [];
@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)