Skip to content

Instantly share code, notes, and snippets.

@frazerh
frazerh / gist:3662422
Created September 7, 2012 01:37 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@frazerh
frazerh / mac_osx_lion_haproxy_logging.txt
Created May 3, 2012 16:15
MACOSX LION HAProxy Logging
HA Proxy Logging on Lion
-------------------------
# To enable haproxy logging we need to change syslogd startup procedure to include its network listener.
# Backup syslogd start up file
sudo cp /System/Library/LaunchDaemons/com.apple.syslogd.plist /System/Library/LaunchDaemons/com.apple.syslogd.plist.bakup
# Convert binary file to xml to be human readable / editable
@frazerh
frazerh / gist:1688915
Created January 27, 2012 14:00
Example engram query
'http://localhost:9200/test,test2/_search?timeout=10s&size=10' -d '
{
"sort":
[
"_score"
],
"query":
{
"filtered":
@frazerh
frazerh / gist:1663100
Created January 23, 2012 13:22
Not analyzed field and its role in the _all field
curl -XDELETE 'http://localhost:9200/blog/'
curl -XPUT 'http://localhost:9200/blog/'
curl -XPUT 'http://localhost:9200/blog/doc/_mapping' -d '
{
"doc" : {
"dynamic" : false,
"properties" : {
"title" : { "type" : "string"},
@frazerh
frazerh / gist:1596260
Created January 11, 2012 19:15
Elasticsearch not respecting timeout parameter
Expensive child query
---------------------
curl -XGET 'http://localhost:9200/test/_search?pretty=true&timeout=2' -d '
{
"query" : {
"has_child" : {
"type" : "comment",
"query" : {
@frazerh
frazerh / elastic_text_phrase_search
Created October 12, 2011 12:46
Elasticsearch text phrase prefix search with expansion
@frazerh
frazerh / ticket_customer_search.json
Created April 13, 2011 01:06
typical search on search 3/4
curl -XGET 'http://localhost:9200/ticket_customers/ticket_customer/_search?pretty=true' -d '
{
"sort":
[
"_score"
],
"query":
{
"bool":
{