Skip to content

Instantly share code, notes, and snippets.

View wflanagan's full-sized avatar

William Flanagan wflanagan

View GitHub Profile
wflanagan /
Created January 30, 2024 21:30 — forked from chris-sev/
Mac Setup
# how to run this thingy
# create a file on your mac called
# run it from terminal with: sh
# heavily inspired by
# faster dock hiding/showing (run in terminal)
# defaults write autohide-delay -float 0; defaults write autohide-time-modifier -int 0;killall Dock
## This should return hits, it doesn't.
curl -XGET "http://localhost:9200/mentions_production/_search" -H 'Content-Type: application/json' -d'{ "query": { "term": {"references": "publisher/"} }}'
## If you do the query adding the aggs, it then errors wtih a fielddata error
curl -XGET "http://localhost:9200/mentions_production/_search" -H 'Content-Type: application/json' -d'{ "query": { "term": {"references": "publisher/"} }, "aggs": { "friendly_ids": { "terms": { "field": "references" } } }}'
## This one retrieves correctly
curl -XGET "http://localhost:9200/mentions_production/_search" -H 'Content-Type: application/json' -d'{ "query": { "bool": { "must": { "match": {"references": "publisher/"} } } }}'
## This one errors when you add the aggs to it
Parent 1
"periscope/profile:691880" # when this redirects it redirects to andyoakes as the name, so it would cluster
Parent 2
Parent 3
{"severity":"INFO","progname":"audienti","request_id":"ActiveJob","time":"2019-11-27T21:32:51.756+01:00","message":"status=success action=profile_deleted profile='Profile:#linkedin/company:channel-newsasia'","class_name":"Pipeline::Profile::LowPriorityEnrichJob","job_id":"13262789-fd15-487f-b8e2-9e2f7135508d","profile":"Profile:#linkedin/company:channel-newsasia"}
2019-11-27T20:32:51.758Z 14916 TID-ot0bvd8w4 Pipeline::Profile::LowPriorityEnrichJob JID-dce2c5d81a
module YourService
class Config
class << self
def config
@config ||= new.config
def config
@config ||= YAML.load(
wflanagan /
Last active November 14, 2017 13:38 file for use in our dev environment
# Add to your path to the application for editing
# This file is automatically generated.
# v0.1.1 14November2017 837amEST
# This file was generated at <%= %>
<% if defined?(home) && home.to_s.length > 0 %>
export DEVELOPER_HOME="<%= home %>"
<% end -%>
<% if defined?(app_path) && app_path.to_s.length > 0 %>
export APP_PATH="<%= app_path %>"
wflanagan / 0_reuse_code.js
Created September 21, 2017 13:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
wflanagan /
Last active June 12, 2017 23:58
What i'm trying to do.
window.App ||= {}
# This is what calls the KeywordsIndex class and initializes it.
class PageInit
constructor: ->
page = "#{$('body').data('page')}"
execute_page_js: (page) ->
if "function" is typeof window[page]
klass = window[page]
test_string = "key=1 key2=keys2 message=this is a message that is a long message key3=key key4=four"
# candidate regex (\w+)=(\w+) but it misses beyond the this in the message attribute
# what I want
# [['key', '1'], ['key2', 'keys2'], ['message', 'this is a message that is a long message'],['key3', 'key'],['key4', 'four']]
books = ["Charlie and the Chocolate Factory", "War and Peace", "Utopia", "A Brief History of Time", "A Wrinkle in Time"]
books.sort! # sorts the books in place
books = books.sort # sorts them, putting them back into the books variable.
books = books.sort_by { |book| book.length } # sorts them into the length of their title, shortest first