Skip to content

Instantly share code, notes, and snippets.

View bryangreen's full-sized avatar

Bryan Green bryangreen

View GitHub Profile
@bryangreen
bryangreen / keybase.md
Created March 31, 2020 22:25
Keybase.md

Keybase proof

I hereby claim:

  • I am bryangreen on github.
  • I am bryangreen (https://keybase.io/bryangreen) on keybase.
  • I have a public key ASD5Qu1nEjAWWd5tbd6Badl_mGTVKuBpkBFryWuyU6H2rQo

To claim this, I am signing this object:

# install missing libraries (if any)
cd ~
sudo yum update
yum install java-1.7.0-openjdk.x86_64
yum install unzip
yum install mc
yum install wget
yum install curl
# get and unpack elasticsearch zip file
@bryangreen
bryangreen / Inflector.php
Last active October 24, 2020 00:50
Twig Inflector Extension - For plural and singular English words
<?php
/**
* ReadySetData 2009-2013
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@bryangreen
bryangreen / gist:2790748
Created May 25, 2012 21:36
When using the "and" filter, "fields" not being recognized and all _source being returned.
{
"from": 0,
"size": 999,
"filter": {
"and": [
{
"term": {
"user_role_permission": "administrator"
}
}
@bryangreen
bryangreen / gist:1820642
Created February 13, 2012 21:29
Getting ClassCastException[org.elasticsearch.search.controller.ShardScoreDoc cannot be cast to org.apache.lucene.search.FieldDoc]
The "permission" item type exists on the system and library indexes. It does not exist on the 'kk' index.
curl -XPOST "http://localhost:9200/system,library,kk/permission/_search" -d {
"from": 0,
"size": "20",
"sort": [
{
"title": {
"ignore_unmapped": true
}