Skip to content

Instantly share code, notes, and snippets.

@attozk
attozk / gist:e01e6ba24b0113ded54fe978f244d31c
Created September 24, 2016 03:55
ElasticSearch GeoPolygon Drawing Utility
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>ElasticSearch GeoPolygon Drawing Utility</title>
<style>
html, body {
height : 100%;
margin : 0;
client
dev tun1
proto tcp
remote 37.187.239.39 80
resolv-retry infinite
nobind
persist-key
persist-tun
auth-user-pass
comp-lzo
client
dev tun0
proto udp
remote 37.187.239.39 53
resolv-retry infinite
nobind
persist-key
persist-tun
auth-user-pass
comp-lzo
@attozk
attozk / gist:a63b9d115aa84c2fd1fd
Created November 14, 2014 18:31
understanding php memory GC with diff var name
// comparing against https://gist.github.com/attozk/5727bad9e621dbca4615
<?php
$loader = include __DIR__ . '/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$counter = 0;
$timer = $loop->addPeriodicTimer(10, function() use(&$timer, &$counter) {
$counter++;
@attozk
attozk / gist:5727bad9e621dbca4615
Created November 14, 2014 18:27
understanding php memory GC with same var
<?php
$loader = include __DIR__ . '/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$counter = 0;
$timer = $loop->addPeriodicTimer(10, function() use(&$timer, &$counter) {
$counter++;
if ($counter > 1 && $counter <= 5) {
@attozk
attozk / gist:e77987fd01488db836b6
Last active August 29, 2015 14:09
Evenement not freeing up memory?
<?php
$loader = include __DIR__ . '/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$counter = 0;
$timer = $loop->addPeriodicTimer(10, function() use(&$timer, &$counter) {
$counter++;
$type = 'None';
@attozk
attozk / gist:5ddf1e4acb6f76f24478
Last active August 29, 2015 14:07
MYSQLND MYSQLI_ASYNC pretty much useless for single connection
############################################################
###
### Useless for a single mysql connection trying to
### ASYNC multiple db calls
###
$link1 = mysqli_connect("localhost","user","pwd","dbname");
$s1 = "SELECT SLEEP(10)";
$s2 = "SELECT SLEEP(5)";
@attozk
attozk / owpd
Created August 8, 2014 17:27 — forked from jonathonbyrdziak/owpd
#! /bin/sh
# /etc/init.d/owpd
#
# chkconfig: 2345 85 15
# description: OWP Daemon
# processname: OWP Daemon
#
# Install the service with chkconfig --add owpd
#