Skip to content

Instantly share code, notes, and snippets.

View jbaiera's full-sized avatar

James Baiera jbaiera

View GitHub Profile
@jbaiera
jbaiera / googleQuery.sh
Last active June 29, 2016 21:06
Searching for "google" in Elasticsearch
curl -XPUT localhost:9200/ftfy -d '{
"mappings": {
"document":{
"properties":{
"content":{
"type":"string",
"analyzer":"simple"
}
}
}
@jbaiera
jbaiera / td.py
Last active December 29, 2015 08:29
A simple python script that calculates timestamp differences up to 24 hours apart. Useful if you do a lot of performance measurements by hand.
#!/usr/bin/python
import os
import getopt
import sys
hour = 60 * 60
minute = 60
def timeDiff(s=0, e=0):
@jbaiera
jbaiera / .gitconfig
Last active May 4, 2016 17:40
Git Graph - Pretty Print Log format for Git
[alias]
graph1 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative --color --date-order
graph2 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(bold white)— %an%C(reset)%n%w(70,12,10)%C(white)%s%C(reset)%n' --abbrev-commit --color --date-order
graph = !"git graph1"