Skip to content

Instantly share code, notes, and snippets.

Avatar

Joost de Valk jdevalk

View GitHub Profile
@jclosure
jclosure / contains_key_or_empty.txt
Created Jul 3, 2017
Kibana Painless scripted field checks if field exists or is empty and returns default, otherwise value
View contains_key_or_empty.txt
if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value }
@jdevalk
jdevalk / wordstream-api-class.php
Created Oct 23, 2011
WordStream API interface class for WordPress
View wordstream-api-class.php
<?php
/**
* Class containing all the functionality to get data from the WordStream API
*
* @link http://api.wordstream.com/doc/introduction
*
* @author Joost de Valk <joost@yoast.com>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*