Skip to content

Instantly share code, notes, and snippets.

Bruno Miranda brupm

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am brupm on github.
  • I am brupm (https://keybase.io/brupm) on keybase.
  • I have a public key whose fingerprint is F94B EAE7 F3C5 95E0 A504 857E A5E8 5511 90D7 B0B5

To claim this, I am signing this object:

@brupm
brupm / sample_es.sh
Created Jun 29, 2016
Elasticsearch Sample Mappings, Indexing, Searching - Useful for debugging & troubleshooting
View sample_es.sh
### Create the Index
curl -XDELETE http://localhost:9200/users
curl -XPOST localhost:9200/users -d '{
"mappings" : {
"user" : {
"properties" : {
"name" : {
"type" : "string",
"index" : "not_analyzed"
}
View elasticsearch.rb
class Elasticsearch < Formula
desc "Distributed real-time search & analytics engine for the cloud"
homepage "https://www.elastic.co/products/elasticsearch"
url "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.5.tar.gz"
sha256 "0aa58947d66b487488e86059352deb7c6cab5da4accdff043cce9fed7c3d2fa7"
head do
url "https://github.com/elasticsearch/elasticsearch.git"
depends_on "maven" => :build
end
View decoded.txt
http://localhost:8080/px.png?tracking_data={"events":[{"identifier":"colleagues::my_colleagues::profile","uid":726015,"sequence":0,"event_type":"track-view"},{"identifier":"colleagues::my_colleagues::profile","uid":723679,"sequence":1,"event_type":"track-view"},{"identifier":"colleagues::my_colleagues::profile","uid":4675426,"sequence":2,"event_type":"track-view"},{"identifier":"colleagues::my_colleagues::profile","uid":963658,"sequence":3,"event_type":"track-view"},{"identifier":"colleagues::my_colleagues::profile","uid":1268440,"sequence":4,"event_type":"track-view"},{"identifier":"colleagues::my_colleagues::profile","uid":1864260,"sequence":5,"event_type":"track-view"},{"identifier":"colleagues::my_colleagues::profile","uid":988316,"sequence":6,"event_type":"track-view"},{"identifier":"colleagues::my_colleagues::profile","uid":3867977,"sequence":7,"event_type":"track-view"},{"identifier":"colleagues::my_colleagues::profile","uid":3867984,"sequence":8,"event_type":"track-view"},{"identifier":"colleagues::my
@brupm
brupm / cors-nginx.conf
Last active Aug 29, 2015 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
View cors-nginx.conf
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
View elasticsearch-term-frequency.sh
#!/bin/sh
test_document="{
\"text\": \"HEAR the sledges with the bells, / Silver bells! / What a world of merriment their melody foretells! / How they tinkle, tinkle, tinkle, / In the icy air of night! / While the stars, that oversprinkle / All the heavens, seem to twinkle / With a crystalline delight; / Keeping time, time, time, / In a sort of Runic rhyme, / To the tintinnabulation that so musically wells / From the bells, bells, bells, bells, / Bells, bells, bells— / From the jingling and the tinkling of the bells.\"
}"
if curl -fs -X HEAD localhost:9200/top-terms; then
echo "Clear the old test index"
curl -X DELETE localhost:9200/top-terms; echo "\n"
fi
@brupm
brupm / kill.rb
Created Nov 14, 2014
kill jobs in resque
View kill.rb
10_000.times do |n|
r.lrange(k, n * 1_000, (n + 1) * 1_000).each do |e|
next unless e =~ /JobToKill/
r.lrem(k, 1, e)
end
end
You can’t perform that action at this time.