Skip to content

Instantly share code, notes, and snippets.

View psimoesSsimoes's full-sized avatar

Pedro Simões psimoesSsimoes

View GitHub Profile
@psimoesSsimoes
psimoesSsimoes / elastic_surrond.sh
Created April 18, 2021 13:31
gist to search surrounding documents elasticsearch
#!/bin/bash
helpFunction()
{
echo ""
echo "Usage: $0 --elastic_url --sort <sort_id> --around <number_of_entries> --filter <jq filter>"
echo -e "\t--elastic_url the elasticsearch url"
echo -e "\t--sort sort field found on json entry, corresponding to an unix timestamp"
echo -e "\t--size number of surrounding documents"
echo -e "\t--filter is the jq filter you want to use"
### Keybase proof
I hereby claim:
* I am psimoesssimoes on github.
* I am seomis_worten (https://keybase.io/seomis_worten) on keybase.
* I have a public key ASDjx1Pu__dNIxAEdYt14CLIYdd4CaWq70YTP3Q4_acVuAo
To claim this, I am signing this object:
@psimoesSsimoes
psimoesSsimoes / .vimrc
Created May 19, 2018 17:03 — forked from JeffreyWay/.vimrc
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@psimoesSsimoes
psimoesSsimoes / loop_string.pl
Created January 3, 2018 22:24 — forked from ishu3101/loop_string.pl
3 ways to loop through each character in a string in Perl
# 3 ways to loop through each character in a string
$text = "hello world";
for $i (0..length($text)-1){
$char = substr($text, $i, 1);
print "Index: $i, Text: $char \n";
}
foreach $char (split //, $text) {
@psimoesSsimoes
psimoesSsimoes / web-servers.md
Created September 8, 2017 15:18 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000