Skip to content

Instantly share code, notes, and snippets.

Avatar

Torben Köhn TorbenKoehn

View GitHub Profile
@TorbenKoehn
TorbenKoehn / address.json
Created Apr 22, 2022
Address Entity JSON-Schema
View address.json
{
"$schema": "https://schema.stackmeister.com/entities/address",
"type": "object",
"properties": {
"id": { "type": "integer", "maxLength": 11, "x-generated": true },
"streetName": { "type": "string", "maxLength": 200 }
}
}
View TransformationMatrix.js
export default class TransformationMatrix
{
a;
b;
c;
d;
tx;
ty;
View index.html
<div data-component="HelloWorld" data-props='{"what": "World!"}'></div>
View inheritance-vs-decorators-de.php
//Inheritance:
class ApiClient extends HttpClient
{
public function getUsers(): array
{
$this->options['my_option'] = stream_context_create(); //Man kann Unfug mit der Parent-Klasse treiben
View index.php
<?php
class Todo
{
private $description;
private $completed;
private $due;
public function __construct($description = '', $completed = 0, $due = 'tomorrow')
{
View jizz.html
<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 Oct 28, 2016
An example gulpfile.js to use Tale Jade with WordPress (or similar template engines)
View gulpfile.js
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
View q.js
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;
View p.js
function getAllProducts()
{
var p = new Promise(),
page = 1,
results = [];
@TorbenKoehn
TorbenKoehn / FastGrf.php
Created Sep 11, 2016
A class to quickly read Ragnarok Online's GRF Format and extract files from it. Supports version 0x200 and unencrypted files only.
View FastGrf.php
<?php
class FastGrf
{
private $files;
private $path;
private $handle;
public function __construct($path)