Skip to content

Instantly share code, notes, and snippets.

View digitalkaoz's full-sized avatar

Robert Schönthal digitalkaoz

View GitHub Profile
<?php
class EdmaParser implements Parser
{
const TYPE = 'EDMA attribute';
public function parse($source, array &$joins, array &$wheres, &$nos)
{
$attr = (int) $source['attribute'][$i];
$value = $source['valuei'][$i];
@digitalkaoz
digitalkaoz / version.h
Last active August 29, 2015 14:13
travis hhvm version.h
#ifndef incl_HHVM_VERSION_H
#define incl_HHVM_VERSION_H
#include <boost/preprocessor/stringize.hpp>
#define HHVM_VERSION_MAJOR 3
#define HHVM_VERSION_MINOR 4
#define HHVM_VERSION_PATCH 0
#define HHVM_VERSION_SUFFIX ""
@digitalkaoz
digitalkaoz / gulpfile.js
Created March 27, 2015 11:39
phpspec watcher with gulp
var gulp = require('gulp');
var shell = require('gulp-shell');
var plumber = require('gulp-plumber');
gulp.task('run', function() {
gulp.src('')
.pipe(plumber())
.pipe(shell('vendor/bin/phpspec run -fdot -v --stop-on-failure --ansi'))
;
});
@digitalkaoz
digitalkaoz / App.ts
Created June 18, 2015 07:23
Angular with Typescript - the React-Component-Style way...
import angular = require('angular');
import ModuleA from './components/moduleA/index';
class App {
name = 'myapp';
selector = '[ng-app]';
private mod: angular.IModule;
@digitalkaoz
digitalkaoz / code.php
Created September 11, 2015 08:01
Symfony Closure Controller
<?php
$routes = new RouteCollection();
$controller = function(Request $request) {
return new Response('foo');
};
$route = new Route('/foo', ['_controller' => $controller]);
@digitalkaoz
digitalkaoz / cmake.out
Last active September 24, 2015 07:22
Cmake Error building ext-zmq
In file included from /tmp/php-zmq-master/ext_zmq.cpp:18:0:
/tmp/php-zmq-master/ext_zmq-private.h: In constructor 'HPHP::zmq::ZMQSocketData::ZMQSocketData(HPHP::zmq::ZMQContextData*, int64_t, bool)':
/tmp/php-zmq-master/ext_zmq-private.h:113:7: warning: 'HPHP::zmq::ZMQSocketData::pid' will be initialized after [-Wreorder]
int pid;
^
/tmp/php-zmq-master/ext_zmq-private.h:111:8: warning: 'bool HPHP::zmq::ZMQSocketData::is_persistent' [-Wreorder]
bool is_persistent;
^
/tmp/php-zmq-master/ext_zmq.cpp:279:1: warning: when initialized here [-Wreorder]
ZMQSocketData::ZMQSocketData(ZMQContextData* ctx, int64_t type, bool isPersistent)
Verifying that +digitalkaoz is my blockchain ID. https://onename.com/digitalkaoz
@digitalkaoz
digitalkaoz / test.js
Created February 17, 2016 11:37
JS Array diffing with objects that respect duplicates
var _ = require('underscore');
var a = [{type: 'green'}];
var b = [{type: 'green'},{type: 'green'}];
var onlyInA = a.filter((current) => {
return b.filter((current_b) => {
return _.isEqual(current, current_b);
}).length == 0
{
"entity": {
"dynamic_templates": [
{
"time_string": {
"mapping": {
"format": "strict_date_time",
"index": "not_analyzed",
"type": "date"
},
@digitalkaoz
digitalkaoz / docker.logs
Created October 25, 2016 14:55
rabbitmq haproxy logstash logs
proxy_1 | [WARNING] 298/144827 (1) : Server amqp/rabbit is UP, reason: Layer4 check passed, check duration: 0ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
logstash_1 | {:timestamp=>"2016-10-25T14:48:30.597000+0000", :message=>"starting agent", :level=>:info}
logstash_1 | {:timestamp=>"2016-10-25T14:48:30.614000+0000", :message=>"starting pipeline", :id=>"main", :level=>:info}
proxy_1 | 00000000:amqp.accept(0006)=0007 from [172.18.0.5:40804]
rabbit_1 |
rabbit_1 | =INFO REPORT==== 25-Oct-2016::14:48:30 ===
rabbit_1 | accepting AMQP connection <0.587.0> (172.18.0.3:38038 -> 172.18.0.2:5672)
logstash_1 | {:timestamp=>"2016-10-25T14:48:30.881000+0000", :message=>"Connected to RabbitMQ at proxy", :level=>:info}
logstash_1 | {:timestamp=>"2016-10-25T14:48:31.064000+0000", :message=>"Starting pipeline", :id=>"main", :pipeline_workers=>2, :batch_size=>125, :batch_delay=>5, :max_inflight=>250, :level=>:info}
logstash_1 | {:timestamp=>"2016-10-25T14:48:31.080000+0