Skip to content

Instantly share code, notes, and snippets.

@jakguru
jakguru / elasticbean.php
Created May 1, 2017 06:31
ElasticBean: ElasticSearch + RedBean Integration
<?php
/**
* Elastic Search Adapter for Tacticlicks Data Warehouse
* @Author: Jak Giveon
*
* This class wraps all RedBean PHP functions, adding ElasticSearch functionality where it is useful
* Please note that this class is meant to MOSTLY be called statically, just like RedBean for PHP
*/
class E {
@jakguru
jakguru / api_error.txt
Created October 2, 2016 15:28
Mumara API Error
HTTP_REQUEST Object
(
[connection_status] => 1
[mime] => text/html
[total_time] => 0.337265
[redirects] => 0
[headers] => Array
(
[date] => Sun, 02 Oct 2016 15:27:19 GMT
[server] => Apache
<?php
function get_client_ip() {
switch ( true ) {
case ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ):
$ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
break;
case ( isset( $_SERVER['HTTP_INCAP_CLIENT_IP'] ) ):
$ip = $_SERVER['HTTP_INCAP_CLIENT_IP'];