Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View brupm's full-sized avatar
👋
Say hi! @brupm

Bruno Miranda brupm

👋
Say hi! @brupm
View GitHub Profile
@brupm
brupm / kill.rb
Created November 14, 2014 01:06
kill jobs in resque
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
#!/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 / cors-nginx.conf
Last active August 29, 2015 14:27 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
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
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
@brupm
brupm / sample_es.sh
Created June 29, 2016 15:50
Elasticsearch Sample Mappings, Indexing, Searching - Useful for debugging & troubleshooting
### Create the Index
curl -XDELETE http://localhost:9200/users
curl -XPOST localhost:9200/users -d '{
"mappings" : {
"user" : {
"properties" : {
"name" : {
"type" : "string",
"index" : "not_analyzed"
}

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 / Bookmarklet.js
Created May 23, 2022 15:36
Add all Amex credit card offers to you account with this Bookmarklet
javascript:btns=[...document.querySelectorAll('.offer-cta')].filter(b => b.textContent === 'Add to Card');c=()=>{ b = btns.pop(); if (!b) return console.log('added all!'); b.click(); setTimeout(c, Math.random() * 1500 + 300) };c();