Skip to content

Instantly share code, notes, and snippets.

Tim Strehle tistre

Block or report user

Report or block tistre

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View TestQueuePublishCommand.php
namespace App\Command;
use App\Module\ModuleList;
use \Exception;
use App\Event\ElvisJob;
use App\Queue\ElvisJobQueue;
use App\Queue\QueueServerConfig;
use Psr\Log\LoggerInterface;
tistre / asset-ingestion.bpmn
Last active Nov 29, 2019
Simple Camunda example: Handling external tasks with PHP
View asset-ingestion.bpmn
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="" xmlns:bpmndi="" xmlns:di="" xmlns:dc="" xmlns:camunda="" xmlns:xsi="" id="Definitions_0w41w6f" targetNamespace="" exporter="Camunda Modeler" exporterVersion="1.16.2">
<bpmn:process id="asset-ingestion" name="Asset Ingestion" isExecutable="true">
<bpmn:startEvent id="StartEvent_1" name="Asset to be ingested">
<bpmn:sequenceFlow id="SequenceFlow_16kf6eb" sourceRef="StartEvent_1" targetRef="extract-metadata" />
<bpmn:serviceTask id="extract-metadata" name="Extract metadata" camunda:type="external" camunda:topic="asset-extract-metadata">
tistre / js-component-demo-dcc-components.js
Created Feb 16, 2017
Simplistic JavaScript component architecture demo
View js-component-demo-dcc-components.js
/* A sample "Die" component using the "library" */
* Create a "Die" component instance
* Creates an anonymous object you can only interact with using events.
* @param object config componentConfig.config object from the component JSON data
* @constructor
tistre / intldateformatter_error_handling.php
Last active Dec 7, 2015
Lack of error handling in IntlDateFormatter::localtime()
View intldateformatter_error_handling.php
// Correct input value:
// $value = 'Wednesday, December 18, 2014 4:05:06 PM PT';
// Wrong input value that I suppose should rather return false:
$value = 'XXX';
$formatter = new IntlDateFormatter
tistre / planetdam_easyrdf_demo.php
Created Jul 10, 2015
Minimal example for parsing RDF/XML using EasyRDF
View planetdam_easyrdf_demo.php
Minimal example for parsing article list RDF/XML
1) Install Composer, see :
curl -s | php
tistre / charcheck.php
Created May 29, 2015
Check files for Unicode U+00A0 No-Break Space
View charcheck.php
// Find invisible non-breaking spaces in source code
// which can cause errors in PHP and JavaScript.
// see:
// Usage:
// php charcheck.php path/to/*.php
// or:
tistre / test.js
Last active Aug 29, 2015
How I do private and public in JavaScript. No “this”, no “new”! Drawback compared to .prototype: Objects hold copies of functions.
View test.js
// Factory function
var Greeter = function(config)
// Hold public and private variables and functions in two objects:
var _public = { };
var _private = { };
// Storing "constructor" parameters in a private variable
tistre / ie_upload.php
Last active Aug 29, 2015
Internet Explorer 9 and 10 do not submit the form if a file input click has been triggered
View ie_upload.php
<script src="//"></script>
if (isset($_FILES[ 'file' ]) && isset($_FILES[ 'file' ][ 'tmp_name' ]) && is_uploaded_file($_FILES[ 'file' ][ 'tmp_name' ]))
tistre / gist:575ef1f0220097c7a585
Last active Aug 29, 2015
jQuery.Deferred(): If an array contains promises, replace them with the real value once resolved
View gist:575ef1f0220097c7a585
// Usage:
// resolvePromisesInArray(values_with_promises).then(function(values_resolved)
// { console.log(values_resolved); });
function resolvePromisesInArray(values)
var deferred, deferred_values;
if (! $.isArray(values))
tistre / cookies_from_raw_http_response.php
Created Apr 7, 2014
Parse cookies from raw HTTP response using PHP’s pecl_http
View cookies_from_raw_http_response.php
$msg = <<<EOT
HTTP/1.1 200 OK
Date: Mon, 07 Apr 2014 08:29:07 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.20
Set-Cookie: dcx_app_trunk=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/dcx_trunk/
Set-Cookie: dcx_app_trunk=33mnkpiau2s80uhrtb7a105l23; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
You can’t perform that action at this time.