Skip to content

Instantly share code, notes, and snippets.

View friaca's full-sized avatar
🎺
Creating

João Friaça friaca

🎺
Creating
  • São Paulo, Brasil
View GitHub Profile
@friaca
friaca / remove_duplicates.py
Created March 9, 2023 20:25
Remove duplicates from an Elasticsearch index
#!/usr/local/bin/python3
# A description and analysis of this code can be found at
# https://alexmarquardt.com/2018/07/23/deduplicating-documents-in-elasticsearch/
# Original code from
# https://github.com/alexander-marquardt/deduplicate-elasticsearch/
import hashlib
from elasticsearch import Elasticsearch, helpers
@friaca
friaca / search_kibana_console.txt
Created February 23, 2023 19:23 — forked from dadoonet/search_kibana_console.txt
Demo script for "A NoSQL search engine to find..." talk
### REINIT
DELETE user
PUT user
{
"mappings": {
"properties": {
"name": {
"type": "text"
},
"comments": {
@friaca
friaca / dom-to-json.js
Last active November 11, 2019 17:51 — forked from sstur/dom-to-json.js
Stringify DOM nodes and parse with JSON
function DOMtoJSON(node) {
node = node || this;
let obj = {
nodeType: node.nodeType
};
if (node.tagName) {
obj.tagName = node.tagName.toLowerCase();
} else if (node.nodeName) {
obj.nodeName = node.nodeName;