Skip to content

Instantly share code, notes, and snippets.

View Mararok's full-sized avatar
🎯
Focusing

Mararok Mararok

🎯
Focusing
View GitHub Profile
<some json with value with \r\n>| jq . | sed 's/\\r\\n/\n/g'
@Mararok
Mararok / Dockerfile
Created March 17, 2017 05:52
phpfpm LB nginx docker
FROM php:7.0.16-fpm-alpine
COPY . /app
FROM php:7-cli
RUN apt-get update && apt-get install -y curl git libzmq3-dev php-pear \
&& docker-php-ext-install opcache \
&& docker-php-ext-install mbstring
RUN pecl install zmq-beta
#COMPOSER
RUN curl -sS https://getcomposer.org/installer | php
@Mararok
Mararok / epl_test1
Last active January 23, 2017 09:16
create schema mailing_opened(user_id string, time integer);
create schema mailing_clicked(user_id string, time integer);
create schema opened_and_clicked(user_id string, open_time integer, click_time integer, time_from_open_to_click integer);
@Name('detected_opened_and_clicked')
insert into opened_and_clicked select a2.user_id as user_id, a1.time as open_time, a2.time as click_time, (a2.time - a1.time) as time_from_open_to_click from pattern [((every a1 = mailing_opened) -> a2 = mailing_clicked(a2.user_id = a1.user_id) where timer:within(50 seconds))]
----------------------------------
mailing_opened={user_id='1', time=100}