Skip to content

Instantly share code, notes, and snippets.

View ebuildy's full-sized avatar
A Montréal - hey bière ??

Thomas Decaux ebuildy

A Montréal - hey bière ??
View GitHub Profile
exAspArk / gist:c325bb9a75dcda5c8212
Last active July 21, 2022 08:46
Elasticsearch: calculating user sessions with Map/Reduce (Ruby)
View gist:c325bb9a75dcda5c8212
# The same algorithm which is used in Google Analytics (
# Time-based expiry (including end of day):
# - After 30 minutes of inactivity
# - At midnight
# Enable dynamic scripting for Groovy (
# ! WARNING: please read about security first
# Usage:
mareksuscak /
Created March 15, 2015 12:56
Bump version shell script.
# Thanks goes to @pete-otaqui for the initial gist:
# Original version modified by Marek Suscak
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"
IvanFernandez / SparkToElasticSearch
Last active October 10, 2016 17:19
Gist to persist from Spark to ElasticSearch
View SparkToElasticSearch
String mode = args[0];
final String collection = args[1];
SparkConf sparkConf = new SparkConf();
sparkConf.set("es.nodes", args[2]);
sparkConf.setAppName("Spark to ElasticSearch PoC");
// Twitter configuration
View php-fpm-cli
# The MIT License (MIT)
# Copyright (c) 2014 Mathias Leppich <>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
polyfractal / gist:4704772
Last active May 26, 2021 17:38
Commands associated with the "Starts-with" ElasticSearch tutorial
View gist:4704772
#Create the index with no mapping
curl -XPUT localhost:9200/startswith/
#add some data
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"river dog"}'
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"data"}'
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"drive"}'
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"drunk"}'
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"dzone"}'
misja /
Last active December 20, 2021 08:30
Quick way to extract opengraph and twitter card attributes from a page in python
from lxml import html
from urllib import request
from collections import defaultdict
url = ""
doc = html.parse(request.urlopen(url))
data = defaultdict(dict)
props = doc.xpath('//meta[re:test(@name|@property, "^twitter|og:.*$", "i")]',
namespaces={"re": ""})