This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# how to run this thingy | |
# create a file on your mac called setup.sh | |
# run it from terminal with: sh setup.sh | |
# heavily inspired by https://twitter.com/damcclean | |
# https://github.com/damcclean/dotfiles/blob/master/install.sh | |
# faster dock hiding/showing (run in terminal) | |
# defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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/profile:mumo.beaplumbereducationok.rocks"} }}' | |
## 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/profile:mumo.beaplumbereducationok.rocks"} }, "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/profile:mumo.beaplumbereducationok.rocks"} } } }}' | |
## This one errors when you add the aggs to it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parent 1 | |
"twitter/profile:andyoakes", | |
"periscope/profile:691880" # when this redirects it redirects to andyoakes as the name, so it would cluster | |
Parent 2 | |
"email/profile:newdigitalage&host=bluestripemedia.co.uk", | |
"twitter/profile:bluestripemedia | |
Parent 3 | |
"linkedin/company:newdigitalage", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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"} | |
{"severity":"INFO","progname":"audienti","request_id":"ActiveJob","time":"2019-11-27T21:32:51.756+01:00","message":"profile_was_deleted","class_name":"Pipeline::Profile::LowPriorityEnrichJob","job_id":"13262789-fd15-487f-b8e2-9e2f7135508d","profile_id":"linkedin/company:channel-newsasia"} | |
{"severity":"INFO","progname":"audienti","request_id":"ActiveJob","time":"2019-11-27T21:32:51.757+01:00","message":null,"class_name":"Pipeline::Profile::LowPriorityEnrichJob","job_id":"13262789-fd15-487f-b8e2-9e2f7135508d","state":"perform_complete","took":"9407.19"} | |
2019-11-27T20:32:51.758Z 14916 TID-ot0bvd8w4 Pipeline::Profile::LowPriorityEnrichJob JID-dce2c5d81a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module YourService | |
class Config | |
class << self | |
def config | |
@config ||= new.config | |
end | |
end | |
def config | |
@config ||= YAML.load(File.read(config_file)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to your path to the application for editing | |
# This file is automatically generated. | |
# v0.1.1 14November2017 837amEST | |
# This file was generated at <%= Time.now.utc %> | |
<% 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 %>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.App ||= {} | |
# This is what calls the KeywordsIndex class and initializes it. | |
class PageInit | |
constructor: -> | |
page = "#{$('body').data('page')}" | |
@execute_page_js(page) | |
execute_page_js: (page) -> | |
if "function" is typeof window[page] | |
klass = window[page] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder